summaryrefslogtreecommitdiff
path: root/src/Resources.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Resources.c')
-rw-r--r--src/Resources.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Resources.c b/src/Resources.c
index 274f9d7..cb60ab2 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -374,8 +374,7 @@ _XtDependencies(XtResourceList *class_resp, /* VAR */
/* Allocate and initialize new_res with superclass resource pointers */
new_num_res = super_num_res + class_num_res;
- new_res = (XrmResourceList *)
- __XtMalloc((Cardinal) (new_num_res * sizeof(XrmResourceList)));
+ new_res = XtMallocArray(new_num_res, (Cardinal) sizeof(XrmResourceList));
if (super_num_res > 0)
memcpy(new_res, super_res, super_num_res * sizeof(XrmResourceList));
@@ -461,8 +460,7 @@ _XtCreateIndirectionTable(XtResourceList resources, Cardinal num_resources)
register Cardinal idx;
XrmResourceList *table;
- table = (XrmResourceList *)
- __XtMalloc((Cardinal) (num_resources * sizeof(XrmResourceList)));
+ table = XtMallocArray(num_resources, (Cardinal) sizeof(XrmResourceList));
for (idx = 0; idx < num_resources; idx++)
table[idx] = (XrmResourceList) (&(resources[idx]));
return table;
@@ -920,9 +918,8 @@ GetResources(Widget widget, /* Widget resources are associated with
cache_ptr = cache_base;
if (cache_ptr && cache_ptr != cache_ref) {
int cache_ref_size = (int) (cache_ptr - cache_ref);
- XtCacheRef *refs = (XtCacheRef *)
- __XtMalloc((Cardinal)
- (sizeof(XtCacheRef) * (size_t) (cache_ref_size + 1)));
+ XtCacheRef *refs = XtMallocArray((Cardinal) cache_ref_size + 1,
+ (Cardinal) sizeof(XtCacheRef));
(void) memcpy(refs, cache_ref,
sizeof(XtCacheRef) * (size_t) cache_ref_size);
@@ -948,8 +945,7 @@ CacheArgs(ArgList args,
count = (args != NULL) ? num_args : num_typed_args;
if (num_quarks < count) {
- quarks =
- (XrmQuarkList) __XtMalloc((Cardinal) (count * sizeof(XrmQuark)));
+ quarks = XtMallocArray(count, (Cardinal) sizeof(XrmQuark));
}
else {
quarks = quark_cache;