dect
/
libdect
Archived
13
0
Fork 0

ie: return void * in dect_ie_collection_hold macro

The intended use is to store the generic reference in a typed pointer, currently
requiring a cast for every use.

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2009-11-27 23:47:34 +01:00
parent fad722147e
commit 2cb704e18d
6 changed files with 17 additions and 19 deletions

View File

@ -122,7 +122,7 @@ static void mm_locate_ind(struct dect_handle *dh,
printf("MM_LOCATE-ind\n");
priv->locate = (void *)dect_ie_collection_hold(param);
priv->locate = dect_ie_collection_hold(param);
mm_authenticate_req(dh, mme);
}

View File

@ -27,7 +27,7 @@ struct dect_ie_collection {
extern struct dect_ie_collection *__dect_ie_collection_hold(struct dect_ie_collection *iec);
#define dect_ie_collection_hold(iec) __dect_ie_collection_hold(&(iec)->common)
#define dect_ie_collection_hold(iec) ((void *)__dect_ie_collection_hold(&(iec)->common))
extern void __dect_ie_collection_put(const struct dect_handle *dh, struct dect_ie_collection *iec);

View File

@ -392,8 +392,7 @@ extern struct dect_ie_common *dect_ie_alloc(const struct dect_handle *dh,
unsigned int size);
extern void dect_ie_destroy(const struct dect_handle *dh, struct dect_ie_common *ie);
extern struct dect_ie_collection *dect_ie_collection_alloc(const struct dect_handle *dh,
unsigned int size);
extern void *dect_ie_collection_alloc(const struct dect_handle *dh, unsigned int size);
struct dect_msg_buf;
extern enum dect_sfmt_error dect_parse_sfmt_msg(const struct dect_handle *dh,

View File

@ -437,7 +437,7 @@ static void dect_cc_setup_timer(struct dect_handle *dh, struct dect_timer *timer
struct dect_mncc_release_param *param;
cc_debug(call, "setup timer");
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto out;
// release-com
@ -761,7 +761,7 @@ static void dect_mncc_alert_ind(struct dect_handle *dh, struct dect_call *call,
{
struct dect_mncc_alert_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -812,7 +812,7 @@ static void dect_mncc_connect_ind(struct dect_handle *dh, struct dect_call *call
{
struct dect_mncc_connect_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -922,7 +922,7 @@ static void dect_mncc_release_ind(struct dect_handle *dh, struct dect_call *call
{
struct dect_mncc_release_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -955,7 +955,7 @@ static void dect_mncc_release_cfm(struct dect_handle *dh, struct dect_call *call
{
struct dect_mncc_release_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -988,7 +988,7 @@ static void dect_cc_rcv_release_com(struct dect_handle *dh, struct dect_call *ca
else {
struct dect_mncc_release_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto out;
@ -1037,7 +1037,7 @@ static void dect_mncc_info_ind(struct dect_handle *dh, struct dect_call *call,
{
struct dect_mncc_info_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -1122,7 +1122,7 @@ static void dect_mncc_setup_ind(struct dect_handle *dh,
{
struct dect_mncc_setup_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;

View File

@ -114,8 +114,7 @@ void dect_ie_list_put(const struct dect_handle *dh, struct dect_ie_list *iel)
* Information Element collections
*/
struct dect_ie_collection *dect_ie_collection_alloc(const struct dect_handle *dh,
unsigned int size)
void *dect_ie_collection_alloc(const struct dect_handle *dh, unsigned int size)
{
struct dect_ie_collection *iec;

View File

@ -378,7 +378,7 @@ static void dect_mm_rcv_authentication_reply(struct dect_handle *dh,
&msg.common, mb) < 0)
return;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto err1;
@ -412,7 +412,7 @@ static void dect_mm_rcv_authentication_reject(struct dect_handle *dh,
&msg.common, mb) < 0)
return;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto err1;
@ -536,7 +536,7 @@ static void dect_mm_rcv_access_rights_request(struct dect_handle *dh,
&msg.common, mb) < 0)
return;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto err1;
@ -614,7 +614,7 @@ static void dect_mm_locate_ind(struct dect_handle *dh,
{
struct dect_mm_locate_param *param;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
return;
@ -702,7 +702,7 @@ static void dect_mm_rcv_temporary_identity_assign_rej(struct dect_handle *dh,
&msg.common, mb) < 0)
return;
param = (void *)dect_ie_collection_alloc(dh, sizeof(*param));
param = dect_ie_collection_alloc(dh, sizeof(*param));
if (param == NULL)
goto err1;