W3C home > Mailing lists > Public > www-amaya-dev@w3.org > September 2002

PATCH: two issues with int -> char casts.

From: Steve Dunham <dunham@cse.msu.edu>
Date: Thu, 19 Sep 2002 16:04:06 -0400 (EDT)
Message-ID: <3D8A2DCA.2020303@cse.msu.edu>
To: www-amaya-dev@w3.org





Below is a patch for two instances where the output of getc() is
assigned to a char and subsequently compared to EOF (the integer -1).

This issue was caught by GCC on the ARM architecture, which has
unsigned chars.  (So the EOF comparison always fails.)


Thanks,
Steve Dunham
dunham@debian.org

(Please CC replies, I'm not on the mailing list.)

--- Amaya/amaya/trans.c.orig    2002-09-19 12:34:08.000000000 -0700
+++ Amaya/amaya/trans.c 2002-09-19 12:34:24.000000000 -0700
@@ -731,7 +731,7 @@
  static ThotBool ExportSubTree (Element subTree, Document doc)
  {
    char               tmpfilename[MAX_PATH];
-  char               charRead;
+  int                charRead;
    FILE              *inputFile = NULL;
    int                 len;
    ThotBool           result = FALSE;
--- Amaya/thotlib/image/xpmhandler.c.orig       2002-09-19 
12:35:38.000000000 -0700
+++ Amaya/thotlib/image/xpmhandler.c    2002-09-19 12:35:54.000000000 -0700
@@ -170,7 +170,7 @@
  ThotBool IsXpmFormat (char *fn)
  {
    FILE               *f;
-  char                c;
+  int                c;
    ThotBool            res;

    res = FALSE;
Received on Friday, 20 September 2002 03:56:40 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:25:48 UTC