Fixed some GCC warnings for Werror

This commit is contained in:
Scott Ehlert 2006-09-09 20:12:50 +00:00
parent b5498818a3
commit 5a4b1d2f03
2 changed files with 9 additions and 11 deletions

View File

@ -486,10 +486,10 @@ unsigned long _GeoIP_lookupaddress (const char *host) {
struct hostent phe2; struct hostent phe2;
struct hostent * phe = &phe2; struct hostent * phe = &phe2;
char *buf = NULL; char *buf = NULL;
int buflength = 16384;
int herr = 0;
int result = 0; int result = 0;
#ifdef HAVE_GETHOSTBYNAME_R #ifdef HAVE_GETHOSTBYNAME_R
int buflength = 16384;
int herr = 0;
buf = malloc(buflength); buf = malloc(buflength);
#endif #endif
if (addr == INADDR_NONE) { if (addr == INADDR_NONE) {

View File

@ -25,17 +25,15 @@
extern "C" { extern "C" {
#endif #endif
#ifdef _MSC_VER #if defined _MSC_VER && _MSC_VER >= 1400
#if _MSC_VER >= 1400 /* Disable deprecation warnings concerning unsafe CRT functions */
/* Disable deprecation warnings concerning unsafe CRT functions */ #define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
/* Replace the POSIX function with ISO C++ conformant one as it is now deprecated */ /* Replace the POSIX function with ISO C++ conformant one as it is now deprecated */
#define fileno _fileno #define fileno _fileno
/* Disable deprecation warnings because MSVC8 seemingly thinks ISO C++ conformant functions are deprecated. */ /* Disable deprecation warnings because MSVC8 seemingly thinks ISO C++ conformant functions are deprecated. */
#pragma warning (disable : 4996) #pragma warning (disable : 4996)
#endif
#endif #endif
#include<stdio.h> #include<stdio.h>