From: "Christoph Egger" Subject: [PATCH] libfsimage: Make it build on NetBSD Date: Fri, 21 Sep 2007 14:39:46 +0200 Message-ID: <200709211439.46415.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_Su78GkKZcKNgZ4b" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_Su78GkKZcKNgZ4b Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch makes libfsimage build on NetBSD by fixing a number of those errors: cc1: warnings being treated as errors fsys_fat.c: In function 'fat_dir': fsys_fat.c:304: warning: array subscript has type 'char' Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_Su78GkKZcKNgZ4b Content-Type: text/plain; charset=iso-8859-1; name=tools_libfsimage.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=tools_libfsimage.diff diff -r 40bf3ffff484 tools/libfsimage/fat/fsys_fat.c --- a/tools/libfsimage/fat/fsys_fat.c Thu Sep 20 16:02:22 2007 +0100 +++ b/tools/libfsimage/fat/fsys_fat.c Fri Sep 21 14:34:10 2007 +0000 @@ -301,7 +301,7 @@ fat_dir (fsi_file_t *ffi, char *dirname) /* if we have a real file (and we're not just printing possibilities), then this is where we want to exit */ - if (!*dirname || isspace (*dirname)) + if (!*dirname || isspace ((uint8_t)*dirname)) { if (attrib & FAT_ATTRIB_DIR) { @@ -325,7 +325,7 @@ fat_dir (fsi_file_t *ffi, char *dirname) /* Directories don't have a file size */ filemax = INT_MAX; - for (rest = dirname; (ch = *rest) && !isspace (ch) && ch != '/'; rest++); + for (rest = dirname; (ch = *rest) && !isspace ((uint8_t)ch) && ch != '/'; rest++); *rest = 0; @@ -426,13 +426,13 @@ fat_dir (fsi_file_t *ffi, char *dirname) { int i, j, c; - for (i = 0; i < 8 && (c = filename[i] = tolower (dir_buf[i])) - && !isspace (c); i++); + for (i = 0; i < 8 && (c = filename[i] = tolower ((uint8_t)dir_buf[i])) + && !isspace ((uint8_t)c); i++); filename[i++] = '.'; - for (j = 0; j < 3 && (c = filename[i + j] = tolower (dir_buf[8 + j])) - && !isspace (c); j++); + for (j = 0; j < 3 && (c = filename[i + j] = tolower ((uint8_t)dir_buf[8 + j])) + && !isspace ((uint8_t)c); j++); if (j == 0) i--; diff -r 40bf3ffff484 tools/libfsimage/iso9660/fsys_iso9660.c --- a/tools/libfsimage/iso9660/fsys_iso9660.c Thu Sep 20 16:02:22 2007 +0100 +++ b/tools/libfsimage/iso9660/fsys_iso9660.c Fri Sep 21 14:34:10 2007 +0000 @@ -164,7 +164,7 @@ iso9660_dir (fsi_file_t *ffi, char *dirn /* pathlen = strcspn(dirname, "/\n\t "); */ for (pathlen = 0 ; dirname[pathlen] - && !isspace(dirname[pathlen]) && dirname[pathlen] != '/' ; + && !isspace((uint8_t)dirname[pathlen]) && dirname[pathlen] != '/' ; pathlen++) ; diff -r 40bf3ffff484 tools/libfsimage/reiserfs/fsys_reiserfs.c --- a/tools/libfsimage/reiserfs/fsys_reiserfs.c Thu Sep 20 16:02:22 2007 +0100 +++ b/tools/libfsimage/reiserfs/fsys_reiserfs.c Fri Sep 21 14:34:10 2007 +0000 @@ -1029,7 +1029,7 @@ reiserfs_dir (fsi_file_t *ffi, char *dir /* Find out how long our remaining name is. */ len = 0; - while (dirname[len] && !isspace (dirname[len])) + while (dirname[len] && !isspace ((uint8_t)dirname[len])) len++; if (filemax + len > sizeof (linkbuf) - 1) @@ -1078,7 +1078,7 @@ reiserfs_dir (fsi_file_t *ffi, char *dir /* if we have a real file (and we're not just printing possibilities), then this is where we want to exit */ - if (! *dirname || isspace (*dirname)) + if (! *dirname || isspace ((uint8_t)*dirname)) { if (! S_ISREG (mode)) { @@ -1102,14 +1102,14 @@ reiserfs_dir (fsi_file_t *ffi, char *dir } /* continue with the file/directory name interpretation */ - while (*dirname == '/') + while ((uint8_t)*dirname == '/') dirname++; if (! S_ISDIR (mode)) { errnum = ERR_BAD_FILETYPE; return 0; } - for (rest = dirname; (ch = *rest) && ! isspace (ch) && ch != '/'; rest++); + for (rest = dirname; (ch = *rest) && ! isspace ((uint8_t)ch) && ch != '/'; rest++); *rest = 0; # ifndef STAGE1_5 diff -r 40bf3ffff484 tools/libfsimage/ufs/fsys_ufs.c --- a/tools/libfsimage/ufs/fsys_ufs.c Thu Sep 20 16:02:22 2007 +0100 +++ b/tools/libfsimage/ufs/fsys_ufs.c Fri Sep 21 14:34:10 2007 +0000 @@ -72,13 +72,13 @@ ufs_dir(fsi_file_t *ffi, char *dirname) while (*dirname == '/') dirname++; - while (inode && *dirname && !isspace(*dirname)) { + while (inode && *dirname && !isspace((uint8_t)*dirname)) { if (!openi(ffi, inode)) return 0; /* parse for next path component */ fname = dirname; - while (*dirname && !isspace(*dirname) && *dirname != '/') + while (*dirname && !isspace((uint8_t)*dirname) && *dirname != '/') dirname++; ch = *dirname; *dirname = 0; /* ensure null termination */ --Boundary-00=_Su78GkKZcKNgZ4b Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_Su78GkKZcKNgZ4b--