Unverified Commit 5fb49125 by alanminko Committed by GitHub

Merge pull request #180 from MyskYko/ttopt

fix compile warnings
parents 1bd75503 fdd56565
...@@ -123,8 +123,8 @@ public: ...@@ -123,8 +123,8 @@ public:
if(logwidth > lww) { if(logwidth > lww) {
int nScopeSize = 1 << (logwidth - lww); int nScopeSize = 1 << (logwidth - lww);
for(int i = 0; i < nScopeSize && (fEq || fCompl); i++) { for(int i = 0; i < nScopeSize && (fEq || fCompl); i++) {
fEq &= t[nScopeSize * index1 + i] == t[nScopeSize * index2 + i]; fEq &= (t[nScopeSize * index1 + i] == t[nScopeSize * index2 + i]);
fCompl &= t[nScopeSize * index1 + i] == ~t[nScopeSize * index2 + i]; fCompl &= (t[nScopeSize * index1 + i] == ~t[nScopeSize * index2 + i]);
} }
} else { } else {
word value = GetValue(index1, lev) ^ GetValue(index2, lev); word value = GetValue(index1, lev) ^ GetValue(index2, lev);
...@@ -174,18 +174,18 @@ public: ...@@ -174,18 +174,18 @@ public:
fOne &= !(~value); fOne &= !(~value);
} }
if(fZero || fOne) { if(fZero || fOne) {
return -2 ^ fOne; return -2 ^ (int)fOne;
} }
for(unsigned j = 0; j < vvIndices[lev].size(); j++) { for(unsigned j = 0; j < vvIndices[lev].size(); j++) {
int index2 = vvIndices[lev][j]; int index2 = vvIndices[lev][j];
bool fEq = true; bool fEq = true;
bool fCompl = true; bool fCompl = true;
for(int i = 0; i < nScopeSize && (fEq || fCompl); i++) { for(int i = 0; i < nScopeSize && (fEq || fCompl); i++) {
fEq &= t[nScopeSize * index + i] == t[nScopeSize * index2 + i]; fEq &= (t[nScopeSize * index + i] == t[nScopeSize * index2 + i]);
fCompl &= t[nScopeSize * index + i] == ~t[nScopeSize * index2 + i]; fCompl &= (t[nScopeSize * index + i] == ~t[nScopeSize * index2 + i]);
} }
if(fEq || fCompl) { if(fEq || fCompl) {
return (j << 1) ^ fCompl; return (j << 1) ^ (int)fCompl;
} }
} }
} else { } else {
...@@ -553,7 +553,7 @@ public: ...@@ -553,7 +553,7 @@ public:
} }
int *place = Hash_Int2ManLookup(unique, cof0, cof1); int *place = Hash_Int2ManLookup(unique, cof0, cof1);
if(*place) { if(*place) {
return (Hash_IntObjData2(unique, *place) << 1) ^ fCompl; return (Hash_IntObjData2(unique, *place) << 1) ^ (int)fCompl;
} }
vvIndices[lev].push_back(index); vvIndices[lev].push_back(index);
Hash_Int2ManInsert(unique, cof0, cof1, vvIndices[lev].size() - 1); Hash_Int2ManInsert(unique, cof0, cof1, vvIndices[lev].size() - 1);
...@@ -562,7 +562,7 @@ public: ...@@ -562,7 +562,7 @@ public:
if(cof0 == cof1) { if(cof0 == cof1) {
vvRedundantIndices[lev].push_back(index); vvRedundantIndices[lev].push_back(index);
} }
return ((vvIndices[lev].size() - 1) << 1) ^ fCompl; return ((vvIndices[lev].size() - 1) << 1) ^ (int)fCompl;
} }
int BDDRebuild(int lev) { int BDDRebuild(int lev) {
...@@ -580,18 +580,18 @@ public: ...@@ -580,18 +580,18 @@ public:
bool cof1c = vvChildren[lev][i+i+1] & 1; bool cof1c = vvChildren[lev][i+i+1] & 1;
int cof00, cof01, cof10, cof11; int cof00, cof01, cof10, cof11;
if(cof0index < 0) { if(cof0index < 0) {
cof00 = -2 ^ cof0c; cof00 = -2 ^ (int)cof0c;
cof01 = -2 ^ cof0c; cof01 = -2 ^ (int)cof0c;
} else { } else {
cof00 = vvChildren[lev+1][cof0index+cof0index] ^ cof0c; cof00 = vvChildren[lev+1][cof0index+cof0index] ^ (int)cof0c;
cof01 = vvChildren[lev+1][cof0index+cof0index+1] ^ cof0c; cof01 = vvChildren[lev+1][cof0index+cof0index+1] ^ (int)cof0c;
} }
if(cof1index < 0) { if(cof1index < 0) {
cof10 = -2 ^ cof1c; cof10 = -2 ^ (int)cof1c;
cof11 = -2 ^ cof1c; cof11 = -2 ^ (int)cof1c;
} else { } else {
cof10 = vvChildren[lev+1][cof1index+cof1index] ^ cof1c; cof10 = vvChildren[lev+1][cof1index+cof1index] ^ (int)cof1c;
cof11 = vvChildren[lev+1][cof1index+cof1index+1] ^ cof1c; cof11 = vvChildren[lev+1][cof1index+cof1index+1] ^ (int)cof1c;
} }
int newcof0 = BDDRebuildOne(index << 1, cof00, cof10, lev + 1, unique, vChildrenLow); int newcof0 = BDDRebuildOne(index << 1, cof00, cof10, lev + 1, unique, vChildrenLow);
int newcof1 = BDDRebuildOne((index << 1) ^ 1, cof01, cof11, lev + 1, unique, vChildrenLow); int newcof1 = BDDRebuildOne((index << 1) ^ 1, cof01, cof11, lev + 1, unique, vChildrenLow);
...@@ -900,7 +900,7 @@ public: ...@@ -900,7 +900,7 @@ public:
void Merge(int index1, int index2, int lev, bool fCompl) { void Merge(int index1, int index2, int lev, bool fCompl) {
MergeCare(index1, index2, lev); MergeCare(index1, index2, lev);
vvMergedIndices[lev].push_back(std::make_pair((index1 << 1) ^ fCompl, index2)); vvMergedIndices[lev].push_back(std::make_pair((index1 << 1) ^ (int)fCompl, index2));
} }
int BDDBuildOne(int index, int lev) { int BDDBuildOne(int index, int lev) {
...@@ -1023,7 +1023,7 @@ public: ...@@ -1023,7 +1023,7 @@ public:
fOne &= !(~value & cvalue); fOne &= !(~value & cvalue);
} }
if(fZero || fOne) { if(fZero || fOne) {
return -2 ^ fOne; return -2 ^ (int)fOne;
} }
for(unsigned j = 0; j < vvIndices[lev].size(); j++) { for(unsigned j = 0; j < vvIndices[lev].size(); j++) {
int index2 = vvIndices[lev][j]; int index2 = vvIndices[lev][j];
...@@ -1036,7 +1036,7 @@ public: ...@@ -1036,7 +1036,7 @@ public:
fCompl &= !(~value & cvalue); fCompl &= !(~value & cvalue);
} }
if(fEq || fCompl) { if(fEq || fCompl) {
return (index2 << 1) ^ !fEq; return (index2 << 1) ^ (int)!fEq;
} }
} }
} else { } else {
......
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