From 74838f16f6c838251af1e8b81a6064a9cac50464 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 1 Jul 2010 18:49:22 +0200 Subject: Remove silly warnings from MSVC. --- fitz/filt_faxd.c | 2 +- fitz/fitz_base.h | 4 ++++ fitz/util_gettimeofday.c | 20 +------------------- 3 files changed, 6 insertions(+), 20 deletions(-) (limited to 'fitz') diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c index 61238819..c31a7ea2 100644 --- a/fitz/filt_faxd.c +++ b/fitz/filt_faxd.c @@ -538,7 +538,7 @@ eol: else { unsigned char * restrict d = out->wp; unsigned char * restrict s = fax->dst; - unsigned w = fax->stride; + int w = fax->stride; for (i = 0; i < w; i++) *d++ = *s++ ^ 0xff; } diff --git a/fitz/fitz_base.h b/fitz/fitz_base.h index c3b1f4a2..ec1eb9fc 100644 --- a/fitz/fitz_base.h +++ b/fitz/fitz_base.h @@ -35,6 +35,10 @@ #ifdef _MSC_VER /* stupid stone-age compiler */ +#pragma warning( disable: 4244 ) /* conversion from X to Y, possible loss of data */ +#pragma warning( disable: 4996 ) /* The POSIX name for this item is deprecated */ +#pragma warning( disable: 4996 ) /* This function or variable may be unsafe */ + #include extern int gettimeofday(struct timeval *tv, struct timezone *tz); diff --git a/fitz/util_gettimeofday.c b/fitz/util_gettimeofday.c index c016902e..ee89d445 100644 --- a/fitz/util_gettimeofday.c +++ b/fitz/util_gettimeofday.c @@ -10,19 +10,12 @@ #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif -struct timezone -{ - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - int gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; unsigned __int64 tmpres = 0; - static int tzflag = 0; - if (NULL != tv) + if (tv) { GetSystemTimeAsFileTime(&ft); @@ -37,17 +30,6 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) tv->tv_usec = (long)(tmpres % 1000000UL); } - if (NULL != tz) - { - if (!tzflag) - { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - return 0; } -- cgit v1.2.3