提交 dbdad460 authored 作者: Michael Jerris's avatar Michael Jerris

fix msvc compile. Cleanup some warnings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@660 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 01fd1c3a
...@@ -113,6 +113,7 @@ typedef unsigned long in_addr_t; ...@@ -113,6 +113,7 @@ typedef unsigned long in_addr_t;
#else #else
#define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __cdecl #define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __cdecl
#endif #endif
#define SIGHUP SIGTERM
#else //not win32 #else //not win32
#define SWITCH_DECLARE(type) type #define SWITCH_DECLARE(type) type
#define SWITCH_DECLARE_NONSTD(type) type #define SWITCH_DECLARE_NONSTD(type) type
......
...@@ -79,7 +79,7 @@ SWITCH_DECLARE(char) switch_rfc2833_to_char(int event); ...@@ -79,7 +79,7 @@ SWITCH_DECLARE(char) switch_rfc2833_to_char(int event);
\param the charecter to encode \param the charecter to encode
\return the event id for the specified character or -1 on an invalid input \return the event id for the specified character or -1 on an invalid input
*/ */
SWITCH_DECLARE(int) switch_char_to_rfc2833(char key); SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
/*! /*!
\brief Duplicate a string \brief Duplicate a string
......
...@@ -673,7 +673,7 @@ static switch_status exosip_write_frame(switch_core_session *session, switch_fra ...@@ -673,7 +673,7 @@ static switch_status exosip_write_frame(switch_core_session *session, switch_fra
tech_pvt->out_digit_sofar = 0; tech_pvt->out_digit_sofar = 0;
tech_pvt->out_digit_dur = rdigit->duration; tech_pvt->out_digit_dur = rdigit->duration;
tech_pvt->out_digit = rdigit->digit; tech_pvt->out_digit = rdigit->digit;
tech_pvt->out_digit_packet[0] = switch_char_to_rfc2833(rdigit->digit); tech_pvt->out_digit_packet[0] = (unsigned char)switch_char_to_rfc2833(rdigit->digit);
tech_pvt->out_digit_packet[1] = 7; tech_pvt->out_digit_packet[1] = 7;
ts = tech_pvt->timestamp_dtmf += samples; ts = tech_pvt->timestamp_dtmf += samples;
...@@ -767,7 +767,7 @@ static switch_status exosip_send_dtmf(switch_core_session *session, char *digits ...@@ -767,7 +767,7 @@ static switch_status exosip_send_dtmf(switch_core_session *session, char *digits
for(c = digits; *c; c++) { for(c = digits; *c; c++) {
struct rfc2833_digit *rdigit; struct rfc2833_digit *rdigit;
if ((rdigit = malloc(sizeof(*rdigit)))) { if ((rdigit = malloc(sizeof(*rdigit))) != 0) {
memset(rdigit, 0, sizeof(*rdigit)); memset(rdigit, 0, sizeof(*rdigit));
rdigit->digit = *c; rdigit->digit = *c;
rdigit->duration = globals.dtmf_duration * (tech_pvt->read_codec.implementation->samples_per_second / 1000); rdigit->duration = globals.dtmf_duration * (tech_pvt->read_codec.implementation->samples_per_second / 1000);
......
...@@ -38,16 +38,16 @@ SWITCH_DECLARE(char) switch_rfc2833_to_char(int event) ...@@ -38,16 +38,16 @@ SWITCH_DECLARE(char) switch_rfc2833_to_char(int event)
return (event > -1 && event < sizeof(RFC2833_CHARS)) ? RFC2833_CHARS[event] : '\0'; return (event > -1 && event < sizeof(RFC2833_CHARS)) ? RFC2833_CHARS[event] : '\0';
} }
SWITCH_DECLARE(int) switch_char_to_rfc2833(char key) SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key)
{ {
char *c; char *c;
for (c = RFC2833_CHARS; *c ; c++) { for (c = RFC2833_CHARS; *c ; c++) {
if (*c == key) { if (*c == key) {
return (c - RFC2833_CHARS); return (unsigned char)(c - RFC2833_CHARS);
} }
} }
return -1; return (unsigned char)-1;
} }
SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen) SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论