fix some warnings
authorbdemsky <bdemsky@uci.edu>
Tue, 24 Oct 2017 05:59:03 +0000 (22:59 -0700)
committerbdemsky <bdemsky@uci.edu>
Tue, 24 Oct 2017 05:59:03 +0000 (22:59 -0700)
src/Backend/constraint.h
src/Makefile
src/Serialize/deserializer.cc
src/Serialize/serializer.cc
src/Test/deserializerautotune.cc

index 2f61d72..1333b6c 100644 (file)
@@ -49,7 +49,7 @@ struct Node {
        Edge edges[];
 };
 
-#define DEFAULT_CNF_ARRAY_SIZE 256
+#define DEFAULT_CNF_ARRAY_SIZE 64
 #define LOAD_FACTOR 0.25
 
 struct CNF {
index acf435a..1ef9453 100644 (file)
@@ -12,9 +12,9 @@ HEADERS := $(wildcard *.h) $(wildcard AST/*.h) $(wildcard ASTTransform/*.h) $(wi
 
 OBJECTS := $(CPP_SOURCES:%.cc=$(OBJ_DIR)/%.o) $(C_SOURCES:%.c=$(OBJ_DIR)/%.o)
 
-CFLAGS := -Wall -g -O0
+CFLAGS := -Wall -O3 -g
 CFLAGS += -IAST -IASTTransform -IASTAnalyses -IASTAnalyses/Polarity -IASTAnalyses/Order -IASTAnalyses/Encoding -ITranslator -ICollections -IBackend -I. -IEncoders -ITuner -ISerialize
-LDFLAGS := -ldl -lrt -rdynamic
+LDFLAGS := -ldl -lrt -rdynamic -g
 SHARED := -shared
 
 # Mac OSX options
index 47de8b1..ddac4c9 100644 (file)
@@ -178,36 +178,36 @@ void Deserializer::deserializeSet() {
        myread(&type, sizeof(VarType));
        bool isRange;
        myread(&isRange, sizeof(bool));
-        bool isMutable;
+       bool isMutable;
        myread(&isMutable, sizeof(bool));
-        if(isRange){
-                uint64_t low;
-                myread(&low, sizeof(uint64_t));
-                uint64_t high;
-                myread(&high, sizeof(uint64_t));
-                map.put(s_ptr, new Set(type, low, high));
-        } else{
-                Set *set;
-                if(isMutable){
-                        set = new MutableSet(type);
-                }
-                uint size;
-                myread(&size, sizeof(uint));
-                Vector<uint64_t> members;
-                for(uint i=0; i<size; i++){
-                        uint64_t mem;
-                        myread(&mem, sizeof(uint64_t));
-                        if(isMutable) {
-                                ((MutableSet*) set)->addElementMSet(mem);
-                        }else {
-                                members.push(mem);
-                        }
-                }
-                if(!isMutable){
-                        set = solver->createSet(type, members.expose(), size);
-                }
-                map.put(s_ptr, set);
-        }
+       if(isRange){
+               uint64_t low;
+               myread(&low, sizeof(uint64_t));
+               uint64_t high;
+               myread(&high, sizeof(uint64_t));
+               map.put(s_ptr, new Set(type, low, high));
+       } else {
+               Set *set = NULL;
+               if(isMutable) {
+                       set = new MutableSet(type);
+               }
+               uint size;
+               myread(&size, sizeof(uint));
+               Vector<uint64_t> members;
+               for(uint i=0; i<size; i++) {
+                       uint64_t mem;
+                       myread(&mem, sizeof(uint64_t));
+                       if(isMutable) {
+                               ((MutableSet*) set)->addElementMSet(mem);
+                       else {
+                               members.push(mem);
+                       }
+               }
+               if(!isMutable) {
+                       set = solver->createSet(type, members.expose(), size);
+               }
+               map.put(s_ptr, set);
+       }
 }
 
 void Deserializer::deserializeBooleanLogic() {
index fe41a39..4a97074 100644 (file)
@@ -48,7 +48,9 @@ void Serializer::mywrite(const void *__buf, size_t __n) {
        if (__n > SERIALBUFFERLENGTH *2) {
                if (bufferoffset != 0)
                        flushBuffer();
-               write(filedesc, __buf, __n);
+               ssize_t result=write(filedesc, __buf, __n);
+               if (result != (ssize_t) __n)
+                       exit(-1);
        } else {
                char *towrite=(char *) __buf;
                do  {
index 8bda6c6..9e21eb5 100755 (executable)
@@ -7,7 +7,7 @@ int main(int argc, char ** argv){
                exit(-1);       
        }
        CSolver * solvers[argc-1];
-       AutoTuner *autotuner = new AutoTuner(300);
+       AutoTuner *autotuner = new AutoTuner(100);
        for(int i = 1; i < argc; i++) {
                solvers[i-1] = CSolver::deserialize(argv[i]);
                autotuner->addProblem(solvers[i-1]);