Changeset 315


Ignore:
Timestamp:
Mar 10, 2006 12:57:12 PM (18 years ago)
Author:
bennylp
Message:

Fixed compilation and run warnings/errors with MSVC 2005

Location:
pjproject/trunk
Files:
8 deleted
38 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/Makefile

    r254 r315  
    1616                    exit 1; \ 
    1717                fi; \ 
    18            fi \ 
     18           fi; \ 
    1919        done 
    2020 
  • pjproject/trunk/pjlib-util/build

    • Property svn:ignore
      •  

        old new  
        55*.suo 
        66*.bsc 
         7*vcproj* 
         8*.sln 
  • pjproject/trunk/pjlib-util/src/pjlib-util/errno.c

    r264 r315  
    9999    /* Error not found. */ 
    100100    errstr.ptr = buf; 
    101     errstr.slen = pj_snprintf(buf, bufsize,  
    102                               "Unknown error %d", 
    103                               statcode); 
     101    errstr.slen = pj_ansi_snprintf(buf, bufsize,  
     102                                   "Unknown error %d", 
     103                                   statcode); 
    104104 
    105105    return errstr; 
  • pjproject/trunk/pjlib/build

    • Property svn:ignore
      •  

        old new  
        77*.plg 
        88test*.txt 
         9*.vcproj* 
  • pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h

    r122 r315  
    3434#define PJ_CC_VER_3         0 
    3535 
     36/* Disable CRT deprecation warnings. */ 
     37#if PJ_CC_VER_1 >= 8 
     38#   define _CRT_SECURE_NO_DEPRECATE 
     39#endif 
     40 
    3641#pragma warning(disable: 4127) // conditional expression is constant 
    3742#pragma warning(disable: 4611) // not wise to mix setjmp with C++ 
  • pjproject/trunk/pjlib/include/pj/compat/string.h

    r206 r315  
    2727 
    2828#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H != 0 
    29 include <string.h> 
     29 include <string.h> 
    3030#else 
    3131 
     
    3636 
    3737#if defined(_MSC_VER) 
    38 define strcasecmp    stricmp 
    39 if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 
     38 include <stdio.h> 
     39 define strcasecmp   _stricmp 
    4040#   define strncasecmp  _strnicmp 
    41 #  else 
    42 #   define strncasecmp  strnicmp 
    43 #  endif 
    44 #  define snprintf      _snprintf 
    45 #  define snwprintf     _snwprintf 
    46 #  define wcsicmp       _wcsicmp 
    47 #  define wcsnicmp      _wcsnicmp 
     41#   define snprintf     _snprintf 
     42#   define vsnprintf    _vsnprintf 
     43#   define snwprintf    _snwprintf 
     44#   define wcsicmp      _wcsicmp 
     45#   define wcsnicmp     _wcsnicmp 
    4846#else 
    49 define stricmp       strcasecmp 
    50 define strnicmp      strncasecmp 
     47 define stricmp      strcasecmp 
     48 define strnicmp     strncasecmp 
    5149 
    52 if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 
    53 #     error "Implement Unicode string functions" 
    54 endif 
     50 if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 
     51#       error "Implement Unicode string functions" 
     52 endif 
    5553#endif 
    56  
    5754 
    5855#define pj_ansi_strcmp          strcmp 
     
    6057#define pj_ansi_strlen          strlen 
    6158#define pj_ansi_strcpy          strcpy 
     59#define pj_ansi_strncpy         strncpy 
    6260#define pj_ansi_strcat          strcat 
    6361#define pj_ansi_strstr          strstr 
     
    6967#define pj_ansi_sprintf         sprintf 
    7068#define pj_ansi_snprintf        snprintf 
     69#define pj_ansi_vsprintf        vsprintf 
     70#define pj_ansi_vsnprintf       vsnprintf 
    7171 
    7272#define pj_unicode_strcmp       wcscmp 
     
    7474#define pj_unicode_strlen       wcslen 
    7575#define pj_unicode_strcpy       wcscpy 
     76#define pj_unicode_strncpy      wcsncpy 
    7677#define pj_unicode_strcat       wcscat 
    7778#define pj_unicode_strstr       wcsstr 
     
    8384#define pj_unicode_sprintf      swprintf 
    8485#define pj_unicode_snprintf     snwprintf 
    85  
     86#define pj_unicode_vsprintf     vswprintf 
     87#define pj_unicode_vsnprintf    vsnwprintf 
    8688 
    8789#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 
     
    9092#   define pj_native_strlen         pj_unicode_strlen 
    9193#   define pj_native_strcpy         pj_unicode_strcpy 
     94#   define pj_native_strncpy        pj_unicode_strncpy 
    9295#   define pj_native_strcat         pj_unicode_strcat 
    9396#   define pj_native_strstr         pj_unicode_strstr 
     
    99102#   define pj_native_sprintf        pj_unicode_sprintf 
    100103#   define pj_native_snprintf       pj_unicode_snprintf 
     104#   define pj_native_vsprintf       pj_unicode_vsprintf 
     105#   define pj_native_vsnprintf      pj_unicode_vsnprintf 
    101106#else 
    102107#   define pj_native_strcmp         pj_ansi_strcmp 
     
    104109#   define pj_native_strlen         pj_ansi_strlen 
    105110#   define pj_native_strcpy         pj_ansi_strcpy 
     111#   define pj_native_strncpy        pj_ansi_strncpy 
    106112#   define pj_native_strcat         pj_ansi_strcat 
    107113#   define pj_native_strstr         pj_ansi_strstr 
     
    113119#   define pj_native_sprintf        pj_ansi_sprintf 
    114120#   define pj_native_snprintf       pj_ansi_snprintf 
     121#   define pj_native_vsprintf       pj_ansi_vsprintf 
     122#   define pj_native_vsnprintf      pj_ansi_vsnprintf 
    115123#endif 
    116124 
  • pjproject/trunk/pjlib/include/pj/string.h

    r263 r315  
    2727#include <pj/types.h> 
    2828#include <pj/compat/string.h> 
    29 #include <pj/compat/sprintf.h> 
    30 #include <pj/compat/vsprintf.h> 
    3129 
    3230 
  • pjproject/trunk/pjlib/src/pj/config.c

    r307 r315  
    2222 
    2323static const char *id = "config.c"; 
    24 const char *PJ_VERSION = "0.5.4"; 
     24const char *PJ_VERSION = "0.5.4.1"; 
    2525 
    2626PJ_DEF(void) pj_dump_config(void) 
  • pjproject/trunk/pjlib/src/pj/errno.c

    r289 r315  
    2020#include <pj/string.h> 
    2121#include <pj/assert.h> 
    22 #include <pj/compat/sprintf.h> 
    2322 
    2423/* Prototype for platform specific error message, which will be defined  
     
    142141 
    143142    if (statcode < PJ_ERRNO_START + PJ_ERRNO_SPACE_SIZE) { 
    144         len = pj_snprintf( buf, bufsize, "Unknown error %d", statcode); 
     143        len = pj_ansi_snprintf( buf, bufsize, "Unknown error %d", statcode); 
    145144 
    146145    } else if (statcode < PJ_ERRNO_START_STATUS + PJ_ERRNO_SPACE_SIZE) { 
  • pjproject/trunk/pjlib/src/pj/log.c

    r141 r315  
    2121#include <pj/string.h> 
    2222#include <pj/os.h> 
    23 #include <pj/compat/vsprintf.h> 
    2423#include <pj/compat/stdarg.h> 
    2524 
     
    8988        static const char *wdays[] = { "Sun", "Mon", "Tue", "Wed", 
    9089                                       "Thu", "Fri", "Sat"}; 
    91         strcpy(pre, wdays[ptime.wday]); 
     90        pj_ansi_strcpy(pre, wdays[ptime.wday]); 
    9291        pre += 3; 
    9392    } 
     
    138137 
    139138    /* Print the whole message to the string log_buffer. */ 
    140     print_len = vsnprintf(pre, sizeof(log_buffer)-len, format, marker); 
     139    print_len = pj_ansi_vsnprintf(pre, sizeof(log_buffer)-len, format,  
     140                                  marker); 
    141141    if (print_len < 0) { 
    142         print_len = pj_snprintf(pre, sizeof(log_buffer)-len,  
    143                                 "<logging error: msg too long>"); 
     142        print_len = pj_ansi_snprintf(pre, sizeof(log_buffer)-len,  
     143                                     "<logging error: msg too long>"); 
    144144    } 
    145145    len = len + print_len; 
  • pjproject/trunk/pjlib/src/pj/os_core_win32.c

    r304 r315  
    2424#include <pj/rand.h> 
    2525#include <pj/assert.h> 
    26 #include <pj/compat/vsprintf.h> 
    27 #include <pj/compat/sprintf.h> 
    2826#include <pj/errno.h> 
    2927#include <pj/except.h> 
     
    231229 
    232230    if (cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1) 
    233         pj_sprintf(thread->obj_name, cstr_thread_name, thread->idthread); 
     231        pj_ansi_sprintf(thread->obj_name, cstr_thread_name, thread->idthread); 
    234232    else 
    235         pj_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 
     233        pj_ansi_sprintf(thread->obj_name, "thr%p", (void*)thread->idthread); 
    236234     
    237235    rc = pj_thread_local_set(thread_tls_id, thread); 
     
    310308 
    311309    if (strchr(thread_name, '%')) { 
    312         pj_snprintf(rec->obj_name, PJ_MAX_OBJ_NAME, thread_name, rec); 
     310        pj_ansi_snprintf(rec->obj_name, PJ_MAX_OBJ_NAME, thread_name, rec); 
    313311    } else { 
    314         strncpy(rec->obj_name, thread_name, PJ_MAX_OBJ_NAME); 
     312        pj_ansi_strncpy(rec->obj_name, thread_name, PJ_MAX_OBJ_NAME); 
    315313        rec->obj_name[PJ_MAX_OBJ_NAME-1] = '\0'; 
    316314    } 
     
    689687    } 
    690688    if (strchr(name, '%')) { 
    691         pj_snprintf(mutex->obj_name, PJ_MAX_OBJ_NAME, name, mutex); 
     689        pj_ansi_snprintf(mutex->obj_name, PJ_MAX_OBJ_NAME, name, mutex); 
    692690    } else { 
    693         strncpy(mutex->obj_name, name, PJ_MAX_OBJ_NAME); 
     691        pj_ansi_strncpy(mutex->obj_name, name, PJ_MAX_OBJ_NAME); 
    694692        mutex->obj_name[PJ_MAX_OBJ_NAME-1] = '\0'; 
    695693    } 
     
    10451043    } 
    10461044    if (strchr(name, '%')) { 
    1047         pj_snprintf(sem->obj_name, PJ_MAX_OBJ_NAME, name, sem); 
     1045        pj_ansi_snprintf(sem->obj_name, PJ_MAX_OBJ_NAME, name, sem); 
    10481046    } else { 
    1049         strncpy(sem->obj_name, name, PJ_MAX_OBJ_NAME); 
     1047        pj_ansi_strncpy(sem->obj_name, name, PJ_MAX_OBJ_NAME); 
    10501048        sem->obj_name[PJ_MAX_OBJ_NAME-1] = '\0'; 
    10511049    } 
     
    11751173    } 
    11761174    if (strchr(name, '%')) { 
    1177         pj_snprintf(event->obj_name, PJ_MAX_OBJ_NAME, name, event); 
     1175        pj_ansi_snprintf(event->obj_name, PJ_MAX_OBJ_NAME, name, event); 
    11781176    } else { 
    1179         strncpy(event->obj_name, name, PJ_MAX_OBJ_NAME); 
     1177        pj_ansi_strncpy(event->obj_name, name, PJ_MAX_OBJ_NAME); 
    11801178        event->obj_name[PJ_MAX_OBJ_NAME-1] = '\0'; 
    11811179    } 
  • pjproject/trunk/pjlib/src/pj/os_error_win32.c

    r126 r315  
    2020#include <pj/assert.h> 
    2121#include <pj/compat/stdarg.h> 
    22 #include <pj/compat/sprintf.h> 
    23 #include <pj/compat/vsprintf.h> 
    2422#include <pj/unicode.h> 
    2523#include <pj/string.h> 
     
    180178 
    181179    if (!len) { 
    182         len = snprintf( buf, bufsize, "Unknown native error %u", (unsigned)os_errcode); 
     180        len = pj_ansi_snprintf( buf, bufsize, "Unknown native error %u",  
     181                                (unsigned)os_errcode); 
    183182        buf[len] = '\0'; 
    184183    } 
  • pjproject/trunk/pjlib/src/pj/pool.c

    r108 r315  
    2222#include <pj/assert.h> 
    2323#include <pj/os.h> 
    24 #include <pj/compat/sprintf.h> 
    2524 
    2625/* Include inline definitions when inlining is disabled. */ 
     
    149148    if (name) { 
    150149        if (strchr(name, '%') != NULL) { 
    151             sprintf(pool->obj_name, name, pool); 
     150            pj_ansi_sprintf(pool->obj_name, name, pool); 
    152151        } else { 
    153             strncpy(pool->obj_name, name, PJ_MAX_OBJ_NAME); 
     152            pj_ansi_strncpy(pool->obj_name, name, PJ_MAX_OBJ_NAME); 
    154153        } 
    155154    } else { 
  • pjproject/trunk/pjlib/src/pjlib-test/main.c

    r126 r315  
    2222#include <pj/sock.h> 
    2323#include <pj/log.h> 
     24#include <stdio.h> 
    2425 
    2526extern int param_echo_sock_type; 
  • pjproject/trunk/pjmedia/build

    • Property svn:ignore
      •  

        old new  
        33.pjmedia* 
        44*.plg 
         5*.vcproj* 
         6*.sln 
         7*.suo 
  • pjproject/trunk/pjmedia/src/pjmedia/errno.c

    r222 r315  
    170170    /* Error not found. */ 
    171171    errstr.ptr = buf; 
    172     errstr.slen = pj_snprintf(buf, bufsize,  
    173                               "Unknown error %d", 
    174                               statcode); 
     172    errstr.slen = pj_ansi_snprintf(buf, bufsize,  
     173                                   "Unknown error %d", 
     174                                   statcode); 
    175175 
    176176    return errstr; 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp.c

    r295 r315  
    291291    /* Get the clock rate. */ 
    292292    token.ptr = (char*)p; 
    293     while (pj_isdigit(*p) && p != end) 
     293    while (p != end && pj_isdigit(*p)) 
    294294        ++p; 
    295295    token.slen = p - token.ptr; 
  • pjproject/trunk/pjsip-apps/build

    • Property svn:ignore
      •  

        old new  
        44*.log 
        55.* 
         6*.sln 
         7*.vcproj* 
         8*.suo 
  • pjproject/trunk/pjsip-apps/build/pjsip_perf.dsp

    r262 r315  
    5151LINK32=link.exe 
    5252# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 
    53 # ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\bin\pjsip-perf-i386-win32-vc6d.exe" 
     53# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib ole32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"..\bin\pjsip-perf-i386-win32-vc6d.exe" 
    5454 
    5555!ELSEIF  "$(CFG)" == "pjsip_perf - Win32 Debug" 
     
    7575LINK32=link.exe 
    7676# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 
    77 # ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /profile /debug /machine:I386 /out:"..\bin\pjsip-perf-i386-win32-vc6d.exe" 
     77# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib ole32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /profile /debug /machine:I386 /out:"..\bin\pjsip-perf-i386-win32-vc6d.exe" 
    7878 
    7979!ENDIF  
  • pjproject/trunk/pjsip-apps/build/pjsua.dsp

    r254 r315  
    5252LINK32=link.exe 
    5353# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 
    54 # ADD LINK32 dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /map /machine:I386 /out:"../bin/pjsua_vc6.exe" /fixed:no 
     54# ADD LINK32 dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib ole32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /map /machine:I386 /out:"../bin/pjsua_vc6.exe" /fixed:no 
    5555# SUBTRACT LINK32 /pdb:none /debug 
    5656 
     
    7878LINK32=link.exe 
    7979# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 
    80 # ADD LINK32 dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjsua_vc6d.exe" /pdbtype:sept 
     80# ADD LINK32 dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib ole32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjsua_vc6d.exe" /pdbtype:sept 
    8181 
    8282!ENDIF  
  • pjproject/trunk/pjsip-apps/src/pjsip-perf/main.c

    r309 r315  
    2121#include <stdlib.h>             /* atoi */ 
    2222 
    23 //#define THIS_FILE   "main.c" 
     23#define THIS_FILE   "main.c" 
    2424 
    2525pjsip_perf_settings settings; 
  • pjproject/trunk/pjsip-apps/src/pjsua/main.c

    r301 r315  
    1919#include <pjsua-lib/pjsua.h> 
    2020#include <stdlib.h>             /* atoi */ 
    21  
     21#include <stdio.h> 
    2222 
    2323#define THIS_FILE       "main.c" 
     
    206206 
    207207        pjsip_regc_info info; 
     208        const pj_str_t *status_str; 
    208209 
    209210        pjsip_regc_get_info(pjsua.acc[acc_index].regc, &info); 
    210211 
    211         pj_snprintf(reg_status, sizeof(reg_status), 
    212                     "%s (%.*s;expires=%d)", 
    213                     pjsip_get_status_text(pjsua.acc[acc_index].reg_last_code)->ptr, 
    214                     (int)info.client_uri.slen, 
    215                     info.client_uri.ptr, 
    216                     info.next_reg); 
     212        status_str = pjsip_get_status_text(pjsua.acc[acc_index].reg_last_code); 
     213        pj_ansi_snprintf(reg_status, sizeof(reg_status), 
     214                         "%s (%.*s;expires=%d)", 
     215                         status_str->ptr, 
     216                         (int)info.client_uri.slen, 
     217                         info.client_uri.ptr, 
     218                         info.next_reg); 
    217219 
    218220    } else { 
    219         pj_sprintf(reg_status, "in progress (%d)",  
    220                    pjsua.acc[acc_index].reg_last_code); 
     221        pj_ansi_sprintf(reg_status, "in progress (%d)",  
     222                        pjsua.acc[acc_index].reg_last_code); 
    221223    } 
    222224 
     
    386388            char s[10]; 
    387389            if (port_info->listener[j]) { 
    388                 pj_sprintf(s, "#%d ", j); 
     390                pj_ansi_sprintf(s, "#%d ", j); 
    389391                pj_ansi_strcat(txlist, s); 
    390392            } 
  • pjproject/trunk/pjsip/build

    • Property svn:ignore
      •  

        old new  
        77*.log 
        88pjsip++.dsp 
         9*.vcproj* 
         10*.sln 
         11*.suo 
  • pjproject/trunk/pjsip/src/pjsip-simple/errno.c

    r268 r315  
    9696    /* Error not found. */ 
    9797    errstr.ptr = buf; 
    98     errstr.slen = pj_snprintf(buf, bufsize,  
    99                               "Unknown error %d", 
    100                               statcode); 
     98    errstr.slen = pj_ansi_snprintf(buf, bufsize,  
     99                                   "Unknown error %d", 
     100                                   statcode); 
    101101 
    102102    return errstr; 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r306 r315  
    667667 
    668668    /* Set name. */ 
    669     pj_snprintf(sub->obj_name, PJ_ARRAY_SIZE(sub->obj_name), 
    670                 "evsub%p", sub); 
     669    pj_ansi_snprintf(sub->obj_name, PJ_ARRAY_SIZE(sub->obj_name), 
     670                     "evsub%p", sub); 
    671671 
    672672 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r283 r315  
    396396 
    397397    /* Object name will use the same dialog pointer. */ 
    398     pj_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 
     398    pj_ansi_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 
    399399 
    400400    /* Create negotiator if local_sdp is specified. */ 
     
    794794 
    795795    /* Object name will use the same dialog pointer. */ 
    796     pj_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 
     796    pj_ansi_snprintf(inv->obj_name, PJ_MAX_OBJ_NAME, "inv%p", dlg); 
    797797 
    798798    /* Parse SDP in message body, if present. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r141 r315  
    229229        cred->qop = pjsip_AUTH_STR; 
    230230        cred->nc.ptr = pj_pool_alloc(pool, 16); 
    231         pj_snprintf(cred->nc.ptr, 16, "%06u", nc); 
     231        pj_ansi_snprintf(cred->nc.ptr, 16, "%06u", nc); 
    232232 
    233233        if (cnonce && cnonce->slen) { 
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r283 r315  
    7474 
    7575    dlg->pool = pool; 
    76     pj_sprintf(dlg->obj_name, "dlg%p", dlg); 
     76    pj_ansi_sprintf(dlg->obj_name, "dlg%p", dlg); 
    7777    dlg->ua = ua; 
    7878    dlg->endpt = endpt; 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r253 r315  
    901901 
    902902        pj_ansi_strcpy(newformat, format); 
    903         pj_snprintf(newformat+len, sizeof(newformat)-len-1, 
    904                     ": [err %d] ", error_code); 
     903        pj_ansi_snprintf(newformat+len, sizeof(newformat)-len-1, 
     904                        ": [err %d] ", error_code); 
    905905        len += pj_ansi_strlen(newformat+len); 
    906906 
    907         errstr = pjsip_strerror(error_code, newformat+len,  
    908                                 sizeof(newformat)-len-1); 
     907        errstr = pj_strerror( error_code, newformat+len,  
     908                              sizeof(newformat)-len-1); 
    909909 
    910910        len += errstr.slen; 
  • pjproject/trunk/pjsip/src/pjsip/sip_errno.c

    r283 r315  
    148148            /* Error not found. */ 
    149149            errstr.ptr = buf; 
    150             errstr.slen = pj_snprintf(buf, bufsize,  
    151                                       "Unknown error %d", 
    152                                       statcode); 
     150            errstr.slen = pj_ansi_snprintf(buf, bufsize,  
     151                                           "Unknown error %d", 
     152                                           statcode); 
    153153 
    154154            return errstr; 
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    r266 r315  
    17161716                                     host->slen + 2 +   /* host */ 
    17171717                                     text->slen + 2);   /* text */ 
    1718     hvalue.slen = pj_sprintf(hvalue.ptr, "%u %.*s \"%.*s\"", 
    1719                              code, (int)host->slen, host->ptr, 
    1720                              (int)text->slen, text->ptr); 
     1718    hvalue.slen = pj_ansi_sprintf(hvalue.ptr, "%u %.*s \"%.*s\"", 
     1719                                  code, (int)host->slen, host->ptr, 
     1720                                  (int)text->slen, text->ptr); 
    17211721 
    17221722    return pjsip_generic_string_hdr_create(pool, &str_warning, &hvalue); 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r253 r315  
    863863    tsx->endpt = mod_tsx_layer.endpt; 
    864864 
    865     pj_sprintf(tsx->obj_name, "tsx%p", tsx); 
     865    pj_ansi_sprintf(tsx->obj_name, "tsx%p", tsx); 
    866866 
    867867    tsx->handle_200resp = 1; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r230 r315  
    236236    tdata->pool = pool; 
    237237    tdata->mgr = mgr; 
    238     pj_snprintf(tdata->obj_name, PJ_MAX_OBJ_NAME, "tdta%p", tdata); 
     238    pj_ansi_snprintf(tdata->obj_name, PJ_MAX_OBJ_NAME, "tdta%p", tdata); 
    239239 
    240240    status = pj_atomic_create(tdata->pool, 0, &tdata->ref_cnt); 
     
    318318 
    319319    if (msg->type == PJSIP_REQUEST_MSG) { 
    320         len = pj_snprintf(info_buf, sizeof(info_buf),  
    321                           "Request msg %.*s/cseq=%d (%s)", 
    322                           (int)msg->line.req.method.name.slen, 
    323                           msg->line.req.method.name.ptr, 
    324                           cseq->cseq, obj_name); 
     320        len = pj_ansi_snprintf(info_buf, sizeof(info_buf),  
     321                               "Request msg %.*s/cseq=%d (%s)", 
     322                               (int)msg->line.req.method.name.slen, 
     323                               msg->line.req.method.name.ptr, 
     324                               cseq->cseq, obj_name); 
    325325    } else { 
    326         len = pj_snprintf(info_buf, sizeof(info_buf), 
    327                           "Response msg %d/%.*s/cseq=%d (%s)", 
    328                           msg->line.status.code, 
    329                           (int)cseq->method.name.slen, 
    330                           cseq->method.name.ptr, 
    331                           cseq->cseq, obj_name); 
     326        len = pj_ansi_snprintf(info_buf, sizeof(info_buf), 
     327                               "Response msg %d/%.*s/cseq=%d (%s)", 
     328                               msg->line.status.code, 
     329                               (int)cseq->method.name.slen, 
     330                               cseq->method.name.ptr, 
     331                               cseq->cseq, obj_name); 
    332332    } 
    333333 
     
    368368 
    369369    pj_ansi_strcpy(obj_name, "rdata"); 
    370     pj_sprintf(obj_name+5, "%p", rdata); 
     370    pj_ansi_sprintf(obj_name+5, "%p", rdata); 
    371371 
    372372    rdata->msg_info.info = get_msg_info(rdata->tp_info.pool, obj_name, 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_loop.c

    r184 r315  
    359359     
    360360    /* Initialize transport properties. */ 
    361     pj_sprintf(loop->base.obj_name, "loop%p", loop); 
     361    pj_ansi_sprintf(loop->base.obj_name, "loop%p", loop); 
    362362    loop->base.pool = pool; 
    363363    status = pj_atomic_create(pool, 0, &loop->base.ref_cnt); 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c

    r261 r315  
    402402 
    403403    /* Object name. */ 
    404     pj_sprintf(tp->base.obj_name, "udp%p", tp); 
     404    pj_ansi_sprintf(tp->base.obj_name, "udp%p", tp); 
    405405 
    406406    /* Init reference counter. */ 
     
    446446    /* Transport info. */ 
    447447    tp->base.info = pj_pool_alloc(pool, 80); 
    448     pj_sprintf(tp->base.info, "udp %s:%d [published as %s:%d]", 
    449                               pj_inet_ntoa(((pj_sockaddr_in*)&tp->base.local_addr)->sin_addr), 
    450                               pj_ntohs(((pj_sockaddr_in*)&tp->base.local_addr)->sin_port), 
    451                               tp->base.local_name.host.ptr, 
    452                               tp->base.local_name.port); 
     448    pj_ansi_sprintf(  
     449        tp->base.info, "udp %s:%d [published as %s:%d]", 
     450        pj_inet_ntoa(((pj_sockaddr_in*)&tp->base.local_addr)->sin_addr), 
     451        pj_ntohs(((pj_sockaddr_in*)&tp->base.local_addr)->sin_port), 
     452        tp->base.local_name.host.ptr, 
     453        tp->base.local_name.port); 
    453454 
    454455    /* Set endpoint. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r292 r315  
    766766        userinfo[len] = '\0'; 
    767767     
    768     len = pj_snprintf(buf, size, "%s[%s]  %s", 
    769                       title, 
    770                       (dlg->state==PJSIP_DIALOG_STATE_NULL ? " - " : 
     768    len = pj_ansi_snprintf(buf, size, "%s[%s]  %s", 
     769                           title, 
     770                           (dlg->state==PJSIP_DIALOG_STATE_NULL ? " - " : 
    771771                                                             "est"), 
    772772                      userinfo); 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r312 r315  
    897897 
    898898                /* With the user part. */ 
    899                 len = pj_snprintf(contact, sizeof(contact), 
     899                len = pj_ansi_snprintf(contact, sizeof(contact), 
    900900                                  "<sip:%.*s@%.*s:%d>", 
    901901                                  (int)sip_uri->user.slen, 
     
    908908                /* Without user part */ 
    909909 
    910                 len = pj_snprintf(contact, sizeof(contact), 
     910                len = pj_ansi_snprintf(contact, sizeof(contact), 
    911911                                  "<sip:%.*s:%d>", 
    912912                                  (int)udp_transport->local_name.host.slen, 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c

    r312 r315  
    1919#include <pjsua-lib/pjsua.h> 
    2020#include <pjsua-lib/getopt.h> 
     21#include <stdio.h> 
    2122 
    2223/* 
     
    594595        userinfo[len] = '\0'; 
    595596     
    596     len = pj_snprintf(buf, size, "%s[%s] %s", 
    597                       title, 
    598                       pjsua_inv_state_names[inv->state], 
    599                       userinfo); 
     597    len = pj_ansi_snprintf(buf, size, "%s[%s] %s", 
     598                           title, 
     599                           pjsua_inv_state_names[inv->state], 
     600                           userinfo); 
    600601    if (len < 1 || len >= (int)size) { 
    601602        pj_ansi_strcpy(buf, "<--uri too long-->"); 
Note: See TracChangeset for help on using the changeset viewer.