projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
15ea448
)
Bug fixes
author
root
<root@plrg-1.ics.uci.edu>
Tue, 7 Apr 2020 08:29:58 +0000
(
01:29
-0700)
committer
root
<root@plrg-1.ics.uci.edu>
Tue, 7 Apr 2020 08:29:58 +0000
(
01:29
-0700)
actionlist.cc
patch
|
blob
|
history
actionlist.h
patch
|
blob
|
history
diff --git
a/actionlist.cc
b/actionlist.cc
index f859746ccf5e5bac1c5148c420829946dee6fb0f..9f335e900e2de1910bf7e1a75531b04a64cb56a7 100644
(file)
--- a/
actionlist.cc
+++ b/
actionlist.cc
@@
-5,8
+5,11
@@
#include <limits.h>
actionlist::actionlist() :
#include <limits.h>
actionlist::actionlist() :
- _size(0)
+ head(NULL),
+ tail(NULL),
+ _size(0)
{
{
+ root.parent = NULL;
}
actionlist::~actionlist() {
}
actionlist::~actionlist() {
@@
-44,9
+47,10
@@
sllnode<ModelAction *> * allnode::findPrev(modelclock_t index) {
continue;
} else {
//found non-null...
continue;
} else {
//found non-null...
- if (totalshift
!
= 0)
-
ptr = ptr->children[currindex]
;
+ if (totalshift
=
= 0)
+
return reinterpret_cast<sllnode<ModelAction *> *>(((uintptr_t)ptr->children[currindex])& ACTMASK)
;
//need to increment here...
//need to increment here...
+ ptr = ptr->children[currindex];
increment = increment >> ALLBITS;
mask = mask >> ALLBITS;
totalshift -= ALLBITS;
increment = increment >> ALLBITS;
mask = mask >> ALLBITS;
totalshift -= ALLBITS;
@@
-59,7
+63,7
@@
sllnode<ModelAction *> * allnode::findPrev(modelclock_t index) {
mask = mask << ALLBITS;
totalshift += ALLBITS;
mask = mask << ALLBITS;
totalshift += ALLBITS;
- if (
increment == 0
) {
+ if (
ptr == NULL
) {
return NULL;
}
}
return NULL;
}
}
@@
-71,9
+75,10
@@
sllnode<ModelAction *> * allnode::findPrev(modelclock_t index) {
if (ptr->children[currindex] != NULL) {
if (totalshift != 0) {
ptr = ptr->children[currindex];
if (ptr->children[currindex] != NULL) {
if (totalshift != 0) {
ptr = ptr->children[currindex];
+ break;
} else {
allnode * act = ptr->children[currindex];
} else {
allnode * act = ptr->children[currindex];
- sllnode<ModelAction *> * node = reinterpret_cast<sllnode<ModelAction *>*>(((uintptr_t)act) & A
LL
MASK);
+ sllnode<ModelAction *> * node = reinterpret_cast<sllnode<ModelAction *>*>(((uintptr_t)act) & A
CT
MASK);
return node;
}
}
return node;
}
}
@@
-100,7
+105,7
@@
void actionlist::addAction(ModelAction * act) {
llnode->val = act;
if (tmp == NULL) {
ptr->children[index] = reinterpret_cast<allnode *>(((uintptr_t) llnode) | ISACT);
llnode->val = act;
if (tmp == NULL) {
ptr->children[index] = reinterpret_cast<allnode *>(((uintptr_t) llnode) | ISACT);
- sllnode<ModelAction *> * llnodeprev = ptr->findPrev(
index
);
+ sllnode<ModelAction *> * llnodeprev = ptr->findPrev(
clock
);
if (llnodeprev != NULL) {
llnode->next = llnodeprev->next;
if (llnodeprev != NULL) {
llnode->next = llnodeprev->next;
@@
-131,10
+136,11
@@
void actionlist::addAction(ModelAction * act) {
} else {
//handle case where something else is here
} else {
//handle case where something else is here
- sllnode<ModelAction *> * llnodeprev = reinterpret_cast<sllnode<ModelAction *>*>(((uintptr_t) llnode) & A
LL
MASK);
+ sllnode<ModelAction *> * llnodeprev = reinterpret_cast<sllnode<ModelAction *>*>(((uintptr_t) llnode) & A
CT
MASK);
llnode->next = llnodeprev->next;
llnode->prev = llnodeprev;
llnode->next = llnodeprev->next;
llnode->prev = llnodeprev;
- llnode->next->prev = llnode;
+ if (llnode->next != NULL)
+ llnode->next->prev = llnode;
llnodeprev->next = llnode;
ptr->children[index] = reinterpret_cast<allnode *>(((uintptr_t) llnode) | ISACT);
}
llnodeprev->next = llnode;
ptr->children[index] = reinterpret_cast<allnode *>(((uintptr_t) llnode) | ISACT);
}
@@
-178,7
+184,7
@@
void actionlist::removeAction(ModelAction * act) {
//not found
return;
} else {
//not found
return;
} else {
- sllnode<ModelAction *> * llnode = reinterpret_cast<sllnode<ModelAction *> *>(((uintptr_t) tmp) & A
LL
MASK);
+ sllnode<ModelAction *> * llnode = reinterpret_cast<sllnode<ModelAction *> *>(((uintptr_t) tmp) & A
CT
MASK);
bool first = true;
do {
if (llnode->val == act) {
bool first = true;
do {
if (llnode->val == act) {
diff --git
a/actionlist.h
b/actionlist.h
index 70f90eb8a93da61b647afb1b1323344c36c0c03b..20f93fc953b9c27472df84c7de15cc53f66800e7 100644
(file)
--- a/
actionlist.h
+++ b/
actionlist.h
@@
-4,7
+4,9
@@
#include "classlist.h"
#include "stl-model.h"
#include "classlist.h"
#include "stl-model.h"
-#define ISACT 1
+#define ISACT ((uintptr_t) 1ULL)
+#define ACTMASK (~ISACT)
+
#define ALLBITS 4
#define ALLNODESIZE (1 << ALLBITS)
#define ALLMASK ((1 << ALLBITS)-1)
#define ALLBITS 4
#define ALLNODESIZE (1 << ALLBITS)
#define ALLMASK ((1 << ALLBITS)-1)