Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix some "unsafe" pointer casts in lsm_config(). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | f58fb32e42e2adefe7bbe0025bbdf35b21fc9f98 |
User & Date: | dan 2012-11-22 16:14:29 |
Context
2012-11-23
| ||
16:41 | Fix a problem in compressed database mode causing pages to be incorrectly marked as dirty. check-in: b55b092602 user: dan tags: trunk | |
2012-11-22
| ||
16:14 | Fix some "unsafe" pointer casts in lsm_config(). check-in: f58fb32e42 user: dan tags: trunk | |
2012-11-17
| ||
13:17 | Fix another out-of-order writes problem. check-in: 1b21fb4494 user: dan tags: trunk | |
Changes
Changes to lsm-test/lsmtest_tdb3.c.
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
rc = uncompress((Bytef*)aOut, &n, (Bytef*)aIn, nIn);
*pnOut = n;
return (rc==Z_OK ? 0 : LSM_ERROR);
}
static int testConfigureCompression(lsm_db *pDb){
static lsm_compress zip = {
1, sizeof(lsm_compress),
0, /* Context pointer (unused) */
testZipBound, /* xBound method */
testZipCompress, /* xCompress method */
testZipUncompress /* xUncompress method */
};
return lsm_config(pDb, LSM_CONFIG_SET_COMPRESSION, &zip);
}
#endif /* ifdef HAVE_ZLIB */
|
< > |
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
rc = uncompress((Bytef*)aOut, &n, (Bytef*)aIn, nIn);
*pnOut = n;
return (rc==Z_OK ? 0 : LSM_ERROR);
}
static int testConfigureCompression(lsm_db *pDb){
static lsm_compress zip = {
0, /* Context pointer (unused) */
1, /* Id value */
testZipBound, /* xBound method */
testZipCompress, /* xCompress method */
testZipUncompress /* xUncompress method */
};
return lsm_config(pDb, LSM_CONFIG_SET_COMPRESSION, &zip);
}
#endif /* ifdef HAVE_ZLIB */
|
Changes to src/lsm_main.c.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
}else{ pDb->bMultiProc = *piVal = (*piVal!=0); } break; } case LSM_CONFIG_SET_COMPRESSION: { int *p = va_arg(ap, lsm_compress *); if( pDb->pDatabase ){ /* If lsm_open() has been called, this call is against the rules. */ rc = LSM_MISUSE_BKPT; }else{ memcpy(&pDb->compress, p, sizeof(lsm_compress)); } break; } case LSM_CONFIG_GET_COMPRESSION: { int *p = va_arg(ap, lsm_compress *); memcpy(p, &pDb->compress, sizeof(lsm_compress)); break; } default: rc = LSM_MISUSE; break; |
| | |
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
}else{ pDb->bMultiProc = *piVal = (*piVal!=0); } break; } case LSM_CONFIG_SET_COMPRESSION: { lsm_compress *p = va_arg(ap, lsm_compress *); if( pDb->pDatabase ){ /* If lsm_open() has been called, this call is against the rules. */ rc = LSM_MISUSE_BKPT; }else{ memcpy(&pDb->compress, p, sizeof(lsm_compress)); } break; } case LSM_CONFIG_GET_COMPRESSION: { lsm_compress *p = va_arg(ap, lsm_compress *); memcpy(p, &pDb->compress, sizeof(lsm_compress)); break; } default: rc = LSM_MISUSE; break; |