From 45ecbc2f6144872ed2335fb724639145f2852815 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 29 Sep 2010 15:47:58 -0500 Subject: [PATCH] fix warnings on windows x64 builds src and mods projects - only libsofia included on the libs side --- .../libsofia-sip-ua/http/sofia-sip/http.h | 4 +++ libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c | 4 +++ .../msg/sofia-sip/msg_header.h | 5 +++ .../libsofia-sip-ua/msg/sofia-sip/msg_mime.h | 4 +++ .../libsofia-sip-ua/nea/nea_server.c | 4 +++ libs/sofia-sip/libsofia-sip-ua/nta/nta.c | 5 ++- .../libsofia-sip-ua/nua/nua_dialog.c | 5 +++ .../sofia-sip/libsofia-sip-ua/nua/nua_stack.h | 4 +++ .../libsofia-sip-ua/sip/sofia-sip/sip.h | 8 +++++ libs/sofia-sip/libsofia-sip-ua/soa/soa.c | 4 +++ .../libsofia-sip-ua/soa/soa_static.c | 4 +++ libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c | 2 +- libs/sofia-sip/libsofia-sip-ua/su/su.c | 2 +- .../libsofia-sip-ua/tport/tport_internal.h | 4 +++ src/include/switch_types.h | 4 +-- .../applications/mod_commands/mod_commands.c | 4 +-- .../mod_conference/mod_conference.c | 2 +- .../mod_directory/mod_directory.c | 4 +-- src/mod/applications/mod_fifo/mod_fifo.c | 1 - src/mod/applications/mod_hash/mod_hash.c | 7 ++-- src/mod/applications/mod_lcr/mod_lcr.c | 4 +-- .../mod_nibblebill/mod_nibblebill.c | 4 +-- src/mod/applications/mod_spandsp/udptl.c | 8 ++--- src/mod/endpoints/mod_sofia/mod_sofia.c | 11 ++++--- src/mod/endpoints/mod_sofia/sip-dig.c | 2 +- src/mod/endpoints/mod_sofia/sofia.c | 2 +- src/mod/endpoints/mod_sofia/sofia_glue.c | 26 +++++++-------- src/mod/endpoints/mod_sofia/sofia_reg.c | 9 +++--- .../mod_managed/freeswitch_wrap.2010.cxx | 32 +++++++++---------- .../mod_managed/managed/swig.2010.cs | 16 +++++----- 30 files changed, 125 insertions(+), 70 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h b/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h index d5bb617914..bd42743c9f 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h +++ b/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h @@ -58,7 +58,11 @@ SOFIA_BEGIN_DECLS #define HTTP_DEFAULT_SERV "80" /** HTTP protocol identifier */ +#ifndef _MSC_VER #define HTTP_PROTOCOL_TAG ((void *)0x48545450) /* 'HTTP' */ +#else +#define HTTP_PROTOCOL_TAG ((void *)(UINT_PTR)0x48545450) /* 'HTTP' */ +#endif /** HTTP parser flags */ enum { diff --git a/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c b/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c index 2be30b04b9..8d1b1d5285 100644 --- a/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c +++ b/libs/sofia-sip/libsofia-sip-ua/msg/msg_tag.c @@ -50,7 +50,11 @@ #include #include "sofia-sip/msg_tag_class.h" +#ifndef _MSC_VER #define NONE ((void*)-1) +#else +#define NONE ((void*)(UINT_PTR)-1) +#endif int msghdrtag_snprintf(tagi_t const *t, char b[], size_t size) { diff --git a/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h b/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h index 91fd72316b..f930b178e7 100644 --- a/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h +++ b/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h @@ -299,7 +299,12 @@ enum { (h)) /** No header. */ + +#ifndef _MSC_VER #define MSG_HEADER_NONE ((msg_header_t *)-1) +#else +#define MSG_HEADER_NONE ((msg_header_t *)(UINT_PTR)-1) +#endif SOFIA_END_DECLS diff --git a/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h b/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h index 4a9f234dec..033c551fdb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h +++ b/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_mime.h @@ -235,7 +235,11 @@ msg_content_length_t *msg_content_length_create(su_home_t *home, uint32_t n); SOFIAPUBVAR char const msg_mime_version_1_0[]; /** MIME multipart parser table identifier. @HIDE */ +#ifndef _MSC_VER #define MSG_MULTIPART_PROTOCOL_TAG ((void *)0x4d494d45) /* 'MIME' */ +#else +#define MSG_MULTIPART_PROTOCOL_TAG ((void *)(UINT_PTR)0x4d494d45) /* 'MIME' */ +#endif SOFIA_END_DECLS diff --git a/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c b/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c index 4287ae4359..2e5c482e73 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c +++ b/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c @@ -41,7 +41,11 @@ #include "nea_debug.h" +#ifndef _MSC_VER #define NONE ((void *)- 1) +#else +#define NONE ((void *)(UINT_PTR)- 1) +#endif #define SU_ROOT_MAGIC_T struct nea_server_s #define SU_MSG_ARG_T tagi_t diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index 656aecc195..d360041537 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -104,8 +104,11 @@ char const nta_version[] = PACKAGE_VERSION; static char const __func__[] = "nta"; #endif +#ifndef _MSC_VER #define NONE ((void *)-1) - +#else +#define NONE ((void *)(UINT_PTR)-1) +#endif /* ------------------------------------------------------------------------- */ /** Resolving order */ diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c index bf35263d92..cc4bcb2bef 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c @@ -53,7 +53,12 @@ #include #ifndef NONE + +#ifndef _MSC_VER #define NONE ((void *)-1) +#else +#define NONE ((void *)(UINT_PTR)-1) +#endif #endif /* ======================================================================== */ diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h b/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h index 318ccdd61d..f39f9d4c1a 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h @@ -83,7 +83,11 @@ typedef struct nua_ee_data { nua_event_data_t ee_data[1]; } nua_ee_data_t; +#ifndef _MSC_VER #define NONE ((void *)-1) +#else +#define NONE ((void *)(UINT_PTR)-1) +#endif typedef struct register_usage nua_registration_t; diff --git a/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h b/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h index 1a235ca4c8..3c38f3b4fb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h +++ b/libs/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip.h @@ -81,10 +81,18 @@ typedef enum { #define SIP_METHOD_PUBLISH sip_method_publish, "PUBLISH" /** Magic pointer value - never valid for SIP headers. @HI */ +#ifndef _MSC_VER #define SIP_NONE ((void const *)-1L) +#else +#define SIP_NONE ((void const *)(UINT_PTR)-1L) +#endif /** SIP protocol identifier @HIDE */ +#ifndef _MSC_VER #define SIP_PROTOCOL_TAG ((void *)0x53495020) /* 'SIP'20 */ +#else +#define SIP_PROTOCOL_TAG ((void *)(UINT_PTR)0x53495020) /* 'SIP'20 */ +#endif enum { /** Default port for SIP as integer */ diff --git a/libs/sofia-sip/libsofia-sip-ua/soa/soa.c b/libs/sofia-sip/libsofia-sip-ua/soa/soa.c index de79e0f3a5..d1b7477fc0 100644 --- a/libs/sofia-sip/libsofia-sip-ua/soa/soa.c +++ b/libs/sofia-sip/libsofia-sip-ua/soa/soa.c @@ -56,7 +56,11 @@ #include #include +#ifndef _MSC_VER #define NONE ((void *)-1) +#else +#define NONE ((void *)(UINT_PTR)-1) +#endif #define XXX assert(!"implemented") typedef unsigned longlong ull; diff --git a/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c b/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c index f94f9b2962..2c870b28ad 100644 --- a/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c +++ b/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c @@ -396,7 +396,11 @@ sdp_rtpmap_t *soa_sdp_media_matching_rtpmap(sdp_rtpmap_t const *from, return NULL; } +#ifndef _MSC_VER #define SDP_MEDIA_NONE ((sdp_media_t *)-1) +#else +#define SDP_MEDIA_NONE ((sdp_media_t *)(UINT_PTR)-1) +#endif /** Find first matching media in table @a mm. * diff --git a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c index f660b2ce22..e494571f54 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c +++ b/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c @@ -125,7 +125,7 @@ su_inline ssize_t sres_recvfrom(sres_socket_t s, void *buffer, size_t length, int flags, struct sockaddr *from, socklen_t *fromlen) { - int retval, ilen; + int retval, ilen = 0; if (fromlen) ilen = *fromlen; diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su.c b/libs/sofia-sip/libsofia-sip-ua/su/su.c index 250b5d62d1..8067fdec60 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su.c @@ -434,7 +434,7 @@ ssize_t su_recv(su_socket_t s, void *buffer, size_t length, int flags) ssize_t su_recvfrom(su_socket_t s, void *buffer, size_t length, int flags, su_sockaddr_t *from, socklen_t *fromlen) { - int retval, ilen; + int retval, ilen = 0; if (fromlen) ilen = *fromlen; diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h b/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h index b56dd2d9bc..a26d38a552 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_internal.h @@ -79,7 +79,11 @@ #endif #ifndef NONE +#ifndef _MSC_VER #define NONE ((void *)-1) +#else +#define NONE ((void *)(UINT_PTR)-1) +#endif #endif SOFIA_BEGIN_DECLS diff --git a/src/include/switch_types.h b/src/include/switch_types.h index b0395bafdc..70eaa4f80e 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -770,9 +770,9 @@ typedef struct { const char *T38FaxUdpEC; const char *T38VendorInfo; const char *remote_ip; - uint32_t remote_port; + uint16_t remote_port; const char *local_ip; - uint32_t local_port; + uint16_t local_port; } switch_t38_options_t; /*! diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 6a16a9c7e5..1fb1c95c47 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1065,7 +1065,7 @@ SWITCH_STANDARD_API(url_encode_function) int len = 0; if (!zstr(cmd)) { - len = (strlen(cmd) * 3) + 1; + len = (int)(strlen(cmd) * 3) + 1; switch_zmalloc(data, len); switch_url_encode(cmd, data, len); reply = data; @@ -4218,7 +4218,7 @@ SWITCH_STANDARD_API(escape_function) return SWITCH_STATUS_SUCCESS; } - len = strlen(cmd) * 2; + len = (int)strlen(cmd) * 2; mycmd = malloc(len); stream->write_function(stream, "%s", switch_escape_string(cmd, mycmd, len)); diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 1bc220134d..7018294546 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1012,7 +1012,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v uint8_t *file_frame; uint8_t *async_file_frame; int16_t *bptr; - int x = 0; + uint32_t x = 0; int32_t z = 0; int member_score_sum = 0; int divisor = 0; diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index 8464b1c0df..d92974766d 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -393,7 +393,7 @@ static dir_profile_t *load_profile(const char *profile_name) profile_set_config(profile); /* Add the params to the event structure */ - count = switch_event_import_xml(switch_xml_child(x_profile, "param"), "name", "value", &event); + count = (int)switch_event_import_xml(switch_xml_child(x_profile, "param"), "name", "value", &event); if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, profile->config) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to process configuration\n"); @@ -611,7 +611,7 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit } if (strlen(cbr->digits) < sizeof(cbr->digits) - 2) { - int at = strlen(cbr->digits); + int at = (int)strlen(cbr->digits); cbr->digits[at++] = dtmf->digit; cbr->digits[at] = '\0'; } else { diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 585e4bfab4..563706c9f2 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -513,7 +513,6 @@ static switch_status_t caller_read_frame_callback(switch_core_session_t *session if (match_key(caller_exit_key, *buf)) { cd->abort = 1; return SWITCH_STATUS_FALSE; - switch_channel_set_variable(channel, "fifo_caller_exit_key", (char *)buf); } cd->next = switch_epoch_time_now(NULL) + cd->freq; cd->index++; diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 3a65528ea3..29a056104f 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -852,7 +852,8 @@ static void do_config(switch_bool_t reload) const char *username = switch_xml_attr(x_list, "username"); const char *password = switch_xml_attr(x_list, "password"); const char *szinterval = switch_xml_attr(x_list, "interval"); - int port = 0, interval = 0; + uint16_t port = 0; + int interval = 0; limit_remote_t *remote; switch_threadattr_t *thd_attr = NULL; @@ -866,7 +867,7 @@ static void do_config(switch_bool_t reload) } if (!zstr(szport)) { - port = atoi(szport); + port = (uint16_t)atoi(szport); } if (!zstr(szinterval)) { @@ -949,7 +950,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown) /* Kill remote connections, destroy needs a wrlock so we unlock after finding a pointer */ while(remote_clean) { void *val; - const void *key; + const void *key = NULL; switch_ssize_t keylen; limit_remote_t *item = NULL; diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index 105576ce14..cc93707367 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -167,7 +167,7 @@ static const char *do_cid(switch_memory_pool_t *pool, const char *cid, const cha switch_channel_t *channel = NULL; if (!zstr(cid)) { - len = strlen(cid); + len = (uint32_t)strlen(cid); } else { goto done; } @@ -506,7 +506,7 @@ static char *expand_digits(switch_memory_pool_t *pool, char *digits, switch_bool int digit_len; SWITCH_STANDARD_STREAM(dig_stream); - digit_len = strlen(digits); + digit_len = (int)strlen(digits); digits_copy = switch_core_strdup(pool, digits); for (n = digit_len; n > 0; n--) { diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.c b/src/mod/applications/mod_nibblebill/mod_nibblebill.c index 06bc7d0abd..42369f5d0b 100755 --- a/src/mod/applications/mod_nibblebill/mod_nibblebill.c +++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.c @@ -419,10 +419,10 @@ static switch_status_t do_billing(switch_core_session_t *session) billaccount = switch_channel_get_variable(channel, "nibble_account"); if (!zstr(switch_channel_get_variable(channel, "nobal_amt"))) { - nobal_amt = atof(switch_channel_get_variable(channel, "nobal_amt")); + nobal_amt = (float)atof(switch_channel_get_variable(channel, "nobal_amt")); } if (!zstr(switch_channel_get_variable(channel, "lowbal_amt"))) { - lowbal_amt = atof(switch_channel_get_variable(channel, "lowbal_amt")); + lowbal_amt = (float)atof(switch_channel_get_variable(channel, "lowbal_amt")); } /* Return if there's no billing information on this session */ diff --git a/src/mod/applications/mod_spandsp/udptl.c b/src/mod/applications/mod_spandsp/udptl.c index a2651513f0..f5b3be2445 100644 --- a/src/mod/applications/mod_spandsp/udptl.c +++ b/src/mod/applications/mod_spandsp/udptl.c @@ -93,7 +93,7 @@ static int encode_length(uint8_t *buf, int *len, int value) if (value < 0x80) { /* 1 octet */ - buf[(*len)++] = value; + buf[(*len)++] = (uint8_t)value; return value; } if (value < 0x4000) { @@ -106,7 +106,7 @@ static int encode_length(uint8_t *buf, int *len, int value) /* Fragmentation */ multiplier = (value < 0x10000) ? (value >> 14) : 4; /* Set the first 2 bits of the octet */ - buf[(*len)++] = 0xC0 | multiplier; + buf[(*len)++] = (uint8_t) (0xC0 | multiplier); return multiplier << 14; } @@ -419,10 +419,10 @@ int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int /* Span is defined as an inconstrained integer, which it dumb. It will only ever be a small value. Treat it as such. */ buf[len++] = 1; - buf[len++] = span; + buf[len++] = (uint8_t)span; /* The number of entries is defined as a length, but will only ever be a small value. Treat it as such. */ - buf[len++] = entries; + buf[len++] = (uint8_t)entries; for (m = 0; m < entries; m++) { /* Make an XOR'ed entry the maximum length */ limit = (entry + m) & UDPTL_BUF_MASK; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c2fece8a20..7e92decfb1 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2331,7 +2331,7 @@ static int show_reg_callback(void *pArg, int argc, char **argv, char **columnNam switch_time_t etime = atoi(argv[6]); switch_size_t retsize; - exp_secs = etime - now; + exp_secs = (int)(etime - now); switch_time_exp_lt(&tm, switch_time_from_sec(etime)); switch_strftime_nocheck(exp_buf, &retsize, sizeof(exp_buf), "%Y-%m-%d %T", &tm); } @@ -2371,7 +2371,7 @@ static int show_reg_callback_xml(void *pArg, int argc, char **argv, char **colum switch_time_t etime = atoi(argv[6]); switch_size_t retsize; - exp_secs = etime - now; + exp_secs = (int)(etime - now); switch_time_exp_lt(&tm, switch_time_from_sec(etime)); switch_strftime_nocheck(exp_buf, &retsize, sizeof(exp_buf), "%Y-%m-%d %T", &tm); } @@ -2499,7 +2499,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t } else if (!strcasecmp(argv[0], "profile")) { struct cb_helper cb; char *sql = NULL; - int x = 0; + uint32_t x = 0; cb.row_process = 0; @@ -2779,7 +2779,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl } else if (!strcasecmp(argv[0], "profile")) { struct cb_helper cb; char *sql = NULL; - int x = 0; + uint32_t x = 0; cb.row_process = 0; @@ -4394,7 +4394,8 @@ static void general_event_handler(switch_event_t *event) switch_mutex_lock(mod_sofia_globals.hash_mutex); if (mod_sofia_globals.profile_hash) { for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { - int rb = 0, x = 0; + int rb = 0; + uint32_t x = 0; switch_hash_this(hi, &var, NULL, &val); if ((profile = (sofia_profile_t *) val) && profile->auto_restart) { if (!strcmp(profile->sipip, old_ip4)) { diff --git a/src/mod/endpoints/mod_sofia/sip-dig.c b/src/mod/endpoints/mod_sofia/sip-dig.c index f4714bccda..d0c9aa6aff 100644 --- a/src/mod/endpoints/mod_sofia/sip-dig.c +++ b/src/mod/endpoints/mod_sofia/sip-dig.c @@ -785,7 +785,7 @@ int dig_addr(struct dig *dig, char const *tport2 = NULL; sres_record_t **answers1 = NULL, **answers2 = NULL; unsigned count1 = 0, count2 = 0, tcount = 0; - int type1 = 0, type2 = 0, family1 = 0, family2 = 0; + uint16_t type1 = 0, type2 = 0, family1 = 0, family2 = 0; if (dig->ip6 > dig->ip4) { type1 = sres_type_aaaa, family1 = AF_INET6; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index a3554ec861..c3248d1a3d 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1268,7 +1268,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread iterations++; if (len + newlen + 10 > sql_len) { - int new_mlen = len + newlen + 10 + 10240; + switch_size_t new_mlen = len + newlen + 10 + 10240; if (new_mlen < SQLLEN) { sql_len = new_mlen; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 9301348eb5..3dc90b9a68 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1280,7 +1280,7 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt) switch_port_t remote_rtcp_port = 0; if ((rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_video_rtcp_port"))) { - remote_rtcp_port = atoi(rport); + remote_rtcp_port = (switch_port_t)atoi(rport); } @@ -1316,7 +1316,7 @@ switch_status_t sofia_glue_tech_proxy_remote_addr(private_object_t *tech_pvt) } if ((rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_audio_rtcp_port"))) { - remote_rtcp_port = atoi(rport); + remote_rtcp_port = (switch_port_t)atoi(rport); } @@ -2856,7 +2856,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); if ((rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_audio_rtcp_port"))) { - remote_rtcp_port = atoi(rport); + remote_rtcp_port = (switch_port_t)atoi(rport); } if (switch_rtp_set_remote_address(tech_pvt->rtp_session, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port, @@ -2991,7 +2991,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f const char *rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_audio_rtcp_port"); switch_port_t remote_port = 0; if (rport) { - remote_port = atoi(rport); + remote_port = (switch_port_t)atoi(rport); } if (!strcasecmp(val, "passthru")) { switch_rtp_activate_rtcp(tech_pvt->rtp_session, -1, remote_port); @@ -3131,7 +3131,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE); if ((rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_video_rtcp_port"))) { - remote_rtcp_port = atoi(rport); + remote_rtcp_port = (switch_port_t)atoi(rport); } if (switch_rtp_set_remote_address @@ -3248,7 +3248,7 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f const char *rport = switch_channel_get_variable(tech_pvt->channel, "sip_remote_video_rtcp_port"); switch_port_t remote_port = 0; if (rport) { - remote_port = atoi(rport); + remote_port = (switch_port_t)atoi(rport); } if (!strcasecmp(val, "passthru")) { switch_rtp_activate_rtcp(tech_pvt->rtp_session, -1, remote_port); @@ -3590,7 +3590,7 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_ t38_options = switch_core_session_alloc(tech_pvt->session, sizeof(switch_t38_options_t)); } - t38_options->remote_port = m->m_port; + t38_options->remote_port = (switch_port_t)m->m_port; if (m->m_connections && m->m_connections->c_address) { t38_options->remote_ip = switch_core_session_strdup(tech_pvt->session, m->m_connections->c_address); @@ -4848,13 +4848,13 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName } if ((tmp = switch_channel_get_variable(channel, "sip_use_pt"))) { - tech_pvt->pt = tech_pvt->agreed_pt = atoi(tmp); + tech_pvt->pt = tech_pvt->agreed_pt = (switch_payload_t)atoi(tmp); } sofia_glue_tech_set_codec(tech_pvt, 1); tech_pvt->adv_sdp_audio_ip = tech_pvt->extrtpip = (char *) ip; - tech_pvt->adv_sdp_audio_port = tech_pvt->local_sdp_audio_port = atoi(port); + tech_pvt->adv_sdp_audio_port = tech_pvt->local_sdp_audio_port = (switch_port_t)atoi(port); if ((tmp = switch_channel_get_variable(channel, "local_media_ip"))) { tech_pvt->local_sdp_audio_ip = switch_core_session_strdup(session, tmp); @@ -4863,12 +4863,12 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName if (r_ip && r_port) { tech_pvt->remote_sdp_audio_ip = (char *) r_ip; - tech_pvt->remote_sdp_audio_port = atoi(r_port); + tech_pvt->remote_sdp_audio_port = (switch_port_t)atoi(r_port); } if (switch_channel_test_flag(channel, CF_VIDEO)) { if ((tmp = switch_channel_get_variable(channel, "sip_use_video_pt"))) { - tech_pvt->video_pt = tech_pvt->video_agreed_pt = atoi(tmp); + tech_pvt->video_pt = tech_pvt->video_agreed_pt = (switch_payload_t)atoi(tmp); } @@ -4890,11 +4890,11 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName tech_pvt->video_codec_ms = atoi(tmp); } - tech_pvt->adv_sdp_video_port = tech_pvt->local_sdp_video_port = atoi(port); + tech_pvt->adv_sdp_video_port = tech_pvt->local_sdp_video_port = (switch_port_t)atoi(port); if (r_ip && r_port) { tech_pvt->remote_sdp_video_ip = (char *) r_ip; - tech_pvt->remote_sdp_video_port = atoi(r_port); + tech_pvt->remote_sdp_video_port = (switch_port_t)atoi(r_port); } //sofia_glue_tech_set_video_codec(tech_pvt, 1); } diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 64176ee261..4f35ac0e3c 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -934,7 +934,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if (sip->sip_path) { path_val = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_path); - path_encoded_len = (strlen(path_val) * 3) + 1; + path_encoded_len = (int)(strlen(path_val) * 3) + 1; switch_zmalloc(path_encoded, path_encoded_len); switch_copy_string(path_encoded, ";fs_path=", 10); switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9); @@ -947,7 +947,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_snprintf(my_contact_str, sizeof(my_contact_str), "sip:%s@%s:%d", contact->m_url->url_user, url_ip, network_port); } - path_encoded_len = (strlen(my_contact_str) * 3) + 1; + path_encoded_len = (int)(strlen(my_contact_str) * 3) + 1; switch_zmalloc(path_encoded, path_encoded_len); switch_copy_string(path_encoded, ";fs_path=", 10); @@ -2126,7 +2126,8 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, if (auth_acl) { if (!switch_check_network_list_ip(ip, auth_acl)) { - int network_ip_is_proxy = 0, x = 0; + int network_ip_is_proxy = 0; + uint32_t x = 0; char *last_acl = NULL; if (profile->proxy_acl_count == 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by user acl [%s] and no proxy acl present\n", ip, auth_acl); @@ -2223,7 +2224,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, if (max_registrations_perext > 0 && (sip && sip->sip_contact && (sip->sip_contact->m_expires == NULL || atol(sip->sip_contact->m_expires) > 0))) { /* if expires is null still process */ /* expires == 0 means the phone is going to unregiser, so don't count against max */ - int count = 0; + uint32_t count = 0; call_id = sip->sip_call_id->i_id; switch_assert(call_id); diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index b1a19f58fe..a922aadf34 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -3583,24 +3583,24 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_remote_ip_get(void * j } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_set(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_set(void * jarg1, unsigned short jarg2) { switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ; - uint32_t arg2 ; + uint16_t arg2 ; arg1 = (switch_t38_options_t *)jarg1; - arg2 = (uint32_t)jarg2; + arg2 = (uint16_t)jarg2; if (arg1) (arg1)->remote_port = arg2; } -SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_get(void * jarg1) { - unsigned long jresult ; +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_t38_options_t_remote_port_get(void * jarg1) { + unsigned short jresult ; switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ; - uint32_t result; + uint16_t result; arg1 = (switch_t38_options_t *)jarg1; - result = (uint32_t) ((arg1)->remote_port); - jresult = (unsigned long)result; + result = (uint16_t) ((arg1)->remote_port); + jresult = result; return jresult; } @@ -3634,24 +3634,24 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_t38_options_t_local_ip_get(void * ja } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_local_port_set(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_local_port_set(void * jarg1, unsigned short jarg2) { switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ; - uint32_t arg2 ; + uint16_t arg2 ; arg1 = (switch_t38_options_t *)jarg1; - arg2 = (uint32_t)jarg2; + arg2 = (uint16_t)jarg2; if (arg1) (arg1)->local_port = arg2; } -SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_t38_options_t_local_port_get(void * jarg1) { - unsigned long jresult ; +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_t38_options_t_local_port_get(void * jarg1) { + unsigned short jresult ; switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ; - uint32_t result; + uint16_t result; arg1 = (switch_t38_options_t *)jarg1; - result = (uint32_t) ((arg1)->local_port); - jresult = (unsigned long)result; + result = (uint16_t) ((arg1)->local_port); + jresult = result; return jresult; } diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 29fa0d9eb1..8ef49236f9 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -6376,10 +6376,10 @@ class freeswitchPINVOKE { public static extern string switch_t38_options_t_remote_ip_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_set")] - public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, uint jarg2); + public static extern void switch_t38_options_t_remote_port_set(HandleRef jarg1, ushort jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_remote_port_get")] - public static extern uint switch_t38_options_t_remote_port_get(HandleRef jarg1); + public static extern ushort switch_t38_options_t_remote_port_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_ip_set")] public static extern void switch_t38_options_t_local_ip_set(HandleRef jarg1, string jarg2); @@ -6388,10 +6388,10 @@ class freeswitchPINVOKE { public static extern string switch_t38_options_t_local_ip_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_set")] - public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, uint jarg2); + public static extern void switch_t38_options_t_local_port_set(HandleRef jarg1, ushort jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_local_port_get")] - public static extern uint switch_t38_options_t_local_port_get(HandleRef jarg1); + public static extern ushort switch_t38_options_t_local_port_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_new_switch_t38_options_t")] public static extern IntPtr new_switch_t38_options_t(); @@ -29741,12 +29741,12 @@ public class switch_t38_options_t : IDisposable { } } - public uint remote_port { + public ushort remote_port { set { freeswitchPINVOKE.switch_t38_options_t_remote_port_set(swigCPtr, value); } get { - uint ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr); + ushort ret = freeswitchPINVOKE.switch_t38_options_t_remote_port_get(swigCPtr); return ret; } } @@ -29761,12 +29761,12 @@ public class switch_t38_options_t : IDisposable { } } - public uint local_port { + public ushort local_port { set { freeswitchPINVOKE.switch_t38_options_t_local_port_set(swigCPtr, value); } get { - uint ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr); + ushort ret = freeswitchPINVOKE.switch_t38_options_t_local_port_get(swigCPtr); return ret; } }