Commit d7bd4d9e authored by Simon Morlat's avatar Simon Morlat

fix compilation errors

parent 43764778
......@@ -21,6 +21,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
......
......@@ -346,7 +346,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;
int pos=0;
unsigned int 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,
......
......@@ -41,7 +41,7 @@ static void belle_sip_parameters_clone(belle_sip_parameters_t *params, const bel
}
}
belle_sip_error_code belle_sip_parameters_marshal(const belle_sip_parameters_t* params, char* buff,unsigned int buff_size,unsigned int *offset) {
belle_sip_error_code belle_sip_parameters_marshal(const belle_sip_parameters_t* params, char* buff,size_t buff_size,unsigned int *offset) {
belle_sip_list_t* list=params->param_list;
belle_sip_error_code error=BELLE_SIP_OK;
for(;list!=NULL;list=list->next){
......
......@@ -384,9 +384,10 @@ static void test_overflow(void){
belle_sip_list_t *mds;
belle_sdp_media_description_t *vmd;
int i;
const int buffsize=1024;
const unsigned int orig_buffsize=1024;
unsigned int buffsize=orig_buffsize;
char *buffer=belle_sip_malloc0(buffsize);
int err;
belle_sip_error_code err;
sdp=belle_sdp_session_description_parse(big_sdp);
CU_ASSERT_PTR_NOT_NULL(sdp);
......@@ -397,9 +398,10 @@ static void test_overflow(void){
for(i=0;i<16;i++){
belle_sdp_media_description_add_attribute(vmd,belle_sdp_attribute_create("candidate","2 1 UDP 1694498815 82.65.223.97 9078 typ srflx raddr 192.168.0.2 rport 9078"));
}
err=belle_sip_object_marshal(BELLE_SIP_OBJECT(sdp),buffer,0,buffsize);
belle_sip_message("marshal size is %i",err);
CU_ASSERT_TRUE(err==buffsize);
err=belle_sip_object_marshal(BELLE_SIP_OBJECT(sdp),buffer,0,&buffsize);
CU_ASSERT_TRUE(err==BELLE_SIP_OK);
belle_sip_message("marshal size is %i",(int)buffsize);
CU_ASSERT_TRUE(orig_buffsize==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