Update to 1.4.48. Add patches to fix build on OSX.

Changes since 1.4.46:

  * tcadb.cc (tcadbmisc): compilation warnings ware supressed.
  * tchdb.cc (tchdbfbpmerge): size checking was added.
  * tcbdb.cc (tcbdbrangeimpl): a bug of dead locking was fixed.
This commit is contained in:
jperkin 2013-10-25 20:27:18 +00:00
parent bac1073623
commit 5faad01737
6 changed files with 212 additions and 6 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.41 2012/10/02 21:25:55 asau Exp $
# $NetBSD: Makefile,v 1.42 2013/10/25 20:27:18 jperkin Exp $
#
DISTNAME= tokyocabinet-1.4.46
DISTNAME= tokyocabinet-1.4.48
CATEGORIES= databases
MASTER_SITES= ${HOMEPAGE}

View file

@ -1,6 +1,10 @@
$NetBSD: distinfo,v 1.38 2010/08/06 04:36:50 obache Exp $
$NetBSD: distinfo,v 1.39 2013/10/25 20:27:18 jperkin Exp $
SHA1 (tokyocabinet-1.4.46.tar.gz) = 031569d1eb181584ce4a96c4951341e6b29be8c8
RMD160 (tokyocabinet-1.4.46.tar.gz) = 8e7451bcec30e1a432f6d9fea70c2e39027781f8
Size (tokyocabinet-1.4.46.tar.gz) = 1002423 bytes
SHA1 (tokyocabinet-1.4.48.tar.gz) = b26a0a1ae7a05d2e1cc06cc518838cdd552e65aa
RMD160 (tokyocabinet-1.4.48.tar.gz) = 8fb3c2f2e424a2135cb021d46905a783a1032a7b
Size (tokyocabinet-1.4.48.tar.gz) = 1000485 bytes
SHA1 (patch-aa) = da66f5289c3e3e5fcbc306422ca69fb46c90b9dd
SHA1 (patch-tcadb.c) = 625f6355e69e1b8f168292139e11df391360aecb
SHA1 (patch-tcbdb.c) = 4471fc176a078f15a2861d9e8d7790f4c596f66a
SHA1 (patch-tcfdb.c) = bdf87ac92f6d42ab03480b5091ca7e9fd1ad84a7
SHA1 (patch-tchdb.c) = a893bbca5d91e05c8a28e6355d97dbef4a70ba90

View file

@ -0,0 +1,24 @@
$NetBSD: patch-tcadb.c,v 1.1 2013/10/25 20:27:18 jperkin Exp $
Fix return types.
--- tcadb.c.orig 2012-08-18 02:08:38.000000000 +0000
+++ tcadb.c
@@ -3743,7 +3743,7 @@ static bool tcadbmulout(ADBMUL *mul, con
record. */
static void *tcadbmulget(ADBMUL *mul, const void *kbuf, int ksiz, int *sp){
assert(mul && kbuf && ksiz >= 0 && sp);
- if(!mul->adbs) return false;
+ if(!mul->adbs) return NULL;
int idx = tcadbmulidx(mul, kbuf, ksiz);
TCADB *adb = mul->adbs[idx];
return tcadbget(adb, kbuf, ksiz, sp);
@@ -3792,7 +3792,7 @@ static bool tcadbmuliterinit(ADBMUL *mul
`NULL'. */
static void *tcadbmuliternext(ADBMUL *mul, int *sp){
assert(mul && sp);
- if(!mul->adbs || mul->iter < 0) return false;
+ if(!mul->adbs || mul->iter < 0) return NULL;
while(mul->iter < mul->num){
TCADB *adb = mul->adbs[mul->iter];
char *rv = tcadbiternext(adb, sp);

View file

@ -0,0 +1,102 @@
$NetBSD: patch-tcbdb.c,v 1.1 2013/10/25 20:27:18 jperkin Exp $
Fix return types.
--- tcbdb.c.orig 2012-08-18 02:08:38.000000000 +0000
+++ tcbdb.c
@@ -1137,16 +1137,16 @@ bool tcbdbcurout(BDBCUR *cur){
void *tcbdbcurkey(BDBCUR *cur, int *sp){
assert(cur && sp);
TCBDB *bdb = cur->bdb;
- if(!BDBLOCKMETHOD(bdb, false)) return false;
+ if(!BDBLOCKMETHOD(bdb, false)) return NULL;
if(!bdb->open){
tcbdbsetecode(bdb, TCEINVALID, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
if(cur->id < 1){
tcbdbsetecode(bdb, TCENOREC, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
const char *kbuf, *vbuf;
int ksiz, vsiz;
@@ -1174,16 +1174,16 @@ char *tcbdbcurkey2(BDBCUR *cur){
const void *tcbdbcurkey3(BDBCUR *cur, int *sp){
assert(cur && sp);
TCBDB *bdb = cur->bdb;
- if(!BDBLOCKMETHOD(bdb, false)) return false;
+ if(!BDBLOCKMETHOD(bdb, false)) return NULL;
if(!bdb->open){
tcbdbsetecode(bdb, TCEINVALID, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
if(cur->id < 1){
tcbdbsetecode(bdb, TCENOREC, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
const char *kbuf, *vbuf;
int ksiz, vsiz;
@@ -1203,16 +1203,16 @@ const void *tcbdbcurkey3(BDBCUR *cur, in
void *tcbdbcurval(BDBCUR *cur, int *sp){
assert(cur && sp);
TCBDB *bdb = cur->bdb;
- if(!BDBLOCKMETHOD(bdb, false)) return false;
+ if(!BDBLOCKMETHOD(bdb, false)) return NULL;
if(!bdb->open){
tcbdbsetecode(bdb, TCEINVALID, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
if(cur->id < 1){
tcbdbsetecode(bdb, TCENOREC, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
const char *kbuf, *vbuf;
int ksiz, vsiz;
@@ -1240,16 +1240,16 @@ char *tcbdbcurval2(BDBCUR *cur){
const void *tcbdbcurval3(BDBCUR *cur, int *sp){
assert(cur && sp);
TCBDB *bdb = cur->bdb;
- if(!BDBLOCKMETHOD(bdb, false)) return false;
+ if(!BDBLOCKMETHOD(bdb, false)) return NULL;
if(!bdb->open){
tcbdbsetecode(bdb, TCEINVALID, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
if(cur->id < 1){
tcbdbsetecode(bdb, TCENOREC, __FILE__, __LINE__, __func__);
BDBUNLOCKMETHOD(bdb);
- return false;
+ return NULL;
}
const char *kbuf, *vbuf;
int ksiz, vsiz;
@@ -1992,13 +1992,13 @@ static BDBLEAF *tcbdbleafload(TCBDB *bdb
rsiz = tchdbget3(bdb->hdb, hbuf, step, wbuf, BDBPAGEBUFSIZ);
if(rsiz < 1){
tcbdbsetecode(bdb, TCEMISC, __FILE__, __LINE__, __func__);
- return false;
+ return NULL;
} else if(rsiz < BDBPAGEBUFSIZ){
rp = wbuf;
} else {
if(!(rbuf = tchdbget(bdb->hdb, hbuf, step, &rsiz))){
tcbdbsetecode(bdb, TCEMISC, __FILE__, __LINE__, __func__);
- return false;
+ return NULL;
}
rp = rbuf;
}

View file

@ -0,0 +1,61 @@
$NetBSD: patch-tcfdb.c,v 1.1 2013/10/25 20:27:18 jperkin Exp $
Fix return types.
--- tcfdb.c.orig 2012-08-18 02:08:38.000000000 +0000
+++ tcfdb.c
@@ -479,11 +479,11 @@ bool tcfdbout3(TCFDB *fdb, const char *k
/* Retrieve a record in a fixed-length database object. */
void *tcfdbget(TCFDB *fdb, int64_t id, int *sp){
assert(fdb && sp);
- if(!FDBLOCKMETHOD(fdb, false)) return false;
+ if(!FDBLOCKMETHOD(fdb, false)) return NULL;
if(fdb->fd < 0){
tcfdbsetecode(fdb, TCEINVALID, __FILE__, __LINE__, __func__);
FDBUNLOCKMETHOD(fdb);
- return false;
+ return NULL;
}
if(id == FDBIDMIN){
id = fdb->min;
@@ -493,11 +493,11 @@ void *tcfdbget(TCFDB *fdb, int64_t id, i
if(id < 1 || id > fdb->limid){
tcfdbsetecode(fdb, TCEINVALID, __FILE__, __LINE__, __func__);
FDBUNLOCKMETHOD(fdb);
- return false;
+ return NULL;
}
if(!FDBLOCKRECORD(fdb, false, id)){
FDBUNLOCKMETHOD(fdb);
- return false;
+ return NULL;
}
const void *vbuf = tcfdbgetimpl(fdb, id, sp);
char *rv = vbuf ? tcmemdup(vbuf, *sp) : NULL;
@@ -658,7 +658,7 @@ char *tcfdbiternext3(TCFDB *fdb){
/* Get range matching decimal keys in a fixed-length database object. */
uint64_t *tcfdbrange(TCFDB *fdb, int64_t lower, int64_t upper, int max, int *np){
assert(fdb && np);
- if(!FDBLOCKMETHOD(fdb, true)) return false;
+ if(!FDBLOCKMETHOD(fdb, true)) return NULL;
if(fdb->fd < 0){
tcfdbsetecode(fdb, TCEINVALID, __FILE__, __LINE__, __func__);
FDBUNLOCKMETHOD(fdb);
@@ -2289,7 +2289,7 @@ static const void *tcfdbgetimpl(TCFDB *f
uint64_t nsiz = FDBHEADSIZ + id * fdb->rsiz;
if(nsiz > fdb->fsiz){
tcfdbsetecode(fdb, TCENOREC, __FILE__, __LINE__, __func__);
- return false;
+ return NULL;
}
unsigned char *rp = rec;
uint32_t osiz;
@@ -2312,7 +2312,7 @@ static const void *tcfdbgetimpl(TCFDB *f
}
if(osiz == 0 && *rp == 0){
tcfdbsetecode(fdb, TCENOREC, __FILE__, __LINE__, __func__);
- return false;
+ return NULL;
}
*sp = osiz;
return rp;

View file

@ -0,0 +1,15 @@
$NetBSD: patch-tchdb.c,v 1.1 2013/10/25 20:27:18 jperkin Exp $
Fix return types.
--- tchdb.c.orig 2012-08-18 02:08:38.000000000 +0000
+++ tchdb.c
@@ -697,7 +697,7 @@ void *tchdbget(TCHDB *hdb, const void *k
}
if(!HDBLOCKRECORD(hdb, bidx, false)){
HDBUNLOCKMETHOD(hdb);
- return false;
+ return NULL;
}
char *rv = tchdbgetimpl(hdb, kbuf, ksiz, bidx, hash, sp);
HDBUNLOCKRECORD(hdb, bidx);