summaryrefslogtreecommitdiff
path: root/src/Resources.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Resources.c')
-rw-r--r--src/Resources.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/Resources.c b/src/Resources.c
index 562aac9..50d30fb 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -96,7 +96,7 @@ void _XtCopyFromParent(
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidParent","xtCopyFromParent",XtCXtToolkitError,
"CopyFromParent must have non-NULL parent",
- (String *)NULL, (Cardinal *)NULL);
+ NULL, NULL);
value->addr = NULL;
return;
}
@@ -173,7 +173,7 @@ void _XtCopyToArg(
(void) memmove((char*)dst, (char*)src, (size_t)size );
#else
XtErrorMsg("invalidGetValues", "xtGetValues", XtCXtToolkitError,
- "NULL ArgVal in XtGetValues", (String*) NULL, (Cardinal*) NULL);
+ "NULL ArgVal in XtGetValues", NULL, NULL);
#endif
}
else {
@@ -290,7 +290,7 @@ void _XtCompileResourceList(
xrmres->xrm_name = PSToQ(resources->resource_name);
xrmres->xrm_class = PSToQ(resources->resource_class);
xrmres->xrm_type = PSToQ(resources->resource_type);
- xrmres->xrm_offset = (Cardinal)
+ xrmres->xrm_offset = (int)
(-(int)resources->resource_offset - 1);
xrmres->xrm_default_type = PSToQ(resources->default_type);
}
@@ -311,7 +311,7 @@ static void XrmCompileResourceListEphem(
xrmres->xrm_name = StringToName(resources->resource_name);
xrmres->xrm_class = StringToClass(resources->resource_class);
xrmres->xrm_type = StringToQuark(resources->resource_type);
- xrmres->xrm_offset = (Cardinal)
+ xrmres->xrm_offset = (int)
(-(int)resources->resource_offset - 1);
xrmres->xrm_default_type = StringToQuark(resources->default_type);
}
@@ -363,7 +363,7 @@ void _XtDependencies(
/* Allocate and initialize new_res with superclass resource pointers */
new_num_res = super_num_res + class_num_res;
- new_res = (XrmResourceList *) __XtMalloc(new_num_res*sizeof(XrmResourceList));
+ new_res = (XrmResourceList *) __XtMalloc((Cardinal)(new_num_res*sizeof(XrmResourceList)));
if (super_num_res > 0)
XtMemmove(new_res, super_res, super_num_res * sizeof(XrmResourceList));
@@ -452,7 +452,7 @@ XrmResourceList* _XtCreateIndirectionTable (
register Cardinal idx;
XrmResourceList* table;
- table = (XrmResourceList*)__XtMalloc(num_resources * sizeof(XrmResourceList));
+ table = (XrmResourceList*)__XtMalloc((Cardinal)(num_resources * sizeof(XrmResourceList)));
for (idx = 0; idx < num_resources; idx++)
table[idx] = (XrmResourceList)(&(resources[idx]));
return table;
@@ -491,7 +491,7 @@ static XtCacheRef *GetResources(
XtCacheRef *cache_ptr, *cache_base;
Boolean persistent_resources = True;
Boolean found_persistence = False;
- int num_typed_args = *pNumTypedArgs;
+ int num_typed_args = (int) *pNumTypedArgs;
XrmDatabase db;
Boolean do_tm_hack = False;
@@ -499,7 +499,7 @@ static XtCacheRef *GetResources(
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidArgCount","getResources",XtCXtToolkitError,
"argument count > 0 on NULL argument list",
- (String *)NULL, (Cardinal *)NULL);
+ NULL, NULL);
num_args = 0;
}
if (num_resources == 0) {
@@ -508,13 +508,13 @@ static XtCacheRef *GetResources(
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidResourceCount","getResources",XtCXtToolkitError,
"too many resources",
- (String *)NULL, (Cardinal *)NULL);
+ NULL, NULL);
return NULL;
} else if (table == NULL) {
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidResourceCount","getResources",XtCXtToolkitError,
"resource count > 0 on NULL resource list",
- (String *)NULL, (Cardinal *)NULL);
+ NULL, NULL);
return NULL;
}
@@ -584,12 +584,12 @@ static XtCacheRef *GetResources(
db = XtScreenDatabase(XtScreenOfObject(widget));
while (!XrmQGetSearchList(db, names, classes,
- searchList, searchListSize)) {
+ searchList, (int) searchListSize)) {
if (searchList == stackSearchList)
searchList = NULL;
searchList = (XrmHashTable*)XtRealloc((char*)searchList,
- sizeof(XrmHashTable) *
- (searchListSize *= 2));
+ (Cardinal) (sizeof(XrmHashTable) *
+ (searchListSize *= 2)));
}
if (persistent_resources)
@@ -612,7 +612,7 @@ static XtCacheRef *GetResources(
XrmValue from_val, to_val;
from_type = StringToQuark(arg->type);
- from_val.size = arg->size;
+ from_val.size = (Cardinal) arg->size;
if ((from_type == QString) || ((unsigned) arg->size > sizeof(XtArgVal)))
from_val.addr = (XPointer)arg->value;
else
@@ -645,12 +645,12 @@ static XtCacheRef *GetResources(
if (widget->core.screen != oldscreen) {
db = XtScreenDatabase(widget->core.screen);
while (!XrmQGetSearchList(db, names, classes,
- searchList, searchListSize)) {
+ searchList, (int) searchListSize)) {
if (searchList == stackSearchList)
searchList = NULL;
searchList = (XrmHashTable*)XtRealloc((char*)searchList,
- sizeof(XrmHashTable) *
- (searchListSize *= 2));
+ (Cardinal)(sizeof(XrmHashTable) *
+ (searchListSize *= 2)));
}
}
}
@@ -692,7 +692,7 @@ static XtCacheRef *GetResources(
for (res = table, j = 0; j < num_resources; j++, res++) {
rx = *res;
- xrm_type = rx->xrm_type;
+ xrm_type = (XrmRepresentation) rx->xrm_type;
if (typed[j]) {
register XtTypedArg* arg = typed_args + typed[j] - 1;
@@ -706,7 +706,7 @@ static XtCacheRef *GetResources(
Boolean converted;
from_type = StringToQuark(arg->type);
- from_val.size = arg->size;
+ from_val.size = (Cardinal) arg->size;
if ((from_type == QString) || ((unsigned) arg->size > sizeof(XtArgVal)))
from_val.addr = (XPointer)arg->value;
else
@@ -733,7 +733,7 @@ static XtCacheRef *GetResources(
*/
if(rx->xrm_size > sizeof(XtArgVal)) {
- arg->value = (XtArgVal) __XtMalloc(rx->xrm_size);
+ arg->value = (XtArgVal) (void *) __XtMalloc(rx->xrm_size);
arg->size = -(arg->size);
} else { /* will fit - copy directly into value field */
arg->value = (XtArgVal) NULL;
@@ -755,7 +755,7 @@ static XtCacheRef *GetResources(
Boolean have_value = False;
if (XrmQGetSearchResource(searchList,
- rx->xrm_name, rx->xrm_class, &rawType, &value)) {
+ (XrmName) rx->xrm_name, (XrmClass) rx->xrm_class, &rawType, &value)) {
if (rawType != xrm_type) {
convValue.size = rx->xrm_size;
convValue.addr = (XPointer)(base - rx->xrm_offset - 1);
@@ -774,7 +774,7 @@ static XtCacheRef *GetResources(
|| (rx->xrm_default_type == xrm_type)
|| (rx->xrm_default_addr != NULL))) {
/* Convert default value to proper type */
- xrm_default_type = rx->xrm_default_type;
+ xrm_default_type = (XrmRepresentation) rx->xrm_default_type;
if (xrm_default_type == QCallProc) {
(*(XtResourceDefaultProc)(rx->xrm_default_addr))(
widget,-(rx->xrm_offset+1), &value);
@@ -806,7 +806,7 @@ static XtCacheRef *GetResources(
} else {
value.addr = rx->xrm_default_addr;
if (xrm_default_type == QString) {
- value.size = strlen((char *)value.addr) + 1;
+ value.size = (unsigned) strlen((char *)value.addr) + 1;
} else {
value.size = sizeof(XtPointer);
}
@@ -876,15 +876,15 @@ static XtCacheRef *GetResources(
}
}
}
- if ((Cardinal)num_typed_args != *pNumTypedArgs) *pNumTypedArgs = num_typed_args;
+ if ((Cardinal)num_typed_args != *pNumTypedArgs) *pNumTypedArgs = (Cardinal) num_typed_args;
if (searchList != stackSearchList) XtFree((char*)searchList);
if (!cache_ptr)
cache_ptr = cache_base;
if (cache_ptr && cache_ptr != cache_ref) {
- int cache_ref_size = cache_ptr - cache_ref;
+ int cache_ref_size = (int) (cache_ptr - cache_ref);
XtCacheRef *refs = (XtCacheRef*)
- __XtMalloc((unsigned)sizeof(XtCacheRef)*(cache_ref_size + 1));
- (void) memmove(refs, cache_ref, sizeof(XtCacheRef)*cache_ref_size );
+ __XtMalloc((Cardinal)(sizeof(XtCacheRef) * (size_t)(cache_ref_size + 1)));
+ (void) memmove(refs, cache_ref, sizeof(XtCacheRef)*(size_t)cache_ref_size );
refs[cache_ref_size] = NULL;
return refs;
}
@@ -909,7 +909,7 @@ static void CacheArgs(
count = (args != NULL) ? num_args : num_typed_args;
if (num_quarks < count) {
- quarks = (XrmQuarkList) __XtMalloc(count * sizeof(XrmQuark));
+ quarks = (XrmQuarkList) __XtMalloc((Cardinal)(count * sizeof(XrmQuark)));
} else {
quarks = quark_cache;
}
@@ -1145,7 +1145,7 @@ void _XtResourceListInitialize(void)
if (initialized) {
XtWarningMsg("initializationError","xtInitialize",XtCXtToolkitError,
"Initializing Resource Lists twice",
- (String *)NULL, (Cardinal *)NULL);
+ NULL, NULL);
UNLOCK_PROCESS;
return;
}