Backport of svn revision 493: Declare a few functions to have proper

(void) argument list.

	* 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/branches/branch-1.6.x@494 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez
2010-03-15 15:34:54 +00:00
parent 4ad6ea3545
commit a1d707ac81
7 changed files with 131 additions and 112 deletions

View File

@@ -2,6 +2,25 @@
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

@@ -1053,7 +1053,7 @@ EXPORT_SPEC int UpnpInit(
* \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);
/*! /*!
@@ -1067,7 +1067,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);
/*! /*!
@@ -1081,7 +1081,7 @@ EXPORT_SPEC unsigned short UpnpGetServerPort();
* 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);
/*! /*!
@@ -2611,7 +2611,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);
/*! /*!
@@ -2648,7 +2648,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 {
* UPNP_E_SUCCESS : if success * UPNP_E_SUCCESS : if success
***************************************************************************/ ***************************************************************************/
#ifdef DEBUG #ifdef DEBUG
int UpnpInitLog(); int UpnpInitLog(void);
#else #else
static UPNP_INLINE int UpnpInitLog() { return UPNP_E_SUCCESS; } static UPNP_INLINE int UpnpInitLog(void) { return UPNP_E_SUCCESS; }
#endif #endif
@@ -141,9 +141,9 @@ static UPNP_INLINE void UpnpSetLogLevel(Upnp_LogLevel log_level) {}
* Returns: void * Returns: void
***************************************************************************/ ***************************************************************************/
#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

@@ -1826,7 +1826,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

@@ -1,33 +1,34 @@
/////////////////////////////////////////////////////////////////////////// /*******************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// All rights reserved. * All rights reserved.
// *
// Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// ******************************************************************************/
#ifndef UPNP_TV_DEVICE_H #ifndef UPNP_TV_DEVICE_H
#define UPNP_TV_DEVICE_H #define UPNP_TV_DEVICE_H
@@ -631,7 +632,7 @@ int TvDeviceDecreaseBrightness(IN IXML_Document *in, OUT IXML_Document **out,
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

@@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /*******************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// All rights reserved. * All rights reserved.
// *
// Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * - Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * - Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// ******************************************************************************/
#include "config.h" #include "config.h"
@@ -396,7 +396,7 @@ PrintThreadPoolStats(
* UPNP_E_SUCCESS on success, nonzero on failure. * UPNP_E_SUCCESS on success, nonzero on failure.
*****************************************************************************/ *****************************************************************************/
int int
UpnpFinish() UpnpFinish(void)
{ {
#ifdef INCLUDE_DEVICE_APIS #ifdef INCLUDE_DEVICE_APIS
UpnpDevice_Handle device_handle; UpnpDevice_Handle device_handle;
@@ -487,7 +487,7 @@ UpnpFinish()
* local port on success, zero on failure. * local port on success, zero on failure.
*****************************************************************************/ *****************************************************************************/
unsigned short unsigned short
UpnpGetServerPort( void ) UpnpGetServerPort(void)
{ {
if( UpnpSdkInit != 1 ) if( UpnpSdkInit != 1 )
@@ -508,7 +508,7 @@ UpnpGetServerPort( void )
* return the IP address string on success else NULL of failure * return the IP address string on success else NULL of failure
***************************************************************************/ ***************************************************************************/
char * char *
UpnpGetServerIpAddress( void ) UpnpGetServerIpAddress(void)
{ {
if( UpnpSdkInit != 1 ) if( UpnpSdkInit != 1 )
@@ -3880,7 +3880,7 @@ UpnpRemoveVirtualDir( IN const char *dirName )
* *
***************************************************************************/ ***************************************************************************/
void void
UpnpRemoveAllVirtualDirs() UpnpRemoveAllVirtualDirs(void)
{ {
virtualDirList *pCur; virtualDirList *pCur;
@@ -3961,7 +3961,7 @@ UpnpEnableWebserver( IN int enable )
* 0, if webserver disabled * 0, if webserver disabled
***************************************************************************/ ***************************************************************************/
int int
UpnpIsWebserverEnabled() UpnpIsWebserverEnabled(void)
{ {
if( UpnpSdkInit != 1 ) { if( UpnpSdkInit != 1 ) {
return 0; return 0;
@@ -4096,4 +4096,3 @@ UpnpSetMaxContentLength (
} }
/*********************** END OF FILE upnpapi.c :) ************************/

View File

@@ -1,33 +1,33 @@
/////////////////////////////////////////////////////////////////////////// /*******************************************************************************
// *
// Copyright (c) 2000-2003 Intel Corporation * Copyright (c) 2000-2003 Intel Corporation
// All rights reserved. * All rights reserved.
// *
// Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
// *
// * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors * * Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
// without specific prior written permission. * without specific prior written permission.
// *
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// *
/////////////////////////////////////////////////////////////////////////// ******************************************************************************/
#include "config.h" #include "config.h"
#include "upnpdebug.h" #include "upnpdebug.h"
@@ -100,7 +100,7 @@ UpnpSetLogFileNames ( IN const char *ErrFileName,
* UPNP_E_SUCCESS : if success * UPNP_E_SUCCESS : if success
***************************************************************************/ ***************************************************************************/
int int
UpnpInitLog() UpnpInitLog(void)
{ {
ithread_mutex_init( &GlobalDebugMutex, NULL ); ithread_mutex_init( &GlobalDebugMutex, NULL );
@@ -140,7 +140,7 @@ UpnpSetLogLevel (Upnp_LogLevel log_level)
* Returns: void * Returns: void
***************************************************************************/ ***************************************************************************/
void void
UpnpCloseLog() UpnpCloseLog(void)
{ {
if( DEBUG_TARGET == 1 ) { if( DEBUG_TARGET == 1 ) {
fflush( ErrFileHnd ); fflush( ErrFileHnd );