Commit ea61cf38 authored by Ghislain MARY's avatar Ghislain MARY

Fix compilation warnings when compiling with Visual Studio.

parent 3a681b17
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src;$(ProjectDir)..\..\..\..\cunit\build\windows\cunit\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src;$(ProjectDir)..\..\..\..\cunit\build\windows\cunit\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</PrecompiledHeader> </PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;BELLESIP_INTERNAL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;BELLESIP_INTERNAL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\antlr3\runtime\C\include;$(ProjectDir)..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\antlr3\runtime\C\include;$(ProjectDir)..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessToFile>false</PreprocessToFile> <PreprocessToFile>false</PreprocessToFile>
<BasicRuntimeChecks>Default</BasicRuntimeChecks> <BasicRuntimeChecks>Default</BasicRuntimeChecks>
......
...@@ -48,4 +48,6 @@ ...@@ -48,4 +48,6 @@
BELLESIP_EXPORT int gettimeofday (struct timeval *tv, void* tz); BELLESIP_EXPORT int gettimeofday (struct timeval *tv, void* tz);
#endif #endif
#define BELLESIP_UNUSED(a) a;
#endif #endif
...@@ -347,7 +347,7 @@ fail: ...@@ -347,7 +347,7 @@ fail:
hints.ai_family=af_type; hints.ai_family=af_type;
err=getaddrinfo(af_type==AF_INET ? "0.0.0.0" : "::0","0",&hints,&res); err=getaddrinfo(af_type==AF_INET ? "0.0.0.0" : "::0","0",&hints,&res);
if (err!=0) belle_sip_fatal("belle_sip_get_src_addr_for(): getaddrinfo failed: %s",belle_sip_get_socket_error_string_from_code(err)); if (err!=0) belle_sip_fatal("belle_sip_get_src_addr_for(): getaddrinfo failed: %s",belle_sip_get_socket_error_string_from_code(err));
memcpy(src,res->ai_addr,MIN(*srclen,res->ai_addrlen)); memcpy(src,res->ai_addr,MIN((size_t)*srclen,res->ai_addrlen));
*srclen=res->ai_addrlen; *srclen=res->ai_addrlen;
freeaddrinfo(res); freeaddrinfo(res);
} }
......
...@@ -182,7 +182,7 @@ return result; ...@@ -182,7 +182,7 @@ return result;
static int uri_strncmp_common(const char*a,const char*b,size_t n,int case_sensitive) { static int uri_strncmp_common(const char*a,const char*b,size_t n,int case_sensitive) {
int result=0; int result=0;
int index_a=0,index_b=0; size_t index_a=0,index_b=0;
char char_a,char_b; char char_a,char_b;
while (a[index_a]!='\0'&&b[index_b]!='\0'&&index_a<n&&index_b<n) { while (a[index_a]!='\0'&&b[index_b]!='\0'&&index_a<n&&index_b<n) {
......
...@@ -546,7 +546,7 @@ unsigned int belle_sip_random(void){ ...@@ -546,7 +546,7 @@ unsigned int belle_sip_random(void){
#elif defined(WIN32) #elif defined(WIN32)
static int initd=0; static int initd=0;
if (!initd) { if (!initd) {
srand(belle_sip_time_ms()); srand((unsigned int)belle_sip_time_ms());
initd=1; initd=1;
} }
return rand()<<16 | rand(); return rand()<<16 | rand();
...@@ -588,8 +588,8 @@ static void bits_reader_init(bits_reader_t *reader, const uint8_t *buffer, size_ ...@@ -588,8 +588,8 @@ static void bits_reader_init(bits_reader_t *reader, const uint8_t *buffer, size_
static int bits_reader_read(bits_reader_t *reader, int count, unsigned int *ret){ static int bits_reader_read(bits_reader_t *reader, int count, unsigned int *ret){
unsigned int tmp; unsigned int tmp;
int byte_index=reader->bit_index/8; size_t byte_index=reader->bit_index/8;
int bit_index=reader->bit_index % 8; size_t bit_index=reader->bit_index % 8;
int shift=32-bit_index-count; int shift=32-bit_index-count;
if (count>=24){ if (count>=24){
...@@ -623,7 +623,7 @@ char * belle_sip_octets_to_text(const uint8_t *hash, size_t hash_len, char *ret, ...@@ -623,7 +623,7 @@ char * belle_sip_octets_to_text(const uint8_t *hash, size_t hash_len, char *ret,
bits_reader_init(&bitctx,hash,hash_len); bits_reader_init(&bitctx,hash,hash_len);
for(i=0;i<size-1;++i){ for(i=0;i<(int)size-1;++i){
unsigned int val=0; unsigned int val=0;
if (bits_reader_read(&bitctx,6,&val)==0){ if (bits_reader_read(&bitctx,6,&val)==0){
ret[i]=symbols[val]; ret[i]=symbols[val];
......
...@@ -263,7 +263,7 @@ static int dialog_on_200Ok_timer(belle_sip_dialog_t *dialog){ ...@@ -263,7 +263,7 @@ static int dialog_on_200Ok_timer(belle_sip_dialog_t *dialog){
/*reset the timer */ /*reset the timer */
const belle_sip_timer_config_t *cfg=belle_sip_stack_get_timer_config(dialog->provider->stack); const belle_sip_timer_config_t *cfg=belle_sip_stack_get_timer_config(dialog->provider->stack);
unsigned int prev_timeout=belle_sip_source_get_timeout(dialog->timer_200Ok); unsigned int prev_timeout=belle_sip_source_get_timeout(dialog->timer_200Ok);
belle_sip_source_set_timeout(dialog->timer_200Ok,MIN(2*prev_timeout,cfg->T2)); belle_sip_source_set_timeout(dialog->timer_200Ok,MIN(2*prev_timeout,(unsigned int)cfg->T2));
belle_sip_message("Dialog sending retransmission of 200Ok"); belle_sip_message("Dialog sending retransmission of 200Ok");
belle_sip_provider_send_response(dialog->provider,dialog->last_200Ok); belle_sip_provider_send_response(dialog->provider,dialog->last_200Ok);
return BELLE_SIP_CONTINUE; return BELLE_SIP_CONTINUE;
......
...@@ -830,9 +830,13 @@ static char *dns_strsep(char **sp, const char *delim) { ...@@ -830,9 +830,13 @@ static char *dns_strsep(char **sp, const char *delim) {
#if _WIN32 #if _WIN32
#ifndef strcasecmp
#define strcasecmp(...) _stricmp(__VA_ARGS__) #define strcasecmp(...) _stricmp(__VA_ARGS__)
#endif
#ifndef strncasecmp
#define strncasecmp(...) _strnicmp(__VA_ARGS__) #define strncasecmp(...) _strnicmp(__VA_ARGS__)
#endif #endif
#endif
static int dns_poll(int fd, short events, int timeout) { static int dns_poll(int fd, short events, int timeout) {
...@@ -4691,7 +4695,7 @@ int dns_nssconf_loadfile(struct dns_resolv_conf *resconf, FILE *fp) { ...@@ -4691,7 +4695,7 @@ int dns_nssconf_loadfile(struct dns_resolv_conf *resconf, FILE *fp) {
dns_anyconf_skip("] \t", fp); dns_anyconf_skip("] \t", fp);
} }
if (endof(lookup) - lp < cf.count + 1) /* +1 for '\0' */ if ((unsigned int)(endof(lookup) - lp) < cf.count + 1) /* +1 for '\0' */
goto nextsrc; goto nextsrc;
source = dns_nssconf_keyword(cf.token[0]); source = dns_nssconf_keyword(cf.token[0]);
......
...@@ -109,7 +109,7 @@ static int nict_on_timer_E(belle_sip_nict_t *obj){ ...@@ -109,7 +109,7 @@ static int nict_on_timer_E(belle_sip_nict_t *obj){
{ {
/*reset the timer */ /*reset the timer */
unsigned int prev_timeout=belle_sip_source_get_timeout(obj->timer_E); unsigned int prev_timeout=belle_sip_source_get_timeout(obj->timer_E);
belle_sip_source_set_timeout(obj->timer_E,MIN(2*prev_timeout,cfg->T2)); belle_sip_source_set_timeout(obj->timer_E,MIN(2*prev_timeout,(unsigned int)cfg->T2));
belle_sip_message("nict_on_timer_E: sending retransmission"); belle_sip_message("nict_on_timer_E: sending retransmission");
belle_sip_channel_queue_message(base->channel,(belle_sip_message_t*)base->request); belle_sip_channel_queue_message(base->channel,(belle_sip_message_t*)base->request);
} }
......
...@@ -40,6 +40,7 @@ typedef long long int64_t; ...@@ -40,6 +40,7 @@ typedef long long int64_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
#define strcasecmp(a,b) _stricmp(a,b) #define strcasecmp(a,b) _stricmp(a,b)
#define snprintf _snprintf #define snprintf _snprintf
#define strdup _strdup
#else #else
#include <stdint.h> #include <stdint.h>
#endif #endif
......
...@@ -134,7 +134,9 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR(belle_sip_tls_channel_t)= ...@@ -134,7 +134,9 @@ BELLE_SIP_INSTANCIATE_CUSTOM_VPTR(belle_sip_tls_channel_t)=
static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){ static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){
belle_sip_tls_channel_t* channel=(belle_sip_tls_channel_t*)obj; belle_sip_tls_channel_t* channel=(belle_sip_tls_channel_t*)obj;
socklen_t addrlen=sizeof(channel->ss); socklen_t addrlen=sizeof(channel->ss);
#if HAVE_GNUTLS || HAVE_OPENSSL
int result; int result;
#endif
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
char ssl_error_string[128]; char ssl_error_string[128];
#endif /*HAVE_OPENSSL*/ #endif /*HAVE_OPENSSL*/
...@@ -205,8 +207,8 @@ static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){ ...@@ -205,8 +207,8 @@ static int tls_process_data(belle_sip_channel_t *obj,unsigned int revents){
belle_sip_channel_t * belle_sip_channel_new_tls(belle_sip_tls_listening_point_t *lp,const char *bindip, int localport, const char *dest, int port){ belle_sip_channel_t * belle_sip_channel_new_tls(belle_sip_tls_listening_point_t *lp,const char *bindip, int localport, const char *dest, int port){
belle_sip_tls_channel_t *obj=belle_sip_object_new(belle_sip_tls_channel_t); belle_sip_tls_channel_t *obj=belle_sip_object_new(belle_sip_tls_channel_t);
belle_sip_channel_t* channel=(belle_sip_channel_t*)obj; belle_sip_channel_t* channel=(belle_sip_channel_t*)obj;
#ifdef HAVE_GNUTLS
int result; int result;
#ifdef HAVE_GNUTLS
const char* err_pos; const char* err_pos;
result = gnutls_init (&obj->session, GNUTLS_CLIENT); result = gnutls_init (&obj->session, GNUTLS_CLIENT);
if (result<0) { if (result<0) {
...@@ -237,7 +239,9 @@ belle_sip_channel_t * belle_sip_channel_new_tls(belle_sip_tls_listening_point_t ...@@ -237,7 +239,9 @@ belle_sip_channel_t * belle_sip_channel_new_tls(belle_sip_tls_listening_point_t
,((belle_sip_listening_point_t*)lp)->stack ,((belle_sip_listening_point_t*)lp)->stack
,bindip,localport,dest,port); ,bindip,localport,dest,port);
return (belle_sip_channel_t*)obj; return (belle_sip_channel_t*)obj;
#ifdef HAVE_GNUTLS
error: error:
#endif
belle_sip_error("Cannot create tls channel to [%s://%s:%i]",belle_sip_channel_get_transport_name(channel),channel->peer_name,channel->peer_port); belle_sip_error("Cannot create tls channel to [%s://%s:%i]",belle_sip_channel_get_transport_name(channel),channel->peer_name,channel->peer_port);
belle_sip_object_unref(obj); belle_sip_object_unref(obj);
return NULL; return NULL;
......
...@@ -80,7 +80,7 @@ belle_sip_request_t* build_request(belle_sip_stack_t * stack ...@@ -80,7 +80,7 @@ belle_sip_request_t* build_request(belle_sip_stack_t * stack
belle_sip_request_t *req; belle_sip_request_t *req;
belle_sip_uri_t* req_uri; belle_sip_uri_t* req_uri;
belle_sip_header_contact_t* contact_header; belle_sip_header_contact_t* contact_header;
BELLESIP_UNUSED(stack);
from_header = belle_sip_header_from_create(from,BELLE_SIP_RANDOM_TAG); from_header = belle_sip_header_from_create(from,BELLE_SIP_RANDOM_TAG);
to_header = belle_sip_header_to_create(to,NULL); to_header = belle_sip_header_to_create(to,NULL);
...@@ -111,9 +111,13 @@ static belle_sip_response_t* ok_response; ...@@ -111,9 +111,13 @@ static belle_sip_response_t* ok_response;
static belle_sip_server_transaction_t* inserv_transaction; static belle_sip_server_transaction_t* inserv_transaction;
static void process_dialog_terminated(void *user_ctx, const belle_sip_dialog_terminated_event_t *event){ static void process_dialog_terminated(void *user_ctx, const belle_sip_dialog_terminated_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_dialog_terminated not implemented yet"); belle_sip_message("process_dialog_terminated not implemented yet");
} }
static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){ static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_io_error not implemented yet"); belle_sip_message("process_io_error not implemented yet");
} }
static void caller_process_request_event(void *user_ctx, const belle_sip_request_event_t *event) { static void caller_process_request_event(void *user_ctx, const belle_sip_request_event_t *event) {
...@@ -235,6 +239,7 @@ static void callee_process_response_event(void *user_ctx, const belle_sip_respon ...@@ -235,6 +239,7 @@ static void callee_process_response_event(void *user_ctx, const belle_sip_respon
} }
static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event) { static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event) {
BELLESIP_UNUSED(user_ctx);
/* belle_sip_client_transaction_t* client_transaction = belle_sip_timeout_event_get_client_transaction(event); /* belle_sip_client_transaction_t* client_transaction = belle_sip_timeout_event_get_client_transaction(event);
SalOp* op = (SalOp*)belle_sip_transaction_get_application_data(BELLE_SIP_TRANSACTION(client_transaction)); SalOp* op = (SalOp*)belle_sip_transaction_get_application_data(BELLE_SIP_TRANSACTION(client_transaction));
if (op->callbacks.process_timeout) { if (op->callbacks.process_timeout) {
...@@ -244,6 +249,7 @@ static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *eve ...@@ -244,6 +249,7 @@ static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *eve
} }
} }
static void process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event) { static void process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event) {
BELLESIP_UNUSED(user_ctx);
/* belle_sip_client_transaction_t* client_transaction = belle_sip_transaction_terminated_event_get_client_transaction(event); /* belle_sip_client_transaction_t* client_transaction = belle_sip_transaction_terminated_event_get_client_transaction(event);
SalOp* op = (SalOp*)belle_sip_transaction_get_application_data(client_transaction); SalOp* op = (SalOp*)belle_sip_transaction_get_application_data(client_transaction);
if (op->calbacks.process_transaction_terminated) { if (op->calbacks.process_transaction_terminated) {
...@@ -345,7 +351,7 @@ static void simple_call(void){ ...@@ -345,7 +351,7 @@ static void simple_call(void){
do_simple_call(); do_simple_call();
} }
static void simple_call_with_delay(){ static void simple_call_with_delay(void){
belle_sip_stack_set_tx_delay(stack,2000); belle_sip_stack_set_tx_delay(stack,2000);
do_simple_call(); do_simple_call();
belle_sip_stack_set_tx_delay(stack,0); belle_sip_stack_set_tx_delay(stack,0);
......
...@@ -521,12 +521,12 @@ void test_header_allow(void) { ...@@ -521,12 +521,12 @@ void test_header_allow(void) {
belle_sip_object_unref(BELLE_SIP_OBJECT(L_allow)); belle_sip_object_unref(BELLE_SIP_OBJECT(L_allow));
} }
static void test_header_address_with_error() { static void test_header_address_with_error(void) {
belle_sip_header_address_t* laddress = belle_sip_header_address_parse("sip:liblinphone_tester@=auth1.example.org"); belle_sip_header_address_t* laddress = belle_sip_header_address_parse("sip:liblinphone_tester@=auth1.example.org");
CU_ASSERT_PTR_NULL(laddress); CU_ASSERT_PTR_NULL(laddress);
} }
static void test_header_address() { static void test_header_address(void) {
belle_sip_uri_t* L_uri; belle_sip_uri_t* L_uri;
belle_sip_header_address_t* laddress = belle_sip_header_address_parse("\"toto\" <sip:liblinphone_tester@81.56.11.2:5060>"); belle_sip_header_address_t* laddress = belle_sip_header_address_parse("\"toto\" <sip:liblinphone_tester@81.56.11.2:5060>");
CU_ASSERT_PTR_NOT_NULL_FATAL(laddress); CU_ASSERT_PTR_NOT_NULL_FATAL(laddress);
......
...@@ -190,7 +190,7 @@ static void testOptionMessage(void) { ...@@ -190,7 +190,7 @@ static void testOptionMessage(void) {
belle_sip_object_unref(message); belle_sip_object_unref(message);
} }
static void test_extract_source() { static void test_extract_source(void) {
const char * invite_1="INVITE sip:jehan@81.56.113.2:50343;transport=tcp;line=f18e0009dd6cc43 SIP/2.0\r\n" const char * invite_1="INVITE sip:jehan@81.56.113.2:50343;transport=tcp;line=f18e0009dd6cc43 SIP/2.0\r\n"
"Via: SIP/2.0/TCP 37.59.129.73;branch=z9hG4bK.SKvK9U327e8mU68XUv5rt144pg\r\n" "Via: SIP/2.0/TCP 37.59.129.73;branch=z9hG4bK.SKvK9U327e8mU68XUv5rt144pg\r\n"
"Via: SIP/2.0/UDP 192.168.1.12:15060;rport=15060;branch=z9hG4bK1596944937;received=81.56.113.2\r\n" "Via: SIP/2.0/UDP 192.168.1.12:15060;rport=15060;branch=z9hG4bK1596944937;received=81.56.113.2\r\n"
......
...@@ -127,7 +127,7 @@ static void server_process_request_event(void *obj, const belle_sip_request_even ...@@ -127,7 +127,7 @@ static void server_process_request_event(void *obj, const belle_sip_request_even
} }
case digest_auth: case digest_auth:
case digest: { case digest: {
if ((authorization=belle_sip_message_get_header_by_type(req,belle_sip_header_authorization_t))){ if ((authorization=belle_sip_message_get_header_by_type(req,belle_sip_header_authorization_t)) != NULL){
qop=belle_sip_header_authorization_get_qop(authorization); qop=belle_sip_header_authorization_get_qop(authorization);
if (qop && strcmp(qop,"auth")==0) { if (qop && strcmp(qop,"auth")==0) {
...@@ -216,6 +216,7 @@ static void client_process_response_event(void *obj, const belle_sip_response_ev ...@@ -216,6 +216,7 @@ static void client_process_response_event(void *obj, const belle_sip_response_ev
// belle_sip_message("process_transaction_terminated"); // belle_sip_message("process_transaction_terminated");
//} //}
static void client_process_auth_requested(void *obj, belle_sip_auth_event_t *event){ static void client_process_auth_requested(void *obj, belle_sip_auth_event_t *event){
BELLESIP_UNUSED(obj);
belle_sip_message("process_auth_requested requested for [%s@%s]" belle_sip_message("process_auth_requested requested for [%s@%s]"
,belle_sip_auth_event_get_username(event) ,belle_sip_auth_event_get_username(event)
,belle_sip_auth_event_get_realm(event)); ,belle_sip_auth_event_get_realm(event));
...@@ -227,6 +228,7 @@ static void belle_sip_refresher_listener ( const belle_sip_refresher_t* refreshe ...@@ -227,6 +228,7 @@ static void belle_sip_refresher_listener ( const belle_sip_refresher_t* refreshe
,unsigned int status_code ,unsigned int status_code
,const char* reason_phrase) { ,const char* reason_phrase) {
endpoint_t* endpoint = (endpoint_t*)user_pointer; endpoint_t* endpoint = (endpoint_t*)user_pointer;
BELLESIP_UNUSED(refresher);
belle_sip_message("belle_sip_refresher_listener [%i] reason [%s]",status_code,reason_phrase); belle_sip_message("belle_sip_refresher_listener [%i] reason [%s]",status_code,reason_phrase);
switch (status_code) { switch (status_code) {
case 200:endpoint->stat.refreshOk++; break; case 200:endpoint->stat.refreshOk++; break;
...@@ -338,7 +340,7 @@ static void register_test_with_param(unsigned char expire_in_contact,auth_mode_t ...@@ -338,7 +340,7 @@ static void register_test_with_param(unsigned char expire_in_contact,auth_mode_t
destroy_endpoint(server); destroy_endpoint(server);
} }
static void subscribe_test() { static void subscribe_test(void) {
belle_sip_listener_callbacks_t client_callbacks; belle_sip_listener_callbacks_t client_callbacks;
belle_sip_listener_callbacks_t server_callbacks; belle_sip_listener_callbacks_t server_callbacks;
belle_sip_request_t* req; belle_sip_request_t* req;
...@@ -413,17 +415,17 @@ static void subscribe_test() { ...@@ -413,17 +415,17 @@ static void subscribe_test() {
destroy_endpoint(server); destroy_endpoint(server);
} }
static void register_expires_header() { static void register_expires_header(void) {
register_test_with_param(0,none); register_test_with_param(0,none);
} }
static void register_expires_in_contact() { static void register_expires_in_contact(void) {
register_test_with_param(1,none); register_test_with_param(1,none);
} }
static void register_expires_header_digest() { static void register_expires_header_digest(void) {
register_test_with_param(0,digest); register_test_with_param(0,digest);
} }
static void register_expires_in_contact_header_digest_auth() { static void register_expires_in_contact_header_digest_auth(void) {
register_test_with_param(1,digest_auth); register_test_with_param(1,digest_auth);
} }
......
...@@ -31,20 +31,27 @@ belle_sip_provider_t *prov; ...@@ -31,20 +31,27 @@ belle_sip_provider_t *prov;
static belle_sip_listener_t* l; static belle_sip_listener_t* l;
static void process_dialog_terminated(void *user_ctx, const belle_sip_dialog_terminated_event_t *event){ static void process_dialog_terminated(void *user_ctx, const belle_sip_dialog_terminated_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_dialog_terminated called"); belle_sip_message("process_dialog_terminated called");
} }
static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){ static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_warning("process_io_error"); belle_sip_warning("process_io_error");
belle_sip_main_loop_quit(belle_sip_stack_get_main_loop(stack)); belle_sip_main_loop_quit(belle_sip_stack_get_main_loop(stack));
/*CU_ASSERT(CU_FALSE);*/ /*CU_ASSERT(CU_FALSE);*/
} }
static void process_request_event(void *user_ctx, const belle_sip_request_event_t *event){ static void process_request_event(void *user_ctx, const belle_sip_request_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_request_event"); belle_sip_message("process_request_event");
} }
belle_sip_request_t* authorized_request; belle_sip_request_t* authorized_request;
static void process_response_event(void *user_ctx, const belle_sip_response_event_t *event){ static void process_response_event(void *user_ctx, const belle_sip_response_event_t *event){
int status; int status;
belle_sip_request_t* request; belle_sip_request_t* request;
BELLESIP_UNUSED(user_ctx);
CU_ASSERT_PTR_NOT_NULL_FATAL(belle_sip_response_event_get_response(event)); CU_ASSERT_PTR_NOT_NULL_FATAL(belle_sip_response_event_get_response(event));
belle_sip_message("process_response_event [%i] [%s]" belle_sip_message("process_response_event [%i] [%s]"
,status=belle_sip_response_get_status_code(belle_sip_response_event_get_response(event)) ,status=belle_sip_response_get_status_code(belle_sip_response_event_get_response(event))
...@@ -71,12 +78,17 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even ...@@ -71,12 +78,17 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
} }
} }
static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event){ static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_timeout"); belle_sip_message("process_timeout");
} }
static void process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event){ static void process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("process_transaction_terminated"); belle_sip_message("process_transaction_terminated");
} }
static void process_auth_requested(void *user_ctx, belle_sip_auth_event_t *event){ static void process_auth_requested(void *user_ctx, belle_sip_auth_event_t *event){
BELLESIP_UNUSED(user_ctx);
belle_sip_message("process_auth_requested requested for [%s@%s]" belle_sip_message("process_auth_requested requested for [%s@%s]"
,belle_sip_auth_event_get_username(event) ,belle_sip_auth_event_get_username(event)
,belle_sip_auth_event_get_realm(event)); ,belle_sip_auth_event_get_realm(event));
...@@ -244,7 +256,7 @@ static void stateless_register_tcp(void){ ...@@ -244,7 +256,7 @@ static void stateless_register_tcp(void){
static void stateful_register_udp(void){ static void stateful_register_udp(void){
register_test(NULL,1); register_test(NULL,1);
} }
static void stateful_register_udp_with_keep_alive() { static void stateful_register_udp_with_keep_alive(void) {
belle_sip_listening_point_set_keep_alive(belle_sip_provider_get_listening_point(prov,"udp"),200); belle_sip_listening_point_set_keep_alive(belle_sip_provider_get_listening_point(prov,"udp"),200);
register_test(NULL,1); register_test(NULL,1);
belle_sip_main_loop_sleep(belle_sip_stack_get_main_loop(stack),500); belle_sip_main_loop_sleep(belle_sip_stack_get_main_loop(stack),500);
...@@ -276,13 +288,17 @@ static void stateful_register_tls(void){ ...@@ -276,13 +288,17 @@ static void stateful_register_tls(void){
static void bad_req_process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){ static void bad_req_process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("bad_req_process_io_error not implemented yet"); belle_sip_message("bad_req_process_io_error not implemented yet");
} }
static void bad_req_process_response_event(void *user_ctx, const belle_sip_response_event_t *event){ static void bad_req_process_response_event(void *user_ctx, const belle_sip_response_event_t *event){
BELLESIP_UNUSED(user_ctx);
BELLESIP_UNUSED(event);
belle_sip_message("bad_req_process_response_event not implemented yet"); belle_sip_message("bad_req_process_response_event not implemented yet");
} }
static void test_bad_request() { static void test_bad_request(void) {
belle_sip_request_t *req; belle_sip_request_t *req;
belle_sip_listener_t *bad_req_listener; belle_sip_listener_t *bad_req_listener;
belle_sip_client_transaction_t *t; belle_sip_client_transaction_t *t;
...@@ -320,7 +336,7 @@ static void test_bad_request() { ...@@ -320,7 +336,7 @@ static void test_bad_request() {
belle_sip_provider_remove_sip_listener(prov,bad_req_listener); belle_sip_provider_remove_sip_listener(prov,bad_req_listener);
belle_sip_object_unref(bad_req_listener); belle_sip_object_unref(bad_req_listener);
} }
static void test_register_authenticate() { static void test_register_authenticate(void) {
belle_sip_request_t *reg; belle_sip_request_t *reg;
number_of_challenge=0; number_of_challenge=0;
authorized_request=NULL; authorized_request=NULL;
......
...@@ -73,6 +73,7 @@ static void destroy_endpoint(endpoint_t *endpoint) { ...@@ -73,6 +73,7 @@ static void destroy_endpoint(endpoint_t *endpoint) {
static void resolve_done(void *data, const char *name, struct addrinfo *res) { static void resolve_done(void *data, const char *name, struct addrinfo *res) {
endpoint_t *client = (endpoint_t *)data; endpoint_t *client = (endpoint_t *)data;
BELLESIP_UNUSED(name);
client->resolve_done = 1; client->resolve_done = 1;
if (res) { if (res) {
client->result = res; client->result = res;
......
...@@ -122,7 +122,7 @@ static void test_maddr(void) { ...@@ -122,7 +122,7 @@ static void test_maddr(void) {
belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri)); belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
} }
static void test_uri_parameters () { static void test_uri_parameters (void) {
char* l_raw_uri; char* l_raw_uri;
belle_sip_uri_t* L_tmp; belle_sip_uri_t* L_tmp;
belle_sip_uri_t * L_uri = belle_sip_uri_parse("sip:192.168.0.1;ttl=12"); belle_sip_uri_t * L_uri = belle_sip_uri_parse("sip:192.168.0.1;ttl=12");
......
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
#include "belle-sip/belle-sip.h" #include "belle-sip/belle-sip.h"
static int init_cast_suite(){ static int init_cast_suite(void){
return 0; return 0;
} }
static int cleanup_cast_suite(){ static int cleanup_cast_suite(void){
return 0; return 0;
} }
static void cast_test(){ static void cast_test(void){
belle_sip_stack_t *stack=belle_sip_stack_new(NULL); belle_sip_stack_t *stack=belle_sip_stack_new(NULL);
belle_sip_listening_point_t *lp=belle_sip_stack_create_listening_point(stack,"0.0.0.0",7060,"UDP"); belle_sip_listening_point_t *lp=belle_sip_stack_create_listening_point(stack,"0.0.0.0",7060,"UDP");
belle_sip_provider_t *provider; belle_sip_provider_t *provider;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment