diff --git a/src/api/pdc.c b/src/api/pdc.c index 6010552b3..f2f3b68cb 100644 --- a/src/api/pdc.c +++ b/src/api/pdc.c @@ -67,7 +67,7 @@ PDC_class_create(const char *pdc_name) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_class); + p = (struct _pdc_class *)PDC_malloc(sizeof(struct _pdc_class)); if (!p) PGOTO_ERROR(FAIL, "PDC class property memory allocation failed\n"); @@ -89,7 +89,7 @@ PDCinit(const char *pdc_name) FUNC_ENTER(NULL); - if (NULL == (pdc_id_list_g = PDC_CALLOC(1, struct pdc_id_list))) + if (NULL == (pdc_id_list_g = (struct pdc_id_list *)PDC_calloc(1, sizeof(struct pdc_id_list)))) PGOTO_ERROR(FAIL, "PDC global id list: memory allocation failed"); if (PDC_class_init() < 0) @@ -130,7 +130,7 @@ PDC_class__close(struct _pdc_class *p) #endif free(p->name); - p = PDC_FREE(struct _pdc_class, p); + p = (struct _pdc_class *)(intptr_t)PDC_free(p); FUNC_LEAVE(ret_value); } @@ -214,7 +214,7 @@ PDCclose(pdcid_t pdcid) PDC_class_end(); - pdc_id_list_g = PDC_FREE(struct pdc_id_list, pdc_id_list_g); + pdc_id_list_g = (struct pdc_id_list *)(intptr_t)PDC_free(pdc_id_list_g); // Finalize METADATA PDC_Client_finalize(); diff --git a/src/api/pdc_analysis/pdc_analysis.c b/src/api/pdc_analysis/pdc_analysis.c index 3e603df4d..0add84746 100644 --- a/src/api/pdc_analysis/pdc_analysis.c +++ b/src/api/pdc_analysis/pdc_analysis.c @@ -453,7 +453,8 @@ PDCobj_analysis_register(char *func, pdcid_t iterIn, pdcid_t iterOut) if ((ftnPtr = ftnHandle) == NULL) PGOTO_ERROR(FAIL, "Analysis function lookup failed"); - if ((thisFtn = PDC_MALLOC(struct _pdc_region_analysis_ftn_info)) == NULL) + if ((thisFtn = (struct _pdc_region_analysis_ftn_info *)PDC_malloc( + sizeof(struct _pdc_region_analysis_ftn_info))) == NULL) PGOTO_ERROR(FAIL, "PDC register_obj_analysis memory allocation failed"); thisFtn->ftnPtr = (int (*)())ftnPtr; diff --git a/src/api/pdc_obj/pdc_cont.c b/src/api/pdc_obj/pdc_cont.c index b589188e6..4366c4156 100644 --- a/src/api/pdc_obj/pdc_cont.c +++ b/src/api/pdc_obj/pdc_cont.c @@ -61,11 +61,11 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_cont_info); + p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info)); if (!p) PGOTO_ERROR(0, "PDC container memory allocation failed"); - p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info); + p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info)); if (!p->cont_info_pub) PGOTO_ERROR(0, "PDC pub container memory allocation failed"); p->cont_info_pub->name = strdup(cont_name); @@ -73,12 +73,12 @@ PDCcont_create(const char *cont_name, pdcid_t cont_prop_id) id_info = PDC_find_id(cont_prop_id); cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr); - p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont_pt) PGOTO_ERROR(0, "PDC container prop memory allocation failed"); memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop)); - p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont_pt->pdc) PGOTO_ERROR(0, "PDC container pdc class memory allocation failed"); if (cont_prop->pdc->name) @@ -110,11 +110,11 @@ PDCcont_create_col(const char *cont_name, pdcid_t cont_prop_id) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_cont_info); + p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info)); if (!p) PGOTO_ERROR(0, "PDC container memory allocation failed"); - p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info); + p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info)); if (!p->cont_info_pub) PGOTO_ERROR(0, "PDC pub container memory allocation failed"); p->cont_info_pub->name = strdup(cont_name); @@ -122,12 +122,12 @@ PDCcont_create_col(const char *cont_name, pdcid_t cont_prop_id) id_info = PDC_find_id(cont_prop_id); cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr); - p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont_pt) PGOTO_ERROR(0, "PDC container prop memory allocation failed"); memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop)); - p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont_pt->pdc) PGOTO_ERROR(0, "PDC container pdc class memory allocation failed"); if (cont_prop->pdc->name) @@ -157,11 +157,11 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_cont_info); + p = (struct _pdc_cont_info *)PDC_malloc(sizeof(struct _pdc_cont_info)); if (!p) PGOTO_ERROR(0, "PDC container memory allocation failed"); - p->cont_info_pub = PDC_MALLOC(struct pdc_cont_info); + p->cont_info_pub = (struct pdc_cont_info *)PDC_malloc(sizeof(struct pdc_cont_info)); if (!p) PGOTO_ERROR(0, "PDC container memory allocation failed"); p->cont_info_pub->name = strdup(cont_name); @@ -171,12 +171,12 @@ PDC_cont_create_local(pdcid_t pdc, const char *cont_name, uint64_t cont_meta_id) id_info = PDC_find_id(cont_prop_id); cont_prop = (struct _pdc_cont_prop *)(id_info->obj_ptr); - p->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + p->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont_pt) PGOTO_ERROR(0, "PDC container prop memory allocation failed"); memcpy(p->cont_pt, cont_prop, sizeof(struct _pdc_cont_prop)); - p->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont_pt->pdc) PGOTO_ERROR(0, "PDC container pdc class memory allocation failed"); @@ -222,11 +222,11 @@ PDC_cont_close(struct _pdc_cont_info *cp) FUNC_ENTER(NULL); free((void *)(cp->cont_info_pub->name)); - cp->cont_info_pub = PDC_FREE(struct pdc_cont_info, cp->cont_info_pub); + cp->cont_info_pub = (struct pdc_cont_info *)(intptr_t)PDC_free(cp->cont_info_pub); free(cp->cont_pt->pdc->name); - cp->cont_pt->pdc = PDC_FREE(struct _pdc_class, cp->cont_pt->pdc); - cp->cont_pt = PDC_FREE(struct _pdc_cont_prop, cp->cont_pt); - cp = PDC_FREE(struct _pdc_cont_info, cp); + cp->cont_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(cp->cont_pt->pdc); + cp->cont_pt = (struct _pdc_cont_prop *)(intptr_t)PDC_free(cp->cont_pt); + cp = (struct _pdc_cont_info *)(intptr_t)PDC_free(cp); FUNC_LEAVE(ret_value); } @@ -321,25 +321,25 @@ PDC_cont_get_info(pdcid_t cont_id) PGOTO_ERROR(NULL, "cannot locate object"); info = (struct _pdc_cont_info *)(id_info->obj_ptr); - ret_value = PDC_CALLOC(1, struct _pdc_cont_info); + ret_value = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info)); if (ret_value) memcpy(ret_value, info, sizeof(struct _pdc_cont_info)); else PGOTO_ERROR(NULL, "cannot allocate ret_value"); - ret_value->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); + ret_value->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (ret_value->cont_info_pub) memcpy(ret_value->cont_info_pub, info->cont_info_pub, sizeof(struct pdc_cont_info)); if (info->cont_info_pub->name) ret_value->cont_info_pub->name = strdup(info->cont_info_pub->name); - ret_value->cont_pt = PDC_MALLOC(struct _pdc_cont_prop); + ret_value->cont_pt = (struct _pdc_cont_prop *)PDC_malloc(sizeof(struct _pdc_cont_prop)); if (ret_value->cont_pt) memcpy(ret_value->cont_pt, info->cont_pt, sizeof(struct _pdc_cont_prop)); else PGOTO_ERROR(NULL, "cannot allocate ret_value->cont_pt"); - ret_value->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + ret_value->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (ret_value->cont_pt->pdc) { ret_value->cont_pt->pdc->local_id = info->cont_pt->pdc->local_id; if (info->cont_pt->pdc->name) @@ -366,7 +366,7 @@ PDCcont_get_info(const char *cont_name) tmp = PDC_cont_get_info(cont_id); - ret_value = PDC_CALLOC(1, struct pdc_cont_info); + ret_value = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (!ret_value) PGOTO_ERROR(NULL, "cannot allocate memory"); @@ -440,7 +440,7 @@ PDCcont_iter_get_info(cont_handle *chandle) if (info == NULL) PGOTO_ERROR(NULL, "PDC container info memory allocation failed"); - ret_value = PDC_CALLOC(1, struct pdc_cont_info); + ret_value = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (!ret_value) PGOTO_ERROR(NULL, "failed to allocate memory"); diff --git a/src/api/pdc_obj/pdc_obj.c b/src/api/pdc_obj/pdc_obj.c index 95687826c..9b307e5fa 100644 --- a/src/api/pdc_obj/pdc_obj.c +++ b/src/api/pdc_obj/pdc_obj.c @@ -72,7 +72,7 @@ PDCobj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id) pdcid_t ret_value = 0; FUNC_ENTER(NULL); #if 0 - p = PDC_MALLOC(struct _pdc_obj_info); + p = (struct _pdc_obj_info *)PDC_malloc(sizeof(struct _pdc_obj_info)); if (!p) PGOTO_ERROR(0, "PDC object memory allocation failed"); p->metadata = NULL; @@ -86,24 +86,24 @@ PDCobj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id) cont_info = (struct _pdc_cont_info *)(id_info->obj_ptr); /* struct _pdc_cont_info field */ - p->cont = PDC_CALLOC(1,struct _pdc_cont_info); + p->cont = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info)); if (!p->cont) PGOTO_ERROR(0, "PDC object container memory allocation failed"); memcpy(p->cont, cont_info, sizeof(struct _pdc_cont_info)); - p->cont->cont_info_pub = PDC_CALLOC(1,struct pdc_cont_info); + p->cont->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (!p->cont->cont_info_pub) PGOTO_ERROR(0, "PDC object pub container memory allocation failed"); memcpy(p->cont->cont_info_pub, cont_info->cont_info_pub, sizeof(struct pdc_cont_info)); if (cont_info->cont_info_pub->name) p->cont->cont_info_pub->name = strdup(cont_info->cont_info_pub->name); - p->cont->cont_pt = PDC_CALLOC(1,struct _pdc_cont_prop); + p->cont->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont->cont_pt) PGOTO_ERROR(0, "PDC object container property memory allocation failed"); memcpy(p->cont->cont_pt, cont_info->cont_pt, sizeof(struct _pdc_cont_prop)); - p->cont->cont_pt->pdc = PDC_CALLOC(1,struct _pdc_class); + p->cont->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont->cont_pt->pdc) PGOTO_ERROR(0, "PDC object container property pdc memory allocation failed"); p->cont->cont_pt->pdc->name = strdup(cont_info->cont_pt->pdc->name); @@ -115,20 +115,20 @@ PDCobj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id) obj_prop = (struct _pdc_obj_prop *)(id_info->obj_ptr); /* struct _pdc_obj_prop field */ - p->obj_pt = PDC_CALLOC(1,struct _pdc_obj_prop); + p->obj_pt = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (!p->obj_pt) PGOTO_ERROR(0, "PDC object property memory allocation failed"); memcpy(p->obj_pt, obj_prop, sizeof(struct _pdc_obj_prop)); if (obj_prop->app_name) p->obj_pt->app_name = strdup(obj_prop->app_name); - p->obj_pt->pdc = PDC_CALLOC(1,struct _pdc_class); + p->obj_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->obj_pt->pdc) PGOTO_ERROR(0, "cannot allocate ret_value->pdc"); p->obj_pt->pdc->name = strdup(obj_prop->pdc->name); p->obj_pt->pdc->local_id = obj_prop->pdc->local_id; /* struct pdc_obj_prop field */ - p->obj_pt->obj_prop_pub = PDC_CALLOC(1,struct pdc_obj_prop); + p->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_pt->obj_prop_pub) PGOTO_ERROR(0, "cannot allocate ret_value->obj_pt->obj_prop_pub"); p->obj_pt->obj_prop_pub->ndim = obj_prop->obj_prop_pub->ndim; @@ -146,7 +146,7 @@ PDCobj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id) if (obj_prop->tags) p->obj_pt->tags = strdup(obj_prop->tags); - p->obj_info_pub = PDC_MALLOC(struct pdc_obj_info); + p->obj_info_pub = (struct pdc_obj_info *)PDC_malloc(sizeof(struct pdc_obj_info)); if (!p->obj_info_pub) PGOTO_ERROR(0, "PDC pub object memory allocation failed"); p->obj_info_pub->name = strdup(obj_name); @@ -156,7 +156,7 @@ PDCobj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id) if (ret == FAIL) PGOTO_ERROR(0, "Unable to create object on server!"); - p->obj_info_pub->obj_pt = PDC_CALLOC(1,struct pdc_obj_prop); + p->obj_info_pub->obj_pt = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_info_pub->obj_pt) PGOTO_ERROR(0, "PDC object prop memory allocation failed"); memcpy(p->obj_info_pub->obj_pt, p->obj_pt->obj_prop_pub, sizeof(struct pdc_obj_prop)); @@ -239,7 +239,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_obj_info); + p = (struct _pdc_obj_info *)PDC_malloc(sizeof(struct _pdc_obj_info)); if (!p) PGOTO_ERROR(0, "PDC object memory allocation failed"); p->metadata = NULL; @@ -254,13 +254,13 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ /* struct _pdc_cont_info field */ cont_info = (struct _pdc_cont_info *)(id_info->obj_ptr); - p->cont = PDC_CALLOC(1, struct _pdc_cont_info); + p->cont = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info)); if (!p->cont) PGOTO_ERROR(0, "PDC object container memory allocation failed"); memcpy(p->cont, cont_info, sizeof(struct _pdc_cont_info)); /* struct pdc_cont_info field */ - p->cont->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); + p->cont->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (!p->cont->cont_info_pub) PGOTO_ERROR(0, "PDC object pub container memory allocation failed"); memcpy(p->cont->cont_info_pub, cont_info->cont_info_pub, sizeof(struct pdc_cont_info)); @@ -268,13 +268,13 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ p->cont->cont_info_pub->name = strdup(cont_info->cont_info_pub->name); /* struct _pdc_cont_prop field */ - p->cont->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + p->cont->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont->cont_pt) PGOTO_ERROR(0, "PDC object container property memory allocation failed"); memcpy(p->cont->cont_pt, cont_info->cont_pt, sizeof(struct _pdc_cont_prop)); /* struct _pdc_class field */ - p->cont->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->cont->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont->cont_pt->pdc) PGOTO_ERROR(0, "PDC object container property pdc memory allocation failed"); if (cont_info->cont_pt->pdc->name) @@ -287,7 +287,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ obj_prop = (struct _pdc_obj_prop *)(id_info->obj_ptr); /* struct _pdc_obj_prop field */ - p->obj_pt = PDC_CALLOC(1, struct _pdc_obj_prop); + p->obj_pt = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (!p->obj_pt) PGOTO_ERROR(0, "PDC object property memory allocation failed"); memcpy(p->obj_pt, obj_prop, sizeof(struct _pdc_obj_prop)); @@ -299,7 +299,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ p->obj_pt->tags = strdup(obj_prop->tags); p->obj_pt->locus = PDC_get_execution_locus(); - p->obj_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->obj_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->obj_pt->pdc) PGOTO_ERROR(0, "cannot allocate ret_value->pdc"); if (obj_prop->pdc->name) @@ -307,7 +307,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ p->obj_pt->pdc->local_id = obj_prop->pdc->local_id; /* struct pdc_obj_prop field */ - p->obj_pt->obj_prop_pub = PDC_CALLOC(1, struct pdc_obj_prop); + p->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_pt->obj_prop_pub) PGOTO_ERROR(0, "cannot allocate ret_value->obj_pt->obj_prop_pub"); p->obj_pt->obj_prop_pub->ndim = obj_prop->obj_prop_pub->ndim; @@ -329,7 +329,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ p->local_transfer_request_end = NULL; p->local_transfer_request_size = 0; /* struct pdc_obj_info field */ - p->obj_info_pub = PDC_MALLOC(struct pdc_obj_info); + p->obj_info_pub = (struct pdc_obj_info *)PDC_malloc(sizeof(struct pdc_obj_info)); if (!p->obj_info_pub) PGOTO_ERROR(0, "PDC pub object memory allocation failed"); p->obj_info_pub->name = strdup(obj_name); @@ -349,7 +349,7 @@ PDC_obj_create(pdcid_t cont_id, const char *obj_name, pdcid_t obj_prop_id, _pdc_ p->obj_pt->obj_prop_pub->region_partition, p->obj_pt->obj_prop_pub->consistency, p); - p->obj_info_pub->obj_pt = PDC_CALLOC(1, struct pdc_obj_prop); + p->obj_info_pub->obj_pt = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_info_pub->obj_pt) PGOTO_ERROR(0, "PDC object prop memory allocation failed"); memcpy(p->obj_info_pub->obj_pt, p->obj_pt->obj_prop_pub, sizeof(struct pdc_obj_prop)); @@ -417,28 +417,28 @@ PDC_obj_close(struct _pdc_obj_info *op) free((void *)(op->obj_info_pub->name)); free(op->cont->cont_info_pub->name); - op->cont->cont_info_pub = PDC_FREE(struct pdc_cont_info, op->cont->cont_info_pub); + op->cont->cont_info_pub = (struct pdc_cont_info *)(intptr_t)PDC_free(op->cont->cont_info_pub); free(op->cont->cont_pt->pdc->name); - op->cont->cont_pt->pdc = PDC_FREE(struct _pdc_class, op->cont->cont_pt->pdc); - op->cont->cont_pt = PDC_FREE(struct _pdc_cont_prop, op->cont->cont_pt); - op->cont = PDC_FREE(struct _pdc_cont_info, op->cont); + op->cont->cont_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(op->cont->cont_pt->pdc); + op->cont->cont_pt = (struct _pdc_cont_prop *)(intptr_t)PDC_free(op->cont->cont_pt); + op->cont = (struct _pdc_cont_info *)(intptr_t)PDC_free(op->cont); free(op->obj_pt->pdc->name); - op->obj_pt->pdc = PDC_FREE(struct _pdc_class, op->obj_pt->pdc); + op->obj_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(op->obj_pt->pdc); free(op->obj_pt->obj_prop_pub->dims); - op->obj_pt->obj_prop_pub = PDC_FREE(struct pdc_obj_prop, op->obj_pt->obj_prop_pub); + op->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)(intptr_t)PDC_free(op->obj_pt->obj_prop_pub); free(op->obj_pt->app_name); free(op->obj_pt->data_loc); free(op->obj_pt->tags); - op->obj_pt = PDC_FREE(struct _pdc_obj_prop, op->obj_pt); + op->obj_pt = (struct _pdc_obj_prop *)(intptr_t)PDC_free(op->obj_pt); if (op->metadata != NULL) free(op->metadata); free(op->obj_info_pub->obj_pt->dims); - op->obj_info_pub->obj_pt = PDC_FREE(struct pdc_obj_prop, op->obj_info_pub->obj_pt); - op->obj_info_pub = PDC_FREE(struct pdc_obj_info, op->obj_info_pub); + op->obj_info_pub->obj_pt = (struct pdc_obj_prop *)(intptr_t)PDC_free(op->obj_info_pub->obj_pt); + op->obj_info_pub = (struct pdc_obj_info *)(intptr_t)PDC_free(op->obj_info_pub); - op = PDC_FREE(struct _pdc_obj_info, op); + op = (struct _pdc_obj_info *)(intptr_t)PDC_free(op); FUNC_LEAVE(ret_value); } @@ -537,34 +537,34 @@ PDCobj_open_common(const char *obj_name, pdcid_t pdc, int is_col) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct _pdc_obj_info); + p = (struct _pdc_obj_info *)PDC_malloc(sizeof(struct _pdc_obj_info)); if (!p) PGOTO_ERROR(0, "PDC object memory allocation failed"); - p->cont = PDC_CALLOC(1, struct _pdc_cont_info); + p->cont = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info)); if (!p->cont) PGOTO_ERROR(0, "PDC object container memory allocation failed"); - p->cont->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); + p->cont->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (!p->cont->cont_info_pub) PGOTO_ERROR(0, "PDC object pub container memory allocation failed"); - p->cont->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + p->cont->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!p->cont->cont_pt) PGOTO_ERROR(0, "PDC object container property memory allocation failed"); - p->cont->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->cont->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->cont->cont_pt->pdc) PGOTO_ERROR(0, "PDC object container property pdc memory allocation failed"); - p->obj_pt = PDC_CALLOC(1, struct _pdc_obj_prop); + p->obj_pt = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (!p->obj_pt) PGOTO_ERROR(0, "PDC object property memory allocation failed"); - p->obj_pt->obj_prop_pub = PDC_CALLOC(1, struct pdc_obj_prop); + p->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_pt->obj_prop_pub) PGOTO_ERROR(0, "PDC object property memory allocation failed"); - p->obj_info_pub = PDC_MALLOC(struct pdc_obj_info); + p->obj_info_pub = (struct pdc_obj_info *)PDC_malloc(sizeof(struct pdc_obj_info)); if (!p->obj_info_pub) PGOTO_ERROR(0, "PDC pub object memory allocation failed"); - p->obj_info_pub->obj_pt = PDC_CALLOC(1, struct pdc_obj_prop); + p->obj_info_pub->obj_pt = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!p->obj_info_pub->obj_pt) PGOTO_ERROR(0, "PDC object prop memory allocation failed"); - p->obj_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + p->obj_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!p->obj_pt->pdc) PGOTO_ERROR(0, "cannot allocate ret_value->pdc"); @@ -738,12 +738,12 @@ PDCobj_iter_get_info(obj_handle *ohandle) if (info == NULL) PGOTO_ERROR(NULL, "PDC container info memory allocation failed"); - ret_value = PDC_CALLOC(1, struct pdc_obj_info); + ret_value = (struct pdc_obj_info *)PDC_calloc(1, sizeof(struct pdc_obj_info)); if (!ret_value) PGOTO_ERROR(NULL, "failed to allocate memory"); memcpy(ret_value, info->obj_info_pub, sizeof(struct pdc_obj_info)); - ret_value->obj_pt = PDC_CALLOC(1, struct pdc_obj_prop); + ret_value->obj_pt = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!ret_value->obj_pt) PGOTO_ERROR(NULL, "failed to allocate memory"); memcpy(ret_value->obj_pt, info->obj_info_pub->obj_pt, sizeof(struct pdc_obj_prop)); @@ -1058,14 +1058,14 @@ PDC_obj_get_info(pdcid_t obj_id) PGOTO_ERROR(NULL, "cannot locate object"); info = (struct _pdc_obj_info *)(obj->obj_ptr); - ret_value = PDC_CALLOC(1, struct _pdc_obj_info); + ret_value = (struct _pdc_obj_info *)PDC_calloc(1, sizeof(struct _pdc_obj_info)); if (ret_value) memcpy(ret_value, info, sizeof(struct _pdc_obj_info)); else PGOTO_ERROR(NULL, "cannot allocate ret_value"); /* struct pdc_obj_info field */ - ret_value->obj_info_pub = PDC_CALLOC(1, struct pdc_obj_info); + ret_value->obj_info_pub = (struct pdc_obj_info *)PDC_calloc(1, sizeof(struct pdc_obj_info)); if (ret_value->obj_info_pub) memcpy(ret_value->obj_info_pub, info->obj_info_pub, sizeof(struct pdc_obj_info)); else @@ -1075,7 +1075,7 @@ PDC_obj_get_info(pdcid_t obj_id) else ret_value->obj_info_pub->name = NULL; - ret_value->obj_info_pub->obj_pt = PDC_CALLOC(1, struct pdc_obj_prop); + ret_value->obj_info_pub->obj_pt = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (!ret_value->obj_info_pub->obj_pt) PGOTO_ERROR(NULL, "failed to allocate memory"); memcpy(ret_value->obj_info_pub->obj_pt, info->obj_info_pub->obj_pt, sizeof(struct pdc_obj_prop)); @@ -1089,13 +1089,13 @@ PDC_obj_get_info(pdcid_t obj_id) ret_value->metadata = NULL; // fill in struct _pdc_cont_info field in ret_value->cont - ret_value->cont = PDC_CALLOC(1, struct _pdc_cont_info); + ret_value->cont = (struct _pdc_cont_info *)PDC_calloc(1, sizeof(struct _pdc_cont_info)); if (ret_value->cont) memcpy(ret_value->cont, info->cont, sizeof(struct _pdc_cont_info)); else PGOTO_ERROR(NULL, "cannot allocate ret_value->cont"); - ret_value->cont->cont_info_pub = PDC_CALLOC(1, struct pdc_cont_info); + ret_value->cont->cont_info_pub = (struct pdc_cont_info *)PDC_calloc(1, sizeof(struct pdc_cont_info)); if (ret_value->cont->cont_info_pub) memcpy(ret_value->cont->cont_info_pub, info->cont->cont_info_pub, sizeof(struct pdc_cont_info)); else @@ -1105,12 +1105,12 @@ PDC_obj_get_info(pdcid_t obj_id) else ret_value->cont->cont_info_pub->name = NULL; - ret_value->cont->cont_pt = PDC_CALLOC(1, struct _pdc_cont_prop); + ret_value->cont->cont_pt = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (ret_value->cont->cont_pt) memcpy(ret_value->cont->cont_pt, info->cont->cont_pt, sizeof(struct _pdc_cont_prop)); else PGOTO_ERROR(NULL, "cannot allocate ret_value->cont->cont_pt"); - ret_value->cont->cont_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + ret_value->cont->cont_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (ret_value->cont->cont_pt->pdc) { ret_value->cont->cont_pt->pdc->local_id = info->cont->cont_pt->pdc->local_id; if (info->cont->cont_pt->pdc->name) @@ -1122,12 +1122,12 @@ PDC_obj_get_info(pdcid_t obj_id) PGOTO_ERROR(NULL, "cannot allocate ret_value->cont->cont_pt->pdc"); // fill in struct _pdc_obj_prop field in ret_value->obj_pt - ret_value->obj_pt = PDC_CALLOC(1, struct _pdc_obj_prop); + ret_value->obj_pt = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (ret_value->obj_pt) memcpy(ret_value->obj_pt, info->obj_pt, sizeof(struct _pdc_obj_prop)); else PGOTO_ERROR(NULL, "cannot allocate ret_value->obj_pt"); - ret_value->obj_pt->pdc = PDC_CALLOC(1, struct _pdc_class); + ret_value->obj_pt->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (ret_value->obj_pt->pdc) { ret_value->obj_pt->pdc->local_id = info->obj_pt->pdc->local_id; if (info->obj_pt->pdc->name) @@ -1138,7 +1138,7 @@ PDC_obj_get_info(pdcid_t obj_id) else PGOTO_ERROR(NULL, "cannot allocate ret_value->obj_pt->pdc"); - ret_value->obj_pt->obj_prop_pub = PDC_CALLOC(1, struct pdc_obj_prop); + ret_value->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (ret_value->obj_pt->obj_prop_pub) memcpy(ret_value->obj_pt->obj_prop_pub, info->obj_pt->obj_prop_pub, sizeof(struct pdc_obj_prop)); else @@ -1182,7 +1182,7 @@ PDC_free_obj_info(struct _pdc_obj_info *obj) if (obj->obj_info_pub->name != NULL) free(obj->obj_info_pub->name); - obj->obj_info_pub = PDC_FREE(struct pdc_obj_info, obj->obj_info_pub); + obj->obj_info_pub = (struct pdc_obj_info *)(intptr_t)PDC_free(obj->obj_info_pub); if (obj->metadata != NULL) free(obj->metadata); @@ -1190,36 +1190,36 @@ PDC_free_obj_info(struct _pdc_obj_info *obj) if (obj->cont != NULL) { if (obj->cont->cont_info_pub->name != NULL) free(obj->cont->cont_info_pub->name); - obj->cont->cont_info_pub = PDC_FREE(struct pdc_cont_info, obj->cont->cont_info_pub); + obj->cont->cont_info_pub = (struct pdc_cont_info *)(intptr_t)PDC_free(obj->cont->cont_info_pub); if (obj->cont->cont_pt->pdc->name != NULL) free(obj->cont->cont_pt->pdc->name); - obj->cont->cont_pt->pdc = PDC_FREE(struct _pdc_class, obj->cont->cont_pt->pdc); - obj->cont->cont_pt = PDC_FREE(struct _pdc_cont_prop, obj->cont->cont_pt); - obj->cont = PDC_FREE(struct _pdc_cont_info, obj->cont); + obj->cont->cont_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(obj->cont->cont_pt->pdc); + obj->cont->cont_pt = (struct _pdc_cont_prop *)(intptr_t)PDC_free(obj->cont->cont_pt); + obj->cont = (struct _pdc_cont_info *)(intptr_t)PDC_free(obj->cont); } if (obj->obj_pt != NULL) { if (obj->obj_pt->pdc != NULL) { if (obj->obj_pt->pdc->name != NULL) free(obj->obj_pt->pdc->name); - obj->obj_pt->pdc = PDC_FREE(struct _pdc_class, obj->obj_pt->pdc); + obj->obj_pt->pdc = (struct _pdc_class *)(intptr_t)PDC_free(obj->obj_pt->pdc); } if (obj->obj_pt->obj_prop_pub->dims != NULL) free(obj->obj_pt->obj_prop_pub->dims); - obj->obj_pt->obj_prop_pub = PDC_FREE(struct pdc_obj_prop, obj->obj_pt->obj_prop_pub); + obj->obj_pt->obj_prop_pub = (struct pdc_obj_prop *)(intptr_t)PDC_free(obj->obj_pt->obj_prop_pub); if (obj->obj_pt->app_name != NULL) free(obj->obj_pt->app_name); if (obj->obj_pt->data_loc != NULL) free(obj->obj_pt->data_loc); if (obj->obj_pt->tags != NULL) free(obj->obj_pt->tags); - obj->obj_pt = PDC_FREE(struct _pdc_obj_prop, obj->obj_pt); + obj->obj_pt = (struct _pdc_obj_prop *)(intptr_t)PDC_free(obj->obj_pt); } if (obj->region_list_head != NULL) free(obj->region_list_head); - obj = PDC_FREE(struct _pdc_obj_info, obj); + obj = (struct _pdc_obj_info *)(intptr_t)PDC_free(obj); FUNC_LEAVE(ret_value); } diff --git a/src/api/pdc_obj/pdc_prop.c b/src/api/pdc_obj/pdc_prop.c index e0632b733..65f1985ec 100644 --- a/src/api/pdc_obj/pdc_prop.c +++ b/src/api/pdc_obj/pdc_prop.c @@ -67,7 +67,7 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) FUNC_ENTER(NULL); if (type == PDC_CONT_CREATE) { - p = PDC_MALLOC(struct _pdc_cont_prop); + p = (struct _pdc_cont_prop *)PDC_malloc(sizeof(struct _pdc_cont_prop)); if (!p) PGOTO_ERROR(0, "PDC container property memory allocation failed"); p->cont_life = PDC_PERSIST; @@ -75,7 +75,7 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) p->cont_prop_id = new_id_c; id_info = PDC_find_id(pdcid); pdc_class = (struct _pdc_class *)(id_info->obj_ptr); - p->pdc = PDC_CALLOC(1, struct _pdc_class); + p->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (p->pdc == NULL) PGOTO_ERROR(0, "PDC class allocation failed"); if (pdc_class->name) @@ -85,10 +85,10 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) ret_value = new_id_c; } if (type == PDC_OBJ_CREATE) { - q = PDC_MALLOC(struct _pdc_obj_prop); + q = (struct _pdc_obj_prop *)PDC_malloc(sizeof(struct _pdc_obj_prop)); if (!q) PGOTO_ERROR(0, "PDC object property memory allocation failed"); - q->obj_prop_pub = PDC_MALLOC(struct pdc_obj_prop); + q->obj_prop_pub = (struct pdc_obj_prop *)PDC_malloc(sizeof(struct pdc_obj_prop)); if (!q->obj_prop_pub) PGOTO_ERROR(0, "PDC object pub property memory allocation failed"); q->obj_prop_pub->ndim = 0; @@ -105,7 +105,7 @@ PDCprop_create(pdc_prop_type_t type, pdcid_t pdcid) q->obj_prop_pub->obj_prop_id = new_id_o; id_info = PDC_find_id(pdcid); pdc_class = (struct _pdc_class *)(id_info->obj_ptr); - q->pdc = PDC_CALLOC(1, struct _pdc_class); + q->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (q->pdc == NULL) PGOTO_ERROR(0, "PDC class allocation failed"); if (pdc_class->name) @@ -141,7 +141,7 @@ PDCprop_obj_dup(pdcid_t prop_id) PGOTO_ERROR(0, "cannot locate object property"); info = (struct _pdc_obj_prop *)(prop->obj_ptr); - q = PDC_CALLOC(1, struct _pdc_obj_prop); + q = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (!q) PGOTO_ERROR(0, "PDC object property memory allocation failed"); if (info->app_name) @@ -153,7 +153,7 @@ PDCprop_obj_dup(pdcid_t prop_id) q->buf = NULL; /* struct obj_prop_pub field */ - q->obj_prop_pub = PDC_MALLOC(struct pdc_obj_prop); + q->obj_prop_pub = (struct pdc_obj_prop *)PDC_malloc(sizeof(struct pdc_obj_prop)); if (!q->obj_prop_pub) PGOTO_ERROR(0, "PDC object property memory allocation failed"); new_id = PDC_id_register(PDC_OBJ_PROP, q); @@ -166,7 +166,7 @@ PDCprop_obj_dup(pdcid_t prop_id) (q->obj_prop_pub->dims)[i] = (info->obj_prop_pub->dims)[i]; /* struct _pdc_class field */ - q->pdc = PDC_CALLOC(1, struct _pdc_class); + q->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!q->pdc) PGOTO_ERROR(0, "PDC class memory allocation failed"); if (info->pdc->name) @@ -228,8 +228,8 @@ pdc_prop_cont_close(struct _pdc_cont_prop *cp) FUNC_ENTER(NULL); free(cp->pdc->name); - cp->pdc = PDC_FREE(struct _pdc_class, cp->pdc); - cp = PDC_FREE(struct _pdc_cont_prop, cp); + cp->pdc = (struct _pdc_class *)(intptr_t)PDC_free(cp->pdc); + cp = (struct _pdc_cont_prop *)(intptr_t)PDC_free(cp); FUNC_LEAVE(ret_value); } @@ -242,7 +242,7 @@ pdc_prop_obj_close(struct _pdc_obj_prop *cp) FUNC_ENTER(NULL); free(cp->pdc->name); - cp->pdc = PDC_FREE(struct _pdc_class, cp->pdc); + cp->pdc = (struct _pdc_class *)(intptr_t)PDC_free(cp->pdc); if (cp->obj_prop_pub->dims != NULL) { free(cp->obj_prop_pub->dims); cp->obj_prop_pub->dims = NULL; @@ -250,7 +250,7 @@ pdc_prop_obj_close(struct _pdc_obj_prop *cp) free(cp->app_name); free(cp->tags); free(cp->data_loc); - cp = PDC_FREE(struct _pdc_obj_prop, cp); + cp = (struct _pdc_obj_prop *)(intptr_t)PDC_free(cp); FUNC_LEAVE(ret_value); } @@ -303,13 +303,13 @@ PDCcont_prop_get_info(pdcid_t cont_prop) PGOTO_ERROR(NULL, "cannot allocate container property"); info = (struct _pdc_cont_prop *)(prop->obj_ptr); - ret_value = PDC_CALLOC(1, struct _pdc_cont_prop); + ret_value = (struct _pdc_cont_prop *)PDC_calloc(1, sizeof(struct _pdc_cont_prop)); if (!ret_value) PGOTO_ERROR(NULL, "PDC container property memory allocation failed"); ret_value->cont_life = info->cont_life; ret_value->cont_prop_id = info->cont_prop_id; - ret_value->pdc = PDC_CALLOC(1, struct _pdc_class); + ret_value->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (!ret_value->pdc) PGOTO_ERROR(NULL, "cannot allocate ret_value->pdc"); if (info->pdc->name) @@ -336,7 +336,7 @@ PDCobj_prop_get_info(pdcid_t obj_prop) PGOTO_ERROR(NULL, "cannot locate object property"); info = (struct _pdc_obj_prop *)(prop->obj_ptr); - ret_value = PDC_CALLOC(1, struct pdc_obj_prop); + ret_value = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (ret_value == NULL) PGOTO_ERROR(NULL, "PDC object property memory allocation failed"); memcpy(ret_value, info->obj_prop_pub, sizeof(struct pdc_obj_prop)); @@ -367,7 +367,7 @@ PDC_obj_prop_get_info(pdcid_t obj_prop) PGOTO_ERROR(NULL, "cannot locate object property"); info = (struct _pdc_obj_prop *)(prop->obj_ptr); - ret_value = PDC_CALLOC(1, struct _pdc_obj_prop); + ret_value = (struct _pdc_obj_prop *)PDC_calloc(1, sizeof(struct _pdc_obj_prop)); if (ret_value == NULL) PGOTO_ERROR(NULL, "PDC object property memory allocation failed"); memcpy(ret_value, info, sizeof(struct _pdc_obj_prop)); @@ -381,7 +381,7 @@ PDC_obj_prop_get_info(pdcid_t obj_prop) ret_value->tags = strdup(info->tags); /* struct _pdc_class field */ - ret_value->pdc = PDC_CALLOC(1, struct _pdc_class); + ret_value->pdc = (struct _pdc_class *)PDC_calloc(1, sizeof(struct _pdc_class)); if (ret_value->pdc == NULL) PGOTO_ERROR(NULL, "cannot allocate ret_value->pdc"); if (info->pdc->name) @@ -389,7 +389,7 @@ PDC_obj_prop_get_info(pdcid_t obj_prop) ret_value->pdc->local_id = info->pdc->local_id; /* struct pdc_obj_prop field */ - ret_value->obj_prop_pub = PDC_CALLOC(1, struct pdc_obj_prop); + ret_value->obj_prop_pub = (struct pdc_obj_prop *)PDC_calloc(1, sizeof(struct pdc_obj_prop)); if (ret_value->obj_prop_pub == NULL) PGOTO_ERROR(NULL, "PDC object pub property memory allocation failed"); memcpy(ret_value->obj_prop_pub, info->obj_prop_pub, sizeof(struct pdc_obj_prop)); diff --git a/src/api/pdc_region/pdc_region.c b/src/api/pdc_region/pdc_region.c index 7192c9234..5b5aa1fe3 100644 --- a/src/api/pdc_region/pdc_region.c +++ b/src/api/pdc_region/pdc_region.c @@ -106,8 +106,8 @@ pdc_region_close(struct pdc_region_info *op) free(op->size); free(op->offset); if (op->obj != NULL) - op->obj = PDC_FREE(struct _pdc_obj_info, op->obj); - op = PDC_FREE(struct pdc_region_info, op); + op->obj = (struct _pdc_obj_info *)(intptr_t)PDC_free(op->obj); + op = (struct pdc_region_info *)(intptr_t)PDC_free(op); FUNC_LEAVE(ret_value); } @@ -184,7 +184,7 @@ PDCregion_create(psize_t ndims, uint64_t *offset, uint64_t *size) FUNC_ENTER(NULL); - p = PDC_MALLOC(struct pdc_region_info); + p = (struct pdc_region_info *)PDC_malloc(sizeof(struct pdc_region_info)); if (!p) PGOTO_ERROR(ret_value, "PDC region memory allocation failed"); p->ndim = ndims; diff --git a/src/api/pdc_region/pdc_region_transfer.c b/src/api/pdc_region/pdc_region_transfer.c index 87f9f3625..942535323 100644 --- a/src/api/pdc_region/pdc_region_transfer.c +++ b/src/api/pdc_region/pdc_region_transfer.c @@ -208,7 +208,7 @@ PDCregion_transfer_create(void *buf, pdc_access_t access_type, pdcid_t obj_id, p obj2 = (struct _pdc_obj_info *)(objinfo2->obj_ptr); // remote_meta_id = obj2->obj_info_pub->meta_id; - p = PDC_MALLOC(pdc_transfer_request); + p = (pdc_transfer_request *)PDC_malloc(sizeof(pdc_transfer_request)); p->obj_pointer = obj2; p->mem_type = obj2->obj_pt->obj_prop_pub->type; p->obj_id = obj2->obj_info_pub->meta_id; diff --git a/src/api/pdc_transform/pdc_transform.c b/src/api/pdc_transform/pdc_transform.c index d2c8381f5..884cbf434 100644 --- a/src/api/pdc_transform/pdc_transform.c +++ b/src/api/pdc_transform/pdc_transform.c @@ -93,7 +93,8 @@ PDCobj_transform_register(char *func, pdcid_t obj_id, int current_state, int nex if ((ftnPtr = ftnHandle) == NULL) PGOTO_ERROR(FAIL, "Transforms function lookup failed"); - if ((thisFtn = PDC_MALLOC(struct _pdc_region_transform_ftn_info)) == NULL) + if ((thisFtn = (struct _pdc_region_transform_ftn_info *)PDC_malloc( + sizeof(struct _pdc_region_transform_ftn_info))) == NULL) PGOTO_ERROR(FAIL, "PDC register_obj_transforms memory allocation failed"); memset(thisFtn, 0, sizeof(struct _pdc_region_transform_ftn_info)); @@ -206,7 +207,8 @@ PDCbuf_map_transform_register(char *func, void *buf, pdcid_t src_region_id, pdci if ((ftnPtr = ftnHandle) == NULL) PGOTO_ERROR(FAIL, "Transforms function lookup failed\n"); - if ((thisFtn = PDC_MALLOC(struct _pdc_region_transform_ftn_info)) == NULL) + if ((thisFtn = (struct _pdc_region_transform_ftn_info *)PDC_malloc( + sizeof(struct _pdc_region_transform_ftn_info))) == NULL) PGOTO_ERROR(FAIL, "PDC register_obj_transforms memory allocation failed"); thisFtn->ftnPtr = (size_t(*)())ftnPtr; diff --git a/src/commons/utils/include/pdc_malloc.h b/src/commons/utils/include/pdc_malloc.h index 8c3a36335..e967c9032 100644 --- a/src/commons/utils/include/pdc_malloc.h +++ b/src/commons/utils/include/pdc_malloc.h @@ -76,9 +76,4 @@ void *PDC_free(void *mem); */ size_t PDC_get_global_mem_usage(); -#define PDC_MALLOC(t) (t *)PDC_malloc(sizeof(t)) -#define PDC_CALLOC(c, t) (t *)PDC_calloc(c, sizeof(t)) - -#define PDC_FREE(t, obj) (t *)(intptr_t) PDC_free(obj) - #endif /* PDC_MALLOC_H */ diff --git a/src/server/pdc_server_metadata.c b/src/server/pdc_server_metadata.c index b33087173..02380fcc8 100644 --- a/src/server/pdc_server_metadata.c +++ b/src/server/pdc_server_metadata.c @@ -2766,7 +2766,7 @@ PDC_add_kvtag_to_list(pdc_kvtag_list_t **list_head, pdc_kvtag_t *tag) FUNC_ENTER(NULL); PDC_kvtag_dup(tag, &newtag); - new_list_item = PDC_CALLOC(1, pdc_kvtag_list_t); + new_list_item = (pdc_kvtag_list_t *)PDC_calloc(1, sizeof(pdc_kvtag_list_t)); new_list_item->kvtag = newtag; DL_APPEND(*list_head, new_list_item); diff --git a/src/utils/pdc_interface.c b/src/utils/pdc_interface.c index 727b3ee96..827ae4de6 100644 --- a/src/utils/pdc_interface.c +++ b/src/utils/pdc_interface.c @@ -81,7 +81,7 @@ PDC_register_type(PDC_type_t type_id, PDC_free_t free_func) /* Initialize the type */ if (NULL == (pdc_id_list_g->PDC_id_type_list_g)[type_id]) { /* Allocate the type information for new type */ - if (NULL == (type_ptr = PDC_CALLOC(1, struct PDC_id_type))) + if (NULL == (type_ptr = (struct PDC_id_type *)PDC_calloc(1, sizeof(struct PDC_id_type)))) PGOTO_ERROR(FAIL, "ID type allocation failed"); (pdc_id_list_g->PDC_id_type_list_g)[type_id] = type_ptr; } @@ -120,7 +120,7 @@ PDC_id_register(PDC_type_t type, void *object) type_ptr = (pdc_id_list_g->PDC_id_type_list_g)[type]; if (NULL == type_ptr || type_ptr->init_count <= 0) PGOTO_ERROR(ret_value, "invalid type"); - if (NULL == (id_ptr = PDC_MALLOC(struct _pdc_id_info))) + if (NULL == (id_ptr = (struct _pdc_id_info *)PDC_malloc(sizeof(struct _pdc_id_info)))) PGOTO_ERROR(ret_value, "memory allocation failed"); /* Create the struct & it's ID */ @@ -172,7 +172,7 @@ PDC_dec_ref(pdcid_t id) PDC_MUTEX_LOCK(type_ptr->ids); /* Remove the node from the type */ PDC_LIST_REMOVE(id_ptr, entry); - id_ptr = PDC_FREE(struct _pdc_id_info, id_ptr); + id_ptr = (struct _pdc_id_info *)(intptr_t)PDC_free(id_ptr); /* Decrement the number of IDs in the type */ (type_ptr->id_count)--; ret_value = 0; @@ -267,7 +267,7 @@ PDC_id_list_clear(PDC_type_t type) if (!type_ptr->free_func || (type_ptr->free_func)((void *)id_ptr->obj_ptr) >= 0) { PDC_MUTEX_LOCK(type_ptr->ids); PDC_LIST_REMOVE(id_ptr, entry); - id_ptr = PDC_FREE(struct _pdc_id_info, id_ptr); + id_ptr = (struct _pdc_id_info *)(intptr_t)PDC_free(id_ptr); (type_ptr->id_count)--; PDC_MUTEX_UNLOCK(type_ptr->ids); } @@ -289,7 +289,7 @@ PDC_destroy_type(PDC_type_t type) type_ptr = (pdc_id_list_g->PDC_id_type_list_g)[type]; if (type_ptr == NULL) PGOTO_ERROR(FAIL, "type was not initialized correctly"); - type_ptr = PDC_FREE(struct PDC_id_type, type_ptr); + type_ptr = (struct PDC_id_type *)(intptr_t)PDC_free(type_ptr); done: fflush(stdout);