Revision: 15150
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15150&view=rev
Author: hofman
Date: 2009-04-22 11:51:18 +0000 (Wed, 22 Apr 2009)
Log Message:
-----------
Don't typedef enums directly. Rename scaner method
Modified Paths:
--------------
trunk/bibdesk/BDSKCondition.h
trunk/bibdesk/BDSKFilter.h
trunk/bibdesk/BDSKFormatParser.m
trunk/bibdesk/BDSKPreviewer.h
trunk/bibdesk/BDSKScrollableTextField.h
trunk/bibdesk/BDSKStatusBar.h
trunk/bibdesk/BDSKStringNode.h
trunk/bibdesk/BDSKTemplate.h
trunk/bibdesk/BibPref_Export.h
trunk/bibdesk/NSScanner_BDSKExtensions.h
trunk/bibdesk/NSScanner_BDSKExtensions.m
Modified: trunk/bibdesk/BDSKCondition.h
===================================================================
--- trunk/bibdesk/BDSKCondition.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKCondition.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -39,7 +39,7 @@
#import <Cocoa/Cocoa.h>
// this should correspond to the tags of the items in the popup
-typedef enum {
+enum {
BDSKGroupContain = 0,
BDSKGroupNotContain,
BDSKContain,
@@ -50,10 +50,11 @@
BDSKEndWith,
BDSKSmaller,
BDSKLarger
-} BDSKStringComparison;
+};
+typedef NSUInteger BDSKStringComparison;
// this should correspond to the tags of the items in the popup
-typedef enum {
+enum {
BDSKCountEqual = 0,
BDSKCountNotEqual,
BDSKCountLarger,
@@ -62,10 +63,11 @@
BDSKAttachmentNotContain,
BDSKAttachmentStartWith,
BDSKAttachmentEndWith
-} BDSKAttachmentComparison;
+};
+typedef NSUInteger BDSKAttachmentComparison;
// this should correspond to the tags of the items in the popup
-typedef enum {
+enum {
BDSKToday = 0,
BDSKYesterday,
BDSKThisWeek,
@@ -78,7 +80,8 @@
BDSKAfterDate,
BDSKBeforeDate,
BDSKInDateRange
-} BDSKDateComparison;
+};
+typedef NSUInteger BDSKDateComparison;
enum {
BDSKDateField,
Modified: trunk/bibdesk/BDSKFilter.h
===================================================================
--- trunk/bibdesk/BDSKFilter.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKFilter.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -38,10 +38,11 @@
#import <Cocoa/Cocoa.h>
-typedef enum {
+enum {
BDSKAnd = 0,
BDSKOr = 1
-} BDSKConjunction;
+};
+typedef NSUInteger BDSKConjunction;
@class BDSKCondition, BibItem, BDSKSmartGroup;
Modified: trunk/bibdesk/BDSKFormatParser.m
===================================================================
--- trunk/bibdesk/BDSKFormatParser.m 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKFormatParser.m 2009-04-22 11:51:18 UTC (rev 15150)
@@ -145,7 +145,7 @@
[scanner
setScanLocation:[scanner scanLocation]+1];
numAuth =
(NSUInteger)(nextChar - '0');
// scan for
#chars per name
- if (NO ==
[scanner scanUnsignedInt:&numChars]) numChars = 0;
+ if (NO ==
[scanner scanUnsignedInteger:&numChars]) numChars = 0;
}
}
}
@@ -262,7 +262,7 @@
if (isLocalFile) {
title = [title
stringByReplacingCharactersInSet:slashCharSet withString:@"-"];
}
- if (NO == [scanner scanUnsignedInt:&numChars])
numChars = 0;
+ if (NO == [scanner scanUnsignedInteger:&numChars])
numChars = 0;
if (numChars > 0 && [title length] > numChars) {
[parsedStr appendString:[title
substringToIndex:numChars]];
} else {
@@ -285,7 +285,7 @@
smallWordLength = 0;
[scanner scanString:@"]" intoString:NULL];
}
- if (NO == [scanner
scanUnsignedInt:&numWords]) numWords = 0;
+ if (NO == [scanner
scanUnsignedInteger:&numWords]) numWords = 0;
if ([NSString isEmptyString:title] ==
NO) {
NSMutableArray *words =
[NSMutableArray array];
NSString *word;
@@ -376,7 +376,7 @@
}
NSString *keywordsString = [pub
stringValueOfField:BDSKKeywordsString];
NSUInteger i, numWords = 0;
- if (NO == [scanner scanUnsignedInt:&numWords]) numWords =
0;
+ if (NO == [scanner scanUnsignedInteger:&numWords])
numWords = 0;
if ([NSString
isEmptyString:keywordsString] == NO) {
NSMutableArray *keywords =
[NSMutableArray array];
NSString *keyword;
@@ -484,7 +484,7 @@
[scanner
scanString:@"]" intoString:NULL];
}
- if (NO == [scanner
scanUnsignedInt:&numChars]) numChars = 0;
+ if (NO == [scanner
scanUnsignedInteger:&numChars]) numChars = 0;
if (NO == [fieldName
isEqualToString:BDSKCiteKeyString] &&
[key
isEqualToString:BDSKCiteKeyString]) {
value = [pub citeKey];
@@ -530,7 +530,7 @@
}
NSString *wordsString = [pub stringValueOfField:key];
NSUInteger i, numWords = 0;
- if (NO == [scanner scanUnsignedInt:&numWords])
numWords = 0;
+ if (NO == [scanner scanUnsignedInteger:&numWords])
numWords = 0;
if ([NSString isEmptyString:wordsString] == NO) {
NSMutableArray *words = [NSMutableArray array];
NSString *word;
@@ -572,7 +572,7 @@
if ([scanner scanString:@"{" intoString:NULL] &&
[scanner scanUpToString:@"}"
intoString:&key] &&
[scanner scanString:@"}"
intoString:NULL]) {
- if (NO == [scanner
scanUnsignedInt:&smallWordLength]) smallWordLength = 3;
+ if (NO == [scanner
scanUnsignedInteger:&smallWordLength]) smallWordLength = 3;
value = [[pub
stringValueOfField:key] acronymValueIgnoringWordLength:smallWordLength];
value = [self
stringByStrictlySanitizingString:value forField:fieldName inFileType:[pub
fileType]];
@@ -611,7 +611,7 @@
}
}
}
- if (NO == [scanner
scanUnsignedInt:&numChars]) numChars = 0;
+ if (NO == [scanner
scanUnsignedInteger:&numChars]) numChars = 0;
intValue = [pub intValueOfField:key];
value = (intValue == 0 ? noValue : (intValue == 1 ?
yesValue : mixedValue));
if (numChars > 0 && [value length] > numChars) {
@@ -635,7 +635,7 @@
[scanner scanUpToString:@"}"
intoString:&key] &&
[scanner scanString:@"}"
intoString:NULL]) {
- if (NO == [scanner
scanUnsignedInt:&numChars]) numChars = 0;
+ if (NO == [scanner
scanUnsignedInteger:&numChars]) numChars = 0;
value = [[pub owner] documentInfoForKey:key];
if ([NSString
isEmptyString:value] == NO) {
value = [self
stringByStrictlySanitizingString:value forField:fieldName inFileType:[pub
fileType]];
@@ -655,7 +655,7 @@
{
// random lowercase letters
NSUInteger numChars = 1;
- if (NO == [scanner scanUnsignedInt:&numChars]) numChars =
1;
+ if (NO == [scanner scanUnsignedInteger:&numChars])
numChars = 1;
while (numChars-- > 0) {
[parsedStr
appendFormat:@"%c",'a' + (char)(rand() % 26)];
}
@@ -665,7 +665,7 @@
{
// random uppercase letters
NSUInteger numChars = 1;
- if (NO == [scanner
scanUnsignedInt:&numChars]) numChars = 1;
+ if (NO == [scanner
scanUnsignedInteger:&numChars]) numChars = 1;
while (numChars-- > 0) {
[parsedStr
appendFormat:@"%c",'A' + (char)(rand() % 26)];
}
@@ -675,7 +675,7 @@
{
// random digits
NSUInteger numChars = 1;
- if (NO == [scanner
scanUnsignedInt:&numChars]) numChars = 1;
+ if (NO == [scanner
scanUnsignedInteger:&numChars]) numChars = 1;
while (numChars-- > 0) {
[parsedStr
appendFormat:@"%ld",(long)(rand() % 10)];
}
@@ -713,7 +713,7 @@
[scanner scanUpToString:@"]"
intoString:&uniqueSeparator];
[scanner scanString:@"]" intoString:NULL];
}
- if (NO == [scanner
scanUnsignedInt:&uniqueNumber]) uniqueNumber = 1;
+ if (NO == [scanner
scanUnsignedInteger:&uniqueNumber]) uniqueNumber = 1;
}
else {
NSLog(@"Specifier %%%C can only
be used once in the format.", specifier);
Modified: trunk/bibdesk/BDSKPreviewer.h
===================================================================
--- trunk/bibdesk/BDSKPreviewer.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKPreviewer.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -42,12 +42,13 @@
@class PDFView, BDSKZoomablePDFView, BDSKTeXTask, BDSKOverlay,
BDSKPreviewerServer;
-typedef enum {
+enum {
BDSKUnknownPreviewState = -1,
BDSKEmptyPreviewState = 0,
BDSKWaitingPreviewState = 1,
BDSKShowingPreviewState = 2
-} BDSKPreviewState;
+};
+typedef NSInteger BDSKPreviewState;
/*!
@class BDSKPreviewer
Modified: trunk/bibdesk/BDSKScrollableTextField.h
===================================================================
--- trunk/bibdesk/BDSKScrollableTextField.h 2009-04-22 08:58:45 UTC (rev
15149)
+++ trunk/bibdesk/BDSKScrollableTextField.h 2009-04-22 11:51:18 UTC (rev
15150)
@@ -39,10 +39,11 @@
#import <Cocoa/Cocoa.h>
-typedef enum {
+enum {
BDSKScrollLeftButton = 0,
BDSKScrollRightButton = 1
-} BDSKScrollButton;
+};
+typedef NSUInteger BDSKScrollButton;
@interface BDSKScrollableTextField : NSTextField {
Modified: trunk/bibdesk/BDSKStatusBar.h
===================================================================
--- trunk/bibdesk/BDSKStatusBar.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKStatusBar.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -39,11 +39,12 @@
#import <Cocoa/Cocoa.h>
#import "BDSKGradientView.h"
-typedef enum {
+enum {
BDSKProgressIndicatorNone = -1,
BDSKProgressIndicatorBarStyle = NSProgressIndicatorBarStyle,
BDSKProgressIndicatorSpinningStyle = NSProgressIndicatorSpinningStyle
-} BDSKProgressIndicatorStyle;
+};
+typedef NSInteger BDSKProgressIndicatorStyle;
@interface BDSKStatusBar : BDSKGradientView {
Modified: trunk/bibdesk/BDSKStringNode.h
===================================================================
--- trunk/bibdesk/BDSKStringNode.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKStringNode.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -39,11 +39,12 @@
#import <Cocoa/Cocoa.h>
-typedef enum{
+enum {
BSN_STRING = 0,
BSN_NUMBER = 1,
BSN_MACRODEF = 2
-} BDSKStringNodeType;
+};
+typedef NSUInteger BDSKStringNodeType;
@interface BDSKStringNode : NSObject <NSCopying, NSCoding>{
@public
Modified: trunk/bibdesk/BDSKTemplate.h
===================================================================
--- trunk/bibdesk/BDSKTemplate.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BDSKTemplate.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -39,7 +39,7 @@
#import <Cocoa/Cocoa.h>
#import "BDSKTreeNode.h"
-typedef enum _BDSKTemplateFormat {
+enum {
BDSKUnknownTemplateFormat = 0,
BDSKTextTemplateFormat = 1, // generic plain text template
BDSKPlainHTMLTemplateFormat = 2, // HTML template edited as plain text
@@ -51,7 +51,8 @@
BDSKDocxTemplateFormat = 64,
BDSKOdtTemplateFormat = 128,
BDSKRichTextTemplateFormat = 188 // Rich HTML, RTF, RTFD, Doc, Docx, or ODT
-} BDSKTemplateFormat;
+};
+typedef NSUInteger BDSKTemplateFormat;
extern NSString *BDSKTemplateRoleString;
extern NSString *BDSKTemplateNameString;
Modified: trunk/bibdesk/BibPref_Export.h
===================================================================
--- trunk/bibdesk/BibPref_Export.h 2009-04-22 08:58:45 UTC (rev 15149)
+++ trunk/bibdesk/BibPref_Export.h 2009-04-22 11:51:18 UTC (rev 15150)
@@ -39,10 +39,11 @@
#import <Cocoa/Cocoa.h>
#import "BDSKPreferencePane.h"
-typedef enum {
+enum {
BDSKExportTemplateList = 0,
BDSKServiceTemplateList = 1
-} BDSKTemplateListType;
+};
+typedef NSUInteger BDSKTemplateListType;
@interface BibPref_Export : BDSKPreferencePane {
IBOutlet NSOutlineView *outlineView;
Modified: trunk/bibdesk/NSScanner_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSScanner_BDSKExtensions.h 2009-04-22 08:58:45 UTC (rev
15149)
+++ trunk/bibdesk/NSScanner_BDSKExtensions.h 2009-04-22 11:51:18 UTC (rev
15150)
@@ -41,7 +41,7 @@
@interface NSScanner (BDSKExtensions)
-- (BOOL)scanUnsignedInt:(NSUInteger *)unsignedValue;
+- (BOOL)scanUnsignedInteger:(NSUInteger *)unsignedValue;
- (BOOL)scanCharacter:(unichar *)ch;
- (BOOL)peekCharacter:(unichar *)ch;
Modified: trunk/bibdesk/NSScanner_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSScanner_BDSKExtensions.m 2009-04-22 08:58:45 UTC (rev
15149)
+++ trunk/bibdesk/NSScanner_BDSKExtensions.m 2009-04-22 11:51:18 UTC (rev
15150)
@@ -41,7 +41,7 @@
@implementation NSScanner (BDSKExtensions)
-- (BOOL)scanUnsignedInt:(NSUInteger *)unsignedValue{
+- (BOOL)scanUnsignedInteger:(NSUInteger *)unsignedValue{
NSUInteger rewindLocation = [self scanLocation];
NSInteger intValue = 0;
BOOL returnValue = [self scanInt:&intValue];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit