View | Details | Raw Unified | Return to bug 237410 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-2 lines)
Lines 16-23 Link Here
16
16
17
LICENSE=	RUBY
17
LICENSE=	RUBY
18
18
19
BROKEN_RUBY25=	yes
20
21
OPTIONS_DEFINE=	DOCS EXAMPLES
19
OPTIONS_DEFINE=	DOCS EXAMPLES
22
20
23
USE_RUBY=		yes
21
USE_RUBY=		yes
(-)files/patch-src-common.c (-21 / +21 lines)
Lines 1-38 Link Here
1
--- src/common.c.orig	2011-04-06 19:35:39.000000000 +0000
1
--- src/common.c.orig	2011-04-06 19:35:39 UTC
2
+++ src/common.c	2015-01-22 17:10:32.000000000 +0000
2
+++ src/common.c
3
@@ -1229,7 +1229,7 @@
3
@@ -1229,7 +1229,7 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
4
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
4
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
5
 	VALUE v, f = argv[argc - 1];
5
 	VALUE v, f = argv[argc - 1];
6
 
6
 
7
-	if ((v = rb_hash_aref(f, rb_str_new2("txn"))) != RHASH(f)->ifnone) {
7
-	if ((v = rb_hash_aref(f, rb_str_new2("txn"))) != RHASH(f)->ifnone) {
8
+	if ((v = rb_hash_aref(f, rb_str_new2("txn"))) != rb_hash_ifnone(f)) {
8
+	if ((v = rb_hash_lookup(f, rb_str_new2("txn"))) != Qnil) {
9
 	    if (!rb_obj_is_kind_of(v, bdb_cTxn)) {
9
 	    if (!rb_obj_is_kind_of(v, bdb_cTxn)) {
10
 		rb_raise(bdb_eFatal, "argument of txn must be a transaction");
10
 		rb_raise(bdb_eFatal, "argument of txn must be a transaction");
11
 	    }
11
 	    }
12
@@ -1241,7 +1241,7 @@
12
@@ -1241,7 +1241,7 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
13
 	    dbst->options |= envst->options & BDB_NO_THREAD;
13
 	    dbst->options |= envst->options & BDB_NO_THREAD;
14
 	    dbst->marshal = txnst->marshal;
14
 	    dbst->marshal = txnst->marshal;
15
 	}
15
 	}
16
-	else if ((v = rb_hash_aref(f, rb_str_new2("env"))) != RHASH(f)->ifnone) {
16
-	else if ((v = rb_hash_aref(f, rb_str_new2("env"))) != RHASH(f)->ifnone) {
17
+	else if ((v = rb_hash_aref(f, rb_str_new2("env"))) != rb_hash_ifnone(f)) {
17
+	else if ((v = rb_hash_lookup(f, rb_str_new2("env"))) != Qnil) {
18
 	    if (!rb_obj_is_kind_of(v, bdb_cEnv)) {
18
 	    if (!rb_obj_is_kind_of(v, bdb_cEnv)) {
19
 		rb_raise(bdb_eFatal, "argument of env must be an environnement");
19
 		rb_raise(bdb_eFatal, "argument of env must be an environnement");
20
 	    }
20
 	    }
21
@@ -1254,11 +1254,11 @@
21
@@ -1254,11 +1254,11 @@ bdb_s_new(int argc, VALUE *argv, VALUE o
22
 #if HAVE_CONST_DB_ENCRYPT 
22
 #if HAVE_CONST_DB_ENCRYPT 
23
 	if (envst && (envst->options & BDB_ENV_ENCRYPT)) {
23
 	if (envst && (envst->options & BDB_ENV_ENCRYPT)) {
24
 	    VALUE tmp = rb_str_new2("set_flags");
24
 	    VALUE tmp = rb_str_new2("set_flags");
25
-	    if ((v = rb_hash_aref(f, rb_intern("set_flags"))) != RHASH(f)->ifnone) {
25
-	    if ((v = rb_hash_aref(f, rb_intern("set_flags"))) != RHASH(f)->ifnone) {
26
+	    if ((v = rb_hash_aref(f, rb_intern("set_flags"))) != rb_hash_ifnone(f)) {
26
+	    if ((v = rb_hash_lookup(f, rb_intern("set_flags"))) != Qnil) {
27
 		rb_hash_aset(f, rb_intern("set_flags"), 
27
 		rb_hash_aset(f, rb_intern("set_flags"), 
28
 			     INT2NUM(NUM2INT(v) | DB_ENCRYPT));
28
 			     INT2NUM(NUM2INT(v) | DB_ENCRYPT));
29
 	    }
29
 	    }
30
-	    else if ((v = rb_hash_aref(f, tmp)) != RHASH(f)->ifnone) {
30
-	    else if ((v = rb_hash_aref(f, tmp)) != RHASH(f)->ifnone) {
31
+	    else if ((v = rb_hash_aref(f, tmp)) != rb_hash_ifnone(f)) {
31
+	    else if ((v = rb_hash_lookup(f, tmp)) != Qnil) {
32
 		rb_hash_aset(f, tmp, INT2NUM(NUM2INT(v) | DB_ENCRYPT));
32
 		rb_hash_aset(f, tmp, INT2NUM(NUM2INT(v) | DB_ENCRYPT));
33
 	    }
33
 	    }
34
 	    else {
34
 	    else {
35
@@ -1570,10 +1570,10 @@
35
@@ -1570,10 +1570,10 @@ bdb_init(int argc, VALUE *argv, VALUE ob
36
 #endif
36
 #endif
37
 	switch(dbst->type) {
37
 	switch(dbst->type) {
38
 	case DB_BTREE:
38
 	case DB_BTREE:
Lines 45-51 Link Here
45
 	    break;
45
 	    break;
46
 	case DB_RECNO:
46
 	case DB_RECNO:
47
 	{
47
 	{
48
@@ -1581,17 +1581,17 @@
48
@@ -1581,17 +1581,17 @@ bdb_init(int argc, VALUE *argv, VALUE ob
49
 
49
 
50
 	    rb_warning("It's hard to distinguish Recnum with Recno for all versions of Berkeley DB");
50
 	    rb_warning("It's hard to distinguish Recnum with Recno for all versions of Berkeley DB");
51
 	    if ((count = bdb_is_recnum(dbst->dbp)) != -1) {
51
 	    if ((count = bdb_is_recnum(dbst->dbp)) != -1) {
Lines 66-72 Link Here
66
 	    break;
66
 	    break;
67
 #endif
67
 #endif
68
 	default:
68
 	default:
69
@@ -1635,29 +1635,29 @@
69
@@ -1635,29 +1635,29 @@ bdb_s_alloc(obj)
70
     dbst->options = BDB_NOT_OPEN;
70
     dbst->options = BDB_NOT_OPEN;
71
     cl = obj;
71
     cl = obj;
72
     while (cl) {
72
     while (cl) {
Lines 102-137 Link Here
102
 	    dbst->type = DB_UNKNOWN;
102
 	    dbst->type = DB_UNKNOWN;
103
 	    break;
103
 	    break;
104
 	}
104
 	}
105
@@ -3004,8 +3004,8 @@
105
@@ -3004,8 +3004,8 @@ bdb_each_kvc(argc, argv, obj, sens, repl
106
 
106
 
107
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
107
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
108
 	VALUE g, f = argv[argc - 1];
108
 	VALUE g, f = argv[argc - 1];
109
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
109
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
110
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
110
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
111
+	if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
111
+	if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
112
+	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
112
+	    (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
113
 	    flags = NUM2INT(g);
113
 	    flags = NUM2INT(g);
114
 	}
114
 	}
115
 	argc--;
115
 	argc--;
116
@@ -3323,8 +3323,8 @@
116
@@ -3323,8 +3323,8 @@ bdb_clear(int argc, VALUE *argv, VALUE o
117
     flags = 0;
117
     flags = 0;
118
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
118
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
119
 	VALUE g, f = argv[argc - 1];
119
 	VALUE g, f = argv[argc - 1];
120
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
120
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
121
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
121
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
122
+	if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
122
+	if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
123
+	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
123
+	    (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
124
 	    flags = NUM2INT(g);
124
 	    flags = NUM2INT(g);
125
 	}
125
 	}
126
 	argc--;
126
 	argc--;
127
@@ -3348,8 +3348,8 @@
127
@@ -3348,8 +3348,8 @@ bdb_replace(int argc, VALUE *argv, VALUE
128
     flags = 0;
128
     flags = 0;
129
     if (TYPE(argv[argc - 1]) == T_HASH) {
129
     if (TYPE(argv[argc - 1]) == T_HASH) {
130
 	VALUE f = argv[argc - 1];
130
 	VALUE f = argv[argc - 1];
131
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
131
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
132
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
132
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
133
+	if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
133
+	if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
134
+	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
134
+	    (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
135
 	    flags = NUM2INT(g);
135
 	    flags = NUM2INT(g);
136
 	}
136
 	}
137
 	argc--;
137
 	argc--;
(-)files/patch-src-cursor.c (-5 / +5 lines)
Lines 1-13 Link Here
1
--- src/cursor.c.orig	2015-01-22 17:37:51.000000000 +0000
1
--- src/cursor.c.orig	2011-04-06 19:35:39 UTC
2
+++ src/cursor.c	2015-01-22 17:38:17.000000000 +0000
2
+++ src/cursor.c
3
@@ -29,8 +29,8 @@
3
@@ -29,8 +29,8 @@ bdb_cursor(int argc, VALUE *argv, VALUE 
4
     flags = 0;
4
     flags = 0;
5
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
5
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
6
 	VALUE g, f = argv[argc - 1];
6
 	VALUE g, f = argv[argc - 1];
7
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
7
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
8
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
8
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
9
+	if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
9
+	if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
10
+	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
10
+	    (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
11
 	    flags = NUM2INT(g);
11
 	    flags = NUM2INT(g);
12
 	}
12
 	}
13
 	argc--;
13
 	argc--;
(-)files/patch-src-recnum.c (-7 / +7 lines)
Lines 1-22 Link Here
1
--- src/recnum.c.orig	2011-04-06 19:35:39.000000000 +0000
1
--- src/recnum.c.orig	2011-04-06 19:35:39 UTC
2
+++ src/recnum.c	2015-01-22 17:16:32.000000000 +0000
2
+++ src/recnum.c
3
@@ -17,7 +17,7 @@
3
@@ -17,7 +17,7 @@ bdb_recnum_init(int argc, VALUE *argv, V
4
 	argc++;
4
 	argc++;
5
     }
5
     }
6
     rb_hash_aset(argv[argc - 1], array, INT2FIX(0));
6
     rb_hash_aset(argv[argc - 1], array, INT2FIX(0));
7
-    if (rb_hash_aref(argv[argc - 1], sarray) != RHASH(argv[argc - 1])->ifnone) {
7
-    if (rb_hash_aref(argv[argc - 1], sarray) != RHASH(argv[argc - 1])->ifnone) {
8
+    if (rb_hash_aref(argv[argc - 1], sarray) != rb_hash_ifnone(argv[argc - 1])) {
8
+    if (rb_hash_lookup(argv[argc - 1], sarray) != Qnil) {
9
 	rb_hash_aset(argv[argc - 1], sarray, INT2FIX(0));
9
 	rb_hash_aset(argv[argc - 1], sarray, INT2FIX(0));
10
     }
10
     }
11
     rb_hash_aset(argv[argc - 1], rb_str_new2("set_flags"), INT2FIX(DB_RENUMBER));
11
     rb_hash_aset(argv[argc - 1], rb_str_new2("set_flags"), INT2FIX(DB_RENUMBER));
12
@@ -697,8 +697,8 @@
12
@@ -697,8 +697,8 @@ bdb_sary_clear(int argc, VALUE *argv, VA
13
 
13
 
14
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
14
     if (argc && TYPE(argv[argc - 1]) == T_HASH) {
15
 	VALUE f = argv[argc - 1];
15
 	VALUE f = argv[argc - 1];
16
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
16
-	if ((g = rb_hash_aref(f, rb_intern("flags"))) != RHASH(f)->ifnone ||
17
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
17
-	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != RHASH(f)->ifnone) {
18
+	if ((g = rb_hash_aref(f, rb_intern("flags"))) != rb_hash_ifnone(f) ||
18
+	if ((g = rb_hash_lookup(f, rb_intern("flags"))) != Qnil ||
19
+	    (g = rb_hash_aref(f, rb_str_new2("flags"))) != rb_hash_ifnone(f)) {
19
+	    (g = rb_hash_lookup(f, rb_str_new2("flags"))) != Qnil) {
20
 	    flags = NUM2INT(g);
20
 	    flags = NUM2INT(g);
21
 	}
21
 	}
22
 	argc--;
22
 	argc--;

Return to bug 237410