Commit 589d000c authored by Simon Morlat's avatar Simon Morlat

fix compilation warnings

parent f931682f
......@@ -449,7 +449,7 @@ void belle_sip_header_user_agent_add_product(belle_sip_header_user_agent_t* user
user_agent->products = belle_sip_list_append(user_agent->products ,belle_sip_strdup(product));
}
int belle_sip_header_user_agent_get_products_as_string(const belle_sip_header_user_agent_t* user_agent,char* value,unsigned int value_size) {
unsigned int result = 0;
size_t result = 0;
belle_sip_list_t* list = user_agent->products;
for(;list!=NULL;list=list->next){
belle_sip_snprintf(value,value_size,&result,"%s ",(const char *)list->data);
......
......@@ -1178,7 +1178,7 @@ catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
header_p_preferred_identity returns [belle_sip_header_p_preferred_identity_t* ret]
: {IS_HEADER_NAMED(P-Preferred-Identity,NULL)}? token /*"P-Preferred-Identity"*/
hcolon header_address_base[belle_sip_header_p_preferred_identity_new()] {$ret=$header_address_base.ret;};
hcolon header_address_base[(belle_sip_header_address_t*)belle_sip_header_p_preferred_identity_new()] {$ret=(belle_sip_header_p_preferred_identity_t*)$header_address_base.ret;};
......
......@@ -279,14 +279,14 @@ static belle_sip_error_code checked_marshal(belle_sip_object_vptr_t *vptr, belle
written=i-initial_offset;
if (error==BELLE_SIP_BUFFER_OVERFLOW){
belle_sip_error("Object of type %s commited a buffer overflow by marshalling %i bytes",
vptr->type_name,*offset-initial_offset);
vptr->type_name,(int)(*offset-initial_offset));
} else if (error!=BELLE_SIP_OK){
belle_sip_error("Object of type %s produced an error during marshalling: %i",
vptr->type_name,error);
}
if (written!=(*offset-initial_offset) && written!=(buff_size-initial_offset-1)){ /*this is because snprintf won't allow you to write a non null character at the end of the buffer*/
belle_sip_fatal("Object of type %s marshalled %i bytes but said it marshalled %i bytes !",
vptr->type_name,written,*offset-initial_offset);
vptr->type_name,(int)written,(int)(*offset-initial_offset));
}
memcpy(buff+initial_offset,p+initial_offset,*offset-initial_offset);
belle_sip_free(p);
......@@ -352,7 +352,7 @@ char * _belle_sip_object_describe_type(belle_sip_object_vptr_t *vptr){
const int maxbufsize=2048;
char *ret=belle_sip_malloc(maxbufsize);
belle_sip_object_vptr_t *it;
unsigned int pos=0;
size_t pos=0;
belle_sip_list_t *l=NULL,*elem;
belle_sip_snprintf(ret,maxbufsize,&pos,"Ownership:\n");
belle_sip_snprintf(ret,maxbufsize,&pos,"\t%s is created initially %s\n",vptr->type_name,
......
......@@ -473,7 +473,7 @@ static void _send_message(belle_sip_channel_t *obj, belle_sip_message_t *msg){
if (ret<0){
belle_sip_error("channel [%p]: could not send [%i] bytes from [%s://%s:%i] to [%s:%i]" ,obj
,len
,(int)len
,belle_sip_channel_get_transport_name(obj)
,obj->local_ip
,obj->local_port
......@@ -495,7 +495,7 @@ static void _send_message(belle_sip_channel_t *obj, belle_sip_message_t *msg){
,obj->peer_name
,obj->peer_port
,ret
,len
,(int)len
,buffer);
}
}
......
......@@ -400,7 +400,7 @@ static void test_overflow(void){
}
CU_ASSERT_EQUAL(belle_sip_object_marshal(BELLE_SIP_OBJECT(sdp),buffer,buffsize,&offset),BELLE_SIP_BUFFER_OVERFLOW);
belle_sip_message("marshal size is %i",offset);
belle_sip_message("marshal size is %i",(int)offset);
CU_ASSERT_TRUE(offset==buffsize);
belle_sip_object_unref(sdp);
belle_sip_free(buffer);
......
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