(long long) cast replaced by a generic data type ulong64 that can be defined separately for every used system/compiler (did not work with VC++)

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@139 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Oxy
2007-03-01 10:08:04 +00:00
parent bbd16d75ed
commit 0d451c9c8e
4 changed files with 16 additions and 14 deletions

View File

@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /FR /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\pthreads\include" /I "..\ixml\src\inc" /I "..\ixml\inc" /I "..\threadutil\inc" /I "..\upnp\inc" /I "..\upnp\src\inc" /I "..\build\inc" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBUPNP_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG" # ADD BASE RSC /l 0x407 /d "_DEBUG"
@@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\pthreads\lib\pthreadvc2.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF

View File

@@ -65,8 +65,10 @@
#else #else
#define EXPORT_SPEC #define EXPORT_SPEC
#endif #endif
typedef __int64 ulong64;
#else #else
#define EXPORT_SPEC #define EXPORT_SPEC
typedef long long ulong64;
#endif #endif
#ifndef WIN32 #ifndef WIN32

View File

@@ -1903,7 +1903,7 @@ http_MakeMessage( INOUT membuffer * buf,
{ {
bignum = ( off_t )va_arg( argp, off_t ); bignum = ( off_t )va_arg( argp, off_t );
sprintf( tempbuf, "%lld", (long long)bignum ); sprintf( tempbuf, "%lld", (ulong64)bignum );
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) { if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
goto error_handler; goto error_handler;
} }

View File

@@ -986,34 +986,34 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
Instr->ReadSendSize = LastByte - FirstByte + 1; Instr->ReadSendSize = LastByte - FirstByte + 1;
sprintf( Instr->RangeHeader, sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(long long)FirstByte, (ulong64)FirstByte,
(long long)LastByte, (ulong64)LastByte,
(long long)FileLength ); //Data between two range. (ulong64)FileLength ); //Data between two range.
} else if( FirstByte >= 0 && LastByte == -1 } else if( FirstByte >= 0 && LastByte == -1
&& FirstByte < FileLength ) { && FirstByte < FileLength ) {
Instr->RangeOffset = FirstByte; Instr->RangeOffset = FirstByte;
Instr->ReadSendSize = FileLength - FirstByte; Instr->ReadSendSize = FileLength - FirstByte;
sprintf( Instr->RangeHeader, sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(long long)FirstByte, (ulong64)FirstByte,
(long long)(FileLength - 1), (ulong64)(FileLength - 1),
(long long)FileLength ); (ulong64)FileLength );
} else if( FirstByte == -1 && LastByte > 0 ) { } else if( FirstByte == -1 && LastByte > 0 ) {
if( LastByte >= FileLength ) { if( LastByte >= FileLength ) {
Instr->RangeOffset = 0; Instr->RangeOffset = 0;
Instr->ReadSendSize = FileLength; Instr->ReadSendSize = FileLength;
sprintf( Instr->RangeHeader, sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes 0-%lld/%lld\r\n", "CONTENT-RANGE: bytes 0-%lld/%lld\r\n",
(long long)(FileLength - 1), (ulong64)(FileLength - 1),
(long long)FileLength ); (ulong64)FileLength );
} else { } else {
Instr->RangeOffset = FileLength - LastByte; Instr->RangeOffset = FileLength - LastByte;
Instr->ReadSendSize = LastByte; Instr->ReadSendSize = LastByte;
sprintf( Instr->RangeHeader, sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
(long long)(FileLength - LastByte + 1), (ulong64)(FileLength - LastByte + 1),
(long long)FileLength, (ulong64)FileLength,
(long long)FileLength ); (ulong64)FileLength );
} }
} else { } else {
free( RangeInput ); free( RangeInput );