summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2016-10-16 21:47:04 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2016-10-16 21:47:04 +0000
commit4290e84d21bce54a94bc3a6dc9d6c9e2dacca2dd (patch)
treeba70c01c08ae65c899829b1afeb36b4a18bed9a1 /usr.sbin
parent52eda3744afca6f7f2d3755a147aae88f79f1153 (diff)
there's no need for a special typedef and function pointer for picking
between two functions.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/makefs/cd9660.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index 45060de81da..b21f62faaca 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd9660.c,v 1.4 2016/10/16 21:44:43 tedu Exp $ */
+/* $OpenBSD: cd9660.c,v 1.5 2016/10/16 21:47:03 tedu Exp $ */
/* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $ */
/*
@@ -146,10 +146,6 @@ static int cd9660_level1_convert_filename(iso9660_disk *, const char *, char *,
size_t, int);
static int cd9660_level2_convert_filename(iso9660_disk *, const char *, char *,
size_t, int);
-#if 0
-static int cd9660_joliet_convert_filename(iso9660_disk *, const char *, char *,
- int);
-#endif
static int cd9660_convert_filename(iso9660_disk *, const char *, char *, size_t, int);
static void cd9660_populate_dot_records(iso9660_disk *, cd9660node *);
static int64_t cd9660_compute_offsets(iso9660_disk *, cd9660node *, int64_t);
@@ -1599,11 +1595,6 @@ cd9660_compute_full_filename(cd9660node *node, char *buf)
errx(EXIT_FAILURE, "Pathname too long.");
}
-/* NEW filename conversion method */
-typedef int(*cd9660_filename_conversion_functor)(iso9660_disk *, const char *,
- char *, size_t, int);
-
-
/*
* TODO: These two functions are almost identical.
* Some code cleanup is possible here
@@ -1738,16 +1729,6 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname,
return namelen + extlen + found_ext;
}
-#if 0
-static int
-cd9660_joliet_convert_filename(iso9660_disk *diskStructure, const char *oldname,
- char *newname, int is_file)
-{
- /* TODO: implement later, move to cd9660_joliet.c ?? */
-}
-#endif
-
-
/*
* Convert a file name to ISO compliant file name
* @param char * oldname The original filename
@@ -1760,13 +1741,13 @@ static int
cd9660_convert_filename(iso9660_disk *diskStructure, const char *oldname,
char *newname, size_t newnamelen, int is_file)
{
- /* NEW */
- cd9660_filename_conversion_functor conversion_function = 0;
if (diskStructure->isoLevel == 1)
- conversion_function = &cd9660_level1_convert_filename;
+ return cd9660_level1_convert_filename(diskStructure,
+ oldname, newname, newnamelen, is_file);
else if (diskStructure->isoLevel == 2)
- conversion_function = &cd9660_level2_convert_filename;
- return (*conversion_function)(diskStructure, oldname, newname, newnamelen, is_file);
+ return cd9660_level2_convert_filename(diskStructure,
+ oldname, newname, newnamelen, is_file);
+ abort();
}
int