Re: [Refdb-users] Cannot add reference.
Status: Beta
Brought to you by:
mhoenicka
|
From: Markus H. <mar...@mh...> - 2009-05-08 23:41:25
|
Wei-Wei Guo writes: > Thanks. I'd better wait since PG or MySql is kind of heavy for me. Hope the > driver problem could be solved soon :> > It turned out that this was not a driver problem, but a bug in the libdbi library itself. I've checked in a fix today. I assume you won't be able to wait until the next libdbi release, which may take some time to be picked up by package maintainers. If you feel comfortable with installing libdbi from the sources, please use the appended patch for src/dbi_main.c. regards, Markus --- dbi_main.c 2008/11/28 22:28:51 1.95 +++ dbi_main.c 2009/05/08 23:22:33 1.96 @@ -1570,8 +1574,19 @@ /* hahaha! who woulda ever thunk strawberry's code would come in handy? */ // find first (highest) bit set; methods not using FP can be found at // http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious - unsigned startbit = log(rangemin)/log(2); - unsigned endbit = log(rangemax)/log(2); +/* unsigned startbit = log(rangemin)/log(2); */ +/* unsigned endbit = log(rangemax)/log(2); */ + unsigned int startbit = 0; + unsigned int endbit = 0; + + while (rangemin >>= 1) { + startbit++; + } + + while (rangemax >>= 1) { + endbit++; + } + // construct mask from startbit to endbit inclusive unsigned attrib_mask = ((1<<(endbit+1))-1) ^ ((1<<startbit)-1); return attribs & attrib_mask; -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |