summaryrefslogtreecommitdiffstats
path: root/usr.sbin/makefs
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2016-10-16 21:47:03 +0000
committertedu <tedu@openbsd.org>2016-10-16 21:47:03 +0000
commit4095a2e01d1837f69f4677ecc0cf1af6543ce573 (patch)
tree7458e00bbc4e19706cf5776c8af216b22e75b750 /usr.sbin/makefs
parentm_resethdr() clears information attached to a mbuf that has been (diff)
downloadwireguard-openbsd-4095a2e01d1837f69f4677ecc0cf1af6543ce573.tar.xz
wireguard-openbsd-4095a2e01d1837f69f4677ecc0cf1af6543ce573.zip
there's no need for a special typedef and function pointer for picking
between two functions.
Diffstat (limited to 'usr.sbin/makefs')
-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