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

[MiNT] warning fixes for MiNTlib



more attached.

Alan.
diff --git a/include/features.h.in b/include/features.h.in
index 30f50a5..9f8994d 100644
--- a/include/features.h.in
+++ b/include/features.h.in
@@ -63,6 +63,8 @@
    __USE_XOPEN		Define XPG things.
    __USE_XOPEN_EXTENDED	Define X/Open Unix things.
    __USE_UNIX98		Define Single Unix V2 things.
+   __USE_XOPEN2K        Define XPG6 things.
+   __USE_LARGEFILE	Define correct standard I/O things.
    __USE_LARGEFILE64	Define LFS things with separate names.
    __USE_FILE_OFFSET64	Define 64bit interface as default.
    __USE_BSD		Define 4.3BSD things.
diff --git a/mintlib/crtinit.c b/mintlib/crtinit.c
index 9f58ed3..8a361f6 100644
--- a/mintlib/crtinit.c
+++ b/mintlib/crtinit.c
@@ -410,7 +410,7 @@ do_argc:
 	 */
 	if (null_list) {
 		char *s;
-		unsigned long idx;
+		long idx;
 
 		while (*null_list) {
 			s = null_list;
diff --git a/mintlib/gmon.c b/mintlib/gmon.c
index 7cbd98e..93324a9 100644
--- a/mintlib/gmon.c
+++ b/mintlib/gmon.c
@@ -79,14 +79,9 @@ __writev (int s, const struct iovec *iov, int niov)
 	int i;
 
 	for (i = 0; i < niov; i++) {
-		if (iov[i].iov_len >= 0) {
-			int r = __write (s, iov[i].iov_base, iov[i].iov_len);
-			if (r < 0) return r;
-			ret += r;
-		} else {
-			__set_errno (EINVAL);
-			return -1;
-		}
+		int r = __write (s, iov[i].iov_base, iov[i].iov_len);
+		if (r < 0) return r;
+		ret += r;
 	}
 	return ret;	
 }
diff --git a/mintlib/spawn.c b/mintlib/spawn.c
index 72f6473..eabd204 100644
--- a/mintlib/spawn.c
+++ b/mintlib/spawn.c
@@ -483,8 +483,6 @@ need_more_core:
 	{
 #ifdef HASH_BANG
 		if (rval == -ENOEXEC) {
-			char	*umode;
-
 			if (__scriptable) {
 				(void)Mfree(env);
 				return interpret_script(mode, path, _path, _argv, _envp);
diff --git a/misc/mkstemp.c b/misc/mkstemp.c
index 0bd1bda..ee637d3 100644
--- a/misc/mkstemp.c
+++ b/misc/mkstemp.c
@@ -38,7 +38,7 @@ mkstemp (char* template)
 {
   size_t len;
   pid_t pid = getpid ();
-  int i0, i1, i2, j0, j1, j2;
+  unsigned int i0, i1, i2, j0, j1, j2;
   int saved_errno;
   
   if (template == NULL)
diff --git a/misc/mktemp.c b/misc/mktemp.c
index 406c1ef..9b2ed52 100644
--- a/misc/mktemp.c
+++ b/misc/mktemp.c
@@ -24,7 +24,7 @@ mktemp (char* template)
 {
   size_t len;
   pid_t pid = getpid ();
-  int i0, i1, i2, j0, j1, j2;
+  unsigned int i0, i1, i2, j0, j1, j2;
   int saved_errno;
   
   if (template == NULL)
diff --git a/misc/syslog.c b/misc/syslog.c
index 11de150..278877d 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -161,7 +161,7 @@ vsyslog(int pri, const char* fmt, va_list argp)
 			*b++ = c;
 			continue;
 		}
-		if ((unsigned)olderrno > _sys_nerr)
+		if (olderrno > _sys_nerr)
 			(void)sprintf(b, "error %d", olderrno);
 		else
 			strcpy(b, _sys_errlist[olderrno]);
@@ -186,6 +186,8 @@ vsyslog(int pri, const char* fmt, va_list argp)
 	if (!(LogStat & LOG_CONS))
 		return;
 
+	strcat(o, "\r");
+
 	/* output the message to the console */
 #if defined SYSV
 	pid = fork();
@@ -205,7 +207,6 @@ vsyslog(int pri, const char* fmt, va_list argp)
 		alarm(5);
 		fd = open(ctty, O_WRONLY);
 		alarm(0);
-		strcat(o, "\r");
 		o = index(outline, '>') + 1;
 		write(fd, o, c + 1 - (o - outline));
 		close(fd);
diff --git a/posix/usleep.c b/posix/usleep.c
index e0d4829..74289dd 100644
--- a/posix/usleep.c
+++ b/posix/usleep.c
@@ -19,7 +19,7 @@ clock_t _clock (void);
 void
 usleep (unsigned long usec)
 {
-	unsigned long stop;
+	long stop;
 	int r = -ENOSYS;
 
 	if (usec >= 1000)
diff --git a/stdio/tempnam.c b/stdio/tempnam.c
index a49bbfe..e8f2e70 100644
--- a/stdio/tempnam.c
+++ b/stdio/tempnam.c
@@ -29,7 +29,7 @@ tempnam (const char* dir, const char* prefix)
 {
   static char buf[L_tmpnam];
   pid_t pid = getpid ();
-  int i0, i1, i2, j0, j1, j2;
+  unsigned int i0, i1, i2, j0, j1, j2;
   int saved_errno;
   size_t len;
   char* tmpdir = (char*) (dir == NULL || (strlen (dir) > L_tmpnam - 13) ?