Clear up some warnings.
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-branch-2-0/src/snc/gen_ss_code.c new-branch-2-0/src/snc/gen_ss_code.c
--- old-branch-2-0/src/snc/gen_ss_code.c 2022-09-28 12:39:06.453073676 +0200
+++ new-branch-2-0/src/snc/gen_ss_code.c 2022-09-28 12:39:06.457073776 +0200
@@ -253,9 +253,7 @@
*/
void eval_delay(Expr *ep, Expr *sp)
{
- Expr *epf;
int delay_id;
- extern char *stype[];
#ifdef DEBUG
fprintf(stderr, "eval_delay: type=%s\n", stype[ep->type]);
@@ -283,8 +281,7 @@
Expr *tp;
Expr *ap;
int trans_num;
- extern char *prog_name;
- extern line_num;
+ extern int line_num;
/* Action function declaration */
printf("\n/* Action function for state \"%s\" in state set \"%s\" */\n",
@@ -618,9 +615,7 @@
*/
{
char *fname; /* function name */
- Expr *ep1, *ep2, *ep3; /* parameters */
- Chan *cp;
- Var *vp;
+ Expr *ep1; /* parameters */
enum fcode func_code;
int delay_id;
@@ -723,9 +718,8 @@
enum fcode func_code; function code
*/
{
- Expr *ep1, *ep2, *ep3;
+ Expr *ep1;
Var *vp;
- Chan *cp;
ep1 = ep->left; /* ptr to 1-st parameters */
if (ep1 != 0 && ep1->type == E_COMMA)
@@ -776,7 +770,6 @@
Var *vp;
char *vn;
int id;
- int len;
Chan *cp;
int num;
@@ -851,7 +844,7 @@
{
if (vp != 0 && ep1->type != E_SUBSCR)
{
- printf(", %ld", vp->length1);
+ printf(", %d", vp->length1);
}
else
{
diff -rN -u old-branch-2-0/src/snc/gen_tables.c new-branch-2-0/src/snc/gen_tables.c
--- old-branch-2-0/src/snc/gen_tables.c 2022-09-28 12:39:06.453073676 +0200
+++ new-branch-2-0/src/snc/gen_tables.c 2022-09-28 12:39:06.457073776 +0200
@@ -68,9 +68,6 @@
void gen_tables()
{
- extern Expr *ss_list; /* state sets (from parse) */
- extern char *global_c_code; /* global C code */
-
printf("\f/************************ Tables ***********************/\n");
/* Generate DB blocks */
@@ -140,11 +137,10 @@
int elem_num;
{
Var *vp;
- char *type_string, *suffix, elem_str[20], *db_name;
- extern char *prog_name;
+ char *suffix, elem_str[20], *db_name;
extern int reent_opt;
extern int num_events;
- int size, count, ef_num, mon_flag;
+ int ef_num, mon_flag;
char *db_type_str();
vp = cp->var;
@@ -155,7 +151,7 @@
else if (vp->class == VC_ARRAY2)
sprintf(elem_str, "[%d][0]", elem_num);
else
- sprintf(elem_str, "");
+ elem_str[0] = '\0';
if (vp->type == V_STRING)
suffix = "[0]";
@@ -456,9 +452,6 @@
extern int reent_opt;
extern char *prog_name;
- extern Expr entry_code_list;
- extern Expr exit_code_list;
- int i;
printf("\n/* State Program table (global) */\n");
@@ -524,7 +517,7 @@
{
extern Expr *ss_list;
Expr *ssp;
- int nss, nstates, n;
+ int nss, nstates;
printf("\n/* State Set Blocks */\n");
printf("static struct seqSS seqSS[NUM_SS] = {\n");
diff -rN -u old-branch-2-0/src/snc/parse.c new-branch-2-0/src/snc/parse.c
--- old-branch-2-0/src/snc/parse.c 2022-09-28 12:39:06.453073676 +0200
+++ new-branch-2-0/src/snc/parse.c 2022-09-28 12:39:06.457073776 +0200
@@ -203,7 +203,6 @@
{
Chan *cp;
Var *vp;
- int subNum;
extern int line_num;
#ifdef DEBUG
@@ -810,8 +809,6 @@
Expr *ep1; /* beginning of 1-st structure or list */
Expr *ep2; /* beginning 2-nd (append it to 1-st) */
{
- Expr *ep;
-
if (ep1 == 0 && ep2 == 0)
return NULL;
else if (ep1 == 0)
diff -rN -u old-branch-2-0/src/snc/phase2.c new-branch-2-0/src/snc/phase2.c
--- old-branch-2-0/src/snc/phase2.c 2022-09-28 12:39:06.453073676 +0200
+++ new-branch-2-0/src/snc/phase2.c 2022-09-28 12:39:06.457073776 +0200
@@ -84,9 +84,7 @@
*-*************************************************************************/
void phase2()
{
- extern Var *var_list; /* variables (from parse) */
extern Expr *ss_list; /* state sets (from parse) */
- extern Expr *global_c_list; /* global C code */
/* Count number of db channels and state sets defined */
num_queues = db_queue_count();
@@ -242,7 +240,6 @@
Expr *ep;
{
Var *vp;
- extern char *stype[];
extern int warn_opt;
if (ep->type != E_VAR)
@@ -280,7 +277,7 @@
extern Expr *ss_list;
extern int num_errors;
- Expr *ssp, *sp, *sp1, tr;
+ Expr *ssp, *sp, *sp1;
for (ssp = ss_list; ssp != 0; ssp = ssp->next)
{
diff -rN -u old-branch-2-0/src/snc/snc_lex.l new-branch-2-0/src/snc/snc_lex.l
--- old-branch-2-0/src/snc/snc_lex.l 2022-09-28 12:39:06.453073676 +0200
+++ new-branch-2-0/src/snc/snc_lex.l 2022-09-28 12:39:06.457073776 +0200
@@ -116,7 +116,7 @@
line_num);
line_num++;
}
-<PP>{FPNUM} { yylval.pchar = strdup(yytext);
+<PP>{FPNUM} { yylval.pchar = strdup((char *)yytext);
RETURN(NUMBER);
}
<PP>\" { pStr = strBfr; BEGIN PP_STR; }
@@ -198,7 +198,7 @@
RETURN(NUMBER);
}
<SNL>{NAME} {
- yylval.pchar = strdup(yytext);
+ yylval.pchar = strdup((char *)yytext);
RETURN(NAME);
}
<SNL>"++" RETURN(AUTO_INCR);
@@ -248,19 +248,19 @@
<SNL>")" RETURN(R_PAREN);
<SNL>"," RETURN(COMMA);
<SNL>{HEX} {
- yylval.pchar = strdup(yytext);
+ yylval.pchar = strdup((char *)yytext);
RETURN(NUMBER);
}
<SNL>{OCTAL} {
- yylval.pchar = strdup(yytext);
+ yylval.pchar = strdup((char *)yytext);
RETURN(NUMBER);
}
<SNL>{FPNUM} {
- yylval.pchar = strdup(yytext);
+ yylval.pchar = strdup((char *)yytext);
RETURN(NUMBER);
}
<SNL>{CCONST} {
- yylval.pchar = strdup(yytext);
+ yylval.pchar = strdup((char *)yytext);
RETURN(CHAR_CONST);
}
<SNL>[\f\t\ ]* /* no action */ ;
patch cf243f6213b44fc116993830056d8e6b6b24c881
Author: Andrew Johnson <anj@aps.anl.gov>
Date: Wed Jan 24 17:26:00 CET 2007
* Clear up some warnings