summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 18:24:50 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:48:11 +0200
commit46aa529396625efebdd637f540e9e104059866b6 (patch)
tree00bfc36e90ac8a14cb7ed3a699d6b0c056eb1a4f /src
parentbe75198abbd8420d25e67ee5d714422cf6c488db (diff)
downloadhercules-46aa529396625efebdd637f540e9e104059866b6.tar.gz
hercules-46aa529396625efebdd637f540e9e104059866b6.tar.bz2
hercules-46aa529396625efebdd637f540e9e104059866b6.tar.xz
hercules-46aa529396625efebdd637f540e9e104059866b6.zip
Explicitly specify 'void' when a function expects no arguments
- See CERT DCL20-C. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/common/core.c2
-rw-r--r--src/common/mutex.c4
-rw-r--r--src/common/thread.c10
-rw-r--r--src/common/thread.h10
-rw-r--r--src/common/timer.c4
-rw-r--r--src/test/test_spinlock.c6
6 files changed, 18 insertions, 18 deletions
diff --git a/src/common/core.c b/src/common/core.c
index 28c84e2cf..99dbc36ec 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -99,7 +99,7 @@ static BOOL WINAPI console_handler(DWORD c_event) {
return TRUE;
}
-static void cevents_init() {
+static void cevents_init(void) {
if (SetConsoleCtrlHandler(console_handler,TRUE)==FALSE)
ShowWarning ("Unable to install the console handler!\n");
}
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 6707df7e6..ea3e0f8ce 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -50,7 +50,7 @@ struct racond{
//
-ramutex *ramutex_create() {
+ramutex *ramutex_create(void) {
struct ramutex *m;
m = (struct ramutex*)aMalloc( sizeof(struct ramutex) );
@@ -124,7 +124,7 @@ void ramutex_unlock(ramutex *m) {
// Implementation:
//
-racond *racond_create() {
+racond *racond_create(void) {
struct racond *c;
c = (struct racond*)aMalloc( sizeof(struct racond) );
diff --git a/src/common/thread.c b/src/common/thread.c
index d680d0347..1d0285302 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -59,7 +59,7 @@ __thread int g_rathread_ID = -1;
///
static struct rAthread l_threads[RA_THREADS_MAX];
-void rathread_init(){
+void rathread_init(void) {
register unsigned int i;
memset(&l_threads, 0x00, RA_THREADS_MAX * sizeof(struct rAthread) );
@@ -78,7 +78,7 @@ void rathread_init(){
-void rathread_final(){
+void rathread_final(void) {
register unsigned int i;
// Unterminated Threads Left?
@@ -230,7 +230,7 @@ void rathread_destroy(rAthread *handle) {
#endif
}//end: rathread_destroy()
-rAthread *rathread_self() {
+rAthread *rathread_self(void) {
#ifdef HAS_TLS
rAthread *handle = &l_threads[g_rathread_ID];
@@ -259,7 +259,7 @@ rAthread *rathread_self() {
}//end: rathread_self()
-int rathread_get_tid(){
+int rathread_get_tid(void) {
#ifdef HAS_TLS
return g_rathread_ID;
@@ -305,7 +305,7 @@ RATHREAD_PRIO rathread_prio_get(rAthread *handle) {
}//end: rathread_prio_get()
-void rathread_yield(){
+void rathread_yield(void) {
#ifdef WIN32
SwitchToThread();
#else
diff --git a/src/common/thread.h b/src/common/thread.h
index f781cfbd0..c7582366d 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -58,7 +58,7 @@ void rathread_destroy(rAthread *handle);
*
* @return not NULL if success
*/
-rAthread *rathread_self();
+rAthread *rathread_self(void);
/**
@@ -69,7 +69,7 @@ rAthread *rathread_self();
*
* @return -1 when fails, otherwise >= 0
*/
-int rathread_get_tid();
+int rathread_get_tid(void);
/**
@@ -107,12 +107,12 @@ RATHREAD_PRIO rathread_prio_get(rAthread *handle);
* it just allows the OS to spent the remaining time
* of the slice to another thread.
*/
-void rathread_yield();
+void rathread_yield(void);
-void rathread_init();
-void rathread_final();
+void rathread_init(void);
+void rathread_final(void);
#endif /* COMMON_THREAD_H */
diff --git a/src/common/timer.c b/src/common/timer.c
index 128fc4daf..370eafd4c 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -107,7 +107,7 @@ char* search_timer_func_list(TimerFunc func)
#if defined(ENABLE_RDTSC)
static uint64 RDTSC_BEGINTICK = 0, RDTSC_CLOCK = 0;
-static __inline uint64 rdtsc_() {
+static __inline uint64 rdtsc_(void) {
register union{
uint64 qw;
uint32 dw[2];
@@ -118,7 +118,7 @@ static __inline uint64 rdtsc_() {
return t.qw;
}
-static void rdtsc_calibrate(){
+static void rdtsc_calibrate(void){
uint64 t1, t2;
int32 i;
diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c
index 2f4c2a5ca..19a25f9d2 100644
--- a/src/test/test_spinlock.c
+++ b/src/test/test_spinlock.c
@@ -98,16 +98,16 @@ return 0;
}//end: do_init()
-void do_abort(){
+void do_abort(void) {
}//end: do_abort()
-void set_server_type(){
+void set_server_type(void) {
SERVER_TYPE = SERVER_TYPE_UNKNOWN;
}//end: set_server_type()
-int do_final(){
+int do_final(void) {
return EXIT_SUCCESS;
}//end: do_final()