diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-07-01 18:49:22 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-07-01 18:49:22 +0200 |
commit | 74838f16f6c838251af1e8b81a6064a9cac50464 (patch) | |
tree | 0f4bbda6c9266c3df8071cd37cb258510adfd6dd | |
parent | 7f940ad522ceb63bc5d54923a1635773ca592b9b (diff) | |
download | mupdf-74838f16f6c838251af1e8b81a6064a9cac50464.tar.xz |
Remove silly warnings from MSVC.
-rw-r--r-- | apps/win_main.c | 8 | ||||
-rw-r--r-- | draw/archport.c | 2 | ||||
-rw-r--r-- | fitz/filt_faxd.c | 2 | ||||
-rw-r--r-- | fitz/fitz_base.h | 4 | ||||
-rw-r--r-- | fitz/util_gettimeofday.c | 20 |
5 files changed, 11 insertions, 25 deletions
diff --git a/apps/win_main.c b/apps/win_main.c index 7de84d2d..5a16e357 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -63,7 +63,7 @@ void win32error(char *msg) NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - &buf, 0, NULL); + (LPSTR)&buf, 0, NULL); winerror(&gapp, fz_throw("%s:\n%s", msg, buf)); } @@ -234,7 +234,7 @@ dlogaboutproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return FALSE; } -void winhelp() +void winhelp(pdfapp_t*app) { int code = DialogBoxW(NULL, L"IDD_DLOGABOUT", hwndframe, dlogaboutproc); if (code <= 0) @@ -546,7 +546,7 @@ void winreloadfile(pdfapp_t *app) void winopenuri(pdfapp_t *app, char *buf) { - ShellExecute(hwndframe, "open", buf, 0, 0, SW_SHOWNORMAL); + ShellExecuteA(hwndframe, "open", buf, 0, 0, SW_SHOWNORMAL); } void handlekey(int c) @@ -615,7 +615,7 @@ frameproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_SYSCOMMAND: if (wParam == ID_ABOUT) { - winhelp(); + winhelp(&gapp); return 0; } if (wParam == ID_DOCINFO) diff --git a/draw/archport.c b/draw/archport.c index a4601328..2fb491d7 100644 --- a/draw/archport.c +++ b/draw/archport.c @@ -102,7 +102,7 @@ text_w4i1o4_32bit(byte * restrict rgba, { unsigned int ca, drb, dga, crb, cga; ca = *src++; - dga = *dst32++; + drb = *dst32++; ca += ca>>7; ca = (ca*alpha)>>8; if (ca == 0) 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 <io.h> 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; } |