From: Guillermo Rodriguez Garcia Date: Tue, 14 Mar 2000 09:32:27 +0000 (+0000) Subject: Changed declaration of functions taking an empty arglist (which means X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/da051b23feb1bdd85204f53a06884415cc80f037 Changed declaration of functions taking an empty arglist (which means no prototype in C, not (void) like in C++) to take (void) instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gsocket.h b/include/wx/gsocket.h index 14dc3c609f..2e3f86d256 100644 --- a/include/wx/gsocket.h +++ b/include/wx/gsocket.h @@ -91,15 +91,15 @@ typedef void (*GSocketCallback)(GSocket *socket, GSocketEvent event, /* Global initializers */ /* GSocket_Init() must be called at the beginning */ -bool GSocket_Init(); +bool GSocket_Init(void); /* GSocket_Cleanup() must be called at the end */ -void GSocket_Cleanup(); +void GSocket_Cleanup(void); /* Constructors / Destructors */ -GSocket *GSocket_new(); +GSocket *GSocket_new(void); void GSocket_destroy(GSocket *socket); @@ -289,7 +289,7 @@ void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags); /* GAddress */ -GAddress *GAddress_new(); +GAddress *GAddress_new(void); GAddress *GAddress_copy(GAddress *address); void GAddress_destroy(GAddress *address); diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index 59214ea7d6..2274a39fe8 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -42,11 +42,6 @@ #define SOCKLEN_T int #endif -#if defined(__BORLANDC__) -GAddress *GAddress_new(void); -GSocket *GSocket_new(void); -#endif - #ifdef _MSC_VER /* using FD_SET results in this warning */ #pragma warning(disable:4127) /* conditional expression is constant */ @@ -55,7 +50,7 @@ GSocket *GSocket_new(void); /* Constructors / Destructors for GSocket */ -GSocket *GSocket_new() +GSocket *GSocket_new(void) { int i; GSocket *socket; @@ -953,7 +948,7 @@ int _GSocket_Send_Dgram(GSocket *socket, const char *buffer, int size) } \ } -GAddress *GAddress_new() +GAddress *GAddress_new(void) { GAddress *address; diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 44ce4e0dbc..f7f2b1ef04 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -113,18 +113,18 @@ struct sockaddr_un { /* Global initialisers */ -bool GSocket_Init() +bool GSocket_Init(void) { return TRUE; } -void GSocket_Cleanup() +void GSocket_Cleanup(void) { } /* Constructors / Destructors for GSocket */ -GSocket *GSocket_new() +GSocket *GSocket_new(void) { int i; GSocket *socket; @@ -151,8 +151,12 @@ GSocket *GSocket_new() /* 10 minutes * 60 sec * 1000 millisec */ socket->m_establishing = FALSE; - /* We initialize the GUI specific entries here */ - _GSocket_GUI_Init(socket); + /* Per-socket GUI-specific initialization */ + if (!_GSocket_GUI_Init(socket)) + { + free(socket); + return NULL; + } return socket; } @@ -161,13 +165,13 @@ void GSocket_destroy(GSocket *socket) { assert(socket != NULL); + /* Per-socket GUI-specific cleanup */ + _GSocket_GUI_Destroy(socket); + /* Check that the socket is really shutdowned */ if (socket->m_fd != -1) GSocket_Shutdown(socket); - /* We destroy GUI specific variables */ - _GSocket_GUI_Destroy(socket); - /* Destroy private addresses */ if (socket->m_local) GAddress_destroy(socket->m_local); @@ -1115,7 +1119,7 @@ void _GSocket_Detected_Write(GSocket *socket) } \ } -GAddress *GAddress_new() +GAddress *GAddress_new(void) { GAddress *address;