From 9f80cfd5ea9c21409f10ad96affd20b524cb7771 Mon Sep 17 00:00:00 2001 From: maartenbrock Date: Fri, 24 Dec 2004 14:54:36 +0000 Subject: [PATCH] * src/pic16/pcode.c: declaring variables other than at the start of a block is not supported in C by VC6. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3610 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/pic16/pcode.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10651a54..46b6dc2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-24 Maarten Brock + + * src/pic16/pcode.c: declaring variables other than at the start of a + block is not supported in C by VC6. + 2004-12-22 Vangelis Rokas * applied a previous patch from Raphael Neider that wasn't included diff --git a/src/pic16/pcode.c b/src/pic16/pcode.c index 085d7e94..b85f6987 100644 --- a/src/pic16/pcode.c +++ b/src/pic16/pcode.c @@ -7207,8 +7207,8 @@ void pic16_OptimizeJumps () //fprintf (stderr, "%s:%d: %s\n", __FILE__, __LINE__, __FUNCTION__); for (pb = the_pFile->pbHead; pb != NULL; pb = pb->next) { - iteration = 1; int matchedInvertRule = 1; + iteration = 1; do { //fprintf (stderr, "%s:%d: iterating over pBlock %p\n", __FUNCTION__, __LINE__, pb); change = 0; @@ -7248,9 +7248,10 @@ void pic16_OptimizeJumps () if (IS_GOTO(pc)) { - label = PCI(pc)->pcop->name; + int dist; int condBraType = isSkipOnStatus(pc_prev); - int dist = findpCodeLabel(pc, label, MAX_DIST_BRA, &target); + label = PCI(pc)->pcop->name; + dist = findpCodeLabel(pc, label, MAX_DIST_BRA, &target); if (dist < 0) dist = -dist; //fprintf (stderr, "distance: %d (", dist); pc->print(stderr, pc);fprintf (stderr, ")\n"); isHandled = 0; -- 2.30.2