summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar nadiramra2010-06-01 16:36:08 +0000
committerGravatar nadiramra2010-06-01 16:36:08 +0000
commitf524a1720af5bacf807684d890afa85af4cbe5b7 (patch)
tree7dfae2d75f3f7b258fbdcd38b6c2dec3903fca69
parent2c853b4c44ff3e27ee2f0e018a983d4b08de25c2 (diff)
downloadaxis2c-f524a1720af5bacf807684d890afa85af4cbe5b7.tar.gz
axis2c-f524a1720af5bacf807684d890afa85af4cbe5b7.tar.bz2
AXIS2C-1467 Dangerous macros defs in axutil_unix.h and axutil_windows.h
git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@950151 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--util/include/platforms/os400/axutil_os400.h6
-rw-r--r--util/include/platforms/unix/axutil_unix.h6
-rw-r--r--util/include/platforms/windows/axutil_windows.h6
-rw-r--r--util/src/network_handler.c9
4 files changed, 15 insertions, 12 deletions
diff --git a/util/include/platforms/os400/axutil_os400.h b/util/include/platforms/os400/axutil_os400.h
index e9ca465..1b6477f 100644
--- a/util/include/platforms/os400/axutil_os400.h
+++ b/util/include/platforms/os400/axutil_os400.h
@@ -140,7 +140,7 @@ extern char AXIS2_PLATFORM_XML_ENTITY_REFERENCE_CHARS_S[];
#define AXIS2_STRRCHR(x, y) (strrchr(x, y))
-#define AXIS2_PLATFORM_SLEEP(x) sleep(0);
+#define AXIS2_PLATFORM_SLEEP(x) sleep(0)
/** sleep function abstraction */
#define AXIS2_SLEEP sleep
@@ -249,7 +249,7 @@ static int os400_ftime(struct os400_timeb * tp)
#define AXIS2_INADDR_NONE (in_addr_t)-1
#define axis2_unsigned_short_t uint16_t
#define AXIS2_CLOSE_SOCKET(sock) close(sock)
-#define AXIS2_CLOSE_SOCKET_ON_EXIT(sock) fcntl(sock,F_SETFD, FD_CLOEXEC);
+#define AXIS2_CLOSE_SOCKET_ON_EXIT(sock) fcntl(sock,F_SETFD, FD_CLOEXEC)
#define axis2_socket_len_t socklen_t
#define AXIS2_SHUT_WR SHUT_WR
@@ -258,7 +258,7 @@ static int os400_ftime(struct os400_timeb * tp)
/** minizip functions */
#define axis2_fill_win32_filefunc(ffunc)
-#define AXIS2_UNZOPEN2(zipfilename,ffunc) unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc));
+#define AXIS2_UNZOPEN2(zipfilename,ffunc) do { unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc)); } while (0)
/**
* handling variable number of arguments (for log.c)
diff --git a/util/include/platforms/unix/axutil_unix.h b/util/include/platforms/unix/axutil_unix.h
index 7a7e38c..bb3c08f 100644
--- a/util/include/platforms/unix/axutil_unix.h
+++ b/util/include/platforms/unix/axutil_unix.h
@@ -141,7 +141,7 @@ extern "C"
#define AXIS2_STRRCHR(x, y) (strrchr(x, y))
-#define AXIS2_PLATFORM_SLEEP(x) sleep(0);
+#define AXIS2_PLATFORM_SLEEP(x) sleep(0)
/** sleep function abstraction */
#define AXIS2_SLEEP sleep
@@ -253,7 +253,7 @@ extern "C"
#define AXIS2_INADDR_NONE (in_addr_t)-1
#define axis2_unsigned_short_t uint16_t
#define AXIS2_CLOSE_SOCKET(sock) close(sock)
-#define AXIS2_CLOSE_SOCKET_ON_EXIT(sock) fcntl(sock,F_SETFD, FD_CLOEXEC);
+#define AXIS2_CLOSE_SOCKET_ON_EXIT(sock) fcntl(sock,F_SETFD, FD_CLOEXEC)
#define axis2_socket_len_t socklen_t
#define AXIS2_SHUT_WR SHUT_WR
@@ -262,7 +262,7 @@ extern "C"
/** minizip functions */
#define axis2_fill_win32_filefunc(ffunc)
-#define AXIS2_UNZOPEN2(zipfilename,ffunc) unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc));
+#define AXIS2_UNZOPEN2(zipfilename,ffunc) do { unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc)); } while (0)
/**
* handling variable number of arguments (for log.c)
diff --git a/util/include/platforms/windows/axutil_windows.h b/util/include/platforms/windows/axutil_windows.h
index a473264..44a3ac9 100644
--- a/util/include/platforms/windows/axutil_windows.h
+++ b/util/include/platforms/windows/axutil_windows.h
@@ -149,10 +149,10 @@ extern "C"
#define AXIS2_STRRCHR(x, y) (strrchr(x, y))
-#define AXIS2_PLATFORM_SLEEP(x) Sleep(0);
+#define AXIS2_PLATFORM_SLEEP(x) Sleep(0)
#define AXIS2_SLEEP(x) Sleep((x)*1000)
-#define AXIS2_USLEEP(x) Sleep((x)/1000);
+#define AXIS2_USLEEP(x) Sleep((x)/1000)
/**
* Get the last error code from the system.
@@ -160,7 +160,7 @@ extern "C"
* and that it returns a long
* @return long the last error message for this thread
*/
-#define AXIS2_GETLASTERROR GetLastError();
+#define AXIS2_GETLASTERROR GetLastError()
/**
* From the last error number get a sensible std::string representing it
diff --git a/util/src/network_handler.c b/util/src/network_handler.c
index 04e6ea6..0d11ef2 100644
--- a/util/src/network_handler.c
+++ b/util/src/network_handler.c
@@ -160,7 +160,8 @@ axutil_network_handler_create_server_socket(
#endif
/* Exec behaviour */
- AXIS2_CLOSE_SOCKET_ON_EXIT(sock) memset(&sock_addr, 0, sizeof(sock_addr));
+ AXIS2_CLOSE_SOCKET_ON_EXIT(sock);
+ memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
sock_addr.sin_addr.s_addr = htonl(INADDR_ANY);
@@ -369,7 +370,8 @@ axutil_network_handler_create_dgram_svr_socket(
}
#endif
/* Exec behaviour */
- AXIS2_CLOSE_SOCKET_ON_EXIT(sock) memset(&sock_addr, 0, sizeof(sock_addr));
+ AXIS2_CLOSE_SOCKET_ON_EXIT(sock);
+ memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
sock_addr.sin_addr.s_addr = htonl(INADDR_ANY);
@@ -607,7 +609,8 @@ axutil_network_hadler_create_multicast_svr_socket(
#endif
/* Exec behaviour */
- AXIS2_CLOSE_SOCKET_ON_EXIT(sock) memset(&sock_addr, 0, sizeof(sock_addr));
+ AXIS2_CLOSE_SOCKET_ON_EXIT(sock);
+ memset(&sock_addr, 0, sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
sock_addr.sin_addr.s_addr = htonl(INADDR_ANY);