summaryrefslogtreecommitdiff
path: root/ext/GDBM_File
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-12-13 17:06:26 +0100
committerNicholas Clark <nick@ccl4.org>2012-12-13 17:13:35 +0100
commit708cce4f6b3b5d37df12460d4fa3dca84646cf8b (patch)
tree31ba3e389394d8e5c4b77aef2bd58e432b050c0b /ext/GDBM_File
parentceab7011c2af9d86bd7743d6c1b7c37540fe14f1 (diff)
downloadperl-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/GDBM_File')
-rw-r--r--ext/GDBM_File/GDBM_File.xs7
-rw-r--r--ext/GDBM_File/typemap1
2 files changed, 2 insertions, 6 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