From: bdemsky Date: Tue, 24 Oct 2017 05:59:03 +0000 (-0700) Subject: fix some warnings X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f32a4230fd634efd243963a1f0b4e80b18a1b225;p=satune.git fix some warnings --- diff --git a/src/Backend/constraint.h b/src/Backend/constraint.h index 2f61d72..1333b6c 100644 --- a/src/Backend/constraint.h +++ b/src/Backend/constraint.h @@ -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 { diff --git a/src/Makefile b/src/Makefile index acf435a..1ef9453 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/Serialize/deserializer.cc b/src/Serialize/deserializer.cc index 47de8b1..ddac4c9 100644 --- a/src/Serialize/deserializer.cc +++ b/src/Serialize/deserializer.cc @@ -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 members; - for(uint i=0; iaddElementMSet(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 members; + for(uint i=0; iaddElementMSet(mem); + } else { + members.push(mem); + } + } + if(!isMutable) { + set = solver->createSet(type, members.expose(), size); + } + map.put(s_ptr, set); + } } void Deserializer::deserializeBooleanLogic() { diff --git a/src/Serialize/serializer.cc b/src/Serialize/serializer.cc index fe41a39..4a97074 100644 --- a/src/Serialize/serializer.cc +++ b/src/Serialize/serializer.cc @@ -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 { diff --git a/src/Test/deserializerautotune.cc b/src/Test/deserializerautotune.cc index 8bda6c6..9e21eb5 100755 --- a/src/Test/deserializerautotune.cc +++ b/src/Test/deserializerautotune.cc @@ -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]);