Add casts to prevent warnings on (upcoming changes to) recordRead, recordWrite
This commit is contained in:
parent
9feb3efdb5
commit
951a897040
4 changed files with 18 additions and 18 deletions
|
@ -51,9 +51,9 @@ terms specified in this license.
|
|||
static int operate(int xid, Page * p, lsn_t lsn, recordid r, const void *d) {
|
||||
int i;
|
||||
|
||||
recordRead(xid, p, r, &i);
|
||||
recordRead(xid, p, r, (byte*)&i);
|
||||
i--;
|
||||
recordWrite(xid, p, lsn, r, &i);
|
||||
recordWrite(xid, p, lsn, r, (byte*)&i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@ terms specified in this license.
|
|||
static int operate(int xid, Page * p, lsn_t lsn, recordid r, const void *d) {
|
||||
int i;
|
||||
|
||||
recordRead(xid, p, r, &i);
|
||||
recordRead(xid, p, r, (byte*)&i);
|
||||
i++;
|
||||
recordWrite(xid, p, lsn, r, &i);
|
||||
recordWrite(xid, p, lsn, r, (byte*)&i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ void initializePages() {
|
|||
assert(p->id != -1);
|
||||
slottedPostRalloc(-1, p, 0, rid);
|
||||
|
||||
recordWrite(1, p, 1, rid, &i);
|
||||
recordWrite(1, p, 1, rid, (byte*)&i);
|
||||
|
||||
p->LSN = 0;
|
||||
*lsn_ptr(p) = 0;
|
||||
|
@ -87,7 +87,7 @@ void * workerThread(void * p) {
|
|||
|
||||
p = loadPage(-1, rid.page);
|
||||
|
||||
recordRead(1, p, rid, &j);
|
||||
recordRead(1, p, rid, (byte*)&j);
|
||||
|
||||
releasePage(p);
|
||||
|
||||
|
@ -138,7 +138,7 @@ void * workerThreadWriting(void * q) {
|
|||
}
|
||||
|
||||
/* sched_yield(); */
|
||||
recordWrite(1, p, 0, rids[i], &val);
|
||||
recordWrite(1, p, 0, rids[i], (byte*)&val);
|
||||
|
||||
assert(p->id == rids[i].page);
|
||||
/* p->LSN = 0;
|
||||
|
@ -159,7 +159,7 @@ void * workerThreadWriting(void * q) {
|
|||
|
||||
p = loadPage(xid, rids[i].page);
|
||||
|
||||
recordRead(1, p, rids[i], &val);
|
||||
recordRead(1, p, rids[i], (byte*)&val);
|
||||
|
||||
/* p->LSN = 0;
|
||||
*lsn_ptr(p) = 0; */
|
||||
|
|
|
@ -90,7 +90,7 @@ START_TEST(operation_physical_do_undo) {
|
|||
DEBUG("B\n");
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordWrite(xid, p, lsn, rid, &buf);
|
||||
recordWrite(xid, p, lsn, rid, (byte*)&buf);
|
||||
releasePage(p);
|
||||
setToTwo->LSN = 10;
|
||||
|
||||
|
@ -100,7 +100,7 @@ START_TEST(operation_physical_do_undo) {
|
|||
releasePage(p);
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
releasePage(p);
|
||||
|
||||
fail_unless(buf == 2, NULL);
|
||||
|
@ -118,7 +118,7 @@ START_TEST(operation_physical_do_undo) {
|
|||
releasePage(p);
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
releasePage(p);
|
||||
|
||||
fail_unless(buf == 1, NULL);
|
||||
|
@ -128,7 +128,7 @@ START_TEST(operation_physical_do_undo) {
|
|||
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
releasePage(p);
|
||||
|
||||
fail_unless(buf == 1, NULL);
|
||||
|
@ -147,7 +147,7 @@ START_TEST(operation_physical_do_undo) {
|
|||
buf = 1;
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordWrite(xid, p, lsn, rid, &buf);
|
||||
recordWrite(xid, p, lsn, rid, (byte*)&buf);
|
||||
releasePage(p);
|
||||
/* Trace of test:
|
||||
|
||||
|
@ -175,14 +175,14 @@ START_TEST(operation_physical_do_undo) {
|
|||
redoUpdate(setToTwo);
|
||||
|
||||
p = loadPage(xid, rid.page);
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
assert(buf == 2);
|
||||
fail_unless(buf == 2, NULL);
|
||||
|
||||
DEBUG("G undo set to 2\n");
|
||||
undoUpdate(setToTwo, p, 20); /* Succeeds -- 20 is the 'CLR' entry's lsn.*/
|
||||
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
|
||||
fail_unless(buf == 1, NULL);
|
||||
releasePage(p);
|
||||
|
@ -192,18 +192,18 @@ START_TEST(operation_physical_do_undo) {
|
|||
|
||||
p = loadPage(xid, rid.page);
|
||||
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
|
||||
fail_unless(buf == 1, NULL);
|
||||
|
||||
recordWrite(xid, p, 0, rid, &buf); /* reset the page's LSN. */
|
||||
recordWrite(xid, p, 0, rid, (byte*)&buf); /* reset the page's LSN. */
|
||||
|
||||
DEBUG("I redo set to 2\n");
|
||||
|
||||
releasePage(p);
|
||||
redoUpdate(setToTwo); /* Succeeds */
|
||||
p = loadPage(xid, rid.page);
|
||||
recordRead(xid, p, rid, &buf);
|
||||
recordRead(xid, p, rid, (byte*)&buf);
|
||||
|
||||
fail_unless(buf == 2, NULL);
|
||||
releasePage(p);
|
||||
|
|
Loading…
Reference in a new issue