|
From: Peter K. <pk...@us...> - 2001-03-26 12:58:27
|
The following file was modified in apps/bluetooth/sdp_server:
Name Old version New version Comment
---- ----------- ----------- -------
sdp_server.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Removed unnecessary casts when calling malloc().
The diff of the modified file(s):
--- sdp_server.c 2001/03/26 12:25:24 1.20
+++ sdp_server.c 2001/03/26 12:58:25 1.21
@@ -252,7 +252,7 @@
unsigned char *hex_data;
=20
m_size =3D strlen(char_data) / 2;=20
- hex_data =3D (char*) malloc(m_size);
+ hex_data =3D malloc(m_size);
D_MEM("---> malloc%d %ld bytes at 0x%8p", malloc_dbg++, m_size, hex_data=
);
=20
/* FIXME, How will this work when using big endian ? */
@@ -288,7 +288,7 @@
des_pos[i] =3D NULL;
}
=20=20=20
- tmp_list =3D (char*) malloc(256);
+ tmp_list =3D malloc(256);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, 256, tmp_list);
=20
/* While we have not reached the end of the string */
@@ -475,7 +475,7 @@
{
tmp =3D s_hdl->hdl_list;
s_hdl->block_len =3D s_hdl->hdl_list_len + s_hdl->block_len * 2;
- s_hdl->hdl_list =3D (unsigned int*) malloc(s_hdl->block_len);
+ s_hdl->hdl_list =3D malloc(s_hdl->block_len);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, s_hdl->bloc=
k_len, s_hdl->hdl_list);
=20
memcpy(s_hdl->hdl_list, tmp, s_hdl->hdl_list_len);
@@ -528,7 +528,7 @@
=20
s_hdl.hdl_list_len =3D 0;
s_hdl.block_len =3D 16 * sizeof(unsigned int);
- s_hdl.hdl_list =3D (unsigned int*) malloc(s_hdl.block_len);
+ s_hdl.hdl_list =3D malloc(s_hdl.block_len);
=20=20=20
p =3D XML_ParserCreate(NULL);
XML_SetElementHandler(p, get_more_rec_hdl_start, get_more_rec_hdl_end);
@@ -544,7 +544,7 @@
tmp_len =3D s_hdl.hdl_list_len + sizeof(unsigned int);
s_hdl.block_len +=3D 1;
=20=20=20=20=20
- s_hdl.hdl_list =3D (unsigned int*) malloc(tmp_len);
+ s_hdl.hdl_list =3D malloc(tmp_len);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, tmp_len, s_hdl.=
hdl_list);
=20=20=20=20=20
memcpy(s_hdl.hdl_list, tmp, s_hdl.hdl_list_len);
@@ -569,7 +569,7 @@
char *return_sequence;
=20
/* FIXME: But for now 256 bytes will do */
- return_sequence =3D (char*) malloc(256);
+ return_sequence =3D malloc(256);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, 256, return_seque=
nce);
=20=20=20
=20=20=20
@@ -709,7 +709,7 @@
=20
hex_tmp =3D char2hex(char_tmp);
=20
- return_sequence =3D (char*) malloc(len + 2);
+ return_sequence =3D malloc(len + 2);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, len + 2, return_s=
equence);
=20=20=20
return_sequence[0] =3D 0x35;
@@ -1003,7 +1003,7 @@
{
S_FNC("Found %s", attr[i]);
m_size =3D strlen(attr[i] + 1);
- search_hdl->search_attr =3D (char*) malloc(m_size);
+ search_hdl->search_attr =3D malloc(m_size);
D_MEM("---> malloc%d % d bytes at 0x%8p", malloc_dbg++, m_size, =
search_hdl->search_attr);
strcpy(search_hdl->search_attr, attr[i]);
return;
@@ -1022,7 +1022,7 @@
{
S_FNC("Found %s", attr[i + 1]);
m_size =3D strlen(attr[i + 1] + 1);
- search_hdl->search_val =3D (char*) malloc(m_size);
+ search_hdl->search_val =3D malloc(m_size);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, m_size, s=
earch_hdl->search_val);
strcpy(search_hdl->search_val, attr[i + 1]);
return;
@@ -1038,7 +1038,7 @@
(strcmp(search_hdl->search_val, attr[i + 1]) =3D=3D 0))
{
m_size =3D strlen(el) + 1;
- search_hdl->search_name =3D (char*) malloc(m_size);
+ search_hdl->search_name =3D malloc(m_size);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, m_size, sea=
rch_hdl->search_name);
strcpy(search_hdl->search_name, el);
return;
@@ -1115,7 +1115,7 @@
/* Allocate space for all the attribute UUIDs plus the attribute count
in the search_output pointer, */
m_size =3D attr_cnt * 4 + 4;
- search_hdl->search_val =3D (char*) malloc(m_size);
+ search_hdl->search_val =3D malloc(m_size);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, m_size, search_=
hdl->search_val);
memcpy(search_hdl->search_val, &attr_cnt, 4);
for (i =3D 0; attr[i]; i +=3D 2)
@@ -1441,7 +1441,7 @@
bytes */
len -=3D cnt_len;
=20=20=20=20=20
- cont_state_buf =3D (cont_state_struct*) malloc(sizeof(cont_state_struc=
t) + cnt_len);
+ cont_state_buf =3D malloc(sizeof(cont_state_struct) + cnt_len);
D_MEM("---> malloc%d %ld bytes at 0x%8p", malloc_dbg++, sizeof(cont_st=
ate_struct) + cnt_len, cont_state_buf);
=20
cont_state_buf->pdu =3D pkt[0];
@@ -1495,7 +1495,7 @@
bytes */
len -=3D cont_len;
=20=20=20=20
- cont_state_buf =3D (cont_state_struct*) malloc(sizeof(cont_state_struc=
t) + cont_len);
+ cont_state_buf =3D malloc(sizeof(cont_state_struct) + cont_len);
D_MEM("---> malloc%d %ld bytes at 0x%8p", malloc_dbg++, sizeof(cont_st=
ate_struct) + cont_len , cont_state_buf);
=20
cont_state_buf->pdu =3D pkt[0];
@@ -1546,7 +1546,7 @@
the attributes and the continuation state field */
send_len =3D SDP_HDR_SIZE + 2 + 2 + cont_state_buf->len + 1;
=20
- send_buf =3D (unsigned char*) malloc(send_len);
+ send_buf =3D malloc(send_len);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, send_len, sen=
d_buf);
=20
set_sdp_hdr(send_buf, cont_state_buf->pdu, trans_id, send_len - SDP_=
HDR_SIZE);
@@ -1602,7 +1602,7 @@
the attributes and the continuation state field */
send_len =3D SDP_HDR_SIZE + 2 + cont_state_buf->len + 1;
=20
- send_buf =3D (unsigned char*) malloc(send_len);
+ send_buf =3D malloc(send_len);
D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, send_len, sen=
d_buf);
=20
set_sdp_hdr(send_buf, cont_state_buf->pdu, trans_id, send_len - SDP_=
HDR_SIZE);
|