From 04282d6b8f039d957fdf4946529168d252f4d045 Mon Sep 17 00:00:00 2001 From: Joris Van Damme Date: Wed, 7 Mar 2007 17:10:31 +0000 Subject: [PATCH] minor changes in tif_win32.c --- ChangeLog | 7 +++++++ libtiff/tif_win32.c | 50 ++++++++++++++++++++++----------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 186ecb27..8466d49d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-07 Joris Van Damme + + * libtiff/tif_win32.c: made inclusion of windows.h unconditional + + * libtiff/tif_win32.c: replaced preprocessor indication for consiously + unused arguments by standard C indication for the same + 2007-02-27 Andrey Kiselev * libtiff/tif_dirread.c: Use uint32 type instead of tsize_t in byte diff --git a/libtiff/tif_win32.c b/libtiff/tif_win32.c index 9845c30b..f152cf4c 100644 --- a/libtiff/tif_win32.c +++ b/libtiff/tif_win32.c @@ -1,4 +1,4 @@ -/* $Id: tif_win32.c,v 1.20 2007-01-15 18:40:39 mloskot Exp $ */ +/* $Id: tif_win32.c,v 1.21 2007-03-07 17:10:31 joris Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -30,9 +30,7 @@ */ #include "tiffiop.h" -#ifdef _WIN32_WCE #include -#endif static tsize_t _tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size) @@ -91,12 +89,12 @@ _tiffSizeProc(thandle_t fd) return ((toff_t)GetFileSize(fd, NULL)); } -#ifdef __BORLANDC__ -#pragma argsused -#endif static int _tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) { + (void) fd; + (void) pbase; + (void) psize; return (0); } @@ -130,12 +128,12 @@ _tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) return(1); } -#ifdef __BORLANDC__ -#pragma argsused -#endif static void _tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) { + (void) fd; + (void) base; + (void) size; } static void @@ -295,26 +293,26 @@ _TIFFfree(tdata_t p) tdata_t _TIFFrealloc(tdata_t p, tsize_t s) { - void* pvTmp; - tsize_t old; + void* pvTmp; + tsize_t old; - if(p == NULL) - return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); + if(p == NULL) + return ((tdata_t)GlobalAlloc(GMEM_FIXED, s)); - old = GlobalSize(p); + old = GlobalSize(p); - if (old>=s) { - if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { - CopyMemory(pvTmp, p, s); - GlobalFree(p); - } - } else { - if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { - CopyMemory(pvTmp, p, old); - GlobalFree(p); - } - } - return ((tdata_t)pvTmp); + if (old>=s) { + if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { + CopyMemory(pvTmp, p, s); + GlobalFree(p); + } + } else { + if ((pvTmp = GlobalAlloc(GMEM_FIXED, s)) != NULL) { + CopyMemory(pvTmp, p, old); + GlobalFree(p); + } + } + return ((tdata_t)pvTmp); } void