From d7aa4332dae06ae890053dd13239ddabee46b86c Mon Sep 17 00:00:00 2001 From: Riza Sulistyo Date: Wed, 19 Jun 2013 06:47:43 +0000 Subject: Re #1680: Add initial support for Win64 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4537 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/build/Samples-vc.mak | 9 +- pjsip-apps/build/libpjproject.vcproj | 672 ++++-- pjsip-apps/build/pjsua.vcproj | 977 +++++++-- pjsip-apps/build/pjsystest.vcproj | 403 +++- pjsip-apps/build/py_pjsua.vcproj | 682 ++++-- pjsip-apps/build/sample_debug.vcproj | 986 ++++++--- pjsip-apps/build/samples.vcproj | 3663 ++++++++++++++++--------------- pjsip-apps/build/vidgui.vcproj | 147 ++ pjsip-apps/src/pjsua/pjsua_app_cli.c | 14 +- pjsip-apps/src/pjsua/pjsua_app_common.c | 2 +- pjsip-apps/src/pjsua/pjsua_app_config.c | 7 +- pjsip-apps/src/pjsua/pjsua_app_legacy.c | 21 +- pjsip-apps/src/pjsystest/systest.c | 12 +- pjsip-apps/src/samples/aectest.c | 2 +- pjsip-apps/src/samples/aviplay.c | 4 +- pjsip-apps/src/samples/confbench.c | 3 +- pjsip-apps/src/samples/confsample.c | 2 +- pjsip-apps/src/samples/icedemo.c | 10 +- pjsip-apps/src/samples/latency.c | 3 +- pjsip-apps/src/samples/pcaputil.c | 14 +- pjsip-apps/src/samples/pjsip-perf.c | 24 +- pjsip-apps/src/samples/playsine.c | 3 +- pjsip-apps/src/samples/sipecho.c | 5 +- pjsip-apps/src/samples/siprtp.c | 12 +- pjsip-apps/src/samples/streamutil.c | 6 +- pjsip-apps/src/samples/tonegen.c | 2 +- pjsip-apps/src/samples/util.h | 4 +- pjsip-apps/src/samples/vid_streamutil.c | 7 +- 28 files changed, 4966 insertions(+), 2730 deletions(-) (limited to 'pjsip-apps') diff --git a/pjsip-apps/build/Samples-vc.mak b/pjsip-apps/build/Samples-vc.mak index afcd76f8..fed970f1 100644 --- a/pjsip-apps/build/Samples-vc.mak +++ b/pjsip-apps/build/Samples-vc.mak @@ -1,7 +1,14 @@ LIBEXT = .lib +!if "$(ARCH)" == "win64" +TARGET = x86_64-x64-vc$(VC_VER)-$(BUILD_MODE) +TARGET_FLAGS = /DPJ_WIN64=1 /DPJ_M_X86_64=1 +!else + TARGET = i386-win32-vc$(VC_VER)-$(BUILD_MODE) +TARGET_FLAGS = /DPJ_WIN32=1 /DPJ_M_I386=1 +!endif !if "$(BUILD_MODE)" == "debug" BUILD_FLAGS = /MTd /Od /Zi /W4 @@ -45,7 +52,7 @@ LIBS = $(PJSUA_LIB_LIB) $(PJSIP_UA_LIB) $(PJSIP_SIMPLE_LIB) \ $(PJMEDIA_LIB) $(PJNATH_LIB) $(PJLIB_UTIL_LIB) $(PJLIB_LIB) \ $(THIRD_PARTY_LIBS) -CFLAGS = /DPJ_WIN32=1 /DPJ_M_I386=1 \ +CFLAGS = $(TARGET_FLAGS) \ $(BUILD_FLAGS) \ -I..\..\pjsip\include \ -I..\..\pjlib\include \ diff --git a/pjsip-apps/build/libpjproject.vcproj b/pjsip-apps/build/libpjproject.vcproj index 8bf1552e..66eb6b63 100644 --- a/pjsip-apps/build/libpjproject.vcproj +++ b/pjsip-apps/build/libpjproject.vcproj @@ -11,16 +11,19 @@ Name="Win32" /> + @@ -130,7 +133,7 @@ @@ -196,7 +199,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -289,9 +410,9 @@ /> @@ -355,9 +476,126 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -394,7 +632,7 @@ @@ -460,7 +698,7 @@ + + + + + + + + + + + + + + + + + @@ -584,7 +882,7 @@ @@ -650,7 +948,7 @@ - + + + + + + + + + + + + + + + + + @@ -716,7 +1073,7 @@ - - @@ -782,7 +1131,7 @@ @@ -848,7 +1197,7 @@ - - @@ -1038,7 +1381,7 @@ @@ -1104,7 +1447,7 @@ @@ -1170,7 +1514,7 @@ - - @@ -1236,7 +1572,7 @@ @@ -1302,7 +1638,7 @@ @@ -1434,7 +1770,7 @@ + + @@ -1624,7 +1968,7 @@ @@ -1690,7 +2034,7 @@ @@ -1743,7 +2087,6 @@ ExecutionBucket="7" PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" - EnableFloatingPointEmulation="false" /> @@ -1824,7 +2166,7 @@ @@ -1890,7 +2232,7 @@ + + @@ -1948,7 +2298,7 @@ @@ -2014,7 +2364,7 @@ @@ -2080,7 +2430,7 @@ @@ -2133,6 +2483,7 @@ ExecutionBucket="7" PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" + EnableFloatingPointEmulation="false" /> @@ -2212,7 +2564,7 @@ @@ -2278,7 +2630,7 @@ @@ -2344,7 +2696,7 @@ + + @@ -2402,7 +2762,7 @@ @@ -2468,7 +2828,7 @@ @@ -2534,7 +2894,7 @@ @@ -2600,7 +2960,7 @@ + @@ -234,9 +237,146 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -693,24 +1107,22 @@ Name="VCBscMakeTool" /> - - + @@ -962,27 +1378,25 @@ Name="VCBscMakeTool" /> - - + @@ -1030,27 +1445,25 @@ Name="VCBscMakeTool" /> - - - @@ -1099,22 +1510,24 @@ Name="VCBscMakeTool" /> - - + @@ -1231,22 +1648,20 @@ Name="VCBscMakeTool" /> - - - @@ -1436,22 +1850,24 @@ Name="VCBscMakeTool" /> - - - @@ -1773,22 +2190,24 @@ Name="VCBscMakeTool" /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -413,17 +611,90 @@ Name="VCBscMakeTool" /> + + + + + + + + + + + + + + + + + + + @@ -481,6 +752,22 @@ Name="VCCLCompilerTool" /> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pjsip-apps/build/sample_debug.vcproj b/pjsip-apps/build/sample_debug.vcproj index f9e77266..1f7331f2 100644 --- a/pjsip-apps/build/sample_debug.vcproj +++ b/pjsip-apps/build/sample_debug.vcproj @@ -11,16 +11,19 @@ Name="Win32" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -489,27 +916,25 @@ Name="VCBscMakeTool" /> - - - @@ -560,22 +981,24 @@ Name="VCBscMakeTool" /> - - + @@ -692,27 +1121,25 @@ Name="VCBscMakeTool" /> - - + @@ -759,24 +1190,22 @@ Name="VCBscMakeTool" /> - - + @@ -960,24 +1396,22 @@ Name="VCBscMakeTool" /> - - + @@ -1230,24 +1670,22 @@ Name="VCBscMakeTool" /> - - - @@ -1502,20 +1936,22 @@ Name="VCBscMakeTool" /> - - - @@ -1973,22 +2405,24 @@ Name="VCBscMakeTool" /> - - - @@ -2444,22 +2874,24 @@ Name="VCBscMakeTool" /> - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pjsip-apps/build/vidgui.vcproj b/pjsip-apps/build/vidgui.vcproj index 31cf7db8..922595a3 100644 --- a/pjsip-apps/build/vidgui.vcproj +++ b/pjsip-apps/build/vidgui.vcproj @@ -11,6 +11,9 @@ + @@ -155,6 +158,150 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pjsip-apps/src/pjsua/pjsua_app_cli.c b/pjsip-apps/src/pjsua/pjsua_app_cli.c index 795c084b..771539a8 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_cli.c +++ b/pjsip-apps/src/pjsua/pjsua_app_cli.c @@ -280,7 +280,7 @@ void cli_destroy() /* Get input URL */ static void get_input_url(char *buf, - int len, + pj_size_t len, pj_cli_cmd_val *cval, struct input_result *result) { @@ -305,7 +305,7 @@ static void get_input_url(char *buf, if (pj_isdigit(*buf) || *buf=='-') { - int i; + unsigned i; if (*buf=='-') i = 1; @@ -315,7 +315,7 @@ static void get_input_url(char *buf, for (; isess, err_invalid_input.ptr, - err_invalid_input.slen); + (int)err_invalid_input.slen); return; } } @@ -331,7 +331,7 @@ static void get_input_url(char *buf, return; pj_cli_sess_write_msg(cval->sess, err_invalid_input.ptr, - err_invalid_input.slen); + (int)err_invalid_input.slen); result->nb_result = PJSUA_APP_NO_NB; return; @@ -790,13 +790,13 @@ static pj_status_t cmd_del_account(pj_cli_cmd_val *cval) if (!pjsua_acc_is_valid(i)) { pj_ansi_snprintf(out_str, sizeof(out_str), "Invalid account id %d\n", i); - str_len = pj_ansi_strlen(out_str); + str_len = (unsigned)pj_ansi_strlen(out_str); pj_cli_sess_write_msg(cval->sess, out_str, str_len); } else { pjsua_acc_del(i); pj_ansi_snprintf(out_str, sizeof(out_str), "Account %d deleted\n", i); - str_len = pj_ansi_strlen(out_str); + str_len = (unsigned)pj_ansi_strlen(out_str); pj_cli_sess_write_msg(cval->sess, out_str, str_len); } return PJ_SUCCESS; @@ -2492,7 +2492,7 @@ static pj_status_t cmd_video_handler(pj_cli_cmd_val *cval) status = cmd_vid_win_list(); break; case CMD_VIDEO_WIN_ARRANGE: - status = cmd_arrange_vid_win(cval); + status = cmd_arrange_vid_win(); break; case CMD_VIDEO_WIN_SHOW: case CMD_VIDEO_WIN_HIDE: diff --git a/pjsip-apps/src/pjsua/pjsua_app_common.c b/pjsip-apps/src/pjsua/pjsua_app_common.c index e02f0456..2f79cae5 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_common.c +++ b/pjsip-apps/src/pjsua/pjsua_app_common.c @@ -142,7 +142,7 @@ void log_call_dump(int call_id) unsigned log_decor; pjsua_call_dump(call_id, PJ_TRUE, some_buf, sizeof(some_buf), " "); - call_dump_len = strlen(some_buf); + call_dump_len = (unsigned)strlen(some_buf); log_decor = pj_log_get_decor(); pj_log_set_decor(log_decor & ~(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); diff --git a/pjsip-apps/src/pjsua/pjsua_app_config.c b/pjsip-apps/src/pjsua/pjsua_app_config.c index 60d4aefa..f7450d02 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_config.c +++ b/pjsip-apps/src/pjsua/pjsua_app_config.c @@ -246,7 +246,8 @@ static int read_config_file(pj_pool_t *pool, const char *filename, char *p; const char *whitespace = " \t\r\n"; char cDelimiter; - int len, token_len; + pj_size_t len; + int token_len; pj_bzero(line, sizeof(line)); if (fgets(line, sizeof(line), fhnd) == NULL) break; @@ -285,7 +286,7 @@ static int read_config_file(pj_pool_t *pool, const char *filename, } *p = '\0'; - token_len = p-token; + token_len = (int)(p-token); if (token_len > 0) { if (*token == '#') @@ -2175,5 +2176,5 @@ int write_settings(pjsua_app_config *config, char *buf, pj_size_t max) } *(cfg.ptr + cfg.slen) = '\0'; - return cfg.slen; + return (int)cfg.slen; } diff --git a/pjsip-apps/src/pjsua/pjsua_app_legacy.c b/pjsip-apps/src/pjsua/pjsua_app_legacy.c index c3d9af1c..e49490b0 100644 --- a/pjsip-apps/src/pjsua/pjsua_app_legacy.c +++ b/pjsip-apps/src/pjsua/pjsua_app_legacy.c @@ -61,7 +61,7 @@ static void print_buddy_list() /* * Input URL. */ -static void ui_input_url(const char *title, char *buf, int len, +static void ui_input_url(const char *title, char *buf, pj_size_t len, input_result *result) { result->nb_result = PJSUA_APP_NO_NB; @@ -79,7 +79,7 @@ static void ui_input_url(const char *title, char *buf, int len, printf("%s: ", title); fflush(stdout); - if (fgets(buf, len, stdin) == NULL) + if (fgets(buf, (int)len, stdin) == NULL) return; len = strlen(buf); @@ -98,7 +98,7 @@ static void ui_input_url(const char *title, char *buf, int len, if (pj_isdigit(*buf) || *buf=='-') { - int i; + unsigned i; if (*buf=='-') i = 1; @@ -143,7 +143,7 @@ static pj_bool_t simple_input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - if (fgets(buf, len, stdin) == NULL) + if (fgets(buf, (int)len, stdin) == NULL) return PJ_FALSE; /* Remove trailing newlines. */ @@ -1674,7 +1674,7 @@ void legacy_main() char menuin[80]; char buf[128]; - keystroke_help(current_call); + keystroke_help(); for (;;) { @@ -1688,7 +1688,8 @@ void legacy_main() * If exit is desired end script with q for quit */ /* Reopen stdin/stdout/stderr to /dev/console */ -#if defined(PJ_WIN32) && PJ_WIN32!=0 && \ +#if ((defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_WIN64) && PJ_WIN64!=0)) && \ (!defined(PJ_WIN32_WINCE) || PJ_WIN32_WINCE==0) if (freopen ("CONIN$", "r", stdin) == NULL) { #else @@ -1847,9 +1848,11 @@ void legacy_main() ui_echo(menuin); break; - case 's': - ui_sleep(menuin); - break; + case 's': + if (pj_ansi_strnicmp(menuin, "sleep", 5)==0) { + ui_sleep(menuin); + break; + } /* Continue below */ case 'u': diff --git a/pjsip-apps/src/pjsystest/systest.c b/pjsip-apps/src/pjsystest/systest.c index 63ca849d..a8ce7538 100644 --- a/pjsip-apps/src/pjsystest/systest.c +++ b/pjsip-apps/src/pjsystest/systest.c @@ -479,7 +479,7 @@ static void systest_audio_test(void) const pjmedia_dir dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; pjmedia_aud_param param; pjmedia_aud_test_results result; - int textbufpos; + pj_size_t textbufpos; enum gui_key key; unsigned problem_count = 0; const char *problems[16]; @@ -654,7 +654,8 @@ static int calculate_latency(pj_pool_t *pool, pjmedia_port *wav, { pjmedia_frame frm; short *buf; - unsigned i, clock_rate, samples_per_frame, read, len; + unsigned i, clock_rate, samples_per_frame; + pj_size_t read, len; unsigned start_pos; pj_bool_t first; pj_status_t status; @@ -894,7 +895,7 @@ on_return: } } else { char msg[200]; - int msglen; + pj_size_t msglen; pj_ansi_snprintf(msg, sizeof(msg), "The sound device latency:\r\n" @@ -1066,7 +1067,8 @@ on_return: */ static void systest_list_audio_devs() { - unsigned i, dev_count, len=0; + unsigned i, dev_count; + pj_size_t len=0; pj_status_t status; test_item_t *ti; enum gui_key key; @@ -1118,7 +1120,7 @@ static void systest_list_audio_devs() static void systest_display_settings(void) { pjmedia_aud_dev_info di; - int len = 0; + pj_size_t len = 0; enum gui_key key; test_item_t *ti; const char *title = "Audio Settings"; diff --git a/pjsip-apps/src/samples/aectest.c b/pjsip-apps/src/samples/aectest.c index 4168f698..645fd88d 100644 --- a/pjsip-apps/src/samples/aectest.c +++ b/pjsip-apps/src/samples/aectest.c @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) } pj_get_timestamp(&t1); - i = pjmedia_wav_writer_port_get_pos(wav_out) / sizeof(pj_int16_t) * 1000 / + i = (int)pjmedia_wav_writer_port_get_pos(wav_out) / sizeof(pj_int16_t) * 1000 / (PJMEDIA_PIA_SRATE(&wav_out->info) * PJMEDIA_PIA_CCNT(&wav_out->info)); PJ_LOG(3,(THIS_FILE, "Processed %3d.%03ds audio", i / 1000, i % 1000)); diff --git a/pjsip-apps/src/samples/aviplay.c b/pjsip-apps/src/samples/aviplay.c index a4d92764..35b05044 100644 --- a/pjsip-apps/src/samples/aviplay.c +++ b/pjsip-apps/src/samples/aviplay.c @@ -155,7 +155,7 @@ static pj_status_t codec_get_frame(pjmedia_port *port, if (status != PJ_SUCCESS) goto on_error; status = pjmedia_vid_codec_decode(codec, 1, frame, - frame->size, &enc_frame); + (unsigned)frame->size, &enc_frame); if (status != PJ_SUCCESS) goto on_error; frame->size = frame_size; @@ -169,7 +169,7 @@ static pj_status_t codec_get_frame(pjmedia_port *port, if (status != PJ_SUCCESS) goto on_error; status = pjmedia_vid_codec_decode(codec, 1, &enc_frame, - frame->size, frame); + (unsigned)frame->size, frame); if (status != PJ_SUCCESS) goto on_error; return PJ_SUCCESS; diff --git a/pjsip-apps/src/samples/confbench.c b/pjsip-apps/src/samples/confbench.c index db9cd55f..84305f6c 100644 --- a/pjsip-apps/src/samples/confbench.c +++ b/pjsip-apps/src/samples/confbench.c @@ -144,7 +144,8 @@ static pj_status_t sine_get_frame( pjmedia_port *port, { port_data *sine = port->port_data.pdata; pj_int16_t *samples = frame->buf; - unsigned i, count, left, right; + unsigned i, left, right; + pj_size_t count; /* Get number of samples */ count = frame->size / 2 / PJMEDIA_PIA_CCNT(&port->info); diff --git a/pjsip-apps/src/samples/confsample.c b/pjsip-apps/src/samples/confsample.c index 7da70e11..de9c29ff 100644 --- a/pjsip-apps/src/samples/confsample.c +++ b/pjsip-apps/src/samples/confsample.c @@ -105,7 +105,7 @@ static pj_bool_t input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - if (fgets(buf, len, stdin) == NULL) + if (fgets(buf, (int)len, stdin) == NULL) return PJ_FALSE; /* Remove trailing newlines. */ diff --git a/pjsip-apps/src/samples/icedemo.c b/pjsip-apps/src/samples/icedemo.c index 943befb2..4cb9f221 100644 --- a/pjsip-apps/src/samples/icedemo.c +++ b/pjsip-apps/src/samples/icedemo.c @@ -547,7 +547,7 @@ static int print_cand(char buffer[], unsigned maxlen, *p = '\0'; - return p-buffer; + return (int)(p-buffer); } /* @@ -622,7 +622,7 @@ static int encode_session(char buffer[], unsigned maxlen) /* And encode the candidates as SDP */ for (j=0; j"); @@ -1077,7 +1077,7 @@ static void icedemo_console(void) while (!app_quit) { char input[80], *cmd; const char *SEP = " \t\r\n"; - int len; + pj_size_t len; icedemo_print_menu(); diff --git a/pjsip-apps/src/samples/latency.c b/pjsip-apps/src/samples/latency.c index 297b80b7..c9192b52 100644 --- a/pjsip-apps/src/samples/latency.c +++ b/pjsip-apps/src/samples/latency.c @@ -51,7 +51,8 @@ static int calculate_latency(pj_pool_t *pool, pjmedia_port *wav) { pjmedia_frame frm; short *buf; - unsigned i, samples_per_frame, read, len; + unsigned i, samples_per_frame; + pj_size_t read, len; unsigned start_pos; pj_status_t status; diff --git a/pjsip-apps/src/samples/pcaputil.c b/pjsip-apps/src/samples/pcaputil.c index 81015256..bb231127 100644 --- a/pjsip-apps/src/samples/pcaputil.c +++ b/pjsip-apps/src/samples/pcaputil.c @@ -88,7 +88,7 @@ static void cleanup() pj_ssize_t pos = pjmedia_wav_writer_port_get_pos(app.wav); if (pos >= 0) { unsigned msec; - msec = pos / 2 * 1000 / PJMEDIA_PIA_SRATE(&app.wav->info); + msec = (unsigned)pos / 2 * 1000 / PJMEDIA_PIA_SRATE(&app.wav->info); printf("Written: %dm:%02ds.%03d\n", msec / 1000 / 60, (msec / 1000) % 60, @@ -162,7 +162,7 @@ static void read_rtp(pj_uint8_t *buf, pj_size_t bufsize, * We will decode it again to get the payload after we do * SRTP decoding */ - status = pjmedia_rtp_decode_rtp(&app.rtp_sess, buf, sz, &r, + status = pjmedia_rtp_decode_rtp(&app.rtp_sess, buf, (int)sz, &r, &p, payload_size); if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; @@ -174,7 +174,7 @@ static void read_rtp(pj_uint8_t *buf, pj_size_t bufsize, /* Decrypt SRTP */ #if PJMEDIA_HAS_SRTP if (app.srtp) { - int len = sz; + int len = (int)sz; status = pjmedia_transport_srtp_decrypt_pkt(app.srtp, PJ_TRUE, buf, &len); if (status != PJ_SUCCESS) { @@ -187,7 +187,7 @@ static void read_rtp(pj_uint8_t *buf, pj_size_t bufsize, sz = len; /* Decode RTP packet again */ - status = pjmedia_rtp_decode_rtp(&app.rtp_sess, buf, sz, &r, + status = pjmedia_rtp_decode_rtp(&app.rtp_sess, buf, (int)sz, &r, &p, payload_size); if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; @@ -376,8 +376,8 @@ static void pcap2wav(const pj_str_t *codec, pcm_frame.buf = pcm; pcm_frame.size = samples_per_frame * 2; - T( pjmedia_codec_decode(app.codec, &frames[i], pcm_frame.size, - &pcm_frame) ); + T( pjmedia_codec_decode(app.codec, &frames[i], + (unsigned)pcm_frame.size, &pcm_frame) ); if (app.wav) { T( pjmedia_port_put_frame(app.wav, &pcm_frame) ); } @@ -400,7 +400,7 @@ static void pcap2wav(const pj_str_t *codec, pcm_frame.size = samples_per_frame * 2; if (app.codec->op->recover) { - T( pjmedia_codec_recover(app.codec, pcm_frame.size, + T( pjmedia_codec_recover(app.codec, (unsigned)pcm_frame.size, &pcm_frame) ); } else { pj_bzero(pcm_frame.buf, pcm_frame.size); diff --git a/pjsip-apps/src/samples/pjsip-perf.c b/pjsip-apps/src/samples/pjsip-perf.c index ae4ce041..2a435cfe 100644 --- a/pjsip-apps/src/samples/pjsip-perf.c +++ b/pjsip-apps/src/samples/pjsip-perf.c @@ -67,7 +67,7 @@ #include #include -#if defined(PJ_WIN32) && PJ_WIN32!=0 +#if (defined(PJ_WIN32) && PJ_WIN32!=0) || (defined(PJ_WIN64) && PJ_WIN64!=0) # include #endif @@ -1006,7 +1006,7 @@ static void call_on_state_changed( pjsip_inv_session *inv, } else if (inv->state == PJSIP_INV_STATE_DISCONNECTED) { report_completion(inv->cause); - inv->mod_data[mod_test.id] = (void*)1; + inv->mod_data[mod_test.id] = (void*)(pj_ssize_t)1; } } @@ -1093,7 +1093,7 @@ static pj_status_t verify_sip_url(const char *c_url) pjsip_uri *p; pj_pool_t *pool; char *url; - int len = (c_url ? pj_ansi_strlen(c_url) : 0); + pj_size_t len = (c_url ? pj_ansi_strlen(c_url) : 0); if (!len) return -1; @@ -1370,18 +1370,18 @@ static void tsx_completion_cb(void *token, pjsip_event *event) if (tsx->state==PJSIP_TSX_STATE_TERMINATED) { report_completion(tsx->status_code); - tsx->mod_data[mod_test.id] = (void*)1; + tsx->mod_data[mod_test.id] = (void*)(pj_ssize_t)1; } else if (tsx->method.id == PJSIP_INVITE_METHOD && tsx->state == PJSIP_TSX_STATE_CONFIRMED) { report_completion(tsx->status_code); - tsx->mod_data[mod_test.id] = (void*)1; + tsx->mod_data[mod_test.id] = (void*)(pj_ssize_t)1; } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED) { report_completion(tsx->status_code); - tsx->mod_data[mod_test.id] = (void*)1; + tsx->mod_data[mod_test.id] = (void*)(pj_ssize_t)1; TERMINATE_TSX(tsx, tsx->status_code); } @@ -1421,7 +1421,7 @@ static pj_status_t submit_job(void) static int client_thread(void *arg) { pj_time_val end_time, last_report, now; - unsigned thread_index = (unsigned)(long)arg; + unsigned thread_index = (unsigned)(long)(pj_ssize_t)arg; unsigned cycle = 0, last_cycle = 0; pj_thread_sleep(100); @@ -1578,7 +1578,7 @@ static const char *good_number(char *buf, pj_int32_t val) static int server_thread(void *arg) { pj_time_val timeout = { 0, 1 }; - unsigned thread_index = (unsigned)(long)arg; + unsigned thread_index = (unsigned)(long)(pj_ssize_t)arg; pj_time_val last_report, next_report; pj_gettimeofday(&last_report); @@ -1639,7 +1639,7 @@ static void write_report(const char *msg) { puts(msg); -#if defined(PJ_WIN32) && PJ_WIN32!=0 +#if (defined(PJ_WIN32) && PJ_WIN32!=0) || (defined(PJ_WIN64) && PJ_WIN64!=0) OutputDebugString(msg); OutputDebugString("\n"); #endif @@ -1715,7 +1715,8 @@ int main(int argc, char *argv[]) for (i=0; iport_data.pdata; pj_int16_t *samples = frame->buf; - unsigned i, count, left, right; + unsigned i, left, right; + pj_size_t count; /* Get number of samples */ count = frame->size / 2 / PJMEDIA_PIA_CCNT(&port->info); diff --git a/pjsip-apps/src/samples/sipecho.c b/pjsip-apps/src/samples/sipecho.c index c1e3bb43..6c5244d8 100644 --- a/pjsip-apps/src/samples/sipecho.c +++ b/pjsip-apps/src/samples/sipecho.c @@ -402,7 +402,8 @@ static void call_on_state_changed( pjsip_inv_session *inv, static void call_on_rx_offer(pjsip_inv_session *inv, const pjmedia_sdp_session *offer) { call_t *call = (call_t*) inv->mod_data[mod_sipecho.id]; - pjsip_inv_set_sdp_answer(inv, create_answer(call - app.call, inv->pool_prov, offer)); + pjsip_inv_set_sdp_answer(inv, create_answer((int)(call - app.call), + inv->pool_prov, offer)); } static void call_on_forked(pjsip_inv_session *inv, pjsip_event *e) @@ -501,7 +502,7 @@ static pj_bool_t on_rx_request( pjsip_rx_data *rdata ) &local_uri, &dlg); if (status == PJ_SUCCESS) - answer = create_answer(call-app.call, dlg->pool, sdp_info->sdp); + answer = create_answer((int)(call-app.call), dlg->pool, sdp_info->sdp); if (status == PJ_SUCCESS) status = pjsip_inv_create_uas( dlg, rdata, answer, 0, &call->inv); if (status == PJ_SUCCESS) diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index 9d544efd..f783b6aa 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -1101,7 +1101,7 @@ static pj_status_t create_sdp( pj_pool_t *pool, } -#if defined(PJ_WIN32) && PJ_WIN32 != 0 +#if (defined(PJ_WIN32) && PJ_WIN32 != 0) || (defined(PJ_WIN64) && PJ_WIN64 != 0) #include static void boost_priority(void) { @@ -1195,13 +1195,13 @@ static void on_rx_rtp(void *user_data, void *pkt, pj_ssize_t size) /* Check for errors */ if (size < 0) { - app_perror(THIS_FILE, "RTP recv() error", -size); + app_perror(THIS_FILE, "RTP recv() error", (pj_status_t)-size); return; } /* Decode RTP packet. */ status = pjmedia_rtp_decode_rtp(&strm->in_sess, - pkt, size, + pkt, (int)size, &hdr, &payload, &payload_len); if (status != PJ_SUCCESS) { app_perror(THIS_FILE, "RTP decode error", status); @@ -1234,7 +1234,7 @@ static void on_rx_rtcp(void *user_data, void *pkt, pj_ssize_t size) /* Check for errors */ if (size < 0) { - app_perror(THIS_FILE, "Error receiving RTCP packet", -size); + app_perror(THIS_FILE, "Error receiving RTCP packet",(pj_status_t)-size); return; } @@ -1862,7 +1862,7 @@ static pj_bool_t simple_input(const char *title, char *buf, pj_size_t len) char *p; printf("%s (empty to cancel): ", title); fflush(stdout); - if (fgets(buf, len, stdin) == NULL) + if (fgets(buf, (int)len, stdin) == NULL) return PJ_FALSE; /* Remove trailing newlines. */ @@ -2024,7 +2024,7 @@ static void app_log_writer(int level, const char *buffer, int len) pj_log_write(level, buffer, len); if (log_file) { - int count = fwrite(buffer, len, 1, log_file); + pj_size_t count = fwrite(buffer, len, 1, log_file); PJ_UNUSED_ARG(count); fflush(log_file); } diff --git a/pjsip-apps/src/samples/streamutil.c b/pjsip-apps/src/samples/streamutil.c index 7037a94e..ee357b3d 100644 --- a/pjsip-apps/src/samples/streamutil.c +++ b/pjsip-apps/src/samples/streamutil.c @@ -360,12 +360,14 @@ int main(int argc, char *argv[]) break; case OPT_SRTP_TX_KEY: - tmp_key_len = hex_string_to_octet_string(tmp_tx_key, pj_optarg, strlen(pj_optarg)); + tmp_key_len = hex_string_to_octet_string(tmp_tx_key, pj_optarg, + (int)strlen(pj_optarg)); pj_strset(&srtp_tx_key, tmp_tx_key, tmp_key_len/2); break; case OPT_SRTP_RX_KEY: - tmp_key_len = hex_string_to_octet_string(tmp_rx_key, pj_optarg, strlen(pj_optarg)); + tmp_key_len = hex_string_to_octet_string(tmp_rx_key, pj_optarg, + (int)strlen(pj_optarg)); pj_strset(&srtp_rx_key, tmp_rx_key, tmp_key_len/2); break; #endif diff --git a/pjsip-apps/src/samples/tonegen.c b/pjsip-apps/src/samples/tonegen.c index e3d5554c..efd4a318 100644 --- a/pjsip-apps/src/samples/tonegen.c +++ b/pjsip-apps/src/samples/tonegen.c @@ -127,7 +127,7 @@ int main() f = fopen("tonegen.pcm", "wb"); for (i=0; i<8000/SAMPLES_PER_FRAME; ++i) { - int count; + pj_size_t count; pjmedia_port_get_frame(port, &frm); count = fwrite(buf, SAMPLES_PER_FRAME, 2, f); if (count != 2) diff --git a/pjsip-apps/src/samples/util.h b/pjsip-apps/src/samples/util.h index c5d8fd6c..4529fad1 100644 --- a/pjsip-apps/src/samples/util.h +++ b/pjsip-apps/src/samples/util.h @@ -155,8 +155,8 @@ void dump_pool_usage( const char *app_name, pj_caching_pool *cp ) { #if !defined(PJ_HAS_POOL_ALT_API) || PJ_HAS_POOL_ALT_API==0 pj_pool_t *p; - unsigned total_alloc = 0; - unsigned total_used = 0; + pj_size_t total_alloc = 0; + pj_size_t total_used = 0; /* Accumulate memory usage in active list. */ p = cp->used_list.next; diff --git a/pjsip-apps/src/samples/vid_streamutil.c b/pjsip-apps/src/samples/vid_streamutil.c index 10eb0d69..f9f0a0d7 100644 --- a/pjsip-apps/src/samples/vid_streamutil.c +++ b/pjsip-apps/src/samples/vid_streamutil.c @@ -302,7 +302,8 @@ static void clock_cb(const pj_timestamp *ts, void *user_data) write_frame.buf = play_file->dec_buf; write_frame.size = play_file->dec_buf_size; status = pjmedia_vid_codec_decode(decoder, 1, &read_frame, - write_frame.size, &write_frame); + (unsigned)write_frame.size, + &write_frame); if (status != PJ_SUCCESS) return; } else { @@ -494,13 +495,13 @@ int main(int argc, char *argv[]) case OPT_SRTP_TX_KEY: tmp_key_len = hex_string_to_octet_string(tmp_tx_key, pj_optarg, - strlen(pj_optarg)); + (int)strlen(pj_optarg)); pj_strset(&srtp_tx_key, tmp_tx_key, tmp_key_len/2); break; case OPT_SRTP_RX_KEY: tmp_key_len = hex_string_to_octet_string(tmp_rx_key, pj_optarg, - strlen(pj_optarg)); + (int)strlen(pj_optarg)); pj_strset(&srtp_rx_key, tmp_rx_key, tmp_key_len/2); break; #endif -- cgit v1.2.3