fix building with gcc 4.x

This commit is contained in:
Gremlin from Kremlin 2009-04-04 09:51:04 +00:00
parent 7f469be929
commit 5d1ed88a16
15 changed files with 32 additions and 10 deletions

View File

@ -31,6 +31,7 @@
#pragma warning(disable: 4786)
#endif
#include <algorithm>
#include <limits.h>
#include <golded.h>
#if defined(__USE_ALLOCA__)

View File

@ -25,6 +25,7 @@
// ------------------------------------------------------------------
#include <cstdarg>
#include <limits.h>
#include <golded.h>
#include <gstrmail.h>
#include <gutlcode.h>

View File

@ -31,6 +31,7 @@
// ------------------------------------------------------------------
#include <limits.h>
#include <gdefs.h>

View File

@ -25,6 +25,8 @@
// Debugging and logging.
// ------------------------------------------------------------------
#include <string.h>
#include <stdio.h>
#include <gutlmisc.h>
#include <gfilutil.h>
#include <gdbgerr.h>

View File

@ -33,7 +33,6 @@
// ------------------------------------------------------------------
#include <gdefs.h>

View File

@ -31,6 +31,10 @@
#define __gdefs_h
/* ------------------------------------------------------------------ */
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#include <limits.h>
#include <gcmpall.h>
#ifdef __WIN32__
@ -44,7 +48,6 @@ typedef char TCHAR;
#endif
#ifdef _MSC_VER
# include <windows.h>
# include <limits.h>
#elif defined(__MINGW32__) || defined(__CYGWIN__)
# include <stdint.h>
#endif
@ -53,6 +56,9 @@ typedef char TCHAR;
#define ARRAYSIZE(A) sizeof(A)/sizeof((A)[0])
#endif
#ifndef INT_MAX
#define INT_MAX 214783647
#endif
/* ------------------------------------------------------------------
// Disable some MS Visual C warnings */

View File

@ -34,11 +34,17 @@
#if defined (__WIN32__)
#include <windows.h>
#else
#include <sys/param.h>
#endif
#ifndef _MAX_PATH
#define _MAX_PATH 256
#endif
#ifndef PATH_MAX
#define PATH_MAX _MAX_PATH
#endif
#endif
const uint SCHECKET_TYPE_UNKNOWN = 0;
const uint SCHECKET_TYPE_MSSPELL = 1;

View File

@ -31,6 +31,8 @@
// ------------------------------------------------------------------
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -47,6 +49,7 @@
#if !defined(__UNIX__)
#include <io.h>
#endif
#include <gdefs.h>
// ------------------------------------------------------------------M

View File

@ -33,7 +33,7 @@
#include <gdefs.h>
#include <string>
#include <stdlib.h>
// ------------------------------------------------------------------
// FTN contants

View File

@ -31,6 +31,7 @@
// ------------------------------------------------------------------
#include <stdlib.h>
#include <gdefs.h>
#if defined(__MSDOS__)
#include <gmemi86.h>

View File

@ -34,6 +34,7 @@
#include <string>
#include <vector>
#include <stdlib.h>
#include <gctype.h>
#include <cstring>
#include <gdefs.h>

View File

@ -46,7 +46,7 @@
#include <limits.h>
#include <stdlib.h>
#include <gdbgerr.h>
#include <stdlib.h>
#include <gdefs.h>
#include <gmemdbg.h>
#include <gdbgtrk.h>
#include <gstrall.h>

View File

@ -37,6 +37,7 @@
#include <gmoarea.h>
#include <limits.h>
#include <gdefs.h>
#include <gusrmax.h>

View File

@ -4942,7 +4942,7 @@ int get_utf_cs_len() {
*/
int get_utf_cs_len()
{
return (int)get_utf_cs(false);
return (long)get_utf_cs(false);
}
static struct lang_map *get_lang2enc(bool what = true)
@ -4980,7 +4980,7 @@ static struct lang_map *get_lang2enc(bool what = true)
const char * get_default_enc(const char * lang)
{
int n = (int)get_lang2enc(false);
int n = (long)get_lang2enc(false);
for (int i = 0; i < n; i++)
{
if (strcmp(lang, get_lang2enc()[i].lang) == 0)
@ -4993,7 +4993,7 @@ const char * get_default_enc(const char * lang)
int get_lang_num(const char * lang)
{
int n = (int)get_lang2enc(false);
int n = (long)get_lang2enc(false);
for (int i = 0; i < n; i++)
{
if (strncmp(lang,get_lang2enc()[i].lang,2) == 0)

View File

@ -260,7 +260,7 @@ static char* fast_parse_addr(char* str, Addr* addr) {
point = strchr(str, '.');
domain = strchr(str, '@');
if(domain and point)
if((uint32_t)point > (uint32_t)domain)
if(point > domain)
point = NULL;
if(space)
@ -305,7 +305,7 @@ static char* parse_address(char* str, Addr* addr, Addr* mainaka) {
char* point = strchr(str, '.');
domain = strchr(str, '@');
if(domain and point)
if((uint32_t)point > (uint32_t)domain)
if(point > domain)
point = NULL;
if(net) {