Author: rmottola
Date: Sun May 22 22:00:54 2016
New Revision: 39798

URL: http://svn.gna.org/viewcvs/gnustep?rev=39798&view=rev
Log:
Transition to NSInteger/NSUInteger

Modified:
    apps/projectcenter/trunk/ChangeLog
    apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.h
    apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.m

Modified: apps/projectcenter/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/ChangeLog?rev=39798&r1=39797&r2=39798&view=diff
==============================================================================
--- apps/projectcenter/trunk/ChangeLog  (original)
+++ apps/projectcenter/trunk/ChangeLog  Sun May 22 22:00:54 2016
@@ -3,6 +3,10 @@
        * Modules/Editors/ProjectCenter/PCEditorView.h
        * Modules/Editors/ProjectCenter/PCEditorView.m
        Comply to protocol.
+
+       * Modules/Editors/ProjectCenter/SyntaxHighlighter.h
+       * Modules/Editors/ProjectCenter/SyntaxHighlighter.m
+       Transition to NSInteger/NSUInteger
 
 2016-05-15 Riccardo Mottola <[email protected]>
 

Modified: 
apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.h
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.h?rev=39798&r1=39797&r2=39798&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.h  
(original)
+++ apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.h  
Sun May 22 22:00:54 2016
@@ -45,7 +45,7 @@
          * italicFont,
          * boldItalicFont;
 
-  unsigned int lastProcessedContextIndex;
+  NSUInteger lastProcessedContextIndex;
 
   NSRange delayedProcessedRange;
   BOOL    didBeginEditing;

Modified: 
apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.m?rev=39798&r1=39797&r2=39798&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.m  
(original)
+++ apps/projectcenter/trunk/Modules/Editors/ProjectCenter/SyntaxHighlighter.m  
Sun May 22 22:00:54 2016
@@ -75,10 +75,10 @@
   SEL sel = @selector(characterAtIndex:);
   unichar (*characterAtIndex)(id, SEL, unsigned int) = 
     (unichar (*)(id, SEL, unsigned int)) [string methodForSelector: sel];
-  int ahead, after;
-  unsigned int length = [string length];
-
-  for (ahead = 1; ahead <= (int) startRange.location; ahead++)
+  NSInteger ahead, after;
+  NSUInteger length = [string length];
+
+  for (ahead = 1; ahead <= (NSInteger) startRange.location; ahead++)
     {
       if (my_isspace(characterAtIndex(string,
                                       sel,
@@ -100,8 +100,8 @@
     }
 
   {
-    unsigned int start = startRange.location - ahead,
-                 length = startRange.length + ahead + after;
+    NSUInteger start = startRange.location - ahead;
+    NSUInteger length = startRange.length + ahead + after;
 
     if (start > 0)
       {
@@ -120,10 +120,10 @@
 static inline BOOL
 LocateString(NSString * str,
              unichar * buf,
-             unsigned int length,
-             unsigned int offset)
-{
-  unsigned int i, n;
+             NSUInteger length,
+             NSUInteger offset)
+{
+  NSUInteger i, n;
 
   for (i = 0, n = [str length]; i < n; i++)
     {
@@ -148,16 +148,16 @@
 - (void) fixUpKeywordsInRange: (NSRange) r;
 - (void) lazilyFixUpKeywordsInRange: (NSRange) r;
 
-- (void) assignGraphicalAttributesOfContext: (unsigned int) context
+- (void) assignGraphicalAttributesOfContext: (NSUInteger) context
                                     toRange: (NSRange) r;
 
 - (void) assignGraphicalAttributesOfKeyword: (unsigned int) keyword
-                                  inContext: (unsigned int) context
+                                  inContext: (NSUInteger) context
                                     toRange: (NSRange) r;
 
-- (int) contextBeforeRange: (NSRange) r;
-- (int) contextAfterRange: (NSRange) r;
-- (int) contextAtEndOfRange: (NSRange) r;
+- (NSUInteger) contextBeforeRange: (NSRange) r;
+- (NSUInteger) contextAfterRange: (NSRange) r;
+- (NSUInteger) contextAtEndOfRange: (NSRange) r;
 
 - (void) beginEditingIfNeeded;
 - (void) endEditingIfNeeded;
@@ -178,7 +178,7 @@
   const char * beginningChars = [syntax contextBeginningCharacters];
   unsigned numBeginningChars = [syntax numberOfContextBeginningCharacters];
 
-  unsigned int i;
+  NSUInteger i;
   unichar * string;
   unsigned int context;
 
@@ -198,7 +198,7 @@
           unsigned int j = 0;
           TextPattern * pattern = NULL;
           NSRange ctxtRange;
-          int l = 0;
+          NSInteger l = 0;
           TextPattern ** skips = [syntax contextSkipsForContext: 0];
           const char * skipChars = [syntax contextSkipCharactersForContext: 0];
           unsigned int numSkipChars = [syntax
@@ -285,13 +285,13 @@
       // exceptions
       else
         {
-          int l = 0;
+          NSInteger l = 0;
           TextPattern * ending = [syntax contextEndingForContext: context - 1];
           NSRange ctxtRange;
           TextPattern ** skips = [syntax contextSkipsForContext: context];
           const char * skipChars = [syntax contextSkipCharactersForContext:
             context];
-          unsigned int numSkipChars = [syntax
+          NSUInteger numSkipChars = [syntax
             numberOfContextSkipCharactersForContext: context];
 
           for (;i < r.length; i++)
@@ -334,7 +334,7 @@
               // add an attribute telling the context into the
               // text storage
               [textStorage addAttribute: ContextAttributeName
-                                  value: [NSNumber numberWithInt: context]
+                                  value: [NSNumber numberWithInteger: context]
                                   range: ctxtRange];
               [self assignGraphicalAttributesOfContext: context
                                                toRange: ctxtRange];
@@ -344,7 +344,7 @@
           if (ctxtRange.length > 0)
             {
               [textStorage addAttribute: ContextAttributeName
-                                  value: [NSNumber numberWithInt: 0]
+                                  value: [NSNumber numberWithInteger: 0]
                                   range: ctxtRange];
               [self assignGraphicalAttributesOfContext: context
                                                toRange: ctxtRange];
@@ -362,7 +362,7 @@
 - (void) fixUpKeywordsInRange: (NSRange) r
 {
   unichar * string;
-  unsigned int i;
+  NSUInteger i;
 
   string = malloc(r.length * sizeof(unichar));
   [[textStorage string] getCharacters: string range: r];
@@ -371,11 +371,11 @@
     {
       NSRange contextRange;
       TextPattern ** patterns;
-      int context;
+      NSInteger context;
 
       context = [[textStorage attribute: ContextAttributeName
                                 atIndex: i + r.location
-                         effectiveRange: &contextRange] intValue];
+                         effectiveRange: &contextRange] integerValue];
 
       contextRange = NSIntersectionRange(r, contextRange);
       contextRange.location -= r.location;
@@ -385,8 +385,8 @@
       while (i < NSMaxRange(contextRange))
         {
           unichar c = string[i];
-          unsigned int l = 0;
-          unsigned int j;
+          NSUInteger l = 0;
+          NSUInteger j;
           TextPattern * pattern;
 
           // skip whitespace - it can't start a keyword
@@ -430,7 +430,7 @@
 
 - (void) lazilyFixUpKeywordsInRange: (NSRange) r
 {
-  unsigned int i;
+  NSUInteger i;
   BOOL localDidBeginEditing = NO;
 
   for (i = r.location; i < NSMaxRange(r);)
@@ -468,7 +468,7 @@
     }
 }
 
-- (void) assignGraphicalAttributesOfContext: (unsigned int) ctxt
+- (void) assignGraphicalAttributesOfContext: (NSUInteger) ctxt
                                     toRange: (NSRange) r
 {
   BOOL bold, italic;
@@ -526,8 +526,8 @@
     }
 }
 
-- (void) assignGraphicalAttributesOfKeyword: (unsigned int) keyword
-                                  inContext: (unsigned int) context
+- (void) assignGraphicalAttributesOfKeyword: (NSUInteger) keyword
+                                  inContext: (NSUInteger) context
                                     toRange: (NSRange) r
 {
   BOOL bold, italic;
@@ -609,7 +609,7 @@
     }
 }
 
-- (int) contextBeforeRange: (NSRange) r
+- (NSUInteger) contextBeforeRange: (NSRange) r
 {
   NSRange tmp;
 
@@ -625,10 +625,11 @@
     }
 }
 
-- (int) contextAfterRange: (NSRange) r
+- (NSUInteger) contextAfterRange: (NSRange) r
 {
   NSRange tmp;
-  unsigned int i, length;
+  NSUInteger i;
+  NSUInteger length;
 
   i = NSMaxRange(r);
   length = [textStorage length];
@@ -649,10 +650,10 @@
     }
 }
 
-- (int) contextAtEndOfRange: (NSRange) r
+- (NSUInteger) contextAtEndOfRange: (NSRange) r
 {
   NSRange tmp;
-  int i = (int) NSMaxRange(r) - 1;
+  NSInteger i = (int) NSMaxRange(r) - 1;
 
   if (i < 0)
     {
@@ -662,7 +663,7 @@
     {
       return [[textStorage attribute: ContextAttributeName
                              atIndex: i
-                      effectiveRange: &tmp] intValue];
+                      effectiveRange: &tmp] integerValue];
     }
 }
 


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to