summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-06-01 17:29:15 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-06-01 17:29:15 -0700
commit012115650d15697e1cdc13edf770ac9775b108f4 (patch)
tree6c06b1aa8e7c4f0af1b6cdbbb3eca0dfe6a3ed56
parent7a04d51cb90b9a314eea117bc36fedb2bfaab516 (diff)
Fix -Wsign-compare warning in Syntax() function
Reported by gcc 7.3: xcalc.c: In function ‘Syntax’: xcalc.c:322:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i=0; i < XtNumber(Options); i++) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xcalc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/xcalc.c b/xcalc.c
index d5d980f..f3ca18f 100644
--- a/xcalc.c
+++ b/xcalc.c
@@ -312,14 +312,12 @@ void Quit(void)
*/
static void Syntax(int argc, char **argv)
{
- register int i;
-
(void) fprintf(stderr, "%s: unknown options:", argv[0]);
- for (i=1; i <argc; i++)
+ for (int i = 1; i <argc; i++)
(void) fprintf(stderr, " %s", argv[i]);
(void) fprintf(stderr, "\n\n");
(void) fprintf(stderr, "Usage: %s", argv[0]);
- for (i=0; i < XtNumber(Options); i++)
+ for (Cardinal i = 0; i < XtNumber(Options); i++)
(void) fprintf(stderr, " [%s]", Options[i].option);
(void) fprintf(stderr, "\n");
XtDestroyApplicationContext(xtcontext);