This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Use an equivalent 'if' condition
[perl5.git] / cpan / DB_File / DB_File.xs
index d060dcb..6e6e154 100644 (file)
@@ -6,7 +6,7 @@
 
  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.
 
@@ -270,7 +270,7 @@ typedef db_recno_t  recno_t;
 #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
@@ -314,7 +314,7 @@ typedef db_recno_t  recno_t;
 #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 */
@@ -536,7 +536,6 @@ u_int               flags ;
     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 ;
@@ -608,6 +607,9 @@ const DBT * key2 ;
 #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);
@@ -1437,10 +1439,10 @@ SV *   sv ;
                    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) ;
                }
 
             }
@@ -1449,12 +1451,12 @@ SV *   sv ;
                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 ;
            }   
 
@@ -1467,7 +1469,7 @@ SV *   sv ;
                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) ;