Fixed MSVC compilation warnings in release build

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@71 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2005-11-21 17:01:06 +00:00
parent 99683ae5d6
commit 4f2be314a1
4 changed files with 24 additions and 15 deletions

View File

@ -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"

View File

@ -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
#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
# define PJ_HAS_INT64 1
typedef __int64 pj_int64_t;
typedef unsigned __int64 pj_uint64_t;

View File

@ -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);

View File

@ -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)));