summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-07-15 19:58:35 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-07-15 19:58:35 -0400
commitc3ff775bfe4556ffbe920cbfbc860e471dfc7f07 (patch)
tree0fbeaafb2ec09955240bac3eb3a9bbe49a44f52e /src/session.c
parentf7a9ead69089a862fbd9aab6995980d3ecd290bf (diff)
fix gcc-normal compiler warnings, no object change
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/session.c b/src/session.c
index e12a6c0..03b84a1 100644
--- a/src/session.c
+++ b/src/session.c
@@ -145,8 +145,8 @@ write_ushort (FILE *file, unsigned short s)
{
unsigned char file_short[2];
- file_short[0] = (s & (unsigned)0xff00) >> 8;
- file_short[1] = s & 0xff;
+ file_short[0] = (unsigned char)((s & (unsigned)0xff00) >> 8);
+ file_short[1] = (unsigned char)(s & 0xff);
if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
return 0;
return 1;
@@ -158,8 +158,8 @@ write_short (FILE *file, short s)
{
unsigned char file_short[2];
- file_short[0] = (s & (unsigned)0xff00) >> 8;
- file_short[1] = s & 0xff;
+ file_short[0] = (unsigned char)(((unsigned)s & (unsigned)0xff00) >> 8);
+ file_short[1] = (unsigned char)(s & 0xff);
if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
return 0;
return 1;
@@ -171,7 +171,7 @@ write_counted_string (FILE *file, char *string)
{
if (string)
{
- unsigned char count = strlen (string);
+ unsigned char count = (unsigned char)strlen (string);
if (write_byte (file, count) == 0)
return 0;
@@ -205,7 +205,7 @@ read_ushort (FILE *file, unsigned short *shortp)
if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
return 0;
- *shortp = file_short[0] * 256 + file_short[1];
+ *shortp = (unsigned short)(file_short[0] * 256 + file_short[1]);
return 1;
}
@@ -217,7 +217,7 @@ read_short (FILE *file, short *shortp)
if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
return 0;
- *shortp = file_short[0] * 256 + file_short[1];
+ *shortp = (short)(file_short[0] * 256 + file_short[1]);
return 1;
}
@@ -335,7 +335,7 @@ WriteWinConfigEntry (FILE *configFile, TwmWindow *theWindow,
}
else
{
- if (!write_byte (configFile, (char) wm_command_count))
+ if (!write_byte (configFile, (unsigned char) wm_command_count))
return 0;
for (i = 0; i < wm_command_count; i++)
if (!write_counted_string (configFile, wm_command[i]))
@@ -426,7 +426,7 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version,
entry->wm_command = NULL;
else
{
- entry->wm_command = malloc (entry->wm_command_count *
+ entry->wm_command = malloc ((size_t)entry->wm_command_count *
sizeof (char *));
if (!entry->wm_command)
@@ -720,7 +720,7 @@ unique_filename (
static void
-SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
+SaveYourselfPhase2CB (SmcConn smcConn2, SmPointer clientData)
{
int scrnum;
ScreenInfo *theScreen;
@@ -749,7 +749,7 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
prop1.num_vals = 1;
prop1.vals = &prop1val;
prop1val.value = Argv[0];
- prop1val.length = strlen (Argv[0]);
+ prop1val.length = (int)strlen (Argv[0]);
snprintf (userId, sizeof(userId), "%ld", (long)getuid());
prop2.name = SmUserID;
@@ -757,7 +757,7 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (SmPointer) userId;
- prop2val.length = strlen (userId);
+ prop2val.length = (int)strlen (userId);
prop3.name = SmRestartStyleHint;
prop3.type = SmCARD8;
@@ -770,7 +770,7 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
props[1] = &prop2;
props[2] = &prop3;
- SmcSetProperties (smcConn, 3, props);
+ SmcSetProperties (smcConn2, 3, props);
first_time = 0;
}
@@ -831,7 +831,7 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
prop1.name = SmRestartCommand;
prop1.type = SmLISTofARRAY8;
- prop1.vals = malloc ((Argc + 4) * sizeof (SmPropValue));
+ prop1.vals = malloc ((size_t)(Argc + 4) * sizeof (SmPropValue));
if (!prop1.vals)
{
@@ -851,7 +851,7 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
else
{
prop1.vals[numVals].value = (SmPointer) Argv[i];
- prop1.vals[numVals++].length = strlen (Argv[i]);
+ prop1.vals[numVals++].length = (int)strlen (Argv[i]);
}
}
@@ -859,13 +859,13 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
prop1.vals[numVals++].length = 9;
prop1.vals[numVals].value = (SmPointer) twm_clientId;
- prop1.vals[numVals++].length = strlen (twm_clientId);
+ prop1.vals[numVals++].length = (int)strlen (twm_clientId);
prop1.vals[numVals].value = (SmPointer) "-restore";
prop1.vals[numVals++].length = 8;
prop1.vals[numVals].value = (SmPointer) filename;
- prop1.vals[numVals++].length = strlen (filename);
+ prop1.vals[numVals++].length = (int)strlen (filename);
prop1.num_vals = numVals;
@@ -875,16 +875,16 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (SmPointer) discardCommand;
- prop2val.length = strlen (discardCommand);
+ prop2val.length = (int)strlen (discardCommand);
props[0] = &prop1;
props[1] = &prop2;
- SmcSetProperties (smcConn, 2, props);
+ SmcSetProperties (smcConn2, 2, props);
free (prop1.vals);
bad:
- SmcSaveYourselfDone (smcConn, success);
+ SmcSaveYourselfDone (smcConn2, success);
sent_save_done = 1;
if (configFile)
@@ -898,16 +898,16 @@ SaveYourselfPhase2CB (SmcConn smcConn, SmPointer clientData)
static void
SaveYourselfCB (
- SmcConn smcConn,
+ SmcConn smcConn2,
SmPointer clientData,
int saveType,
Bool shutdown,
int interactStyle,
Bool fast)
{
- if (!SmcRequestSaveYourselfPhase2 (smcConn, SaveYourselfPhase2CB, NULL))
+ if (!SmcRequestSaveYourselfPhase2 (smcConn2, SaveYourselfPhase2CB, NULL))
{
- SmcSaveYourselfDone (smcConn, False);
+ SmcSaveYourselfDone (smcConn2, False);
sent_save_done = 1;
}
else
@@ -917,9 +917,9 @@ SaveYourselfCB (
static void
-DieCB (SmcConn smcConn, SmPointer clientData)
+DieCB (SmcConn smcConn2, SmPointer clientData)
{
- SmcCloseConnection (smcConn, 0, NULL);
+ SmcCloseConnection (smcConn2, 0, NULL);
XtRemoveInput (iceInputId);
Done(NULL, NULL);
}
@@ -935,11 +935,11 @@ SaveCompleteCB (SmcConn smcConnm, SmPointer clientData)
static void
-ShutdownCancelledCB (SmcConn smcConn, SmPointer clientData)
+ShutdownCancelledCB (SmcConn smcConn2, SmPointer clientData)
{
if (!sent_save_done)
{
- SmcSaveYourselfDone (smcConn, False);
+ SmcSaveYourselfDone (smcConn2, False);
sent_save_done = 1;
}
}