diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-01-01 20:56:36 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-01-01 20:56:36 +0000 |
commit | 423bd3b19d5611412da90b87f6989dc89339defa (patch) | |
tree | e2d8a8d63b37d55ca2a8777e64a7ed054088683d /pjlib | |
parent | 808f9942b9b55991273a490f234900cdf0bb457f (diff) |
Fixed unreached code, deprecated fopen(), unused arguments, and other warnings with MSVC
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2407 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/compat/cc_armcc.h | 2 | ||||
-rw-r--r-- | pjlib/include/pj/compat/cc_codew.h | 1 | ||||
-rw-r--r-- | pjlib/include/pj/compat/cc_gcc.h | 1 | ||||
-rw-r--r-- | pjlib/include/pj/compat/cc_msvc.h | 9 | ||||
-rw-r--r-- | pjlib/include/pj/compat/cc_mwcc.h | 1 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/exception.c | 4 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c | 2 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/udp_echo_srv_sync.c | 4 |
8 files changed, 19 insertions, 5 deletions
diff --git a/pjlib/include/pj/compat/cc_armcc.h b/pjlib/include/pj/compat/cc_armcc.h index 095d4ab6..1761c228 100644 --- a/pjlib/include/pj/compat/cc_armcc.h +++ b/pjlib/include/pj/compat/cc_armcc.h @@ -51,5 +51,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) + #endif /* __PJ_COMPAT_CC_ARMCC_H__ */ diff --git a/pjlib/include/pj/compat/cc_codew.h b/pjlib/include/pj/compat/cc_codew.h index 7dcaae5d..3f8b46ee 100644 --- a/pjlib/include/pj/compat/cc_codew.h +++ b/pjlib/include/pj/compat/cc_codew.h @@ -49,6 +49,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_UINT64(val) val##LLU #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_CODEW_H__ */ diff --git a/pjlib/include/pj/compat/cc_gcc.h b/pjlib/include/pj/compat/cc_gcc.h index 35aecf23..edf04793 100644 --- a/pjlib/include/pj/compat/cc_gcc.h +++ b/pjlib/include/pj/compat/cc_gcc.h @@ -69,6 +69,7 @@ # define PJ_HAS_BZERO 1 #endif +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_GCC_H__ */ diff --git a/pjlib/include/pj/compat/cc_msvc.h b/pjlib/include/pj/compat/cc_msvc.h index b5a0e08e..e6c139da 100644 --- a/pjlib/include/pj/compat/cc_msvc.h +++ b/pjlib/include/pj/compat/cc_msvc.h @@ -38,6 +38,13 @@ #if PJ_CC_VER_1 >= 8 && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif +#if PJ_CC_VER_1 >= 8 && !defined(_CRT_SECURE_NO_WARNINGS) +# define _CRT_SECURE_NO_WARNINGS + /* The above doesn't seem to work, at least on VS2005, so lets use + * this construct as well. + */ +# pragma warning(disable: 4996) +#endif #pragma warning(disable: 4127) // conditional expression is constant #pragma warning(disable: 4611) // not wise to mix setjmp with C++ @@ -71,5 +78,7 @@ typedef unsigned __int64 pj_uint64_t; #define PJ_UINT64(val) val##ui64 #define PJ_INT64_FMT "I64" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_MSVC_H__ */ + diff --git a/pjlib/include/pj/compat/cc_mwcc.h b/pjlib/include/pj/compat/cc_mwcc.h index 511fed76..6c768b98 100644 --- a/pjlib/include/pj/compat/cc_mwcc.h +++ b/pjlib/include/pj/compat/cc_mwcc.h @@ -49,6 +49,7 @@ typedef unsigned long long pj_uint64_t; #define PJ_UINT64(val) val##LLU #define PJ_INT64_FMT "L" +#define PJ_UNREACHED(x) #endif /* __PJ_COMPAT_CC_MWCC_H__ */ diff --git a/pjlib/src/pjlib-test/exception.c b/pjlib/src/pjlib-test/exception.c index 9a479a1b..94ab861a 100644 --- a/pjlib/src/pjlib-test/exception.c +++ b/pjlib/src/pjlib-test/exception.c @@ -54,13 +54,13 @@ static int throw_id_1(void) { PJ_THROW( ID_1 ); - return -1; + PJ_UNREACHED(return -1;) } static int throw_id_2(void) { PJ_THROW( ID_2 ); - return -1; + PJ_UNREACHED(return -1;) } diff --git a/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c b/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c index f23350e3..86469854 100644 --- a/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c +++ b/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c @@ -150,7 +150,7 @@ static int worker_thread(void *arg) timeout.sec = 0; timeout.msec = 10; rc = pj_ioqueue_poll(ioqueue, &timeout); } - return 0; + PJ_UNREACHED(return 0;) } int udp_echo_srv_ioqueue(void) diff --git a/pjlib/src/pjlib-test/udp_echo_srv_sync.c b/pjlib/src/pjlib-test/udp_echo_srv_sync.c index 3b0a02b3..1b4670e7 100644 --- a/pjlib/src/pjlib-test/udp_echo_srv_sync.c +++ b/pjlib/src/pjlib-test/udp_echo_srv_sync.c @@ -56,7 +56,7 @@ static int worker_thread(void *arg) continue; } } - return 0; + PJ_UNREACHED(return 0;) } @@ -160,7 +160,7 @@ int echo_srv_common_loop(pj_atomic_t *bytes_counter) (unsigned)(highest_bw/1000))); } } - return 0; + PJ_UNREACHED(return 0;) } |