libtcore: fix calloc parameters order
authorRonald Tessier <ronald.tessier@linux.intel.com>
Wed, 9 Jan 2013 16:30:40 +0000 (17:30 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 09:03:05 +0000 (18:03 +0900)
void *calloc(size_t nmemb, size_t size);
The calloc() function  allocates memory for an array of nmemb elements
of size bytes each and returns a pointer to the allocated memory.

23 files changed:
src/at.c
src/co_call.c
src/co_context.c
src/co_gps.c
src/co_modem.c
src/co_network.c
src/co_phonebook.c
src/co_ps.c
src/co_sap.c
src/co_sat.c
src/co_sim.c
src/co_sms.c
src/co_ss.c
src/communicator.c
src/core_object.c
src/hal.c
src/mux.c
src/plugin.c
src/queue.c
src/server.c
src/storage.c
src/udev.c
src/user_request.c

index d134e06..bde8ee1 100755 (executable)
--- a/src/at.c
+++ b/src/at.c
@@ -134,7 +134,7 @@ static struct tcore_at_response* _response_new()
 {
        struct tcore_at_response *resp;
 
-       resp = calloc(sizeof(struct tcore_at_response), 1);
+       resp = calloc(1, sizeof(struct tcore_at_response));
        if (!resp)
                return NULL;
 
@@ -326,7 +326,7 @@ TcoreAT* tcore_at_new(TcoreHal *hal)
 {
        TcoreAT *at;
 
-       at = calloc(sizeof(struct tcore_at_type), 1);
+       at = calloc(1, sizeof(struct tcore_at_type));
        if (!at)
                return NULL;
 
@@ -413,7 +413,7 @@ TReturn tcore_at_add_notification(TcoreAT *at, const char *prefix,
 
        noti = g_hash_table_lookup(at->unsolicited_table, prefix);
        if (!noti) {
-               noti = calloc(sizeof(struct _notification), 1);
+               noti = calloc(1, sizeof(struct _notification));
                if (!noti)
                        return TCORE_RETURN_ENOMEM;
 
@@ -426,7 +426,7 @@ TReturn tcore_at_add_notification(TcoreAT *at, const char *prefix,
        if (noti->type_pdu != pdu)
                return TCORE_RETURN_EINVAL;
 
-       item = calloc(sizeof(struct _notification_callback), 1);
+       item = calloc(1, sizeof(struct _notification_callback));
        if (!item)
                return TCORE_RETURN_ENOMEM;
 
@@ -548,7 +548,7 @@ TcoreATRequest* tcore_at_request_new(const char *cmd, const char *prefix, enum t
        if (strlen(cmd) < 1)
                return NULL;
 
-       req = calloc(sizeof(struct tcore_at_request), 1);
+       req = calloc(1, sizeof(struct tcore_at_request));
        if (!req)
                return NULL;
 
index 29c061d..84977e8 100644 (file)
@@ -85,7 +85,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -1302,7 +1302,7 @@ void tcore_call_override_ops(CoreObject *o,
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_CALL);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -1335,7 +1335,7 @@ CoreObject *tcore_call_new(TcorePlugin *p, const char *name, struct tcore_call_o
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -1364,7 +1364,7 @@ CoreObject *tcore_call_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 101339f..481a532 100644 (file)
@@ -83,7 +83,7 @@ CoreObject *tcore_context_new(TcorePlugin *p, const char *name, TcoreHal *hal)
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -114,7 +114,7 @@ CoreObject *tcore_context_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 15852fa..36d8c05 100644 (file)
@@ -41,7 +41,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -104,7 +104,7 @@ void tcore_gps_override_ops(CoreObject *o, struct tcore_gps_operations *gps_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_GPS);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -130,7 +130,7 @@ CoreObject *tcore_gps_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -158,7 +158,7 @@ CoreObject *tcore_gps_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 8070b62..f0ac61f 100755 (executable)
@@ -56,7 +56,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -189,7 +189,7 @@ void tcore_modem_override_ops(CoreObject *o, struct tcore_modem_operations *mode
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_MODEM);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -214,7 +214,8 @@ CoreObject *tcore_modem_new(TcorePlugin *p, const char *name,
        o = tcore_object_new(p, name, hal);
        if (!o)
                return NULL;
-       po = calloc(sizeof(struct private_object_data), 1);
+
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -242,7 +243,7 @@ CoreObject *tcore_modem_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index b6db77d..212ee88 100644 (file)
@@ -282,7 +282,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -299,7 +299,7 @@ void tcore_network_override_ops(CoreObject *o, struct tcore_network_operations *
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_NETWORK);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -325,7 +325,7 @@ CoreObject *tcore_network_new(TcorePlugin *plugin, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -354,7 +354,7 @@ CoreObject *tcore_network_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index b44b546..a81f621 100644 (file)
@@ -132,7 +132,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -180,7 +180,7 @@ struct tel_phonebook_support_list* tcore_phonebook_get_support_list(CoreObject *
        struct private_object_data *po = NULL;
        CORE_OBJECT_CHECK_RETURN(o, CORE_OBJECT_TYPE_PHONEBOOK, NULL);
        po = tcore_object_ref_object(o);
-       tmp = calloc(sizeof(struct tel_phonebook_support_list), 1);
+       tmp = calloc(1, sizeof(struct tel_phonebook_support_list));
        memcpy(tmp, &po->support_list, sizeof(struct tel_phonebook_support_list));
        return tmp;
 }
@@ -216,7 +216,7 @@ void tcore_phonebook_override_ops(CoreObject *o, struct tcore_phonebook_operatio
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_PHONEBOOK);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -242,7 +242,7 @@ CoreObject *tcore_phonebook_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -272,7 +272,7 @@ CoreObject *tcore_phonebook_clone(TcorePlugin *p, const char *name, TcoreHal *ha
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index b8efb12..b876710 100644 (file)
@@ -87,7 +87,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -212,7 +212,7 @@ void tcore_ps_override_ops(CoreObject *o, struct tcore_ps_operations *ps_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_PS);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -238,7 +238,7 @@ CoreObject *tcore_ps_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -267,7 +267,7 @@ CoreObject *tcore_ps_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 57a662c..1c844cd 100644 (file)
@@ -148,7 +148,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -178,7 +178,7 @@ void tcore_sap_override_ops(CoreObject *o, struct tcore_sap_operations *sap_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_SAP);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -204,7 +204,7 @@ CoreObject *tcore_sap_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -233,7 +233,7 @@ CoreObject *tcore_sap_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 23029b9..e0b6e9c 100644 (file)
@@ -174,7 +174,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -6871,7 +6871,7 @@ void tcore_sat_override_ops(CoreObject *o, struct tcore_sat_operations *sat_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_SAT);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -6897,7 +6897,7 @@ CoreObject *tcore_sat_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -6926,7 +6926,7 @@ CoreObject *tcore_sat_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 2a51dc1..f8bdb16 100644 (file)
@@ -214,7 +214,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -2415,7 +2415,7 @@ struct tel_sim_imsi* tcore_sim_get_imsi(CoreObject *o)
                dbg("po access fail");
                return NULL;
        }
-       tmp_imsi =  calloc(sizeof(struct tel_sim_imsi), 1);
+       tmp_imsi =  calloc(1, sizeof(struct tel_sim_imsi));
        memcpy(tmp_imsi, &po->imsi, sizeof(struct tel_sim_imsi));
        return tmp_imsi;
 }
@@ -2441,7 +2441,7 @@ struct tel_sim_service_table* tcore_sim_get_service_table(CoreObject *o)
                dbg("po access fail");
                return NULL;
        }
-       tmp_svct =  calloc(sizeof(struct tel_sim_service_table), 1);
+       tmp_svct =  calloc(1, sizeof(struct tel_sim_service_table));
        memcpy(tmp_svct, &po->svct, sizeof(struct tel_sim_service_table));
        return tmp_svct;
 }
@@ -2523,7 +2523,7 @@ void tcore_sim_override_ops(CoreObject *o, struct tcore_sim_operations *sim_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_SIM);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -2549,7 +2549,7 @@ CoreObject *tcore_sim_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -2580,7 +2580,7 @@ CoreObject *tcore_sim_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index fd01f8c..6e8d7dc 100644 (file)
@@ -428,7 +428,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -471,7 +471,7 @@ void tcore_sms_override_ops(CoreObject *o, struct tcore_sms_operations *sms_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_SMS);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -497,7 +497,7 @@ CoreObject *tcore_sms_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -526,7 +526,7 @@ CoreObject *tcore_sms_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index 3b0cd42..4c8b0ce 100644 (file)
@@ -210,7 +210,7 @@ static void _clone_hook(CoreObject *src, CoreObject *dest)
        if (!src || !dest)
                return;
 
-       dest_po = calloc(sizeof(struct private_object_data), 1);
+       dest_po = calloc(1, sizeof(struct private_object_data));
        if (!dest_po) {
                tcore_object_link_object(dest, NULL);
                return;
@@ -359,7 +359,7 @@ void tcore_ss_override_ops(CoreObject *o, struct tcore_ss_operations *ss_ops)
        struct private_object_data *po = NULL;
 
        CORE_OBJECT_CHECK(o, CORE_OBJECT_TYPE_SS);
-       
+
        po = (struct private_object_data *)tcore_object_ref_object(o);
        if (!po) {
                return;
@@ -385,7 +385,7 @@ CoreObject *tcore_ss_new(TcorePlugin *p, const char *name,
        if (!o)
                return NULL;
 
-       po = calloc(sizeof(struct private_object_data), 1);
+       po = calloc(1, sizeof(struct private_object_data));
        if (!po) {
                tcore_object_free(o);
                return NULL;
@@ -416,7 +416,7 @@ CoreObject *tcore_ss_clone(TcorePlugin *p, const char *name, TcoreHal *hal)
                return NULL;
 
        tcore_object_set_hal(o, hal);
-       
+
        return o;
 }
 
index d0f1fbd..f2534d2 100644 (file)
@@ -44,7 +44,7 @@ Communicator* tcore_communicator_new(TcorePlugin *plugin, const char *name,
 {
        Communicator *comm;
 
-       comm = calloc(sizeof(struct tcore_communicator_type), 1);
+       comm = calloc(1, sizeof(struct tcore_communicator_type));
        if (!comm)
                return NULL;
 
index be2e4ca..b92dde8 100644 (file)
@@ -59,7 +59,7 @@ static CoreObject *_object_new(TcorePlugin *plugin, const char *name, unsigned i
 {
        CoreObject *co;
 
-       co = calloc(sizeof(struct tcore_object_type), 1);
+       co = calloc(1, sizeof(struct tcore_object_type));
        if (!co)
                return NULL;
 
@@ -447,7 +447,7 @@ TReturn tcore_object_add_callback(CoreObject *co,
        if (strlen(event) < 1)
                return TCORE_RETURN_EINVAL;
 
-       cb = calloc(sizeof(struct callback_type), 1);
+       cb = calloc(1, sizeof(struct callback_type));
        if (!cb)
                return TCORE_RETURN_ENOMEM;
 
index 178cecd..5453b83 100644 (file)
--- a/src/hal.c
+++ b/src/hal.c
@@ -137,7 +137,7 @@ TcoreHal *tcore_hal_new(TcorePlugin *plugin, const char *name,
        if (!name)
                return NULL;
 
-       h = calloc(sizeof(struct tcore_hal_type), 1);
+       h = calloc(1, sizeof(struct tcore_hal_type));
        if (!h)
                return NULL;
 
@@ -364,7 +364,7 @@ TReturn tcore_hal_add_recv_callback(TcoreHal *hal, TcoreHalReceiveCallback func,
        if (!hal)
                return TCORE_RETURN_EINVAL;
 
-       item = calloc(sizeof(struct recv_callback_item_type), 1);
+       item = calloc(1, sizeof(struct recv_callback_item_type));
        if (!item)
                return TCORE_RETURN_ENOMEM;
 
@@ -431,7 +431,7 @@ TReturn tcore_hal_add_send_hook(TcoreHal *hal, TcoreHalSendHook func, void *user
        if (!hal || !func)
                return TCORE_RETURN_EINVAL;
 
-       hook = calloc(sizeof(struct hook_send_type), 1);
+       hook = calloc(1, sizeof(struct hook_send_type));
        if (!hook)
                return TCORE_RETURN_ENOMEM;
 
index b62dc01..a1b1bca 100755 (executable)
--- a/src/mux.c
+++ b/src/mux.c
@@ -387,7 +387,7 @@ MUX* tcore_cmux_new(void)
        int i = 0;
 
        /* Allocating memory for mux */
-       mux = (MUX *) calloc(sizeof(MUX), 1);
+       mux = (MUX *) calloc(1, sizeof(MUX));
        if (!mux) {
                err("Failed to allocate memory");
                return NULL;
@@ -405,7 +405,7 @@ MUX* tcore_cmux_new(void)
 
        /* Allocating memory for channel_info */
        for (i = 0; i < MAX_CMUX_CHANNELS_SUPPORTED; i++) {
-               mux->channel_info[i] = (CHANNEL *) calloc(sizeof(CHANNEL), 1);
+               mux->channel_info[i] = (CHANNEL *) calloc(1, sizeof(CHANNEL));
                /* Check for Memory allocation failure */
                if (!mux->channel_info[i]) {
                        err("Failed to allocate memory for channel_info of channel: %d", i);
index 47f7a98..8989ac6 100644 (file)
@@ -52,7 +52,7 @@ TcorePlugin *tcore_plugin_new(Server *server,
 {
        TcorePlugin *p;
 
-       p = calloc(sizeof(struct tcore_plugin_type), 1);
+       p = calloc(1, sizeof(struct tcore_plugin_type));
        if (!p)
                return NULL;
 
index 8937177..84f2235 100644 (file)
@@ -100,7 +100,7 @@ TcorePending *tcore_pending_new(CoreObject *co, unsigned int id)
 {
        TcorePending *p;
 
-       p = calloc(sizeof(struct tcore_pending_type), 1);
+       p = calloc(1, sizeof(struct tcore_pending_type));
        if (!p)
                return NULL;
 
@@ -373,7 +373,7 @@ TcoreQueue *tcore_queue_new(TcoreHal *h)
 {
        TcoreQueue *queue;
 
-       queue = calloc(sizeof(struct tcore_queue_type), 1);
+       queue = calloc(1, sizeof(struct tcore_queue_type));
        if (!queue)
                return FALSE;
 
index 1cbb293..e5c4161 100644 (file)
@@ -108,7 +108,7 @@ Server *tcore_server_new()
 {
        Server *s;
 
-       s = calloc(sizeof(struct tcore_server_type), 1);
+       s = calloc(1, sizeof(struct tcore_server_type));
        if (!s)
                return NULL;
 
@@ -553,7 +553,7 @@ TReturn tcore_server_add_request_hook(Server *s,
        if (!s || !func)
                return TCORE_RETURN_EINVAL;
 
-       hook = calloc(sizeof(struct hook_request_type), 1);
+       hook = calloc(1, sizeof(struct hook_request_type));
        if (!hook)
                return TCORE_RETURN_ENOMEM;
 
@@ -599,7 +599,7 @@ TReturn tcore_server_add_notification_hook(Server *s,
        if (!s || !func)
                return TCORE_RETURN_EINVAL;
 
-       hook = calloc(sizeof(struct hook_notification_type), 1);
+       hook = calloc(1, sizeof(struct hook_notification_type));
        if (!hook)
                return TCORE_RETURN_ENOMEM;
 
index dd439ec..dd32563 100644 (file)
@@ -47,7 +47,7 @@ Storage *tcore_storage_new(TcorePlugin *plugin, const char *name,
 {
        Storage *strg;
 
-       strg = calloc(sizeof(struct tcore_storage_type), 1);
+       strg = calloc(1, sizeof(struct tcore_storage_type));
        if (!strg)
                return NULL;
 
index ed9d34b..5c06884 100644 (file)
@@ -85,7 +85,7 @@ TcoreUdev *tcore_udev_new(Server *s, const gchar **subsystems)
 {
        TcoreUdev *udev;
 
-       udev = calloc(sizeof(struct tcore_udev_type), 1);
+       udev = calloc(1, sizeof(struct tcore_udev_type));
        if (!udev)
                return NULL;
 
@@ -152,7 +152,7 @@ TReturn tcore_udev_add_enumerator_callback(TcoreUdev *udev, TcoreUdevEnumerCallb
        if (!udev || !func)
                return TCORE_RETURN_FAILURE;
 
-       node = calloc(sizeof(struct udev_enumer_callback_type), 1);
+       node = calloc(1, sizeof(struct udev_enumer_callback_type));
        if (!node)
                return TCORE_RETURN_ENOMEM;
 
@@ -204,7 +204,7 @@ TReturn tcore_udev_add_callback(TcoreUdev *udev, const char *subsystem, const ch
        if (!udev || !func)
                return TCORE_RETURN_FAILURE;
 
-       node = calloc(sizeof(struct udev_callback_type), 1);
+       node = calloc(1, sizeof(struct udev_callback_type));
        if (!node)
                return TCORE_RETURN_ENOMEM;
 
index edd10e2..051cdcd 100644 (file)
@@ -53,7 +53,7 @@ UserRequest *tcore_user_request_new(Communicator *comm, const char *modem_name)
 {
        UserRequest *ur;
 
-       ur = calloc(sizeof(struct tcore_user_request_type), 1);
+       ur = calloc(1, sizeof(struct tcore_user_request_type));
        if (!ur)
                return NULL;