removed private atoi implementations
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5837 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f3350670fb
commit
5b490c9e49
4 changed files with 4 additions and 131 deletions
|
@ -169,8 +169,6 @@ void CALLBACK TimeProc(UINT uID,
|
|||
timeleft--;
|
||||
}
|
||||
|
||||
int myatoi(char *s);
|
||||
|
||||
void __declspec(dllexport) show(HWND hwndParent, int string_size,
|
||||
char *variables, stack_t ** stacktop)
|
||||
{
|
||||
|
@ -288,51 +286,3 @@ void __declspec(dllexport) show(HWND hwndParent, int string_size,
|
|||
wsprintf(temp, "%d", g_rv);
|
||||
pushstring(temp);
|
||||
}
|
||||
|
||||
int myatoi(char *s)
|
||||
{
|
||||
unsigned int v = 0;
|
||||
if (*s == '0' && (s[1] == 'x' || s[1] == 'X')) {
|
||||
s += 2;
|
||||
for (;;) {
|
||||
int c = *s++;
|
||||
if (c >= '0' && c <= '9')
|
||||
c -= '0';
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
c -= 'a' - 10;
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
c -= 'A' - 10;
|
||||
else
|
||||
break;
|
||||
v <<= 4;
|
||||
v += c;
|
||||
}
|
||||
} else if (*s == '0' && s[1] <= '7' && s[1] >= '0') {
|
||||
s++;
|
||||
for (;;) {
|
||||
int c = *s++;
|
||||
if (c >= '0' && c <= '7')
|
||||
c -= '0';
|
||||
else
|
||||
break;
|
||||
v <<= 3;
|
||||
v += c;
|
||||
}
|
||||
} else {
|
||||
int sign = 0;
|
||||
if (*s == '-') {
|
||||
s++;
|
||||
sign++;
|
||||
}
|
||||
for (;;) {
|
||||
int c = *s++ - '0';
|
||||
if (c < 0 || c > 9)
|
||||
break;
|
||||
v *= 10;
|
||||
v += c;
|
||||
}
|
||||
if (sign)
|
||||
return -(int) v;
|
||||
}
|
||||
return (int) v;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue