All comments/suggestions/problems are welcome
- Copyright (c) 1995-2013 Paul Marquess. All rights reserved.
+ Copyright (c) 1995-2018 Paul Marquess. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
# include "ppport.h"
#endif
+int DB_File___unused() { return 0; }
+
/* Mention DB_VERSION_MAJOR_CFG, DB_VERSION_MINOR_CFG, and
DB_VERSION_PATCH_CFG here so that Configure pulls them all in. */
# include <db.h>
#endif
+#ifndef PERL_UNUSED_ARG
+# define PERL_UNUSED_ARG(x) ((void)x)
+#endif
+
/* Wall starts with 5.7.x */
#if PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 7)
# ifndef DB_VERSION_MAJOR
# undef dNOOP
-# define dNOOP extern int Perl___notused
+# ifdef __cplusplus
+# define dNOOP (void)0
+# else
+# define dNOOP extern int DB_File___notused()
+# endif
/* Ditto for dXSARGS. */
# undef dXSARGS
#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 5
# define R_SETCURSOR 0x800000
#else
-# define R_SETCURSOR (-100)
+# define R_SETCURSOR (DB_OPFLAGS_MASK)
#endif
#define R_RECNOSYNC 0
#if DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR < 5
# define flagSet(flags, bitmask) ((flags) & (bitmask))
#else
-# define flagSet(flags, bitmask) (((flags) & DB_OPFLAGS_MASK) == (bitmask))
+# define flagSet(flags, bitmask) (((flags) & DB_OPFLAGS_MASK) == (u_int)(bitmask))
#endif
#else /* db version 1.x */
if (flagSet(flags, R_CURSOR)) {
return ((db->cursor)->c_put)(db->cursor, &key, &value, DB_CURRENT);
}
-
if (flagSet(flags, R_SETCURSOR)) {
if ((db->dbp)->put(db->dbp, NULL, &key, &value, 0) != 0)
return -1 ;
int retval ;
int count ;
+#ifdef AT_LEAST_DB_3_2
+ PERL_UNUSED_ARG(db);
+#endif
+#ifdef AT_LEAST_DB_6_0
+ PERL_UNUSED_ARG(locp);
+#endif
if (CurrentDB->in_compare) {
tidyUp(CurrentDB);
int retval ;
int count ;
+#ifdef AT_LEAST_DB_3_2
+ PERL_UNUSED_ARG(db);
+#endif
+
if (CurrentDB->in_prefix){
tidyUp(CurrentDB);
croak ("DB_File btree_prefix: recursion detected\n") ;
int retval = 0;
int count ;
+#ifdef AT_LEAST_DB_3_2
+ PERL_UNUSED_ARG(db);
+#endif
+
if (CurrentDB->in_hash){
tidyUp(CurrentDB);
croak ("DB_File hash callback: recursion detected\n") ;
dTHX;
#endif
SV * sv = perl_get_sv(ERR_BUFF, FALSE) ;
+#ifdef AT_LEAST_DB_4_3
+ PERL_UNUSED_ARG(dbenv);
+#endif
if (sv) {
if (db_errpfx)
sv_setpvf(sv, "%s: %s", db_errpfx, buffer) ;
value = (int)SvIV(*svp) ;
if (fixed) {
- status = dbp->set_re_pad(dbp, value) ;
+ (void)dbp->set_re_pad(dbp, value) ;
}
else {
- status = dbp->set_re_delim(dbp, value) ;
+ (void)dbp->set_re_delim(dbp, value) ;
}
}
svp = hv_fetch(action, "reclen", 6, FALSE);
if (svp) {
u_int32_t len = my_SvUV32(*svp) ;
- status = dbp->set_re_len(dbp, len) ;
+ (void)dbp->set_re_len(dbp, len) ;
}
}
if (name != NULL) {
- status = dbp->set_re_source(dbp, name) ;
+ (void)dbp->set_re_source(dbp, name) ;
name = NULL ;
}
name = NULL ;
- status = dbp->set_flags(dbp, (u_int32_t)DB_RENUMBER) ;
+ (void)dbp->set_flags(dbp, (u_int32_t)DB_RENUMBER) ;
if (flags){
(void)dbp->set_flags(dbp, (u_int32_t)flags) ;
SV * sv_err = perl_get_sv(ERR_BUFF, GV_ADD|GV_ADDMULTI) ;
#endif
MY_CXT_INIT;
+#ifdef WANT_ERROR
+ PERL_UNUSED_VAR(sv_err); /* huh? we just retrieved it... */
+#endif
__getBerkeleyDBInfo() ;
DBT_clear(empty) ;
PREINIT:
dMY_CXT;
INIT:
+ (void)flags;
CurrentDB = db ;
PREINIT:
dMY_CXT;
INIT:
+ (void)flags;
CurrentDB = db ;