diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cbasetypes.h | 6 | ||||
-rw-r--r-- | src/common/core.c | 1 | ||||
-rw-r--r-- | src/common/grfio.c | 1 | ||||
-rw-r--r-- | src/common/showmsg.c | 7 | ||||
-rw-r--r-- | src/common/socket.c | 4 | ||||
-rw-r--r-- | src/common/strlib.c | 3 | ||||
-rw-r--r-- | src/common/strlib.h | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 9eef2d6e5..e8af6bc9c 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -29,6 +29,10 @@ #define WIN32 #endif +#if defined(__MINGW32__) && !defined(MINGW) +#define MINGW +#endif + // __APPLE__ is the only predefined macro on MacOS X #if defined(__APPLE__) #define __DARWIN__ @@ -306,7 +310,7 @@ typedef char bool; ////////////////////////////////////////////////////////////////////////// // Has to be unsigned to avoid problems in some systems // Problems arise when these functions expect an argument in the range [0,256[ and are feed a signed char. -// NOTE: <ctype.h> needs to be included when using these defines +#include <ctype.h> #define ISALNUM(c) (isalnum((unsigned char)(c))) #define ISALPHA(c) (isalpha((unsigned char)(c))) #define ISCNTRL(c) (iscntrl((unsigned char)(c))) diff --git a/src/common/core.c b/src/common/core.c index 17aaa7b3c..a0a6b4f16 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -8,7 +8,6 @@ #endif #include <signal.h> #include <string.h> -#include <ctype.h> #include "core.h" #include "../common/mmo.h" diff --git a/src/common/grfio.c b/src/common/grfio.c index a2d7f7f5a..b15b37018 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -4,7 +4,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> #include <sys/stat.h> #include "grfio.h" diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 58c26ac8a..c61530204 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -27,7 +27,6 @@ #endif #else #include <unistd.h> - #include <ctype.h> #ifdef DEBUGLOGMAP #define DEBUGLOGPATH "log/map-server.log" @@ -400,8 +399,8 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) // \033[#;#f - Horizontal & Vertical Position // The first # specifies the line number, the second # specifies the column. // The default for both is 1 - info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F-1):0; - info.dwCursorPosition.Y = (numpoint && numbers[numpoint-1])?(numbers[numpoint-1]>>4)*10+(numbers[numpoint-1]&0x0F-1):0; + info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+((numbers[numpoint]&0x0F)-1):0; + info.dwCursorPosition.Y = (numpoint && numbers[numpoint-1])?(numbers[numpoint-1]>>4)*10+((numbers[numpoint-1]&0x0F)-1):0; if( info.dwCursorPosition.X >= info.dwSize.X ) info.dwCursorPosition.Y = info.dwSize.X-1; if( info.dwCursorPosition.Y >= info.dwSize.Y ) info.dwCursorPosition.Y = info.dwSize.Y-1; @@ -480,7 +479,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) else if( *q == 'G' ) { // \033[#G - Cursor Horizontal Absolute (CHA) // Moves the cursor to indicated column in current row. - info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+(numbers[numpoint]&0x0F-1):0; + info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+((numbers[numpoint]&0x0F)-1):0; if( info.dwCursorPosition.X >= info.dwSize.X ) info.dwCursorPosition.X = info.dwSize.X-1; diff --git a/src/common/socket.c b/src/common/socket.c index 6d89b26e6..34c707827 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -81,7 +81,7 @@ int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseFunc fun #ifndef MINICORE int ip_rules = 1; - static int connect_check(unsigned int ip); + static int connect_check(uint32 ip); #endif @@ -111,7 +111,7 @@ void set_nonblocking(int fd, int yes) // FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s. // The argp parameter is zero if nonblocking is to be disabled. - if (ioctlsocket(fd, FIONBIO, &yes) != 0) + if (ioctlsocket(fd, FIONBIO, (unsigned long*)&yes) != 0) ShowError("Couldn't set the socket to non-blocking mode (code %d)!\n", s_errno); } diff --git a/src/common/strlib.c b/src/common/strlib.c index 0ad0575f7..bd49e7b61 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -4,7 +4,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> #include "strlib.h" #include "../common/cbasetypes.h" @@ -198,7 +197,7 @@ char* _strtok_r(char *s1, const char *s2, char **lasts) } #endif -#if !defined(WIN32) || (defined(_MSC_VER) && _MSC_VER < 1400) +#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ size_t strnlen (const char* string, size_t maxlen) diff --git a/src/common/strlib.h b/src/common/strlib.h index baaf244d7..bf26c2172 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -18,7 +18,7 @@ const char *stristr(const char *haystack, const char *needle); char* _strtok_r(char* s1, const char* s2, char** lasts); #endif -#if !defined(WIN32) || (defined(_MSC_VER) && _MSC_VER < 1400) +#if !(defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400) size_t strnlen (const char* string, size_t maxlen); #endif |