From 1894ddd7bc810d0b6786eea89daff464e24a8263 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Sat, 19 Jun 2004 00:11:45 +0000 Subject: [PATCH] Bug 241177 remove nsXIContext::itoa patch by ajschult@mindspring.com r=dveditz sr=dveditz git-svn-id: svn://10.0.0.236/trunk@158165 18797224-902f-48f8-a5cc-f745e15eee43 --- .../wizard/unix/src2/nsXIContext.cpp | 42 ------------------- .../xpinstall/wizard/unix/src2/nsXIContext.h | 1 - 2 files changed, 43 deletions(-) diff --git a/mozilla/xpinstall/wizard/unix/src2/nsXIContext.cpp b/mozilla/xpinstall/wizard/unix/src2/nsXIContext.cpp index e84f20a1a0d..fb5e4cbac9f 100644 --- a/mozilla/xpinstall/wizard/unix/src2/nsXIContext.cpp +++ b/mozilla/xpinstall/wizard/unix/src2/nsXIContext.cpp @@ -90,48 +90,6 @@ nsXIContext::~nsXIContext() XI_IF_DELETE(opt); } -char * -nsXIContext::itoa(int n) -{ - char *s; - int i, j, sign, tmp; - - /* check sign and convert to positive to stringify numbers */ - if ( (sign = n) < 0) - n = -n; - i = 0; - s = (char*) malloc(sizeof(char)); - - /* grow string as needed to add numbers from powers of 10 - * down till none left - */ - do - { - s = (char*) realloc(s, (i+1)*sizeof(char)); - s[i++] = n % 10 + '0'; /* '0' or 30 is where ASCII numbers start */ - s[i] = '\0'; - } - while( (n /= 10) > 0); - - /* tack on minus sign if we found earlier that this was negative */ - if (sign < 0) - { - s = (char*) realloc(s, (i+1)*sizeof(char)); - s[i++] = '-'; - } - s[i] = '\0'; - - /* pop numbers (and sign) off of string to push back into right direction */ - for (i = 0, j = strlen(s) - 1; i < j; i++, j--) - { - tmp = s[i]; - s[i] = s[j]; - s[j] = tmp; - } - - return s; -} - #define MAX_KEY_SIZE 64 #define FIRST_ERR -601 #define LAST_ERR -630 diff --git a/mozilla/xpinstall/wizard/unix/src2/nsXIContext.h b/mozilla/xpinstall/wizard/unix/src2/nsXIContext.h index 2d68e49a8c0..15f62c8b3b1 100644 --- a/mozilla/xpinstall/wizard/unix/src2/nsXIContext.h +++ b/mozilla/xpinstall/wizard/unix/src2/nsXIContext.h @@ -108,7 +108,6 @@ public: /*-------------------------------------------------------------------* * Utilities *-------------------------------------------------------------------*/ - char *itoa(int n); int LoadResources(); /* load string resources */ int ReleaseResources(); /* release alloc'd resource strings */ char *Res(char *aKey); /* get string resource for key; NULL==err */