summaryrefslogtreecommitdiff
path: root/src/Display.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Display.c')
-rw-r--r--src/Display.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Display.c b/src/Display.c
index ec01d29..669c8b4 100644
--- a/src/Display.c
+++ b/src/Display.c
@@ -120,9 +120,9 @@ static void AddToAppContext(
#define DISPLAYS_TO_ADD 4
if (app->count >= app->max) {
- app->max += DISPLAYS_TO_ADD;
+ app->max = (short) (app->max + DISPLAYS_TO_ADD);
app->list = (Display **) XtRealloc((char *)app->list,
- (unsigned) app->max * sizeof(Display *));
+ (Cardinal) ((unsigned) app->max * sizeof(Display *)));
}
app->list[app->count++] = d;
@@ -218,8 +218,8 @@ static XtPerDisplay InitPerDisplay(
pd->pdi.keyboard.grabType = XtNoServerGrab;
pd->pdi.pointer.grabType = XtNoServerGrab;
_XtAllocWWTable(pd);
- pd->per_screen_db = (XrmDatabase *)__XtCalloc(ScreenCount(dpy),
- sizeof(XrmDatabase));
+ pd->per_screen_db = (XrmDatabase *)__XtCalloc((Cardinal)ScreenCount(dpy),
+ (Cardinal)sizeof(XrmDatabase));
pd->cmd_db = (XrmDatabase)NULL;
pd->server_db = (XrmDatabase)NULL;
pd->dispatcher_list = NULL;
@@ -288,9 +288,9 @@ Display *XtOpenDisplay(
} else {
int len;
displayName = XDisplayName(displayName);
- len = strlen (displayName);
- app->display_name_tried = (String) __XtMalloc (len + 1);
- strncpy ((char*) app->display_name_tried, displayName, len + 1);
+ len = (int) strlen (displayName);
+ app->display_name_tried = (String) __XtMalloc ((Cardinal)(len + 1));
+ strncpy ((char*) app->display_name_tried, displayName, (size_t) (len + 1));
app->display_name_tried[len] = '\0';
}
if (db) XrmDestroyDatabase(db);
@@ -317,7 +317,7 @@ _XtAppInit(
*/
saved_argv = (String *)
- __XtMalloc( (Cardinal)((*argc_in_out + 1) * sizeof(String)) );
+ __XtMalloc( (Cardinal)((size_t)(*argc_in_out + 1) * sizeof(String)) );
for (i = 0 ; i < *argc_in_out ; i++) saved_argv[i] = (*argv_in_out)[i];
saved_argv[i] = NULL; /* NULL terminate that sucker. */
@@ -329,7 +329,7 @@ _XtAppInit(
if (fallback_resources) /* save a procedure call */
XtAppSetFallbackResources(*app_context_return, fallback_resources);
- dpy = XtOpenDisplay(*app_context_return, (String) NULL, NULL,
+ dpy = XtOpenDisplay(*app_context_return, NULL, NULL,
application_class,
options, num_options, argc_in_out, *argv_in_out);
@@ -507,7 +507,7 @@ void XtDestroyApplicationContext(XtAppContext app)
_XtAppDestroyCount++;
appDestroyList =
(XtAppContext *) XtRealloc((char *) appDestroyList,
- (unsigned) (_XtAppDestroyCount * sizeof(XtAppContext)));
+ (unsigned) ((size_t)_XtAppDestroyCount * sizeof(XtAppContext)));
appDestroyList[_XtAppDestroyCount-1] = app;
UNLOCK_PROCESS;
UNLOCK_APP(app);
@@ -520,7 +520,7 @@ void _XtDestroyAppContexts(void)
XtAppContext apps[8];
XtAppContext* pApps;
- pApps = XtStackAlloc (sizeof (XtAppContext) * _XtAppDestroyCount, apps);
+ pApps = XtStackAlloc (sizeof (XtAppContext) * (size_t)_XtAppDestroyCount, apps);
for (i = ii = 0; i < _XtAppDestroyCount; i++) {
if (_XtSafeToDestroy(appDestroyList[i]))
@@ -566,7 +566,7 @@ XtPerDisplay _XtSortPerDisplayList(Display *dpy)
if (pd == NULL) {
XtErrorMsg(XtNnoPerDisplay, "getPerDisplay", XtCXtToolkitError,
"Couldn't find per display information",
- (String *) NULL, (Cardinal *)NULL);
+ NULL, NULL);
}
if (pd != _XtperDisplayList) { /* move it to the front */
@@ -607,7 +607,7 @@ static void CloseDisplay(Display *dpy)
if (pd == NULL) {
XtErrorMsg(XtNnoPerDisplay, "closeDisplay", XtCXtToolkitError,
"Couldn't find per display information",
- (String *) NULL, (Cardinal *)NULL);
+ NULL, NULL);
}
if (pd == _XtperDisplayList) _XtperDisplayList = pd->next;
@@ -683,7 +683,7 @@ void XtCloseDisplay(Display *dpy)
app->dpy_destroy_count++;
app->dpy_destroy_list = (Display **)
XtRealloc((char *) app->dpy_destroy_list,
- (unsigned) (app->dpy_destroy_count * sizeof(Display *)));
+ (Cardinal) ((size_t)app->dpy_destroy_count * sizeof(Display *)));
app->dpy_destroy_list[app->dpy_destroy_count-1] = dpy;
}
UNLOCK_APP(app);
@@ -756,8 +756,8 @@ void XtGetDisplays(
{
int ii;
LOCK_APP(app_context);
- *num_dpy_return = app_context->count;
- *dpy_return = (Display**)__XtMalloc(app_context->count * sizeof(Display*));
+ *num_dpy_return = (Cardinal)app_context->count;
+ *dpy_return = (Display**)__XtMalloc((Cardinal)((size_t)app_context->count * sizeof(Display*)));
for (ii = 0; ii < app_context->count; ii++)
(*dpy_return)[ii] = app_context->list[ii];
UNLOCK_APP(app_context);