1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

ttsnoop: adjust data types to ensure the result of pointer comparison is

correct.
This commit is contained in:
Liang Chang 2021-02-20 00:57:33 +08:00 committed by Jon Trulson
parent a25a32157f
commit 75a4e93d38

View file

@ -339,6 +339,7 @@ choiceOkayed(
_DtTtChooserAction choice = (_DtTtChooserAction)ival; _DtTtChooserAction choice = (_DtTtChooserAction)ival;
Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label; Widget label = dtb_ttsnoop_ttsnoop_win.ttsnoopWin_label;
switch (choice) { switch (choice) {
void *pval;
int ival, fd; int ival, fd;
Tt_message msg; Tt_message msg;
Tt_pattern pat; Tt_pattern pat;
@ -396,9 +397,9 @@ choiceOkayed(
if (text == 0) { if (text == 0) {
return; return;
} }
ival = 0; pval = NULL;
sscanf( text, "%i", &ival ); sscanf( text, "%p", &pval );
msg = (Tt_message) (intptr_t) ival; msg = (Tt_message) (intptr_t) pval;
if (DtTtIndex( DTTT_MESSAGE, msg ) < 0) { if (DtTtIndex( DTTT_MESSAGE, msg ) < 0) {
return; return;
} }
@ -431,9 +432,9 @@ choiceOkayed(
if (text == 0) { if (text == 0) {
return; return;
} }
ival = 0; pval = NULL;
sscanf( text, "%i", &ival ); sscanf( text, "%p", &pval );
pat = (Tt_pattern) (intptr_t) ival; pat = (Tt_pattern) (intptr_t) pval;
if (DtTtIndex( DTTT_PATTERN, pat ) < 0) { if (DtTtIndex( DTTT_PATTERN, pat ) < 0) {
return; return;
} }
@ -465,9 +466,9 @@ choiceOkayed(
if (text == 0) { if (text == 0) {
return; return;
} }
ival = 0; pval = NULL;
sscanf( text, "%i", &ival ); sscanf( text, "%p", &pval );
pats = (Tt_pattern *) (intptr_t) ival; pats = (Tt_pattern *) (intptr_t) pval;
if (DtTtIndex( DTTT_DTSESSION, pats ) < 0) { if (DtTtIndex( DTTT_DTSESSION, pats ) < 0) {
return; return;
} }
@ -491,9 +492,9 @@ choiceOkayed(
if (text == 0) { if (text == 0) {
return; return;
} }
ival = 0; pval = NULL;
sscanf( text, "%i", &ival ); sscanf( text, "%p", &pval );
pats = (Tt_pattern *) (intptr_t) ival; pats = (Tt_pattern *) (intptr_t) pval;
if (DtTtIndex( DTTT_DTFILE, pats ) < 0) { if (DtTtIndex( DTTT_DTFILE, pats ) < 0) {
return; return;
} }