Commit 324dcd7e 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 d20de9fd
...@@ -77,7 +77,7 @@ toku_le_get_status(LE_STATUS statp) { ...@@ -77,7 +77,7 @@ toku_le_get_status(LE_STATUS statp) {
// //
ULEHANDLE ULEHANDLE
toku_ule_create(const LEAFENTRY le) { toku_ule_create(LEAFENTRY le) {
ULE ule_p = toku_xmalloc(sizeof(ULE_S)); ULE ule_p = toku_xmalloc(sizeof(ULE_S));
le_unpack(ule_p, le); le_unpack(ule_p, le);
return (ULEHANDLE) ule_p; return (ULEHANDLE) ule_p;
...@@ -518,7 +518,7 @@ ule_cleanup(ULE ule) { ...@@ -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. // Purpose of le_unpack() is to populate our private workspace with the contents of the given le.
void void
le_unpack(ULE ule, const LEAFENTRY le) { le_unpack(ULE ule, LEAFENTRY le) {
//Read the keylen //Read the keylen
ule->keylen = toku_dtoh32(le->keylen); ule->keylen = toku_dtoh32(le->keylen);
uint8_t type = le->type; uint8_t type = le->type;
......
...@@ -24,7 +24,7 @@ typedef struct ule *ULEHANDLE; ...@@ -24,7 +24,7 @@ typedef struct ule *ULEHANDLE;
typedef struct uxr *UXRHANDLE; typedef struct uxr *UXRHANDLE;
// create a ULE by copying the contents of the given leafentry // 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); void toku_ule_free(ULEHANDLE ule_p);
......
...@@ -374,10 +374,8 @@ le_cursor_callback(ITEMLEN UU(keylen), bytevec UU(key), ITEMLEN UU(vallen), byte ...@@ -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 // leafentry into its own buffers, so we don't need to malloc space
// for this value to exist outside the callback. // for this value to exist outside the callback.
// //
// this cast is only necssary because the typedef is preventing us // blast away the const from bytevec by casting to LEAFENTRY
// from declaring a "const LEAFENTRY" le. we're only able to say LEAFENTRY le = (LEAFENTRY) val;
// const "LEAFENTRY le".
const LEAFENTRY le = (const LEAFENTRY) val;
ULEHANDLE ule = toku_ule_create(le); ULEHANDLE ule = toku_ule_create(le);
invariant(ule); invariant(ule);
ule_prov_info_init(prov_info, ule); ule_prov_info_init(prov_info, ule);
......
...@@ -815,9 +815,6 @@ cleanup: ...@@ -815,9 +815,6 @@ cleanup:
return r; 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) { 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; int db_index = myrandom_r(arg->random_data)%arg->cli->num_DBs;
DB* db = arg->dbp[db_index]; 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