delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2005/05/12/22:02:27

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Authenticated: #27081556
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: More signedess issues in the cvs tree
Date: Fri, 13 May 2005 04:11:14 +0200
User-Agent: KMail/1.5.1
MIME-Version: 1.0
Message-Id: <200505130411.14826.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

There are even more signedess issues in the sources. Here is a new patch fixing
some of them. May be it will be worth to thincking about making the signedess
warning not to abort compilation instead of correcting almost every source file
in the cvs tree.
Please note that the patch is far from be complete.

Regards,
Juan M. Guerrero


diff -aprNU3 djgpp.orig/src/djasm/djasm.y djgpp/src/djasm/djasm.y
--- djgpp.orig/src/djasm/djasm.y	2005-05-11 22:06:08.000000000 +0000
+++ djgpp/src/djasm/djasm.y	2005-05-13 03:19:04.000000000 +0000
@@ -1455,10 +1455,10 @@ int main(int argc, char **argv)
 
   time(&now);
 
-  sprintf(exe+INFO_TEXT_START, "\r\n%s generated from %s by djasm, on %.24s\r\n", argv[2], argv[1], ctime(&now));
+  sprintf((char *)exe+INFO_TEXT_START, "\r\n%s generated from %s by djasm, on %.24s\r\n", argv[2], argv[1], ctime(&now));
   if (copyright)
-    strncat(exe+INFO_TEXT_START, copyright, (512-3-INFO_TEXT_START)-strlen(exe+INFO_TEXT_START)); /* -3 for the following line: */
-  strcat(exe+INFO_TEXT_START, "\r\n\032");
+    strncat((char *)exe+INFO_TEXT_START, copyright, (512-3-INFO_TEXT_START)-strlen((char *)exe+INFO_TEXT_START)); /* -3 for the following line: */
+  strcat((char *)exe+INFO_TEXT_START, "\r\n\032");
 
   if (argv[2] == 0)
   {
diff -aprNU3 djgpp.orig/src/libc/compat/mman/mprotect.c djgpp/src/libc/compat/mman/mprotect.c
--- djgpp.orig/src/libc/compat/mman/mprotect.c	2002-10-18 01:00:26.000000000 +0000
+++ djgpp/src/libc/compat/mman/mprotect.c	2005-05-13 03:23:34.000000000 +0000
@@ -37,7 +37,7 @@ int mprotect(void *addr, size_t len, int
     meminfo.address = start - handle_info->address;
     meminfo.size = npage;
 
-    i = __dpmi_set_page_attributes(&meminfo, pageprot);
+    i = __dpmi_set_page_attributes(&meminfo, (short *)pageprot);
     if(i)
       errno = EACCES;
     return i;
diff -aprNU3 djgpp.orig/src/libc/compat/mntent/mntent.c djgpp/src/libc/compat/mntent/mntent.c
--- djgpp.orig/src/libc/compat/mntent/mntent.c	2003-05-10 17:32:40.000000000 +0000
+++ djgpp/src/libc/compat/mntent/mntent.c	2005-05-13 03:39:46.000000000 +0000
@@ -186,7 +186,7 @@ get_doublespace_info(int drive_num)
       int host = r.h.bl & 0x7f;
 
       /* Compressed drive, get the host and sequence number of the CVF.  */
-      sprintf(mnt_fsname, "%c:\\DBLSPACE.%03u", 'A' + host, r.h.bh);
+      sprintf((char *)mnt_fsname, "%c:\\DBLSPACE.%03u", 'A' + host, r.h.bh);
       mnt_type = NAME_dblsp;
       return 1;
     }
@@ -252,7 +252,7 @@ get_stacker_info(int drive_num)
      table beginning at offset 70h).  */
   seq  = _farpeekb(dos_mem_base, stac_driver_ptr + 0x58);
   host = _farpeekb(dos_mem_base, stac_driver_ptr + 0x70 + drive_num - 1);
-  sprintf(mnt_fsname, "%c:\\STACVOL.%03u", 'A' + host, seq);
+  sprintf((char *)mnt_fsname, "%c:\\STACVOL.%03u", 'A' + host, seq);
   mnt_type = NAME_stac;
   return 1;
 }
@@ -591,7 +591,7 @@ getmntent(FILE *filep)
 	    drive_number = drive_a_mapping;
         }
 
-      drvstr_len = sprintf(drive_string, "%c:\\", '@' + drive_number);
+      drvstr_len = sprintf((char *)drive_string, "%c:\\", '@' + drive_number);
       mnt_type = NAME_unknown;
 
       /* For the ``File System Name'' we use one of the following:
@@ -611,7 +611,7 @@ getmntent(FILE *filep)
       /* See what 2160 can tell us.  If it fails, there ain't no such
          drive, as far as DOS is concerned.  Some DOS clones, like NT,
 	 don't always upcase the drive letter, so we must do that here.  */
-      truename_result = _truename(drive_string, mnt_fsname);
+      truename_result = _truename((char *)drive_string, (char *)mnt_fsname);
       if (truename_result && mnt_fsname[0]
 	  && mnt_fsname[1] == ':' && islower(mnt_fsname[0]))
 	mnt_fsname[0] = toupper((unsigned char)mnt_fsname[0]);
@@ -623,7 +623,7 @@ getmntent(FILE *filep)
 	 DOS clones, such as NT, don't put them into the CDS.  */
       if (drive_number <= cds_drives
 	  && !_is_remote_drive (drive_number - 1))
-        cds_flags = get_cds_entry(drive_number, cds_path);
+        cds_flags = get_cds_entry(drive_number, (char *)cds_path);
 
       if (truename_result != NULL)
         {
@@ -703,9 +703,9 @@ getmntent(FILE *filep)
                cds_path[0] != '\0')
         {
           mnt_type = NAME_join;
-          strcpy(drive_string, cds_path);
-          drvstr_len = strlen(drive_string);
-          strcat(drive_string, "\\");
+          strcpy((char *)drive_string, (char *)cds_path);
+          drvstr_len = strlen((char *)drive_string);
+          strcat((char *)drive_string, "\\");
 
           /* Don't set got_fsname, so that we get a chance to look for
              a volume label below.  */
@@ -726,12 +726,12 @@ getmntent(FILE *filep)
           int e = errno;
           int volume_found = 0;
 
-          strcat(drive_string, "*.*");
+          strcat((char *)drive_string, "*.*");
           errno = 0;
           /* Windows 2000/XP can't find labels with LFN=y, so help it */
           if (w2k_bug)
             putenv(unconst("LFN=n",char *));
-          volume_found = findfirst(drive_string, &mnt_ff, FA_LABEL) == 0;
+          volume_found = findfirst((char *)drive_string, &mnt_ff, FA_LABEL) == 0;
           /* Floppies and other disks written by Windows 9X include
              entries that have volume label bit set, but they are
              actually parts of some LFN entry.  We only accept volume
@@ -752,8 +752,8 @@ getmntent(FILE *filep)
               errno = e;
 
               /* Got label.  Strip out extraneous '.' separator, if present. */
-              strcpy(mnt_fsname, mnt_ff.ff_name);
-              if (strlen(mnt_fsname) > 8 && mnt_fsname[8] == '.')
+              strcpy((char *)mnt_fsname, mnt_ff.ff_name);
+              if (strlen((char *)mnt_fsname) > 8 && mnt_fsname[8] == '.')
                 {
                   /* Overlapping copy, don't use strcpy() */
                   p = mnt_fsname + 8;
@@ -789,7 +789,7 @@ getmntent(FILE *filep)
               /* Valid drive, but no label.  Construct default
                  filesystem name.  If drive A: is mapped to B:,
                  call it ``Drive A:''.  */
-              (void) strcpy(mnt_fsname, "Drive  :");
+              (void) strcpy((char *)mnt_fsname, "Drive  :");
               mnt_fsname[6] = (drive_number == 2 && drive_a_mapping == 2)
                               ? 'A'
                               : '@' + drive_number;
@@ -804,7 +804,7 @@ getmntent(FILE *filep)
           /* Remove the '*.*' from the drive string for use as mnt_dir */
           drive_string[drvstr_len] = '\0';
           if (mnt_dir[0] == '\0')
-            strcpy(mnt_dir, drive_string);
+            strcpy((char *)mnt_dir, (char *)drive_string);
 
           /* Format mnt_dir[] for beauty.  */
           for (p = mnt_dir; *p; p++)
@@ -816,8 +816,8 @@ getmntent(FILE *filep)
             }
 
           /* Should we convert ``\\HOST\PATH'' into ``HOST:PATH''?  */
-          mntent.mnt_fsname = mnt_fsname;
-          mntent.mnt_dir    = mnt_dir;
+          mntent.mnt_fsname = (char *)mnt_fsname;
+          mntent.mnt_dir    = (char *)mnt_dir;
           mntent.mnt_type   = mnt_type;
           mntent.mnt_opts   = dev_opts;
 
diff -aprNU3 djgpp.orig/src/libc/compat/stdlib/random.c djgpp/src/libc/compat/stdlib/random.c
--- djgpp.orig/src/libc/compat/stdlib/random.c	2002-04-16 23:14:18.000000000 +0000
+++ djgpp/src/libc/compat/stdlib/random.c	2005-05-13 03:44:14.000000000 +0000
@@ -141,8 +141,8 @@ static unsigned long randtbl[DEG_3 + 1] 
  * to point to randtbl[1] (as explained below).
  */
 
-static  long		*fptr			= &randtbl[ SEP_3 + 1 ];
-static  long		*rptr			= &randtbl[ 1 ];
+static  long		*fptr			= (long *)&randtbl[ SEP_3 + 1 ];
+static  long		*rptr			= (long *)&randtbl[ 1 ];
 
 /*
  * The following things are the pointer to the state information table,
@@ -156,11 +156,11 @@ static  long		*rptr			= &randtbl[ 1 ];
  * the front and rear pointers have wrapped.
  */
 
-static  long		*state			= &randtbl[ 1 ];
+static  long		*state			= (long *)&randtbl[ 1 ];
 static  int		rand_type		= TYPE_3;
 static  int		rand_deg		= DEG_3;
 static  int		rand_sep		= SEP_3;
-static  long		*end_ptr		= &randtbl[ DEG_3 + 1 ];
+static  long		*end_ptr		= (long *)&randtbl[ DEG_3 + 1 ];
 
 /*
  * srandom:

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019