From ede96e5706077ce428a36efb3513b3cf789dbce4 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 19 Apr 2007 18:21:55 +0200 Subject: [PATCH] declare variable at start of code block. --- evalue.c | 3 ++- scale.c | 3 ++- util.c | 5 +++-- volume.c | 9 +++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/evalue.c b/evalue.c index ed9e866..fe99310 100644 --- a/evalue.c +++ b/evalue.c @@ -3854,9 +3854,10 @@ void evalue_extract_affine(const evalue *e, Value *coeff, Value *cst, Value *d) value_set_si(*d, 1); evalue_denom(e, d); for ( ; value_zero_p(e->d); e = &e->x.p->arr[0]) { + evalue *c; assert(e->x.p->type == polynomial); assert(e->x.p->size == 2); - evalue *c = &e->x.p->arr[1]; + c = &e->x.p->arr[1]; value_multiply(coeff[e->x.p->pos-1], *d, c->x.n); value_division(coeff[e->x.p->pos-1], coeff[e->x.p->pos-1], c->d); } diff --git a/scale.c b/scale.c index b549ca5..98723d2 100644 --- a/scale.c +++ b/scale.c @@ -644,6 +644,7 @@ static evalue *enumerate_narrow_flated(Polyhedron *P, Polyhedron *C, FORALL_REDUCED_DOMAIN(PP, TC, nd, options, i, D, rVD) Polyhedron *P2, *CA; + Param_Polyhedron *PP_D; /* Intersect with D->Domain, so we only have the relevant constraints * left. Don't use rVD, though, since we still want to recognize * the defining constraints of the parametric vertices. @@ -654,7 +655,7 @@ static evalue *enumerate_narrow_flated(Polyhedron *P, Polyhedron *C, /* Use rVD for context, to avoid overlapping domains in * results of computations in different chambers. */ - Param_Polyhedron *PP_D = Param_Polyhedron_Domain(PP, D, rVD); + PP_D = Param_Polyhedron_Domain(PP, D, rVD); tmp = PP_enumerate_narrow_flated(PP_D, P2, rVD, options); Polyhedron_Free(P2); if (!eres) diff --git a/util.c b/util.c index 34c99ca..933daaf 100644 --- a/util.c +++ b/util.c @@ -1623,9 +1623,9 @@ int Polyhedron_has_revlex_positive_rays(Polyhedron *P, unsigned nparam) { int r; for (r = 0; r < P->NbRays; ++r) { + int i; if (value_notzero_p(P->Ray[r][P->Dimension+1])) continue; - int i; for (i = P->Dimension-1; i >= P->Dimension-nparam; --i) { if (value_neg_p(P->Ray[r][i+1])) return 0; @@ -1644,9 +1644,10 @@ static Polyhedron *Recession_Cone(Polyhedron *P, unsigned nparam, unsigned MaxRa int i; unsigned nvar = P->Dimension - nparam; Matrix *M = Matrix_Alloc(P->NbConstraints, 1 + nvar + 1); + Polyhedron *R; for (i = 0; i < P->NbConstraints; ++i) Vector_Copy(P->Constraint[i], M->p[i], 1+nvar); - Polyhedron *R = Constraints2Polyhedron(M, MaxRays); + R = Constraints2Polyhedron(M, MaxRays); Matrix_Free(M); return R; } diff --git a/volume.c b/volume.c index 0c5f30a..d4266ca 100644 --- a/volume.c +++ b/volume.c @@ -39,6 +39,8 @@ static evalue *determinant_cols(evalue ***matrix, int dim, int *cols) { evalue *det, *tmp; evalue mone; + int j; + int *newcols; if (dim == 1) { det = ALLOC(evalue); @@ -49,9 +51,8 @@ static evalue *determinant_cols(evalue ***matrix, int dim, int *cols) value_init(mone.d); evalue_set_si(&mone, -1, 1); - int j; det = NULL; - int *newcols = ALLOCN(int, dim-1); + newcols = ALLOCN(int, dim-1); for (j = 1; j < dim; ++j) newcols[j-1] = cols[j]; for (j = 0; j < dim; ++j) { @@ -148,11 +149,11 @@ static Param_Domain *face_vertices(Param_Polyhedron *PP, Param_Domain *D, { int nv; Param_Vertices *V; + unsigned nparam = PP->V->Vertex->NbColumns-2; + Vector *row = Vector_Alloc(1+nparam+1); Param_Domain *FD = ALLOC(Param_Domain); FD->Domain = 0; FD->next = 0; - unsigned nparam = PP->V->Vertex->NbColumns-2; - Vector *row = Vector_Alloc(1+nparam+1); nv = (PP->nbV - 1)/(8*sizeof(int)) + 1; FD->F = ALLOCN(unsigned, nv); -- 2.11.4.GIT