diff --git a/ChangeLog b/ChangeLog index edd1f38..93f2c47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -147,6 +147,25 @@ Version 1.8.0 Version 1.6.7 ******************************************************************************* +2010-03-15 Marcelo Jimenez + * SF Patch Tracker [ 2857611 ] Declare a few functions to have proper + (void) argument list. + Submitted By: zephyrus ( zephyrus00jp ) + + In a publicly installed headers, a few functions are declared without any + arguments at all, a la "()". + When I used gcc's -Wimplict and -Wstrict-prototypes to check for the + mismatch of + function prototype declarations and their usage in my own program, + some headers from libupnp-1.6.6 produced warnings. + + They are not strictly bugs, but pretty much annoying. This is 2009, and + almost all the important compilers + understand ISO-C. + + So the offending functions are declared as "(void") to show that they have + no arguments at all. + 2010-03-14 Marcelo Jimenez * SF Patch Tracker [ 2546532 ] Missing carriage return between SOAPACTION and User-Agent headers. diff --git a/upnp/inc/upnp.h b/upnp/inc/upnp.h index 058e3e5..9429dfb 100644 --- a/upnp/inc/upnp.h +++ b/upnp/inc/upnp.h @@ -787,7 +787,7 @@ EXPORT_SPEC int UpnpInit2( * \li \c UPNP_E_FINISH: The SDK is already terminated or * it is not initialized. */ -EXPORT_SPEC int UpnpFinish(); +EXPORT_SPEC int UpnpFinish(void); /*! @@ -801,7 +801,7 @@ EXPORT_SPEC int UpnpFinish(); * related requests. * \li On error: 0 is returned if \b UpnpInit has not succeeded. */ -EXPORT_SPEC unsigned short UpnpGetServerPort(); +EXPORT_SPEC unsigned short UpnpGetServerPort(void); /*! @@ -815,7 +815,7 @@ EXPORT_SPEC unsigned short UpnpGetServerPort(); * related requests. * \li On error: 0 is returned if \b UpnpInit has not succeeded. */ -EXPORT_SPEC unsigned short UpnpGetServerPort6(); +EXPORT_SPEC unsigned short UpnpGetServerPort6(void); /*! * \brief Returns the local IPv4 listening ip address. @@ -828,7 +828,7 @@ EXPORT_SPEC unsigned short UpnpGetServerPort6(); * listening for UPnP related requests. * \li On error: \c NULL is returned if \b UpnpInit has not succeeded. */ -EXPORT_SPEC char *UpnpGetServerIpAddress(); +EXPORT_SPEC char *UpnpGetServerIpAddress(void); /*! @@ -842,7 +842,7 @@ EXPORT_SPEC char *UpnpGetServerIpAddress(); * listening for UPnP related requests. * \li On error: \c NULL is returned if \b UpnpInit has not succeeded. */ -EXPORT_SPEC char *UpnpGetServerIp6Address(); +EXPORT_SPEC char *UpnpGetServerIp6Address(void); /*! @@ -2563,7 +2563,7 @@ EXPORT_SPEC int UpnpEnableWebserver( * \li \c TRUE: The webserver is enabled. * \li \c FALSE: The webserver is not enabled */ -EXPORT_SPEC int UpnpIsWebserverEnabled(); +EXPORT_SPEC int UpnpIsWebserverEnabled(void); /*! @@ -2600,7 +2600,7 @@ EXPORT_SPEC int UpnpRemoveVirtualDir( /*! * \brief Removes all virtual directory mappings. */ -EXPORT_SPEC void UpnpRemoveAllVirtualDirs(); +EXPORT_SPEC void UpnpRemoveAllVirtualDirs(void); /* @} Web Server API */ diff --git a/upnp/inc/upnpdebug.h b/upnp/inc/upnpdebug.h index a6877b1..b45636b 100644 --- a/upnp/inc/upnpdebug.h +++ b/upnp/inc/upnpdebug.h @@ -109,9 +109,9 @@ typedef enum Upnp_LogLevel_e { * \return -1 if fails or UPNP_E_SUCCESS if succeeds. */ #ifdef DEBUG -int UpnpInitLog(); +int UpnpInitLog(void); #else -static UPNP_INLINE int UpnpInitLog() +static UPNP_INLINE int UpnpInitLog(void) { return UPNP_E_SUCCESS; } @@ -134,9 +134,9 @@ static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {} * \brief Closes the log files. */ #ifdef DEBUG -void UpnpCloseLog(); +void UpnpCloseLog(void); #else -static UPNP_INLINE void UpnpCloseLog() {} +static UPNP_INLINE void UpnpCloseLog(void) {} #endif diff --git a/upnp/sample/tvdevice/upnp_tv_device.c b/upnp/sample/tvdevice/upnp_tv_device.c index 227a477..6658043 100644 --- a/upnp/sample/tvdevice/upnp_tv_device.c +++ b/upnp/sample/tvdevice/upnp_tv_device.c @@ -1812,7 +1812,7 @@ int TvDeviceCallbackEventHandler(Upnp_EventType EventType, void *Event, void *Co * *****************************************************************************/ int -TvDeviceStop() +TvDeviceStop(void) { UpnpUnRegisterRootDevice( device_handle ); UpnpFinish(); diff --git a/upnp/sample/tvdevice/upnp_tv_device.h b/upnp/sample/tvdevice/upnp_tv_device.h index c2cbec5..855d984 100644 --- a/upnp/sample/tvdevice/upnp_tv_device.h +++ b/upnp/sample/tvdevice/upnp_tv_device.h @@ -623,7 +623,7 @@ int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out, OU int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name, char *web_dir_path, print_string pfun); -int TvDeviceStop(); +int TvDeviceStop(void); #ifdef __cplusplus } diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index 245da18..705a781 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -299,7 +299,7 @@ int UpnpInit2(const char *IfName, unsigned short DestPort) } -int UpnpFinish() +int UpnpFinish(void) { #ifdef INCLUDE_DEVICE_APIS UpnpDevice_Handle device_handle; @@ -381,7 +381,7 @@ int UpnpFinish() } -unsigned short UpnpGetServerPort() +unsigned short UpnpGetServerPort(void) { if (UpnpSdkInit != 1) { return 0; @@ -391,7 +391,7 @@ unsigned short UpnpGetServerPort() } -unsigned short UpnpGetServerPort6() +unsigned short UpnpGetServerPort6(void) { if (UpnpSdkInit != 1) { return 0; @@ -401,7 +401,7 @@ unsigned short UpnpGetServerPort6() } -char *UpnpGetServerIpAddress() +char *UpnpGetServerIpAddress(void) { if (UpnpSdkInit != 1) { return NULL; @@ -411,7 +411,7 @@ char *UpnpGetServerIpAddress() } -char *UpnpGetServerIp6Address() +char *UpnpGetServerIp6Address(void) { if( UpnpSdkInit != 1 ) { return NULL; @@ -3752,7 +3752,7 @@ int UpnpRemoveVirtualDir(const char *dirName) } -void UpnpRemoveAllVirtualDirs() +void UpnpRemoveAllVirtualDirs(void) { virtualDirList *pCur; virtualDirList *pNext; @@ -3812,7 +3812,7 @@ int UpnpEnableWebserver(int enable) * * \return 1, if webserver is enabled or 0, if webserver is disabled. */ -int UpnpIsWebserverEnabled() +int UpnpIsWebserverEnabled(void) { if (UpnpSdkInit != 1) { return 0; diff --git a/upnp/src/api/upnpdebug.c b/upnp/src/api/upnpdebug.c index 61faa3a..ff4b520 100644 --- a/upnp/src/api/upnpdebug.c +++ b/upnp/src/api/upnpdebug.c @@ -64,7 +64,7 @@ static const char *infoFileName = "IUpnpInfoFile.txt"; #ifdef DEBUG -int UpnpInitLog() +int UpnpInitLog(void) { ithread_mutex_init(&GlobalDebugMutex, NULL); if(DEBUG_TARGET == 1) { @@ -85,7 +85,7 @@ void UpnpSetLogLevel(Upnp_LogLevel log_level) } -void UpnpCloseLog() +void UpnpCloseLog(void) { if (DEBUG_TARGET == 1) { fflush(ErrFileHnd);