File gcc14-fix-incompatible-pointer-type-const-char.patch of Package hfsutils
diff -Ppdru hfsutils-3.2.6/charset.c hfsutils-3.2.6-new/charset.c
--- hfsutils-3.2.6/charset.c 1998-11-02 23:08:23.000000000 +0100
+++ hfsutils-3.2.6-new/charset.c 2024-03-20 09:44:55.297242529 +0100
@@ -151,7 +151,7 @@ UCS2 *cs_unicode(char *mstr, int *lenptr
* NAME: charset->latin1()
* DESCRIPTION: return a Latin-1 (ISO 8859-1) string for MacOS Standard Roman
*/
-char *cs_latin1(char *mstr, int *lenptr)
+char *cs_latin1(const char *mstr, int *lenptr)
{
int ilen, olen, i;
char *latin1, *ptr;
@@ -229,7 +229,7 @@ void mktable(void)
* NAME: charset->macroman()
* DESCRIPTION: return a MacOS Standard Roman string for Latin-1 (ISO 8859-1)
*/
-char *cs_macroman(char *lstr, int *lenptr)
+char *cs_macroman(const char *lstr, int *lenptr)
{
int ilen, olen, i;
char *macroman, *ptr;
diff -Ppdru hfsutils-3.2.6/charset.h hfsutils-3.2.6-new/charset.h
--- hfsutils-3.2.6/charset.h 1998-04-11 10:26:53.000000000 +0200
+++ hfsutils-3.2.6-new/charset.h 2024-03-20 09:45:06.257071470 +0100
@@ -23,5 +23,5 @@ typedef unsigned short UCS2;
UCS2 *cs_unicode(char *, int *);
-char *cs_latin1(char *, int *);
-char *cs_macroman(char *, int *);
+char *cs_latin1(const char *, int *);
+char *cs_macroman(const char *, int *);
diff -Ppdru hfsutils-3.2.6/copyin.c hfsutils-3.2.6-new/copyin.c
--- hfsutils-3.2.6/copyin.c 2024-03-19 16:06:38.350690737 +0100
+++ hfsutils-3.2.6-new/copyin.c 2024-03-20 09:51:14.812330826 +0100
@@ -82,13 +82,13 @@ int fork_macb(const char *srcname, const
if (bytes == (unsigned long) -1)
{
ERROR(errno, "error reading data");
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
else if (bytes != chunk)
{
ERROR(EIO, "read incomplete chunk");
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -98,13 +98,13 @@ int fork_macb(const char *srcname, const
if (bytes == (unsigned long) -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
else if (bytes != chunk)
{
ERROR(EIO, "wrote incomplete chunk");
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
@@ -125,7 +125,7 @@ int do_macb(const char *srcname, const c
if (hfs_setfork(ofile, 0) == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
@@ -135,7 +135,7 @@ int do_macb(const char *srcname, const c
if (hfs_setfork(ofile, 1) == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
@@ -240,7 +240,7 @@ int do_text(const char *srcname, const c
if (chunk == -1)
{
ERROR(errno, "error reading source file");
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
else if (chunk == 0)
@@ -257,7 +257,7 @@ int do_text(const char *srcname, const c
if (ptr == 0)
{
ERROR(ENOMEM, 0);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -267,13 +267,13 @@ int do_text(const char *srcname, const c
if (bytes == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
else if (bytes != len)
{
ERROR(EIO, "wrote incomplete chunk");
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
}
@@ -297,7 +297,7 @@ int do_raw(const char *srcname, const ch
if (chunk == -1)
{
ERROR(errno, "error reading source file");
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
else if (chunk == 0)
@@ -307,13 +307,13 @@ int do_raw(const char *srcname, const ch
if (bytes == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
else if (bytes != chunk)
{
ERROR(EIO, "wrote incomplete chunk");
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
}
@@ -455,14 +455,14 @@ void closefiles(const char *srcname, con
if (ofile && hfs_close(ofile) == -1 && *result == 0)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
*result = -1;
}
if (close(ifile) == -1 && *result == 0)
{
ERROR(errno, "error closing source file");
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
*result = -1;
}
}
@@ -487,7 +487,7 @@ int cpi_macb(const char *srcname, hfsvol
ifile = opensrc(srcname, &dsthint, ".bin", 1);
if (ifile == -1)
{
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -496,7 +496,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(errno, "error reading MacBinary file header");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -505,7 +505,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(EINVAL, "invalid MacBinary file header");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -518,7 +518,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(EINVAL, "unknown, unsupported, or corrupt MacBinary file");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -527,7 +527,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(EINVAL, "unsupported MacBinary file version");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -537,7 +537,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(EINVAL, "invalid MacBinary file header (bad file name)");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -549,7 +549,7 @@ int cpi_macb(const char *srcname, hfsvol
ERROR(EINVAL, "invalid MacBinary file header (bad file length)");
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -563,7 +563,7 @@ int cpi_macb(const char *srcname, hfsvol
if (ofile == 0)
{
close(ifile);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
@@ -684,7 +684,7 @@ int cpi_binh(const char *srcname, hfsvol
ifile = opensrc(srcname, &dsthint, ".hqx", 0);
if (ifile == -1)
{
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -693,7 +693,7 @@ int cpi_binh(const char *srcname, hfsvol
ERROR(errno, bh_error);
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -701,7 +701,7 @@ int cpi_binh(const char *srcname, hfsvol
{
bh_close();
close(ifile);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -712,26 +712,26 @@ int cpi_binh(const char *srcname, hfsvol
{
bh_close();
close(ifile);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
result = do_binh(ofile, dsize, rsize);
if (result == -1)
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
if (bh_close() == -1 && result == 0)
{
ERROR(errno, bh_error);
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
result = -1;
}
if (result == 0 && hfs_fstat(ofile, &ent) == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
result = -1;
}
@@ -741,7 +741,7 @@ int cpi_binh(const char *srcname, hfsvol
if (result == 0 && hfs_fsetattr(ofile, &ent) == -1)
{
ERROR(errno, hfs_error);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
result = -1;
}
@@ -763,7 +763,7 @@ int cpi_text(const char *srcname, hfsvol
ifile = opensrc(srcname, &dsthint, ".txt", 0);
if (ifile == -1)
{
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -771,7 +771,7 @@ int cpi_text(const char *srcname, hfsvol
if (ofile == 0)
{
close(ifile);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
@@ -795,7 +795,7 @@ int cpi_raw(const char *srcname, hfsvol
ifile = opensrc(srcname, &dsthint, 0, 1);
if (ifile == -1)
{
- hfs_error_path = srcname;
+ hfs_error_path = (char *)srcname;
return -1;
}
@@ -803,7 +803,7 @@ int cpi_raw(const char *srcname, hfsvol
if (ofile == 0)
{
close(ifile);
- hfs_error_path = dstname;
+ hfs_error_path = (char *)dstname;
return -1;
}
diff -Ppdru hfsutils-3.2.6/tclhfs.c hfsutils-3.2.6-new/tclhfs.c
--- hfsutils-3.2.6/tclhfs.c 2024-03-19 16:16:44.288981185 +0100
+++ hfsutils-3.2.6-new/tclhfs.c 2024-03-20 09:52:28.335548848 +0100
@@ -190,7 +190,7 @@ char *direntstr(hfsdirent *ent)
argv[argc++] = "bkdate";
argv[argc++] = bkdate;
- return Tcl_Merge(argc, argv);
+ return Tcl_Merge(argc, (const char **)argv);
}
/*
@@ -275,7 +275,7 @@ void file_del(ClientData clientData)
*/
static
int file_cmd(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+ int argc, const char *argv[])
{
fileref *fref = clientData;
hfsfile *file = fref->file;
@@ -546,7 +546,7 @@ int do_copynative(Tcl_Interp *interp, hf
* DESCRIPTION: copy an HFS file to another HFS volume
*/
static
-int copynative(Tcl_Interp *interp, volref *srcvref, char *argv[])
+int copynative(Tcl_Interp *interp, volref *srcvref, const char *argv[])
{
volref *dstvref;
Tcl_CmdInfo info;
@@ -654,7 +654,7 @@ int copynative(Tcl_Interp *interp, volre
* DESCRIPTION: copy a UNIX file into an HFS volume
*/
static
-int copyin(Tcl_Interp *interp, hfsvol *vol, char *argv[])
+int copyin(Tcl_Interp *interp, hfsvol *vol, const char *argv[])
{
cpifunc copyfile;
@@ -689,7 +689,7 @@ int copyin(Tcl_Interp *interp, hfsvol *v
* DESCRIPTION: copy an HFS file out to a UNIX file
*/
static
-int copyout(Tcl_Interp *interp, hfsvol *vol, char *argv[])
+int copyout(Tcl_Interp *interp, hfsvol *vol, const char *argv[])
{
cpofunc copyfile;
@@ -812,7 +812,7 @@ void vol_del(ClientData clientData)
*/
static
int vol_cmd(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+ int argc, const char *argv[])
{
volref *vref = clientData;
hfsvol *vol = vref->vol;
@@ -889,7 +889,7 @@ int vol_cmd(ClientData clientData, Tcl_I
/* reverse the resulting list */
- if (Tcl_SplitList(interp, interp->result, &listc, &listv) != TCL_OK)
+ if (Tcl_SplitList(interp, interp->result, &listc, (const char ***) &listv) != TCL_OK)
return TCL_ERROR;
for (i = 0; i < listc / 2; ++i)
@@ -901,7 +901,7 @@ int vol_cmd(ClientData clientData, Tcl_I
listv[listc - 1 - i] = tmp;
}
- result = Tcl_Merge(listc, listv);
+ result = Tcl_Merge(listc, (const char **)listv);
free(listv);
Tcl_SetResult(interp, result, TCL_DYNAMIC);
@@ -1034,7 +1034,7 @@ int vol_cmd(ClientData clientData, Tcl_I
if (hfs_setcwd(vol, vref->cwd) == -1)
return error(interp, 0);
- if (Tcl_SplitList(interp, argv[2], &listc, &listv) != TCL_OK)
+ if (Tcl_SplitList(interp, argv[2], &listc, (const char ***)&listv) != TCL_OK)
return TCL_ERROR;
fargv = hfs_glob(vol, listc, listv, &fargc);
@@ -1046,7 +1046,7 @@ int vol_cmd(ClientData clientData, Tcl_I
return TCL_ERROR;
}
- result = Tcl_Merge(fargc, fargv);
+ result = Tcl_Merge(fargc, (const char **) fargv);
free(fargv);
Tcl_SetResult(interp, result, TCL_DYNAMIC);
@@ -1119,7 +1119,7 @@ int vol_cmd(ClientData clientData, Tcl_I
file_ref(interp, vref, fref, file);
}
else if (strcmp(argv[1], "copy") == 0)
- return copynative(interp, vref, argv);
+ return copynative(interp, vref, (const char **) argv);
else if (strcmp(argv[1], "copyin") == 0)
{
if (hfs_setcwd(vol, vref->cwd) == -1)
@@ -1157,7 +1157,7 @@ int vol_cmd(ClientData clientData, Tcl_I
*/
static
int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+ int argc, const char *argv[])
{
static int id = 0;
@@ -1307,7 +1307,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
char **listv;
unsigned long *badblocks;
- if (Tcl_SplitList(interp, argv[5], &listc, &listv) != TCL_OK)
+ if (Tcl_SplitList(interp, argv[5], &listc, (const char ***)&listv) != TCL_OK)
return TCL_ERROR;
badblocks = ALLOCX(unsigned long, listc);
@@ -1377,7 +1377,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
result = cs_latin1(argv[4], 0);
else
{
- Tcl_SetResult(interp, argv[4], TCL_VOLATILE);
+ Tcl_SetResult(interp, (char *)argv[4], TCL_VOLATILE);
return TCL_OK;
}
@@ -1448,7 +1448,7 @@ int cmd_hfs(ClientData clientData, Tcl_I
*/
static
int cmd_exit(ClientData clientData, Tcl_Interp *interp,
- int argc, char *argv[])
+ int argc, const char *argv[])
{
int status = 0;