diff options
author | Benny Prijono <bennylp@teluu.com> | 2005-11-21 17:01:06 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2005-11-21 17:01:06 +0000 |
commit | 0f263784356feca86786c2d2ade9eedf2f41a236 (patch) | |
tree | a559a42764013981404b5579895222a3953e889b | |
parent | 483dfa9a40e1818c9fd1cc1dd82884ddbf243778 (diff) |
Fixed MSVC compilation warnings in release build
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@71 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjlib/build/pjlib.dsp | 2 | ||||
-rw-r--r-- | pjlib/include/pj/compat/cc_msvc.h | 34 | ||||
-rw-r--r-- | pjlib/src/pj/ioqueue_winnt.c | 3 | ||||
-rw-r--r-- | pjlib/src/pjlib-test/test.c | 2 |
4 files changed, 25 insertions, 16 deletions
diff --git a/pjlib/build/pjlib.dsp b/pjlib/build/pjlib.dsp index e4063e1b..02d3d8df 100644 --- a/pjlib/build/pjlib.dsp +++ b/pjlib/build/pjlib.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir ".\output\pjlib-i386-win32-vc6-release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /W4 /Zi /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /c
+# ADD CPP /nologo /MD /W4 /Zi /O2 /Ob2 /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "PJ_WIN32" /D "PJ_M_I386" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
diff --git a/pjlib/include/pj/compat/cc_msvc.h b/pjlib/include/pj/compat/cc_msvc.h index 010d7caa..9a1c2a2f 100644 --- a/pjlib/include/pj/compat/cc_msvc.h +++ b/pjlib/include/pj/compat/cc_msvc.h @@ -28,19 +28,27 @@ # error "This header file is only for Visual C compiler!" #endif -# pragma warning(disable: 4127) // conditional expression is constant -# pragma warning(disable: 4611) // not wise to mix setjmp with C++ -# pragma warning(disable: 4514) // unreferenced inline function has been removed -# ifdef __cplusplus -# define PJ_INLINE_SPECIFIER inline -# else -# define PJ_INLINE_SPECIFIER static __inline -# endif -# define PJ_THREAD_FUNC -# define PJ_NORETURN __declspec(noreturn) -# define PJ_ATTR_NORETURN - -# define PJ_HAS_INT64 1 +#pragma warning(disable: 4127) // conditional expression is constant +#pragma warning(disable: 4611) // not wise to mix setjmp with C++ +#pragma warning(disable: 4514) // unref. inline function has been removed +#ifdef NDEBUG +# pragma warning(disable: 4702) // unreachable code +# pragma warning(disable: 4710) // function is not inlined. +# pragma warning(disable: 4711) // function selected for auto inline expansion +#endif + +#ifdef __cplusplus +# define PJ_INLINE_SPECIFIER inline +#else +# define PJ_INLINE_SPECIFIER static __inline +#endif + +#define PJ_THREAD_FUNC +#define PJ_NORETURN __declspec(noreturn) +#define PJ_ATTR_NORETURN + +#define PJ_HAS_INT64 1 + typedef __int64 pj_int64_t; typedef unsigned __int64 pj_uint64_t; diff --git a/pjlib/src/pj/ioqueue_winnt.c b/pjlib/src/pj/ioqueue_winnt.c index e46d36a3..bce430bd 100644 --- a/pjlib/src/pj/ioqueue_winnt.c +++ b/pjlib/src/pj/ioqueue_winnt.c @@ -438,7 +438,7 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout) DWORD dwMsec, dwBytesTransfered, dwKey; generic_overlapped *pOv; pj_ioqueue_key_t *key; - pj_ssize_t size_status; + pj_ssize_t size_status = -1; BOOL rc; PJ_ASSERT_RETURN(ioqueue, -PJ_EINVAL); @@ -509,6 +509,7 @@ PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioqueue, const pj_time_val *timeout) if (GetLastError()==WAIT_TIMEOUT) { /* Check the connecting array (again). */ #if PJ_HAS_TCP + size_status = -1; /* make MSVC happy */ key = check_connecting(ioqueue, &size_status); if (key != NULL) { key->cb.on_connect_complete(key, (int)size_status); diff --git a/pjlib/src/pjlib-test/test.c b/pjlib/src/pjlib-test/test.c index 6a1342c9..f8506fa9 100644 --- a/pjlib/src/pjlib-test/test.c +++ b/pjlib/src/pjlib-test/test.c @@ -188,7 +188,7 @@ int test_main(void) PJ_TRY { return test_inner(); } - PJ_DEFAULT { + PJ_CATCH_ANY { int id = PJ_GET_EXCEPTION(); PJ_LOG(3,("test", "FATAL: unhandled exception id %d (%s)", id, pj_exception_id_name(id))); |