Replace atoi() with strtol() in Windows code

This commit is contained in:
Yamagi Burmeister 2012-06-05 10:46:15 +02:00
parent af83f80dff
commit a55d717a80
3 changed files with 4 additions and 11 deletions

7
TODO
View file

@ -2,15 +2,8 @@ Windows Port TODO
-----------------
- Check WITH_SYSTEMWIDE
- Replace atoi(), atol() and atof() in Windows code.
- Replace rand() with randk() in Windows code.
- Implement Sys_AppActivate() as soon as cl_hwnd is
ported to Yamagi Quake II.
- Check of "rb" is the correct mode to open files in
filesystem.c
- Does the alt-tab handling on windows really work?
And do we need it?
- Is AppActivate() really necessary?
- Does anisotropic filtering work under Windows?
- Remove leftovers from the softrenderer.

View file

@ -98,7 +98,7 @@ InitConProc(int argc, char **argv)
{
if (t < argc)
{
hFile = (HANDLE)atoi(ccom_argv[t + 1]);
hFile = (HANDLE)(int)strtol(ccom_argv[t + 1], (char **)NULL, 10);
}
}
@ -106,7 +106,7 @@ InitConProc(int argc, char **argv)
{
if (t < argc)
{
heventParent = (HANDLE)atoi(ccom_argv[t + 1]);
heventParent = (HANDLE)(int)strtol(ccom_argv[t + 1], (char **)NULL, 10);
}
}
@ -114,7 +114,7 @@ InitConProc(int argc, char **argv)
{
if (t < argc)
{
heventChild = (HANDLE)atoi(ccom_argv[t + 1]);
heventChild = (HANDLE)(int)strtol(ccom_argv[t + 1], (char **)NULL, 10);
}
}

View file

@ -261,7 +261,7 @@ NET_StringToSockaddr(char *s, struct sockaddr *sadr)
{
*colon = 0;
((struct sockaddr_in *)sadr)->sin_port =
htons((short)atoi(colon + 1));
htons((short)(int)strtol(colon + 1, (char **)NULL, 10));
}
}