Module Name:    src
Committed By:   tsutsui
Date:           Fri May 31 20:31:05 UTC 2024

Modified Files:
        src/external/gpl2/mkhybrid/dist: apple.c apple_proto.h

Log Message:
Appease discard-const warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/mkhybrid/dist/apple.c
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/mkhybrid/dist/apple_proto.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/mkhybrid/dist/apple.c
diff -u src/external/gpl2/mkhybrid/dist/apple.c:1.2 src/external/gpl2/mkhybrid/dist/apple.c:1.3
--- src/external/gpl2/mkhybrid/dist/apple.c:1.2	Fri May 31 20:23:33 2024
+++ src/external/gpl2/mkhybrid/dist/apple.c	Fri May 31 20:31:05 2024
@@ -34,17 +34,17 @@
 typedef struct directory_entry dir_ent;
 
 /* routines for getting HFS names and info */
-static int get_none_dir(char *, char *, dir_ent *, int);
+static int get_none_dir(char *, const char *, dir_ent *, int);
 static int get_none_info(char *, char *, dir_ent *, int);
-static int get_cap_dir(char *, char *, dir_ent *, int);
+static int get_cap_dir(char *, const char *, dir_ent *, int);
 static int get_cap_info(char *, char *, dir_ent *, int);
 static int get_es_info(char *, char *, dir_ent *, int);
 static int get_dbl_info(char *, char *, dir_ent *, int);
 static int get_mb_info(char *, char *, dir_ent *, int);
 static int get_sgl_info(char *, char *, dir_ent *, int);
-static int get_fe_dir(char *, char *, dir_ent *, int);
+static int get_fe_dir(char *, const char *, dir_ent *, int);
 static int get_fe_info(char *, char *, dir_ent *, int);
-static int get_sgi_dir(char *, char *, dir_ent *, int);
+static int get_sgi_dir(char *, const char *, dir_ent *, int);
 static int get_sgi_info(char *, char *, dir_ent *, int);
 
 void map_ext(char *, char **, char **, unsigned short *, char *);
@@ -63,11 +63,11 @@ static unsigned int	hselect;		/* type of
 struct hfs_type {			/* Types of various HFS Unix files */
   int	type;					/* type of file */
   int	flags;					/* special flags */
-  char *info;           			/* finderinfo name */
-  char *rsrc;           			/* resource fork name */
+  const char *info;           			/* finderinfo name */
+  const char *rsrc;           			/* resource fork name */
   int  (*get_info)(char*, char*, dir_ent*,int);	/* finderinfo function */
-  int  (*get_dir)(char*, char*,dir_ent*,int);	/* directory name function */
-  char *desc;					/* description */
+  int  (*get_dir)(char*, const char*,dir_ent*,int); /* directory name function */
+  const char *desc;				/* description */
 };
 
 /* Above filled in */
@@ -93,7 +93,7 @@ static char tmp_type[CT_SIZE+1], tmp_cre
 **	':' is replaced by '%' and string is terminated with '\0'
 */
 void
-cstrncpy(char *t, char *f, int c)
+cstrncpy(char *t, const char *f, int c)
 {
 	while (c-- && *f)
 	{
@@ -135,7 +135,7 @@ dehex(char c)
 }
 
 static unsigned char
-hex2char(char *s)
+hex2char(const char *s)
 {
 	unsigned char o;
 
@@ -164,7 +164,7 @@ hex2char(char *s)
 **	
 */
 void
-hstrncpy(unsigned char *t, char *f, int c)
+hstrncpy(unsigned char *t, const char *f, int c)
 {
 	unsigned char	o;
 	while (c-- && *f)
@@ -211,7 +211,7 @@ basename(char *a)
 **	get_none_dir: ordinary Unix directory
 */
 int
-get_none_dir(char *hname, char *dname, dir_ent *s_entry, int ret)
+get_none_dir(char *hname, const char *dname, dir_ent *s_entry, int ret)
 {
 	/* just copy the given name */
 	hstrncpy(s_entry->hfs_ent->name, dname, HFS_MAX_FLEN);
@@ -270,9 +270,9 @@ read_info_file(char *name, void *info, i
 **	get_cap_dir: get the CAP name for a directory
 */
 int
-get_cap_dir(char *hname, char *dname, dir_ent *s_entry, int ret)
+get_cap_dir(char *hname, const char *dname, dir_ent *s_entry, int ret)
 /* char		*hname				whole path */
-/* char		*dname				this dir name */
+/* const char	*dname				this dir name */
 /* dir_ent	*s_entry			directory entry */
 {
 	FileInfo	info;			/* finderinfo struct */
@@ -1029,7 +1029,7 @@ del_hfs_info(struct hfs_info *hfs_info)
 **		as the key
 */
 hfsdirent *
-match_key(struct hfs_info *hfs_info, char *key)
+match_key(struct hfs_info *hfs_info, const char *key)
 {
 	while (hfs_info) {
 	    if (!strcasecmp(key, hfs_info->keyname))
@@ -1046,9 +1046,9 @@ match_key(struct hfs_info *hfs_info, cha
 **	base on probing with od ...
 */
 int
-get_fe_dir(char *hname, char *dname, dir_ent *s_entry, int ret)
+get_fe_dir(char *hname, const char *dname, dir_ent *s_entry, int ret)
 /* char		*hname				whole path */
-/* char		*dname				this dir name */
+/* const char	*dname				this dir name */
 /* dir_ent	*s_entry			directory entry */
 {
 	struct hfs_info *hfs_info;
@@ -1152,9 +1152,9 @@ get_fe_info(char *hname, char *dname, di
 **	base on probing with od ...
 */
 int
-get_sgi_dir(char *hname, char *dname, dir_ent *s_entry, int ret)
+get_sgi_dir(char *hname, const char *dname, dir_ent *s_entry, int ret)
 /* char		*hname				whole path */
-/* char		*dname				this dir name */
+/* const char	*dname				this dir name */
 /* dir_ent	*s_entry			directory entry */
 {
 	struct hfs_info *hfs_info;
@@ -1241,7 +1241,7 @@ get_sgi_info(char *hname, char *dname, d
 **	get_hfs_itype: get the type of HFS info for a file
 */
 int
-get_hfs_itype(char *wname, char *dname, char *htmp)
+get_hfs_itype(const char *wname, const char *dname, char *htmp)
 {
 	int	wlen, i;
 
@@ -1268,7 +1268,7 @@ get_hfs_itype(char *wname, char *dname, 
 **	get_hfs_dir: set the HFS directory name
 */
 int
-get_hfs_dir(char *wname, char *dname, dir_ent *s_entry)
+get_hfs_dir(const char *wname, const const char *dname, dir_ent *s_entry)
 {
 	int	type;
 

Index: src/external/gpl2/mkhybrid/dist/apple_proto.h
diff -u src/external/gpl2/mkhybrid/dist/apple_proto.h:1.1 src/external/gpl2/mkhybrid/dist/apple_proto.h:1.2
--- src/external/gpl2/mkhybrid/dist/apple_proto.h:1.1	Fri May 31 19:49:02 2024
+++ src/external/gpl2/mkhybrid/dist/apple_proto.h	Fri May 31 20:31:05 2024
@@ -26,7 +26,7 @@ extern void hfs_init(char *, unsigned sh
 extern void clean_hfs(void);
 extern int hfs_exclude(char *);
 extern int get_hfs_rname(char *, char *, char *);
-extern int get_hfs_dir(char *, char *, struct directory_entry *);
+extern int get_hfs_dir(const char *, const char *, struct directory_entry *);
 extern int get_hfs_info(char *, char *, struct directory_entry *);
 extern void print_hfs_info(struct directory_entry *);
 extern void delete_rsrc_ent(struct directory_entry *);

Reply via email to