Use "function(void)" instead of "function()" to declare 0-arg functions.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 12 Mar 2014 07:24:14 +0000 (09:24 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 12 Mar 2014 07:24:14 +0000 (09:24 +0200)
"function(void)" is the correct syntax in a function declaration, although
in practice compilers accept the latter too. It's OK in a function
definition, but change those too for consistency.

Michael Paquier and me.

15 files changed:
columninfo.c
connection.c
convert.c
dlg_specific.h
environ.c
environ.h
loadlib.c
mylog.c
mylog.h
psqlodbc.c
psqlodbc.h
qresult.c
sspisvcs.c
sspisvcs.h
xalibname.c

index fed75e978e80e5ad3027a1aec4f0beb0341167b4..7089feeeaf23e530e642e365b7edcf785da40384 100644 (file)
@@ -22,7 +22,7 @@
 #include "pgapifunc.h"
 
 ColumnInfoClass *
-CI_Constructor()
+CI_Constructor(void)
 {
    ColumnInfoClass *rv;
 
index 64321904e0da40579dd6f06ffcd64a853036ca29..ea4e73538e33ee9b9d9c9c2b7fcd99999ddf05a1 100644 (file)
@@ -378,7 +378,8 @@ reset_current_schema(ConnectionClass *self)
    }
 }
 
-static ConnectionClass *CC_alloc()
+static ConnectionClass *
+CC_alloc(void)
 {
    return (ConnectionClass *) calloc(sizeof(ConnectionClass), 1);
 }
index 2896044691a170f7980fe0ae7e7c0120646ee292..3fc68d648eb3ff58c47a1b27a1008ff2cbaa14e7 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -609,7 +609,7 @@ interval2istruct(SQLSMALLINT ctype, int precision, const char *str, SQL_INTERVAL
 #ifdef HAVE_LOCALE_H
 static char *current_locale = NULL;
 static char *current_decimal_point = NULL;
-static void current_numeric_locale()
+static void current_numeric_locale(void)
 {
    char *loc = setlocale(LC_NUMERIC, NULL);
    if (NULL == current_locale || 0 != stricmp(loc, current_locale))
index 0c82634eac2b996bbdd84711dc50e30c6ab3065a..c73bb64745fba6bb91aeb8cf1a2d7a56d0907710 100644 (file)
@@ -162,7 +162,7 @@ extern "C" {
 
 #ifdef _HANDLE_ENLIST_IN_DTC_
 #define INI_XAOPT          "XaOpt"
-const char *GetXaLibPath();
+const char *GetXaLibPath(void);
 #endif /* _HANDLE_ENLIST_IN_DTC_ */
 /* Bit representaion for abbreviated connection strings */
 #define BIT_LFCONVERSION           (1L)
index cd3c6d419db2bc02ec403a60ae091a2c67bc39e6..c10e25959a1840bcd4d9184f56b6c12eafb6c3e5 100644 (file)
--- a/environ.c
+++ b/environ.c
@@ -43,20 +43,20 @@ pthread_mutex_t     common_cs;
 pthread_mutex_t     common_lcs;
 #endif /* WIN_MULTITHREAD_SUPPORT */
 
-void   shortterm_common_lock()
+void   shortterm_common_lock(void)
 {
    ENTER_COMMON_CS;
 }
-void   shortterm_common_unlock()
+void   shortterm_common_unlock(void)
 {
    LEAVE_COMMON_CS;
 }
 
-int    getConnCount()
+int    getConnCount(void)
 {
    return conns_count;
 }
-ConnectionClass * const *getConnList()
+ConnectionClass * const *getConnList(void)
 {
    return conns;
 }
@@ -124,7 +124,8 @@ pg_sqlstate_set(const EnvironmentClass *env, UCHAR *szSqlState, const char *ver3
    strcpy((char *) szSqlState, EN_is_odbc3(env) ? ver3str : ver2str);
 }
 
-PG_ErrorInfo   *ER_Constructor(SDWORD errnumber, const char *msg)
+PG_ErrorInfo *
+ER_Constructor(SDWORD errnumber, const char *msg)
 {
    PG_ErrorInfo    *error;
    ssize_t     aladd, errsize;
@@ -161,7 +162,8 @@ ER_Destructor(PG_ErrorInfo *self)
    free(self);
 }
 
-PG_ErrorInfo *ER_Dup(const PG_ErrorInfo *self)
+PG_ErrorInfo *
+ER_Dup(const PG_ErrorInfo *self)
 {
    PG_ErrorInfo    *new;
    Int4        alsize;
index 5e4000b92ebb4a936a4451b9dabc3df60a717e26..1b0a9bf8aa50514da90fc5fabf7ae01b8c9bd2b7 100644 (file)
--- a/environ.h
+++ b/environ.h
@@ -41,8 +41,8 @@ char      EN_get_error(EnvironmentClass *self, int *number, char **message);
 char       EN_add_connection(EnvironmentClass *self, ConnectionClass *conn);
 char       EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn);
 void       EN_log_error(const char *func, char *desc, EnvironmentClass *self);
-int    getConnCount();
-ConnectionClass * const *getConnList();
+int    getConnCount(void);
+ConnectionClass * const *getConnList(void);
 
 #define    EN_OV_ODBC2 1L
 #define    EN_CONN_POOLING (1L<<1)
@@ -96,8 +96,8 @@ ConnectionClass * const *getConnList();
 #define DELETE_COMMON_CS
 #endif /* WIN_MULTITHREAD_SUPPORT */
 
-void shortterm_common_lock();
-void shortterm_common_unlock();
+void shortterm_common_lock(void);
+void shortterm_common_unlock(void);
 #ifdef __cplusplus
 }
 #endif
index 06dca580fce1ccebb5398c99678bf105a7c9dbd8..1c70d626f59d53be5e9aaf0dcbbc0507375b3f79 100644 (file)
--- a/loadlib.c
+++ b/loadlib.c
@@ -491,7 +491,7 @@ RETCODE CALL_IsolateDtcConn(ConnectionClass *conn, BOOL continueConnection)
 #endif /* _HANDLE_ENLIST_IN_DTC_ */
 
 #if defined(WIN_DYN_LOAD)
-BOOL SSLLIB_check()
+BOOL SSLLIB_check(void)
 {
    extern  HINSTANCE   s_hModule;
    HMODULE hmodule = NULL;
@@ -516,7 +516,7 @@ BOOL SSLLIB_check()
    return (NULL != hmodule);
 }
 #else
-BOOL SSLLIB_check()
+BOOL SSLLIB_check(void)
 {
    return TRUE;
 }
diff --git a/mylog.c b/mylog.c
index 8db7a6fe9511e37aec436497557bfed6e3581fc1..683d583b3f8f4321e8974481e9bb8ef8d6e8eb41 100644 (file)
--- a/mylog.c
+++ b/mylog.c
@@ -334,12 +334,12 @@ forcelog(const char *fmt,...)
    LEAVE_MYLOG_CS;
    GENERAL_ERRNO_SET(gerrno);
 }
-static void mylog_initialize()
+static void mylog_initialize(void)
 {
    INIT_MYLOG_CS;
    mylog_on = force_log;
 }
-static void mylog_finalize()
+static void mylog_finalize(void)
 {
    mylog_on = 0;
    if (MLOGFP)
@@ -350,8 +350,8 @@ static void mylog_finalize()
    DELETE_MYLOG_CS;
 }
 #else
-static void mylog_initialize() {}
-static void mylog_finalize() {}
+static void mylog_initialize(void) {}
+static void mylog_finalize(void) {}
 #endif /* MY_LOG */
 
 
@@ -402,12 +402,12 @@ qlog(char *fmt,...)
    LEAVE_QLOG_CS;
    GENERAL_ERRNO_SET(gerrno);
 }
-static void qlog_initialize()
+static void qlog_initialize(void)
 {
    INIT_QLOG_CS;
    qlog_on = force_log;
 }
-static void qlog_finalize()
+static void qlog_finalize(void)
 {
    qlog_on = 0;
    if (QLOGFP)
@@ -418,11 +418,11 @@ static void qlog_finalize()
    DELETE_QLOG_CS;
 }
 #else
-static void qlog_initialize() {}
-static void qlog_finalize() {}
+static void qlog_initialize(void) {}
+static void qlog_finalize(void) {}
 #endif /* Q_LOG */
 
-void InitializeLogging()
+void InitializeLogging(void)
 {
    char dir[PATH_MAX];
 
@@ -433,7 +433,7 @@ void InitializeLogging()
    qlog_initialize();
 }
 
-void FinalizeLogging()
+void FinalizeLogging(void)
 {
    mylog_finalize();
    qlog_finalize();
diff --git a/mylog.h b/mylog.h
index f3ba5a1de4fc4cbcf64ab97a3ca01ef452b9ffa1..50f394c40319421e5def7c40f03b0675087342b7 100644 (file)
--- a/mylog.h
+++ b/mylog.h
@@ -87,8 +87,8 @@ static void DumLog(const char *fmt,...) {}
 int    get_qlog(void);
 int    get_mylog(void);
 
-void   InitializeLogging();
-void   FinalizeLogging();
+void   InitializeLogging(void);
+void   FinalizeLogging(void);
 
 #ifdef __cplusplus
 }
index a074db41a084a550437d23f078c5fb798188e9e7..a98358f0435ba9257861d767cd004b918d83ec06 100644 (file)
@@ -32,9 +32,9 @@ int   platformId = 0;
 #endif
 
 static int exepgm = 0;
-BOOL isMsAccess() {return 1 == exepgm;}
-BOOL isMsQuery() {return 2 == exepgm;}
-BOOL isSqlServr() {return 3 == exepgm;}
+BOOL isMsAccess(void) {return 1 == exepgm;}
+BOOL isMsQuery(void) {return 2 == exepgm;}
+BOOL isSqlServr(void) {return 3 == exepgm;}
 
 GLOBAL_VALUES globals;
 
index 1f3841a3f233ebd8cdc8ef33b39a666391ee7afc..a3e0fbf6bc82c8880f94d723c40f63935d97e78a 100644 (file)
@@ -290,9 +290,9 @@ typedef double SDOUBLE;
 #define DRIVER_FILE_NAME                        "psqlodbca.so"
 #endif
 #endif   /* WIN32 */
-BOOL isMsAccess();
-BOOL isMsQuery();
-BOOL isSqlServr();
+BOOL isMsAccess(void);
+BOOL isMsQuery(void);
+BOOL isSqlServr(void);
 
 /* ESCAPEs */
 #define    ESCAPE_IN_LITERAL               '\\'
index 0189c141e669430fa96698f0e79212729135e41e..361be56cedf7b582ebe0f21f629d7938350f8c41 100644 (file)
--- a/qresult.c
+++ b/qresult.c
@@ -166,7 +166,7 @@ QR_set_fields(QResultClass *self, ColumnInfoClass *fields)
  * CLASS QResult
  */
 QResultClass *
-QR_Constructor()
+QR_Constructor(void)
 {
    QResultClass *rv;
 
index 84218ef6096c5b15f45122d40327f346edee0c22..18f927b64fa83fc1c72a5cbdde347288b3c0ad88 100644 (file)
@@ -260,7 +260,7 @@ static HCERTSTORE   hMyCertStore  = NULL;
 static HCRYPTPROV  hProv = (HCRYPTPROV) 0;
 static PCCERT_CONTEXT  pClientCertContext = NULL;
 
-static void FreeCertStores()
+static void FreeCertStores(void)
 {
    shortterm_common_lock();
    if (pClientCertContext)
@@ -281,7 +281,7 @@ static void FreeCertStores()
    shortterm_common_unlock();
 }
 
-void LeaveSSPIService()
+void LeaveSSPIService(void)
 {
    FreeCertStores();
    bMyCert = FALSE;
@@ -292,7 +292,7 @@ void LeaveSSPIService()
  * This driver allows certificates of PFX form when a pair of
  * postgresql.crt and postgresql.key doesn't work well.
  */
-static void CertStoreInit_pfx()
+static void CertStoreInit_pfx(void)
 {
    BOOL    success = FALSE;
    LPCTSTR pgsslpfx = NULL;
@@ -343,7 +343,7 @@ cleanup:
        FreeCertStores();
 }
 
-static void CertStoreInit()
+static void CertStoreInit(void)
 {
    BOOL    success = FALSE;
    LPCTSTR pgsslkey = NULL, pgsslcert = NULL;
@@ -494,7 +494,7 @@ cleanup:
    return;
 }
 
-static int InstallRootCA()
+static int InstallRootCA(void)
 {
    HCERTSTORE  hTempCertStore = NULL, hRootCertStore = NULL;
    LPCTSTR pgsslroot = NULL;
index 07542f0722895496fd29d31c00263261baace665..f1b9796dbcff53cd2c5a151e47af19f8e2cb6d28 100644 (file)
@@ -18,7 +18,7 @@ typedef enum {
    ,NegotiateService = (1L << 2)
 } SSPI_Service;
 
-void   LeaveSSPIService();
+void   LeaveSSPIService(void);
 void   ReleaseSvcSpecData(SocketClass *self, UInt4);
 int    StartupSspiService(SocketClass *self, SSPI_Service svc, const void *opt, int *bReconnect);
 int    ContinueSspiService(SocketClass *self, SSPI_Service svc, const void *opt);
index 9d202cdd30eee53399ec15f05b3d52d884b61c2c..7b9e6407c1806169cbaaf4200ceed77e384287d5 100644 (file)
@@ -24,7 +24,7 @@ extern HMODULE    s_hModule;
 static char    xalibpath[_MAX_PATH] = "";
 static char    xalibname[_MAX_FNAME] = "";
 
-const char *GetXaLibName()
+const char *GetXaLibName(void)
 {
    char    dllpath[_MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR],
        fname[_MAX_FNAME], ext[_MAX_EXT];
@@ -43,7 +43,7 @@ const char *GetXaLibName()
    return xalibname;
 }
 
-const char *GetXaLibPath()
+const char *GetXaLibPath(void)
 {
    GetXaLibName();
    return xalibpath;