edits
authorbdemsky <bdemsky@uci.edu>
Fri, 16 Mar 2018 16:53:28 +0000 (09:53 -0700)
committerbdemsky <bdemsky@uci.edu>
Fri, 16 Mar 2018 16:53:28 +0000 (09:53 -0700)
version2/src/C/Commit.cc
version2/src/C/Slot.cc
version2/src/C/SlotBuffer.cc
version2/src/C/Test.C

index 2ee208d..e01a778 100644 (file)
@@ -14,7 +14,7 @@ Commit::Commit() :
        sequenceNumber(-1),
        machineId(-1),
        transactionSequenceNumber(-1),
-       liveKeys(new Hashset<IoTString *>) {
+       liveKeys(new Hashset<IoTString *>()) {
 }
 
 Commit::Commit(int64_t _sequenceNumber, int64_t _machineId, int64_t _transactionSequenceNumber) :
@@ -28,7 +28,7 @@ Commit::Commit(int64_t _sequenceNumber, int64_t _machineId, int64_t _transaction
        sequenceNumber(_sequenceNumber),
        machineId(_machineId),
        transactionSequenceNumber(_transactionSequenceNumber),
-       liveKeys(new Hashset<IoTString *>) {
+       liveKeys(new Hashset<IoTString *>()) {
 }
 
 Commit::~Commit() {
index 644854e..6f37c9a 100644 (file)
@@ -17,8 +17,8 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_pre
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
        table(_table),
-       localSequenceNumber(_localSequenceNumber),
-       fakeLastMessage(NULL) {
+       fakeLastMessage(NULL),
+       localSequenceNumber(_localSequenceNumber) {
 }
 
 Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_prevhmac, int64_t _localSequenceNumber) :
@@ -31,8 +31,8 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_pre
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
        table(_table),
-       localSequenceNumber(_localSequenceNumber),
-       fakeLastMessage(NULL) {
+       fakeLastMessage(NULL),
+       localSequenceNumber(_localSequenceNumber) {
 }
 
 Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, int64_t _localSequenceNumber) :
@@ -45,8 +45,8 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, int64_t _localSeq
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
        table(_table),
-       localSequenceNumber(_localSequenceNumber),
-       fakeLastMessage(NULL) {
+       fakeLastMessage(NULL),
+       localSequenceNumber(_localSequenceNumber) {
 }
 
 Slot::~Slot() {
index af6b031..06c46e9 100644 (file)
@@ -14,11 +14,11 @@ SlotBuffer::SlotBuffer() :
 }
 
 SlotBuffer::~SlotBuffer() {
-       uint index = tail;
+       int32_t index = tail;
        while (index != head) {
                delete array->get(index);
                index++;
-               if (index == array->length())
+               if (index == (int32_t) array->length())
                        index = 0;
        }
        delete array;
@@ -68,11 +68,11 @@ void SlotBuffer::putSlot(Slot *s) {
        int64_t checkNum = (getNewestSeqNum() + 1);
 
        if (checkNum != s->getSequenceNumber()) {
-               uint index = tail;
+               int32_t index = tail;
                while (index != head) {
                        delete array->get(index);
                        index++;
-                       if (index == array->length())
+                       if (index == (int32_t) array->length())
                                index = 0;
                }
                oldestseqn = s->getSequenceNumber();
index dd3fc62..0f6c96c 100644 (file)
@@ -177,6 +177,7 @@ int main(int numargs, char ** args) {
                        foundError = true;
                        printf("Status error\n");
                }
+               delete status;
        }
        
        if (foundError) {