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.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@493 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2010-03-15 15:33:40 +00:00
parent aca89457ae
commit 6b0272d66b
7 changed files with 41 additions and 22 deletions

View File

@ -147,6 +147,25 @@ Version 1.8.0
Version 1.6.7 Version 1.6.7
******************************************************************************* *******************************************************************************
2010-03-15 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* 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 <mroberto(at)users.sourceforge.net> 2010-03-14 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* SF Patch Tracker [ 2546532 ] Missing carriage return between * SF Patch Tracker [ 2546532 ] Missing carriage return between
SOAPACTION and User-Agent headers. SOAPACTION and User-Agent headers.

View File

@ -787,7 +787,7 @@ EXPORT_SPEC int UpnpInit2(
* \li \c UPNP_E_FINISH: The SDK is already terminated or * \li \c UPNP_E_FINISH: The SDK is already terminated or
* it is not initialized. * it is not initialized.
*/ */
EXPORT_SPEC int UpnpFinish(); EXPORT_SPEC int UpnpFinish(void);
/*! /*!
@ -801,7 +801,7 @@ EXPORT_SPEC int UpnpFinish();
* related requests. * related requests.
* \li On error: 0 is returned if \b UpnpInit has not succeeded. * \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. * related requests.
* \li On error: 0 is returned if \b UpnpInit has not succeeded. * \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. * \brief Returns the local IPv4 listening ip address.
@ -828,7 +828,7 @@ EXPORT_SPEC unsigned short UpnpGetServerPort6();
* listening for UPnP related requests. * listening for UPnP related requests.
* \li On error: \c NULL is returned if \b UpnpInit has not succeeded. * \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. * listening for UPnP related requests.
* \li On error: \c NULL is returned if \b UpnpInit has not succeeded. * \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 TRUE: The webserver is enabled.
* \li \c FALSE: The webserver is not 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. * \brief Removes all virtual directory mappings.
*/ */
EXPORT_SPEC void UpnpRemoveAllVirtualDirs(); EXPORT_SPEC void UpnpRemoveAllVirtualDirs(void);
/* @} Web Server API */ /* @} Web Server API */

View File

@ -109,9 +109,9 @@ typedef enum Upnp_LogLevel_e {
* \return -1 if fails or UPNP_E_SUCCESS if succeeds. * \return -1 if fails or UPNP_E_SUCCESS if succeeds.
*/ */
#ifdef DEBUG #ifdef DEBUG
int UpnpInitLog(); int UpnpInitLog(void);
#else #else
static UPNP_INLINE int UpnpInitLog() static UPNP_INLINE int UpnpInitLog(void)
{ {
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }
@ -134,9 +134,9 @@ static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
* \brief Closes the log files. * \brief Closes the log files.
*/ */
#ifdef DEBUG #ifdef DEBUG
void UpnpCloseLog(); void UpnpCloseLog(void);
#else #else
static UPNP_INLINE void UpnpCloseLog() {} static UPNP_INLINE void UpnpCloseLog(void) {}
#endif #endif

View File

@ -1812,7 +1812,7 @@ int TvDeviceCallbackEventHandler(Upnp_EventType EventType, void *Event, void *Co
* *
*****************************************************************************/ *****************************************************************************/
int int
TvDeviceStop() TvDeviceStop(void)
{ {
UpnpUnRegisterRootDevice( device_handle ); UpnpUnRegisterRootDevice( device_handle );
UpnpFinish(); UpnpFinish();

View File

@ -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, int TvDeviceStart(char * ip_address, unsigned short port,char * desc_doc_name,
char *web_dir_path, print_string pfun); char *web_dir_path, print_string pfun);
int TvDeviceStop(); int TvDeviceStop(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -299,7 +299,7 @@ int UpnpInit2(const char *IfName, unsigned short DestPort)
} }
int UpnpFinish() int UpnpFinish(void)
{ {
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
UpnpDevice_Handle device_handle; UpnpDevice_Handle device_handle;
@ -381,7 +381,7 @@ int UpnpFinish()
} }
unsigned short UpnpGetServerPort() unsigned short UpnpGetServerPort(void)
{ {
if (UpnpSdkInit != 1) { if (UpnpSdkInit != 1) {
return 0; return 0;
@ -391,7 +391,7 @@ unsigned short UpnpGetServerPort()
} }
unsigned short UpnpGetServerPort6() unsigned short UpnpGetServerPort6(void)
{ {
if (UpnpSdkInit != 1) { if (UpnpSdkInit != 1) {
return 0; return 0;
@ -401,7 +401,7 @@ unsigned short UpnpGetServerPort6()
} }
char *UpnpGetServerIpAddress() char *UpnpGetServerIpAddress(void)
{ {
if (UpnpSdkInit != 1) { if (UpnpSdkInit != 1) {
return NULL; return NULL;
@ -411,7 +411,7 @@ char *UpnpGetServerIpAddress()
} }
char *UpnpGetServerIp6Address() char *UpnpGetServerIp6Address(void)
{ {
if( UpnpSdkInit != 1 ) { if( UpnpSdkInit != 1 ) {
return NULL; return NULL;
@ -3752,7 +3752,7 @@ int UpnpRemoveVirtualDir(const char *dirName)
} }
void UpnpRemoveAllVirtualDirs() void UpnpRemoveAllVirtualDirs(void)
{ {
virtualDirList *pCur; virtualDirList *pCur;
virtualDirList *pNext; virtualDirList *pNext;
@ -3812,7 +3812,7 @@ int UpnpEnableWebserver(int enable)
* *
* \return 1, if webserver is enabled or 0, if webserver is disabled. * \return 1, if webserver is enabled or 0, if webserver is disabled.
*/ */
int UpnpIsWebserverEnabled() int UpnpIsWebserverEnabled(void)
{ {
if (UpnpSdkInit != 1) { if (UpnpSdkInit != 1) {
return 0; return 0;

View File

@ -64,7 +64,7 @@ static const char *infoFileName = "IUpnpInfoFile.txt";
#ifdef DEBUG #ifdef DEBUG
int UpnpInitLog() int UpnpInitLog(void)
{ {
ithread_mutex_init(&GlobalDebugMutex, NULL); ithread_mutex_init(&GlobalDebugMutex, NULL);
if(DEBUG_TARGET == 1) { if(DEBUG_TARGET == 1) {
@ -85,7 +85,7 @@ void UpnpSetLogLevel(Upnp_LogLevel log_level)
} }
void UpnpCloseLog() void UpnpCloseLog(void)
{ {
if (DEBUG_TARGET == 1) { if (DEBUG_TARGET == 1) {
fflush(ErrFileHnd); fflush(ErrFileHnd);