From: bdemsky Date: Mon, 10 Jul 2017 18:55:27 +0000 (-0700) Subject: edits X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a4e8202361e44cbb9ad4ed325d04ebda25eac516;p=satune.git edits --- diff --git a/src/Backend/cnfexpr.c b/src/Backend/cnfexpr.c index 07d13fa..6bbbbfc 100644 --- a/src/Backend/cnfexpr.c +++ b/src/Backend/cnfexpr.c @@ -99,17 +99,17 @@ void addLiteralLitVector(LitVector *This, Literal l) { This->size = 0; //either true or false now depending on whether this is a conj or disj return; } - if ((++This->size) >= This->capacity) { - This->capacity <<= 1; - This->literals=ourrealloc(This->literals, This->capacity * sizeof(Literal)); - } - - if (vec_size < MERGESIZE) { - memmove(&This->literals[i+1], &This->literals[i], (vec_size-i) * sizeof(Literal)); - This->literals[i]=l; - } else { - This->literals[vec_size]=l; - } + } + if ((++This->size) >= This->capacity) { + This->capacity <<= 1; + This->literals=ourrealloc(This->literals, This->capacity * sizeof(Literal)); + } + + if (vec_size < MERGESIZE) { + memmove(&This->literals[i+1], &This->literals[i], (vec_size-i) * sizeof(Literal)); + This->literals[i]=l; + } else { + This->literals[vec_size]=l; } } diff --git a/src/Backend/nodeedge.c b/src/Backend/nodeedge.c index fdc69ce..287601e 100644 --- a/src/Backend/nodeedge.c +++ b/src/Backend/nodeedge.c @@ -100,6 +100,7 @@ Node * allocNode(NodeType type, uint numEdges, Edge * edges, uint hashcode) { n->flags.wasExpanded=0; n->flags.cnfVisitedDown=0; n->flags.cnfVisitedUp=0; + n->flags.varForced=0; n->numEdges=numEdges; n->hashCode=hashcode; n->intAnnot[0]=0;n->intAnnot[1]=0; diff --git a/src/Collections/vector.h b/src/Collections/vector.h index 0538ff3..e472fcf 100644 --- a/src/Collections/vector.h +++ b/src/Collections/vector.h @@ -55,16 +55,16 @@ vector->size=size; \ return; \ } else if (size > vector->capacity) { \ - vector->array=(type *)ourrealloc(vector->array, size); \ + vector->array=(type *)ourrealloc(vector->array, size * sizeof(type)); \ vector->capacity=size; \ } \ bzero(&vector->array[vector->size], (size-vector->size)*sizeof(type)); \ vector->size=size; \ } \ void pushVector ## name(Vector ## name *vector, type item) { \ - if (vector->size >= vector->capacity) { \ - uint newcap=vector->capacity * 2; \ - vector->array=(type *)ourrealloc(vector->array, newcap); \ + if ((vector->size + 1) >= vector->capacity) { \ + uint newcap=vector->capacity << 1; \ + vector->array=(type *)ourrealloc(vector->array, newcap * sizeof(type)); \ } \ vector->array[vector->size++] = item; \ } \