Fix for 64 bit machines.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@152 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2007-03-13 17:46:26 +00:00
parent 41cb45146c
commit bdda54a66b
2 changed files with 10 additions and 8 deletions

View File

@ -41,12 +41,14 @@
#include <stdarg.h>
#ifndef UPNP_USE_BCBPP
#ifndef UPNP_USE_MSVCPP
#include <inttypes.h>
#include <stdint.h>
#endif
#endif
#ifndef WIN32
#include <arpa/inet.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
@ -54,7 +56,6 @@
#include <sys/wait.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <fcntl.h>
#else
#include <winsock2.h>
#include <malloc.h>
@ -1908,7 +1909,7 @@ http_MakeMessage( INOUT membuffer * buf,
{
bignum = ( off_t )va_arg( argp, off_t );
sprintf( tempbuf, "%lld", (int64_t)bignum );
sprintf( tempbuf, "%"PRId64, (int64_t)bignum );
if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) {
goto error_handler;
}

View File

@ -39,7 +39,8 @@
#include <fcntl.h>
#ifndef UPNP_USE_BCBPP
#ifndef UPNP_USE_MSVCPP
#include <stdint.h>
#include <inttypes.h>
#include <stdint.h>
#endif
#endif
#include "util.h"
@ -54,7 +55,7 @@
#include "ssdplib.h"
#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
#endif
#include <sys/stat.h>
#include "ithread.h"
@ -990,7 +991,7 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
Instr->RangeOffset = FirstByte;
Instr->ReadSendSize = LastByte - FirstByte + 1;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
(int64_t)FirstByte,
(int64_t)LastByte,
(int64_t)FileLength ); //Data between two range.
@ -999,7 +1000,7 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
Instr->RangeOffset = FirstByte;
Instr->ReadSendSize = FileLength - FirstByte;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
(int64_t)FirstByte,
(int64_t)(FileLength - 1),
(int64_t)FileLength );
@ -1008,14 +1009,14 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier,
Instr->RangeOffset = 0;
Instr->ReadSendSize = FileLength;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes 0-%lld/%lld\r\n",
"CONTENT-RANGE: bytes 0-%"PRId64"/%"PRId64"\r\n",
(int64_t)(FileLength - 1),
(int64_t)FileLength );
} else {
Instr->RangeOffset = FileLength - LastByte;
Instr->ReadSendSize = LastByte;
sprintf( Instr->RangeHeader,
"CONTENT-RANGE: bytes %lld-%lld/%lld\r\n",
"CONTENT-RANGE: bytes %"PRId64"-%"PRId64"/%"PRId64"\r\n",
(int64_t)(FileLength - LastByte + 1),
(int64_t)FileLength,
(int64_t)FileLength );