fix some warnings in teyjus

This commit is contained in:
kr.angelov
2012-08-03 12:30:01 +00:00
parent 636d0649f8
commit 3ef3108314
7 changed files with 19 additions and 20 deletions

View File

@@ -73,7 +73,7 @@ static Boolean HN_isEmptyEnv() { return ((ol == 0) && (nl == 0)); }
static DF_EnvPtr HN_addNDummyEnv(int n) static DF_EnvPtr HN_addNDummyEnv(int n)
{ {
int i; int i;
DF_EnvPtr last = envlist, current; DF_EnvPtr last = envlist, current = NULL;
AM_heapError(AM_hreg + n * DF_ENV_DUMMY_SIZE); AM_heapError(AM_hreg + n * DF_ENV_DUMMY_SIZE);
for (i = 0; i < n; i++){ for (i = 0; i < n; i++){
@@ -95,7 +95,7 @@ static DF_EnvPtr HN_addNPair(DF_TermPtr argvec, int myol, int mynl,
DF_EnvPtr myenv, int n) DF_EnvPtr myenv, int n)
{ {
int i; int i;
DF_EnvPtr last = envlist, current; DF_EnvPtr last = envlist, current = NULL;
MemPtr myEnvlist = AM_hreg; MemPtr myEnvlist = AM_hreg;
MemPtr newhtop = AM_hreg + n * DF_ENV_PAIR_SIZE; MemPtr newhtop = AM_hreg + n * DF_ENV_PAIR_SIZE;
@@ -122,7 +122,7 @@ static DF_EnvPtr HN_addNPair(DF_TermPtr argvec, int myol, int mynl,
static DF_EnvPtr HN_addNPairEmpEnv(DF_TermPtr argvec, int n) static DF_EnvPtr HN_addNPairEmpEnv(DF_TermPtr argvec, int n)
{ {
int i; int i;
DF_EnvPtr last = envlist, current; DF_EnvPtr last = envlist, current = NULL;
AM_heapError(AM_hreg + n * DF_ENV_PAIR_SIZE); AM_heapError(AM_hreg + n * DF_ENV_PAIR_SIZE);
for (i = 1; i <= n; i++) { for (i = 1; i <= n; i++) {
current = (DF_EnvPtr)AM_hreg; current = (DF_EnvPtr)AM_hreg;

View File

@@ -152,7 +152,7 @@ void HNL_updateToRef(DF_TermPtr tmPtr, DF_TermPtr target)
*/ */
static DF_TermPtr HNL_renumberAsEnv(DF_TermPtr skPtr, int nl) static DF_TermPtr HNL_renumberAsEnv(DF_TermPtr skPtr, int nl)
{ {
DF_TermPtr rtPtr; //term pointer to be returned DF_TermPtr rtPtr = NULL; //term pointer to be returned
restart_renumberAsEnv: restart_renumberAsEnv:
switch (DF_termTag(skPtr)){ switch (DF_termTag(skPtr)){
case DF_TM_TAG_VAR: case DF_TM_TAG_VAR:
@@ -178,7 +178,6 @@ static DF_TermPtr HNL_renumberAsEnv(DF_TermPtr skPtr, int nl)
{ {
if (nl == 0) rtPtr = skPtr; if (nl == 0) rtPtr = skPtr;
else { else {
DF_TermPtr myskPtr = DF_termDeref(DF_suspTermSkel(skPtr));
int myol = DF_suspOL(skPtr), mynl = DF_suspNL(skPtr); int myol = DF_suspOL(skPtr), mynl = DF_suspNL(skPtr);
DF_EnvPtr myenv = DF_suspEnv(skPtr); DF_EnvPtr myenv = DF_suspEnv(skPtr);
int newnl = mynl+nl; int newnl = mynl+nl;
@@ -353,7 +352,7 @@ static void HNL_BVSuspAsArg(DF_TermPtr bv, int ol, int nl, DF_EnvPtr env,
pushed on the current heap top if necessary. */ pushed on the current heap top if necessary. */
DF_TermPtr HNL_suspAsEnv(DF_TermPtr skPtr, int ol, int nl, DF_EnvPtr env) DF_TermPtr HNL_suspAsEnv(DF_TermPtr skPtr, int ol, int nl, DF_EnvPtr env)
{ {
DF_TermPtr rtPtr; // term pointer to be returned DF_TermPtr rtPtr = NULL; // term pointer to be returned
restart_suspAsEnv: restart_suspAsEnv:
switch(DF_termTag(skPtr)){ //[|c, ol, nl, envlist|] -> c switch(DF_termTag(skPtr)){ //[|c, ol, nl, envlist|] -> c
case DF_TM_TAG_VAR: case DF_TM_TAG_VAR:

View File

@@ -672,7 +672,7 @@ static DF_TermPtr HOPU_mkPrunedTerm(DF_TermPtr hPtr, DF_TermPtr args, int nargs)
/* Find the (partial) structure of the substitution for a flex head of a */ /* Find the (partial) structure of the substitution for a flex head of a */
/* LLambda term corresponding to an internal flex term which is known to be */ /* LLambda term corresponding to an internal flex term which is known to be */
/* LLambda. The internal free variable is bound to a proper substitution as */ /* LLambda. The internal free variable is bound to a proper substitution as */
/* side-effect. /* side-effect. */
/* The arguments of this procedure are: */ /* The arguments of this procedure are: */
/* args1 : reference to the argument vector of the outside flex term */ /* args1 : reference to the argument vector of the outside flex term */
/* nargs1: number of arguments of the outside flex term */ /* nargs1: number of arguments of the outside flex term */
@@ -1512,7 +1512,7 @@ void HOPU_patternUnifyPDL()
DF_TermPtr tPtr1, tPtr2, //pointers to terms to be unified DF_TermPtr tPtr1, tPtr2, //pointers to terms to be unified
hPtr, //pointer to head of hnf hPtr, //pointer to head of hnf
args; //arg vec of hnf args; //arg vec of hnf
Flag rig, cons; //rigid flag and cons flags Flag rig; //rigid flag and cons flags
int nabs, nargs; //binder length and # of arguments of hnf int nabs, nargs; //binder length and # of arguments of hnf
while (AM_nemptyPDL()){ while (AM_nemptyPDL()){
//retrieve the pair of terms on the current top of PDL //retrieve the pair of terms on the current top of PDL
@@ -1601,7 +1601,7 @@ void HOPU_patternUnify()
void HOPU_patternUnifyPair(DF_TermPtr tPtr1, DF_TermPtr tPtr2) void HOPU_patternUnifyPair(DF_TermPtr tPtr1, DF_TermPtr tPtr2)
{ {
DF_TermPtr h1Ptr, h2Ptr, args1, args2; DF_TermPtr h1Ptr, h2Ptr, args1, args2;
Flag rig1, rig2, cons1, cons2; Flag rig1, rig2;
int nabs1, nabs2, nargs1, nargs2; int nabs1, nabs2, nargs1, nargs2;
MemPtr oldPdlBot = AM_pdlBot; MemPtr oldPdlBot = AM_pdlBot;

View File

@@ -87,6 +87,8 @@ static Boolean PRINT_parenNeeded(OP_FixityType opfx, int opprec,
} }
break; break;
} }
default:
break;
} }
} else if (context == OP_RIGHT_TERM) { } else if (context == OP_RIGHT_TERM) {
switch (fx) { switch (fx) {
@@ -101,6 +103,8 @@ static Boolean PRINT_parenNeeded(OP_FixityType opfx, int opprec,
if (opprec < prec) pparen = TRUE; break; if (opprec < prec) pparen = TRUE; break;
} }
} }
default:
break;
} }
} }
return pparen; return pparen;
@@ -132,9 +136,6 @@ static void PRINT_writeNilSymbol(WordPtr outStream)
static void PRINT_writeInfixLam(WordPtr outStream) static void PRINT_writeInfixLam(WordPtr outStream)
{ STREAM_printf(outStream, "\\ "); } { STREAM_printf(outStream, "\\ "); }
static void PRINT_writeLam(WordPtr outStream, int numabs)
{ STREAM_printf(outStream, "lam(%d, ", numabs); }
static void PRINT_writeSpace(WordPtr outStream, int i) static void PRINT_writeSpace(WordPtr outStream, int i)
{ while (i--) STREAM_printf(outStream, " "); } { while (i--) STREAM_printf(outStream, " "); }
@@ -402,7 +403,6 @@ static void PRINT_writeCons(WordPtr outStream, DF_TermPtr tmPtr,
OP_FixityType fx, int prec, OP_TermContext tc) OP_FixityType fx, int prec, OP_TermContext tc)
{ {
DF_TermPtr args = DF_consArgs(tmPtr); DF_TermPtr args = DF_consArgs(tmPtr);
DF_TermPtr arg;
OP_FixityType consfix = (OP_FixityType)AM_cstFixity(PERV_CONS_INDEX); OP_FixityType consfix = (OP_FixityType)AM_cstFixity(PERV_CONS_INDEX);
int consprec = AM_cstPrecedence(PERV_CONS_INDEX); int consprec = AM_cstPrecedence(PERV_CONS_INDEX);
Boolean pparen = PRINT_parenNeeded(consfix, consprec, tc, fx,prec); Boolean pparen = PRINT_parenNeeded(consfix, consprec, tc, fx,prec);
@@ -600,8 +600,8 @@ static void PRINT_writeApp(WordPtr outStream, DF_TermPtr tmPtr,
int arity = DF_appArity(tmPtr); int arity = DF_appArity(tmPtr);
Boolean pparen = PRINT_parenNeeded(OP_APP_FIXITY, OP_APP_PREC, tc, infx, Boolean pparen = PRINT_parenNeeded(OP_APP_FIXITY, OP_APP_PREC, tc, infx,
inprec); inprec);
OP_FixityType fix; OP_FixityType fix = 0;
int prec; int prec = 0;
HN_hnorm(tmPtr); HN_hnorm(tmPtr);
PRINT_getHeadInfo(AM_head, &fix, &prec); PRINT_getHeadInfo(AM_head, &fix, &prec);

View File

@@ -1746,7 +1746,7 @@ void SINSTR_switch_on_bvar() //switch_on_bvar n,tab -- I1_BVT_X
{ {
INSACC_I1BVTX(n, table); INSACC_I1BVTX(n, table);
for (m = 0; m != n; m++) for (m = 0; m != n; m++)
if (numAbs = MEM_branchTabIndexVal(table, m)) break; if ((numAbs = MEM_branchTabIndexVal(table, m))) break;
if (m < n) AM_preg = MEM_branchTabCodePtr(table, m); if (m < n) AM_preg = MEM_branchTabCodePtr(table, m);
else EM_THROW(EM_FAIL); else EM_THROW(EM_FAIL);
} }

View File

@@ -38,7 +38,7 @@ static MemPtr TR_trailItemAddr(TR_TrailItem *trPtr) { return (trPtr -> addr);}
void TR_trailTerm(DF_TermPtr addr) //trailing a term of atomic size void TR_trailTerm(DF_TermPtr addr) //trailing a term of atomic size
{ {
if (((MemPtr)addr <= AM_hbreg) || if (((MemPtr)addr <= AM_hbreg) ||
(AM_hreg < (MemPtr)addr) && ((MemPtr)addr < AM_breg)) { ((AM_hreg < (MemPtr)addr) && ((MemPtr)addr < AM_breg))) {
AM_trailError(TR_TRAIL_TERM_SIZE); AM_trailError(TR_TRAIL_TERM_SIZE);
DF_copyAtomic(addr, AM_trreg); DF_copyAtomic(addr, AM_trreg);
((TR_TrailItem*)(AM_trreg+DF_TM_ATOMIC_SIZE))->tag = TR_TAG_TERM; ((TR_TrailItem*)(AM_trreg+DF_TM_ATOMIC_SIZE))->tag = TR_TAG_TERM;

View File

@@ -114,11 +114,11 @@ EM_TRY
} }
EM_CATCH EM_CATCH
{ {
un_foo(); /* clean up * un_foo(); // clean up
if (EM_CurrentExnType == EM_FOOBAR) if (EM_CurrentExnType == EM_FOOBAR)
printf("foobar!"); /* stop the error here * printf("foobar!"); // stop the error here
else else
EM_RETHROW(); /* let a later handler handle it * EM_RETHROW(); // let a later handler handle it
} }
*/ */