Commit f2df2994 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

refs #5164 fix some garbage in the threaded helpers file

also fix the ule interface to not use const, since it doesn't do what I want because of a pesky typedef


git-svn-id: file:///svn/toku/tokudb@45064 c7de825b-a66e-492c-adef-691d508d4ae1
parent 49927cf8
......@@ -77,7 +77,7 @@ toku_le_get_status(LE_STATUS statp) {
//
ULEHANDLE
toku_ule_create(const LEAFENTRY le) {
toku_ule_create(LEAFENTRY le) {
ULE ule_p = toku_xmalloc(sizeof(ULE_S));
le_unpack(ule_p, le);
return (ULEHANDLE) ule_p;
......@@ -518,7 +518,7 @@ ule_cleanup(ULE ule) {
// Purpose of le_unpack() is to populate our private workspace with the contents of the given le.
void
le_unpack(ULE ule, const LEAFENTRY le) {
le_unpack(ULE ule, LEAFENTRY le) {
//Read the keylen
ule->keylen = toku_dtoh32(le->keylen);
uint8_t type = le->type;
......
......@@ -24,7 +24,7 @@ typedef struct ule *ULEHANDLE;
typedef struct uxr *UXRHANDLE;
// create a ULE by copying the contents of the given leafentry
ULEHANDLE toku_ule_create(const LEAFENTRY le);
ULEHANDLE toku_ule_create(LEAFENTRY le);
void toku_ule_free(ULEHANDLE ule_p);
......
......@@ -374,10 +374,8 @@ le_cursor_callback(ITEMLEN UU(keylen), bytevec UU(key), ITEMLEN UU(vallen), byte
// leafentry into its own buffers, so we don't need to malloc space
// for this value to exist outside the callback.
//
// this cast is only necssary because the typedef is preventing us
// from declaring a "const LEAFENTRY" le. we're only able to say
// const "LEAFENTRY le".
const LEAFENTRY le = (const LEAFENTRY) val;
// blast away the const from bytevec by casting to LEAFENTRY
LEAFENTRY le = (LEAFENTRY) val;
ULEHANDLE ule = toku_ule_create(le);
invariant(ule);
ule_prov_info_init(prov_info, ule);
......
......@@ -815,9 +815,6 @@ cleanup:
return r;
}
struct leaf_entry * le;
const struct leaf_entry * le;
static int UU() random_put_op(DB_TXN *txn, ARG arg, void *UU(operation_extra), void *stats_extra) {
int db_index = myrandom_r(arg->random_data)%arg->cli->num_DBs;
DB* db = arg->dbp[db_index];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment