Some type casts for clang.
FossilOrigin-Name: a050a29fc6795aee5f4592347026bfb9d7999972becacf1ddcec537213b84fb8
This commit is contained in:
parent
6a11cd0b2c
commit
cd484f61e9
@ -13,8 +13,8 @@ GNUTLS_VERSION=3.3.9
|
||||
USE_CONTRIB_GNUTLS=0
|
||||
|
||||
# Compiler to use
|
||||
#CC=clang
|
||||
CC=gcc
|
||||
CC=clang
|
||||
#CC=gcc
|
||||
#CC=mips-openwrt-linux-uclibc-gcc
|
||||
#LD=mips-openwrt-linux-uclibc-ld
|
||||
#AR=mips-openwrt-linux-uclibc-ar
|
||||
|
@ -67,7 +67,7 @@ extern int bstr_to_str(char *dst, bstr_t str,char * def);
|
||||
|
||||
typedef uint8_t *bstr16_t;
|
||||
#define bstr16_len(s) ( *((uint16_t*)(s)) )
|
||||
#define bstr16_data(s) ((s)+2)
|
||||
#define bstr16_data(s) (((uint8_t*)s)+2)
|
||||
#define bstr16_size(l) (l+2)
|
||||
#define BSTR16_MAX_LEN (0xffff-2)
|
||||
|
||||
|
@ -502,9 +502,9 @@ int cw_format_item(char *dst,mbag_item_t * item)
|
||||
{
|
||||
*dst=0;
|
||||
if (item->type==MBAG_BSTR16){
|
||||
strncpy(dst,bstr16_data(item->data),bstr16_len(item->data));
|
||||
*(dst+bstr16_len(item->data))=0;
|
||||
return bstr16_len(item->data);
|
||||
strncpy(dst,(char*)bstr16_data(item->data),bstr16_len(item->data));
|
||||
*(dst+bstr16_len(item->data))=0;
|
||||
return bstr16_len(item->data);
|
||||
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ static int mbag_bstr16str(void *item,char *dst)
|
||||
static int mbag_strstr(void *item,char *dst)
|
||||
{
|
||||
mbag_item_t *i= item;
|
||||
return sprintf(dst, "%s", i->data);
|
||||
return sprintf(dst, "%s", (char*)i->data);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user