Closed Bug 15243 Opened 25 years ago Closed 25 years ago

Recent changes to nsString[2].cpp broke pre-ANSI C++ compilers

Categories

(Core :: XPCOM, defect, P3)

Sun
Solaris
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: tor, Assigned: rickg)

Details

Your changes to nsString[2].cpp broke any pre-ANSI C++ compiler
which does not have a native boolean type.  The fix is simple:

Index: nsString.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpcom/ds/nsString.cpp,v
retrieving revision 3.79
diff -u -r3.79 nsString.cpp
--- nsString.cpp        1999/09/30 04:03:46     3.79
+++ nsString.cpp        1999/09/30 04:48:40
@@ -960,12 +960,12 @@
     else theInt=(int)~(theInt-1);
   }

-  PRBool isfirst=true;
+  PRBool isfirst=PR_TRUE;
   while(mask1>=1) {
     PRInt32 div=theInt/mask1;
     if((div) || (!isfirst)) {
       buf[charpos++]="0123456789abcdef"[div];
-      isfirst=false;
+      isfirst=PR_FALSE;
     }
     theInt-=div*mask1;
     mask1/=aRadix;
Index: nsString2.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpcom/ds/nsString2.cpp,v
retrieving revision 1.52
diff -u -r1.52 nsString2.cpp
--- nsString2.cpp       1999/09/30 04:03:47     1.52
+++ nsString2.cpp       1999/09/30 04:48:41
@@ -1130,12 +1130,12 @@
     else theInt=(int)~(theInt-1);
   }

-  PRBool isfirst=true;
+  PRBool isfirst=PR_FALSE;
   while(mask1>=1) {
     PRInt32 div=theInt/mask1;
     if((div) || (!isfirst)) {
       buf[charpos++]="0123456789abcdef"[div];
-      isfirst=false;
+      isfirst=PR_FALSE;
     }
     theInt-=div*mask1;
     mask1/=aRadix;
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fixed by changing ANSI true/false to PR_TRUE/PR_FALSE. Sorry for the error, and
thanks for the quick fix.
You need to log in before you can comment on or make changes to this bug.