simpler atoi for LangDLL and Banner
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5836 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
41836a0f4a
commit
f3350670fb
2 changed files with 16 additions and 0 deletions
|
@ -99,6 +99,21 @@ int NSISCALL myatoi(const char *s)
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned NSISCALL myatou(const char *s)
|
||||||
|
{
|
||||||
|
unsigned int v=0;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
unsigned int c=*s++;
|
||||||
|
if (c >= '0' && c <= '9') c-='0';
|
||||||
|
else break;
|
||||||
|
v*=10;
|
||||||
|
v+=c;
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
int NSISCALL myatoi_or(const char *s)
|
int NSISCALL myatoi_or(const char *s)
|
||||||
{
|
{
|
||||||
int v=0;
|
int v=0;
|
||||||
|
|
|
@ -60,6 +60,7 @@ int NSISCALL popstringn(char *str, int maxlen); // with length limit, pass 0 for
|
||||||
int NSISCALL popint(); // pops an integer
|
int NSISCALL popint(); // pops an integer
|
||||||
int NSISCALL popint_or(); // with support for or'ing (2|4|8)
|
int NSISCALL popint_or(); // with support for or'ing (2|4|8)
|
||||||
int NSISCALL myatoi(const char *s); // converts a string to an integer
|
int NSISCALL myatoi(const char *s); // converts a string to an integer
|
||||||
|
unsigned NSISCALL myatou(const char *s); // converts a string to an unsigned integer, decimal only
|
||||||
int NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)
|
int NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)
|
||||||
void NSISCALL pushstring(const char *str);
|
void NSISCALL pushstring(const char *str);
|
||||||
void NSISCALL pushint(int value);
|
void NSISCALL pushint(int value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue