[AD] Small patch for DJGPP version.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Very small patch against current CVS version, file
allegro/tools/datedit.c, which allows compilation on DJGPP with
`WARNMODE' set to 1.

It seems that on DJGPP, time_t is an unsigned type, yet it is compared
to -1. However, browsing the library sources, I see that mktime() does
indeed return -1, so this is an oversight in the library rather than
Allegro. This patch just casts -1 to time_t format.

--- cvs/allegro/tools/datedit.c	Wed Aug 16 23:27:30 2000
+++ d:/allegro/tools/datedit.c	Wed Aug 16 23:34:44 2000
@@ -1295,7 +1295,7 @@
       /* make timezone adjustments by converting to time_t with adjustment 
        * from local time, then back again as GMT (=UTC) */
       time_t tm = mktime (&t);
-      if (tm != -1) {
+      if (tm != (time_t)-1) {
 	 struct tm *temp = gmtime (&tm);
 	 if (temp) memcpy (&t, temp, sizeof t);
       }
Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/