updated 3rd party libs: CLapack 3.1.1.1 => 3.2.1, zlib 1.2.3 => 1.2.5, libpng 1.2.x => 1.4.3, libtiff 3.7.x => 3.9.4. fixed many 64-bit related VS2010 warnings

This commit is contained in:
Vadim Pisarevsky
2010-07-16 12:54:53 +00:00
parent 0c9eca7922
commit f78a3b4cc1
465 changed files with 51856 additions and 41344 deletions

View File

@@ -1,4 +1,4 @@
/* $Id: tif_win32.c,v 1.1 2005-06-17 13:54:52 vp153 Exp $ */
/* $Id: tif_win32.c,v 1.21.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -30,6 +30,8 @@
*/
#include "tiffiop.h"
#include <windows.h>
static tsize_t
_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
{
@@ -51,11 +53,10 @@ _tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
static toff_t
_tiffSeekProc(thandle_t fd, toff_t off, int whence)
{
DWORD dwMoveMethod, dwMoveHigh;
ULARGE_INTEGER li;
DWORD dwMoveMethod;
/* we use this as a special code, so avoid accepting it */
if( off == 0xFFFFFFFF )
return 0xFFFFFFFF;
li.QuadPart = off;
switch(whence)
{
@@ -72,9 +73,8 @@ _tiffSeekProc(thandle_t fd, toff_t off, int whence)
dwMoveMethod = FILE_BEGIN;
break;
}
dwMoveHigh = 0;
return ((toff_t)SetFilePointer(fd, (LONG) off, (PLONG)&dwMoveHigh,
dwMoveMethod));
return ((toff_t)SetFilePointer(fd, (LONG) li.LowPart,
(PLONG)&li.HighPart, dwMoveMethod));
}
static int
@@ -89,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);
}
@@ -128,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
@@ -163,6 +163,8 @@ TIFFFdOpen(int ifd, const char* name, const char* mode)
return (tif);
}
#ifndef _WIN32_WCE
/*
* Open a TIFF file for read/writing.
*/
@@ -199,11 +201,11 @@ TIFFOpen(const char* name, const char* mode)
}
fd = (thandle_t)CreateFileA(name,
(m == O_RDONLY)?GENERIC_READ:(GENERIC_READ | GENERIC_WRITE),
FILE_SHARE_READ, NULL, dwMode,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, dwMode,
(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
NULL);
if (fd == INVALID_HANDLE_VALUE) {
TIFFError(module, "%s: Cannot open", name);
TIFFErrorExt(0, module, "%s: Cannot open", name);
return ((TIFF *)0);
}
@@ -244,16 +246,16 @@ TIFFOpenW(const wchar_t* name, const char* mode)
(m == O_RDONLY)?FILE_ATTRIBUTE_READONLY:FILE_ATTRIBUTE_NORMAL,
NULL);
if (fd == INVALID_HANDLE_VALUE) {
TIFFError(module, "%S: Cannot open", name);
TIFFErrorExt(0, module, "%S: Cannot open", name);
return ((TIFF *)0);
}
mbname = NULL;
mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
if (mbsize > 0) {
mbname = _TIFFmalloc(mbsize);
mbname = (char *)_TIFFmalloc(mbsize);
if (!mbname) {
TIFFError(module,
TIFFErrorExt(0, module,
"Can't allocate space for filename conversion buffer");
return ((TIFF*)0);
}
@@ -264,12 +266,17 @@ TIFFOpenW(const wchar_t* name, const char* mode)
tif = TIFFFdOpen((int)fd,
(mbname != NULL) ? mbname : "<unknown>", mode);
if(!tif)
CloseHandle(fd);
_TIFFfree(mbname);
return tif;
}
#endif /* ndef _WIN32_WCE */
tdata_t
_TIFFmalloc(tsize_t s)
{
@@ -286,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
@@ -332,6 +339,8 @@ _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
return (iTmp);
}
#ifndef _WIN32_WCE
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
@@ -387,4 +396,13 @@ Win32ErrorHandler(const char* module, const char* fmt, va_list ap)
}
TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
#endif /* ndef _WIN32_WCE */
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables:
* mode: c
* c-basic-offset: 8
* fill-column: 78
* End:
*/