diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-12-13 17:06:26 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-12-13 17:13:35 +0100 |
commit | 708cce4f6b3b5d37df12460d4fa3dca84646cf8b (patch) | |
tree | 31ba3e389394d8e5c4b77aef2bd58e432b050c0b /ext | |
parent | ceab7011c2af9d86bd7743d6c1b7c37540fe14f1 (diff) | |
download | perl-708cce4f6b3b5d37df12460d4fa3dca84646cf8b.tar.gz |
Eliminate the fifth argument from GDBM_File::TIEHASH.
This was intended to provide control of the callback used by gdbm* functions
in case of fatal errors (such as filesystem problems), but did not work (and
could never have worked). No code on CPAN even attempted to use it. The
callback is now always the previous default, croak.
This eliminates the only used of 'FATALFUNC' in the *DBM modules' type
files, so remove it from all of them.
It also eliminates a cast from a data pointer to a function pointer, which
is not legal C, and rightly upsets pedantic ANSI C compilers. The fact that
there was exactly cast, and only in one direction, gives a clue as to how
likely this was ever to work.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/GDBM_File/GDBM_File.xs | 7 | ||||
-rw-r--r-- | ext/GDBM_File/typemap | 1 | ||||
-rw-r--r-- | ext/NDBM_File/typemap | 1 | ||||
-rw-r--r-- | ext/ODBM_File/typemap | 1 | ||||
-rw-r--r-- | ext/SDBM_File/typemap | 1 |
5 files changed, 2 insertions, 9 deletions
diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index 4eb00d5e8d..6e28f22418 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -25,8 +25,6 @@ typedef datum datum_key_copy; #define GDBM_BLOCKSIZE 0 /* gdbm defaults to stat blocksize */ -typedef void (*FATALFUNC)(); - #ifndef GDBM_FAST static int not_here(char *s) @@ -70,18 +68,17 @@ MODULE = GDBM_File PACKAGE = GDBM_File PREFIX = gdbm_ INCLUDE: const-xs.inc GDBM_File -gdbm_TIEHASH(dbtype, name, read_write, mode, fatal_func = (FATALFUNC)croak_string) +gdbm_TIEHASH(dbtype, name, read_write, mode) char * dbtype char * name int read_write int mode - FATALFUNC fatal_func CODE: { GDBM_FILE dbp ; RETVAL = NULL ; - if ((dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, fatal_func))) { + if ((dbp = gdbm_open(name, GDBM_BLOCKSIZE, read_write, mode, croak_string))) { RETVAL = (GDBM_File)safecalloc(1, sizeof(GDBM_File_type)) ; RETVAL->dbp = dbp ; } diff --git a/ext/GDBM_File/typemap b/ext/GDBM_File/typemap index d97acd414c..8d6edeed35 100644 --- a/ext/GDBM_File/typemap +++ b/ext/GDBM_File/typemap @@ -11,7 +11,6 @@ SDBM_File T_PTROBJ ODBM_File T_PTROBJ DB_File T_PTROBJ DBZ_File T_PTROBJ -FATALFUNC T_OPAQUEPTR INPUT T_DATUM_K diff --git a/ext/NDBM_File/typemap b/ext/NDBM_File/typemap index bb741e4ee7..91f4dcbd84 100644 --- a/ext/NDBM_File/typemap +++ b/ext/NDBM_File/typemap @@ -11,7 +11,6 @@ SDBM_File T_PTROBJ ODBM_File T_PTROBJ DB_File T_PTROBJ DBZ_File T_PTROBJ -FATALFUNC T_OPAQUEPTR INPUT T_DATUM_K diff --git a/ext/ODBM_File/typemap b/ext/ODBM_File/typemap index 2612dfda14..8aed61c8c5 100644 --- a/ext/ODBM_File/typemap +++ b/ext/ODBM_File/typemap @@ -12,7 +12,6 @@ SDBM_File T_PTROBJ ODBM_File T_PTROBJ DB_File T_PTROBJ DBZ_File T_PTROBJ -FATALFUNC T_OPAQUEPTR INPUT T_DATUM_K diff --git a/ext/SDBM_File/typemap b/ext/SDBM_File/typemap index d1fc497f45..44370f21e0 100644 --- a/ext/SDBM_File/typemap +++ b/ext/SDBM_File/typemap @@ -11,7 +11,6 @@ SDBM_File T_PTROBJ ODBM_File T_PTROBJ DB_File T_PTROBJ DBZ_File T_PTROBJ -FATALFUNC T_OPAQUEPTR INPUT T_DATUM_K |