diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 01:28:00 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 01:28:00 +0000 |
commit | 9c60701e4f39d7039da73e7dd5a36f5edade308a (patch) | |
tree | 3475fe7f783e96106c803fca0c28620dd27e9f2f /missing/strtoul.c | |
parent | 1a61008f18e651ef8848813a34cdebd6d8fd5eba (diff) | |
download | ruby-9c60701e4f39d7039da73e7dd5a36f5edade308a.tar.gz |
* missing.h, missing/*.c: SUSv3 compatible strcasecmp and strncasecmp,
ANSI compatible strtol and strtoul, and ANSI styled other functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/strtoul.c')
-rw-r--r-- | missing/strtoul.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/missing/strtoul.c b/missing/strtoul.c index f16f2ad9cf..4f09f899a1 100644 --- a/missing/strtoul.c +++ b/missing/strtoul.c @@ -21,7 +21,7 @@ * (100 for non-digit characters). */ -static char cvtIn[] = { +static const char cvtIn[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* '0' - '9' */ 100, 100, 100, 100, 100, 100, 100, /* punctuation */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, /* 'A' - 'Z' */ @@ -53,22 +53,22 @@ static char cvtIn[] = { */ unsigned long int -strtoul(string, endPtr, base) - char *string; /* String of ASCII digits, possibly +strtoul( + const char *string, /* String of ASCII digits, possibly * preceded by white space. For bases * greater than 10, either lower- or * upper-case digits may be used. */ - char **endPtr; /* Where to store address of terminating + char **endPtr, /* Where to store address of terminating * character, or NULL. */ - int base; /* Base for conversion. Must be less + int base) /* Base for conversion. Must be less * than 37. If 0, then the base is chosen * from the leading characters of string: * "0x" means hex, "0" means octal, anything * else means decimal. */ { - register char *p; + register const char *p; register unsigned long int result = 0; register unsigned digit; int anyDigits = 0; @@ -177,7 +177,7 @@ strtoul(string, endPtr, base) } if (endPtr != 0) { - *endPtr = p; + *endPtr = (char *)p; } return result; |