summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/session.c b/src/session.c
index 94b4d63..92b25bb 100644
--- a/src/session.c
+++ b/src/session.c
@@ -216,7 +216,7 @@ read_counted_string(FILE *file, char **stringp)
data = 0;
}
else {
- data = malloc((unsigned) len + 1);
+ data = (char *) malloc((unsigned) len + 1);
if (!data)
return 0;
if (fread(data, (int) sizeof(char), (int) len, file) != len) {
@@ -275,6 +275,7 @@ WriteWinConfigEntry(FILE *configFile, TwmWindow *theWindow,
{
char **wm_command;
int wm_command_count;
+ unsigned udummy = 0;
if (!write_counted_string(configFile, clientId))
return 0;
@@ -283,9 +284,9 @@ WriteWinConfigEntry(FILE *configFile, TwmWindow *theWindow,
return 0;
if (!windowRole) {
- if (!write_counted_string(configFile, theWindow->class.res_name))
+ if (!write_counted_string(configFile, theWindow->xclass.res_name))
return 0;
- if (!write_counted_string(configFile, theWindow->class.res_class))
+ if (!write_counted_string(configFile, theWindow->xclass.res_class))
return 0;
if (theWindow->nameChanged) {
/*
@@ -330,9 +331,10 @@ WriteWinConfigEntry(FILE *configFile, TwmWindow *theWindow,
if (theWindow->icon_w) {
int icon_x, icon_y;
+ Window wdummy = None;
- XGetGeometry(dpy, theWindow->icon_w, &JunkRoot, &icon_x,
- &icon_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth);
+ XGetGeometry(dpy, theWindow->icon_w, &wdummy, &icon_x,
+ &icon_y, &udummy, &udummy, &udummy, &udummy);
if (!write_short(configFile, (short) icon_x))
return 0;
@@ -366,15 +368,15 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version,
unsigned char byte;
int i;
- *pentry = entry = malloc(sizeof(TWMWinConfigEntry));
+ *pentry = entry = (TWMWinConfigEntry *) malloc(sizeof(TWMWinConfigEntry));
if (!*pentry)
return 0;
entry->tag = 0;
entry->client_id = NULL;
entry->window_role = NULL;
- entry->class.res_name = NULL;
- entry->class.res_class = NULL;
+ entry->xclass.res_name = NULL;
+ entry->xclass.res_class = NULL;
entry->wm_name = NULL;
entry->wm_command = NULL;
entry->wm_command_count = 0;
@@ -386,9 +388,9 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version,
goto give_up;
if (!entry->window_role) {
- if (!read_counted_string(configFile, &entry->class.res_name))
+ if (!read_counted_string(configFile, &entry->xclass.res_name))
goto give_up;
- if (!read_counted_string(configFile, &entry->class.res_class))
+ if (!read_counted_string(configFile, &entry->xclass.res_class))
goto give_up;
if (!read_counted_string(configFile, &entry->wm_name))
goto give_up;
@@ -400,8 +402,8 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version,
if (entry->wm_command_count == 0)
entry->wm_command = NULL;
else {
- entry->wm_command = malloc((size_t) entry->wm_command_count *
- sizeof(char *));
+ entry->wm_command = (char **)
+ malloc((size_t) entry->wm_command_count * sizeof(char *));
if (!entry->wm_command)
goto give_up;
@@ -458,10 +460,10 @@ ReadWinConfigEntry(FILE *configFile, unsigned short version,
free(entry->client_id);
if (entry->window_role)
free(entry->window_role);
- if (entry->class.res_name)
- free(entry->class.res_name);
- if (entry->class.res_class)
- free(entry->class.res_class);
+ if (entry->xclass.res_name)
+ free(entry->xclass.res_name);
+ if (entry->xclass.res_class)
+ free(entry->xclass.res_class);
if (entry->wm_name)
free(entry->wm_name);
if (entry->wm_command_count && entry->wm_command) {
@@ -555,10 +557,10 @@ GetWindowConfig(TwmWindow *theWindow,
* changed in the previous session.
*/
- if (strcmp(theWindow->class.res_name,
- ptr->class.res_name) == 0 &&
- strcmp(theWindow->class.res_class,
- ptr->class.res_class) == 0 &&
+ if (strcmp(theWindow->xclass.res_name,
+ ptr->xclass.res_name) == 0 &&
+ strcmp(theWindow->xclass.res_class,
+ ptr->xclass.res_class) == 0 &&
(ptr->wm_name == NULL ||
strcmp(theWindow->name, ptr->wm_name) == 0)) {
if (clientId) {
@@ -771,7 +773,8 @@ SaveYourselfPhase2CB(SmcConn smcConn2, SmPointer clientData _X_UNUSED)
prop1.name = strdup(SmRestartCommand);
prop1.type = strdup(SmLISTofARRAY8);
- prop1.vals = malloc((size_t) (Argc + 4) * sizeof(SmPropValue));
+ prop1.vals = (SmPropValue *)
+ malloc((size_t) (Argc + 4) * sizeof(SmPropValue));
if (!prop1.vals) {
success = False;
@@ -878,7 +881,7 @@ ProcessIceMsgProc(XtPointer client_data, int *source _X_UNUSED,
}
void
-ConnectToSessionManager(char *previous_id)
+ConnectToSessionManager(char *previous_id, XtAppContext appContext)
{
char errorMsg[256];
unsigned long mask;