diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-01-28 19:02:21 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-01-28 19:02:21 +0000 |
commit | f627f77f23d1497c9e1f4269b5c8812d12b42f18 (patch) | |
tree | 708772d83a8355e25155cf233d5a9e38f8ad4d96 /src/rtt | |
parent | 6ab0c0f5bf14ed9c15370407b9ee7e0b4b089ae1 (diff) | |
download | icon-f627f77f23d1497c9e1f4269b5c8812d12b42f18.tar.gz |
Imported Upstream version 9.5.0upstream/9.5.0upstream
Diffstat (limited to 'src/rtt')
-rw-r--r-- | src/rtt/Makefile | 2 | ||||
-rw-r--r-- | src/rtt/rttdb.c | 26 | ||||
-rw-r--r-- | src/rtt/rttilc.c | 14 | ||||
-rw-r--r-- | src/rtt/rttmain.c | 27 | ||||
-rw-r--r-- | src/rtt/rttout.c | 44 |
5 files changed, 19 insertions, 94 deletions
diff --git a/src/rtt/Makefile b/src/rtt/Makefile index db6445e..7122ca1 100644 --- a/src/rtt/Makefile +++ b/src/rtt/Makefile @@ -23,8 +23,6 @@ OBJ = $(ROBJS) $(POBJS) $(COBJS) rtt: $(OBJ) $(CC) $(LDFLAGS) -o rtt $(OBJ) - cp rtt ../../bin - strip ../../bin/rtt$(EXE) library: $(OBJ) rm -rf rtt.a diff --git a/src/rtt/rttdb.c b/src/rtt/rttdb.c index 22368fe..e38dd5f 100644 --- a/src/rtt/rttdb.c +++ b/src/rtt/rttdb.c @@ -542,7 +542,7 @@ struct il_code *il; fprintf(db, "%d ", num_cases); indx = 1; for (i = 0; i < num_cases; ++i) { - fprintf(db, "\n%d ", il->u[indx++].n); /* selection number */ + fprintf(db, "\n%ld ", (long)il->u[indx++].n);/* selection number */ put_inlin(db, il->u[indx++].fld); /* action */ } fprintf(db, "\n"); @@ -567,14 +567,14 @@ struct il_code *il; * runerr with no value argument. */ fprintf(db, "runerr1 "); - fprintf(db, "%d ", il->u[0].n); /* error number */ + fprintf(db, "%ld ", (long)il->u[0].n); /* error number */ break; case IL_Err2: /* * runerr with a value argument. */ fprintf(db, "runerr2 "); - fprintf(db, "%d ", il->u[0].n); /* error number */ + fprintf(db, "%ld ", (long)il->u[0].n); /* error number */ put_inlin(db, il->u[1].fld); /* variable */ break; case IL_Lst: @@ -649,15 +649,15 @@ struct il_code *il; /* * A variable. */ - fprintf(db, "%d ", il->u[0].n); /* symbol table index */ + fprintf(db, "%ld ", (long)il->u[0].n); /* symbol table index */ break; case IL_Subscr: /* * A subscripted variable. */ fprintf(db, "[ "); - fprintf(db, "%d ", il->u[0].n); /* symbol table index */ - fprintf(db, "%d ", il->u[1].n); /* subscripting index */ + fprintf(db, "%ld ", (long)il->u[0].n); /* symbol table index */ + fprintf(db, "%ld ", (long)il->u[1].n); /* subscripting index */ break; case IL_Block: /* @@ -671,7 +671,7 @@ struct il_code *il; /* * Output a symbol table of tended variables. */ - fprintf(db, "%d ", il->u[1].n); /* number of local tended */ + fprintf(db, "%ld ", (long)il->u[1].n); /* number of local tended */ for (i = 2; i - 2 < il->u[1].n; ++i) switch (il->u[i].n) { case TndDesc: @@ -733,8 +733,8 @@ struct il_code *il; else fprintf(db, "f "); - fprintf(db, "%d ", il->u[5].n); /* num string bufs */ - fprintf(db, "%d ", il->u[6].n); /* num cset bufs */ + fprintf(db, "%ld ", (long)il->u[5].n); /* num string bufs */ + fprintf(db, "%ld ", (long)il->u[6].n); /* num cset bufs */ i = il->u[7].n; fprintf(db, "%d ", i); /* num args */ indx = 8; @@ -961,15 +961,15 @@ struct il_c *ilc; fprintf(db, "$efail "); /* errorfail statement */ break; case ILC_Goto: - fprintf(db, "$goto %d ", ilc->n); /* goto label */ + fprintf(db, "$goto %ld ", (long)ilc->n); /* goto label */ break; case ILC_CGto: fprintf(db, "$cgoto "); /* conditional goto */ put_ilc(db, ilc->code[0]); /* condition (with $c $e) */ - fprintf(db, "%d ", ilc->n); /* label */ + fprintf(db, "%ld ", (long)ilc->n); /* label */ break; case ILC_Lbl: - fprintf(db, "$lbl %d ", ilc->n); /* label */ + fprintf(db, "$lbl %ld ", (long)ilc->n); /* label */ break; case ILC_LBrc: fprintf(db, "${ "); /* start of C block with dcls */ @@ -1000,7 +1000,7 @@ struct il_c *ilc; if (ilc->n == RsltIndx) fprintf(db, "r "); /* this is "result" */ else - fprintf(db, "%d ", ilc->n); /* offset into a symbol table */ + fprintf(db, "%ld ", (long)ilc->n); /* offset into a symbol table */ } /* diff --git a/src/rtt/rttilc.c b/src/rtt/rttilc.c index 70839ef..a660829 100644 --- a/src/rtt/rttilc.c +++ b/src/rtt/rttilc.c @@ -847,25 +847,11 @@ int const_cast; } else if (typcd == int_typ) { ForceNl(); - prt_str("#ifdef LargeInts", 0); - ForceNl(); - ilc_str("((("); ilc_walk(n1, 0, 0); ilc_str(").dword == D_Integer) || (("); ilc_walk(n1, 0, 0); ilc_str(").dword == D_Lrgint))"); - - ForceNl(); - prt_str("#else /* LargeInts */", 0); - ForceNl(); - - ilc_str("(("); - ilc_walk(n1, 0, 0); - ilc_str(").dword == D_Integer)"); - - ForceNl(); - prt_str("#endif /* LargeInts */", 0); ForceNl(); } else { diff --git a/src/rtt/rttmain.c b/src/rtt/rttmain.c index 2099c2f..bfdf643 100644 --- a/src/rtt/rttmain.c +++ b/src/rtt/rttmain.c @@ -24,8 +24,8 @@ static char *options = * interpreted as relative to where rtt.exe is or where rtt.exe is * invoked. */ - char *grttin_path = "../src/h/grttin.h"; - char *rt_path = "../src/h/rt.h"; + char *grttin_path = "../h/grttin.h"; + char *rt_path = "../h/rt.h"; /* * Note: rtt presently does not process system include files. If this @@ -39,7 +39,7 @@ char *compiler_def; FILE *out_file; char *inclname; int def_fnd; -char *largeints = NULL; +char *largeints = "LargeInts"; int iconx_flg = 0; int enable_out = 0; @@ -245,12 +245,9 @@ char *src_file; char *cname; char buf[MaxPath]; /* file name construction buffer */ char *buf_ptr; - char *s; struct fileparts *fp; struct tdefnm *td; struct token *t; - static char *test_largeints = "#ifdef LargeInts\nyes\n#endif\n"; - static int first_time = 1; cur_src = src_file; @@ -266,24 +263,6 @@ char *src_file; sym_add(TypeDefName, td->name, OtherDcl, 1); init_lex(); yyparse(); - if (first_time) { - first_time = 0; - /* - * Now that the standard include files have been processed, see if - * Largeints is defined and make sure it matches what's in the data base. - */ - s = "NoLargeInts"; - str_src("<rtt initialization>", test_largeints, - (int)strlen(test_largeints)); - while ((t = preproc()) != NULL) - if (strcmp(t->image, "yes")) - s = "LargeInts"; - if (largeints == NULL) - largeints = s; - else if (strcmp(largeints, s) != 0) - err2("header file definition of LargeInts/NoLargeInts does not match ", - dbname); - } enable_out = 1; /* diff --git a/src/rtt/rttout.c b/src/rtt/rttout.c index 14c71b7..c2fa8b0 100644 --- a/src/rtt/rttout.c +++ b/src/rtt/rttout.c @@ -566,22 +566,12 @@ int indent; * an ordinary integer or a large integer. */ ForceNl(); - prt_str("#ifdef LargeInts", 0); - ForceNl(); prt_str("(((", indent); c_walk(desc, indent, 0); prt_str(").dword == D_Integer) || ((", indent); c_walk(desc, indent, 0); prt_str(").dword == D_Lrgint))", indent); ForceNl(); - prt_str("#else\t\t\t\t\t/* LargeInts */", 0); - ForceNl(); - prt_str("((", indent); - c_walk(desc, indent, 0); - prt_str(").dword == D_Integer)", indent); - ForceNl(); - prt_str("#endif\t\t\t\t\t/* LargeInts */", 0); - ForceNl(); } else { /* @@ -1393,29 +1383,9 @@ int brace; * is returned. */ if (iconx_flg) { - #ifdef EventMon - switch (op_type) { - case TokFunction: - prt_str( - "if ((signal = interp(G_Fsusp, r_args)) != A_Resume) {", - indent); - break; - case Operator: - case Keyword: - prt_str( - "if ((signal = interp(G_Osusp, r_args)) != A_Resume) {", - indent); - break; - default: - prt_str( - "if ((signal = interp(G_Csusp, r_args)) != A_Resume) {", - indent); - } - #else /* EventMon */ - prt_str( - "if ((signal = interp(G_Csusp, r_args)) != A_Resume) {", - indent); - #endif /* EventMon */ + prt_str( + "if ((signal = interp(G_Csusp, r_args)) != A_Resume) {", + indent); } else { prt_str("if (r_s_cont == (continuation)NULL) {", indent); @@ -2153,12 +2123,8 @@ int indent; if (typcd == int_typ) { ForceNl(); - prt_str("#ifdef LargeInts", 0); - ForceNl(); prt_str("case T_Lrgint: ", indent + IndentInc); ForceNl(); - prt_str("#endif /* LargeInts */", 0); - ForceNl(); } prt_str("case T_", indent + IndentInc); @@ -2681,8 +2647,6 @@ int brace; /* * Try converting both arguments to an integer. */ - prt_str("#ifdef LargeInts", 0); - ForceNl(); ld_prmloc(strt_prms); tok_line(t, indent); prt_str("else if (", indent); @@ -2696,8 +2660,6 @@ int brace; mrg_prmloc(end_prms); } ForceNl(); - prt_str("#endif\t\t\t\t\t/* LargeInts */", 0); - ForceNl(); /* * Try converting both arguments to a C_double |