From 4bcb9dd5e1b7814f5ccd161b3ec1403d4e8986b6 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Tue, 13 Feb 2007 01:40:10 +0000 Subject: [PATCH] Merge of trunk into branch-1.4.x. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@130 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- ChangeLog | 5 +++++ build/inc/config.h | 1 + build/libupnp.bpr | 17 ++++++++++------- threadutil/src/ThreadPool.c | 2 -- upnp/src/gena/gena_device.c | 2 +- upnp/src/genlib/net/http/httpreadwrite.c | 4 ++-- upnp/src/genlib/net/http/webserver.c | 22 +++++++++++++++------- 7 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1307131..3dee486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Version 1.4.2 ************************************************************************* +2007-02-09 Marcelo Jimenez + + * 32/64 bits portability issues on *printf. + Use %zd for size_t, and cast to (long long) for off_t. + 2007-02-02 Marcelo Jimenez * Bumped the program version to 1.4.2 in config.ac. diff --git a/build/inc/config.h b/build/inc/config.h index b4118a5..f6a21e3 100644 --- a/build/inc/config.h +++ b/build/inc/config.h @@ -34,6 +34,7 @@ #include "autoconfig.h" +#define MAX_JOBS_TOTAL 10 /** @name Compile time configuration options * The Linux SDK for UPnP Devices contains some compile-time parameters diff --git a/build/libupnp.bpr b/build/libupnp.bpr index 06938c1..de33f0c 100644 --- a/build/libupnp.bpr +++ b/build/libupnp.bpr @@ -34,7 +34,7 @@ - + @@ -48,8 +48,8 @@ - - + + @@ -94,12 +94,15 @@ ProductVersion=1.0.0.0 Comments= [HistoryLists\hlIncludePath] -Count=1 -Item0=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc +Count=3 +Item0=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc;..\..\pthreads-w32-1-10-0-release +Item1=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc;D:\DEVELOP\pthreads-w32-1-10-0-release +Item2=..\upnp\src\genlib\util;..\upnp\src;..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\threadutil\src;..\ixml\src;$(BCB)\include;$(BCB)\include\vcl;..\ixml\inc;..\threadutil\inc;..\upnp\inc;inc;..\ixml\src\inc;..\upnp\src\inc [HistoryLists\hlLibraryPath] -Count=1 -Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib +Count=2 +Item0=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib;D:\DEVELOP\pthreads-w32-1-10-0-release +Item1=..\upnp\src\uuid;..\upnp\src\urlconfig;..\upnp\src\ssdp;..\upnp\src\soap;..\upnp\src\genlib\util;..\upnp\src\genlib\service_table;..\upnp\src\genlib\net\uri;..\upnp\src\genlib\net\http;..\upnp\src\genlib\net;..\upnp\src\genlib\miniserver;..\upnp\src\genlib\client_table;..\upnp\src\gena;..\upnp\src\api;..\upnp\src;..\threadutil\src;..\ixml\src;$(BCB)\lib\obj;$(BCB)\lib [HistoryLists\hlDebugSourcePath] Count=1 diff --git a/threadutil/src/ThreadPool.c b/threadutil/src/ThreadPool.c index 16701e5..4bbde2c 100644 --- a/threadutil/src/ThreadPool.c +++ b/threadutil/src/ThreadPool.c @@ -34,9 +34,7 @@ #include #include -#ifdef STATS #include -#endif /**************************************************************************** * Function: CmpThreadPoolJob diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index 7aefcc6..ec2511a 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -574,7 +574,7 @@ genaInitNotify( IN UpnpDevice_Handle device_handle, } sprintf( headers, "CONTENT-TYPE: text/xml\r\nCONTENT-LENGTH: " - "%d\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", + "%zd\r\nNT: upnp:event\r\nNTS: upnp:propchange\r\n", strlen( propertySet ) + 1 ); //schedule thread for initial notification diff --git a/upnp/src/genlib/net/http/httpreadwrite.c b/upnp/src/genlib/net/http/httpreadwrite.c index 1c53b8f..6537301 100644 --- a/upnp/src/genlib/net/http/httpreadwrite.c +++ b/upnp/src/genlib/net/http/httpreadwrite.c @@ -637,7 +637,7 @@ http_Download( IN const char *url_str, *temp = '/'; DBGONLY( UpnpPrintf ( UPNP_INFO, HTTP, __FILE__, __LINE__, - "HOSTNAME : %s Length : %d\n", hoststr, hostlen ); + "HOSTNAME : %s Length : %zu\n", hoststr, hostlen ); ) ret_code = http_MakeMessage( @@ -1903,7 +1903,7 @@ http_MakeMessage( INOUT membuffer * buf, { bignum = ( off_t )va_arg( argp, off_t ); - sprintf( tempbuf, "%lld", bignum ); + sprintf( tempbuf, "%lld", (long long)bignum ); if( membuffer_append( buf, tempbuf, strlen( tempbuf ) ) != 0 ) { goto error_handler; } diff --git a/upnp/src/genlib/net/http/webserver.c b/upnp/src/genlib/net/http/webserver.c index 2c93591..adf915c 100644 --- a/upnp/src/genlib/net/http/webserver.c +++ b/upnp/src/genlib/net/http/webserver.c @@ -633,7 +633,7 @@ get_file_info( IN const char *filename, DBGONLY( UpnpPrintf( UPNP_INFO, HTTP, __FILE__, __LINE__, "file info: %s, length: %lld, last_mod=%s readable=%d\n", - filename, info->file_length, + filename, (long long)info->file_length, asctime( gmtime( &info->last_modified ) ), info->is_readable ); ) @@ -984,28 +984,36 @@ CreateHTTPRangeResponseHeader( char *ByteRangeSpecifier, Instr->RangeOffset = FirstByte; Instr->ReadSendSize = LastByte - FirstByte + 1; - sprintf( Instr->RangeHeader, "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", FirstByte, LastByte, FileLength ); //Data between two range. + sprintf( Instr->RangeHeader, + "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", + (long long)FirstByte, + (long long)LastByte, + (long long)FileLength ); //Data between two range. } else if( FirstByte >= 0 && LastByte == -1 && FirstByte < FileLength ) { Instr->RangeOffset = FirstByte; Instr->ReadSendSize = FileLength - FirstByte; sprintf( Instr->RangeHeader, - "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", FirstByte, - FileLength - 1, FileLength ); + "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", + (long long)FirstByte, + (long long)(FileLength - 1), + (long long)FileLength ); } else if( FirstByte == -1 && LastByte > 0 ) { if( LastByte >= FileLength ) { Instr->RangeOffset = 0; Instr->ReadSendSize = FileLength; sprintf( Instr->RangeHeader, "CONTENT-RANGE: bytes 0-%lld/%lld\r\n", - FileLength - 1, FileLength ); + (long long)(FileLength - 1), + (long long)FileLength ); } else { Instr->RangeOffset = FileLength - LastByte; Instr->ReadSendSize = LastByte; sprintf( Instr->RangeHeader, "CONTENT-RANGE: bytes %lld-%lld/%lld\r\n", - FileLength - LastByte + 1, FileLength, - FileLength ); + (long long)(FileLength - LastByte + 1), + (long long)FileLength, + (long long)FileLength ); } } else { free( RangeInput );