[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] some mintlib warning fixes



Attached.

Alan.
Index: mintlib/ctype.c
===================================================================
RCS file: /mint/mintlib/mintlib/ctype.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ctype.c
--- mintlib/ctype.c	12 Oct 2000 10:56:40 -0000	1.1.1.1
+++ mintlib/ctype.c	28 Feb 2008 11:34:22 -0000
@@ -20,7 +20,7 @@
 		/* some code uses these as function pointers --  i   */
 		/* have seen code that does.			     */
 
-static int _myctype[UCHAR_MAX + 1] =
+static unsigned int _myctype[UCHAR_MAX + 1] =
 	{
 	0,						/* EOF */
 	_CTc, _CTc, _CTc, _CTc,				/* 0x00..0x03 */
Index: mintlib/do_fstat.c
===================================================================
RCS file: /mint/mintlib/mintlib/do_fstat.c,v
retrieving revision 1.3
diff -u -r1.3 do_fstat.c
--- mintlib/do_fstat.c	8 Oct 2003 15:23:14 -0000	1.3
+++ mintlib/do_fstat.c	28 Feb 2008 11:34:22 -0000
@@ -35,8 +35,6 @@
 
 			r = Fcntl (fd, &xattr, FSTAT);
 			if (r == 0) {
-				unsigned short *ptr;
-
 				__bzero (st, sizeof (*st));
 
 				st->st_dev = (dev_t) xattr.st_dev;
@@ -48,12 +46,13 @@
 				st->st_rdev = (dev_t) xattr.st_rdev;
 
 				if (exact) {
-					ptr = (unsigned short *) &xattr.st_mtime;
-					st->st_mtime = __unixtime (ptr[0], ptr[1]);
-					ptr = (unsigned short *) &xattr.st_atime;
-					st->st_atime = __unixtime (ptr[0], ptr[1]);
-					ptr = (unsigned short *) &xattr.st_ctime;
-					st->st_ctime = __unixtime (ptr[0], ptr[1]);
+					union { unsigned short s[2]; unsigned long l; } data;
+					data.l = xattr.st_mtime;
+					st->st_mtime = __unixtime (data.s[0], data.s[1]);
+					data.l = xattr.st_atime;
+					st->st_atime = __unixtime (data.s[0], data.s[1]);
+					data.l = xattr.st_ctime;
+					st->st_ctime = __unixtime (data.s[0], data.s[1]);
 				}
 
 				st->st_size = (off_t) xattr.st_size;