Commit ec5bc33f authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

[t:4704] Fix type punning on main line. Refs #4704.

git-svn-id: file:///svn/toku/tokudb@41656 c7de825b-a66e-492c-adef-691d508d4ae1
parent c731941b
...@@ -13,14 +13,15 @@ static const int NUM_ROWS = 1 << 12; ...@@ -13,14 +13,15 @@ static const int NUM_ROWS = 1 << 12;
static int static int
insert(DB_ENV *env, DB *db, void *UU(extra)) insert(DB_ENV *env, DB *db, void *UU(extra))
{ {
char val[VAL_SIZE]; assert(VAL_SIZE%sizeof(int)==0);
int val[VAL_SIZE/sizeof(int)];
memset(val, 0, sizeof val); memset(val, 0, sizeof val);
DB_TXN *txn; DB_TXN *txn;
int r = env->txn_begin(env, 0, &txn, 0); int r = env->txn_begin(env, 0, &txn, 0);
CKERR(r); CKERR(r);
for (int i = 0; i < NUM_ROWS; ++i) { for (int i = 0; i < NUM_ROWS; ++i) {
DBT k, v; DBT k, v;
*((int *) val) = i; val[0] = i;
r = db->put(db, txn, dbt_init(&k, &i, sizeof i), dbt_init(&v, val, sizeof val), 0); r = db->put(db, txn, dbt_init(&k, &i, sizeof i), dbt_init(&v, val, sizeof val), 0);
CKERR(r); CKERR(r);
} }
......
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