lev_comp update for older Unix system
Increase the lex paramaters in lev_comp.l and replace use of snprintf with sprintf in lev_comp.y and lev_main.c. Also some reformatting for lev_comp.y, but I gave up pretty quickly: some early tab replacement and adjusting of the spacing for casts.
This commit is contained in:
+1
-1
@@ -501,7 +501,7 @@ int yy_flex_debug = 0;
|
|||||||
#define YY_MORE_ADJ 0
|
#define YY_MORE_ADJ 0
|
||||||
#define YY_RESTORE_YY_MORE_OFFSET
|
#define YY_RESTORE_YY_MORE_OFFSET
|
||||||
char *yytext;
|
char *yytext;
|
||||||
/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1449615114 2015/12/08 22:51:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.17 $ */
|
/* NetHack 3.6 dgn_comp.l $NHDT-Date: 1453249302 2016/01/20 00:21:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.18 $ */
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* Copyright (c) 1990 by M. Stephenson */
|
/* Copyright (c) 1990 by M. Stephenson */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#define yyerrok (yyerrflag=0)
|
#define yyerrok (yyerrflag=0)
|
||||||
#define YYRECOVERING (yyerrflag!=0)
|
#define YYRECOVERING (yyerrflag!=0)
|
||||||
#define YYPREFIX "yy"
|
#define YYPREFIX "yy"
|
||||||
/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1449233106 2015/12/04 12:45:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.11 $ */
|
/* NetHack 3.6 dgn_comp.y $NHDT-Date: 1453249313 2016/01/20 00:21:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* Copyright (c) 1990 by M. Stephenson */
|
/* Copyright (c) 1990 by M. Stephenson */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|||||||
+1
-1
@@ -1022,7 +1022,7 @@ int yy_flex_debug = 0;
|
|||||||
#define YY_MORE_ADJ 0
|
#define YY_MORE_ADJ 0
|
||||||
#define YY_RESTORE_YY_MORE_OFFSET
|
#define YY_RESTORE_YY_MORE_OFFSET
|
||||||
char *yytext;
|
char *yytext;
|
||||||
/* NetHack 3.6 lev_comp.l $NHDT-Date: 1449615116 2015/12/08 22:51:56 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.25 $ */
|
/* NetHack 3.6 lev_comp.l $NHDT-Date: 1453249313 2016/01/20 00:21:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.26 $ */
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
|
|||||||
+38
-17
@@ -11,7 +11,7 @@
|
|||||||
#define yyerrok (yyerrflag=0)
|
#define yyerrok (yyerrflag=0)
|
||||||
#define YYRECOVERING (yyerrflag!=0)
|
#define YYRECOVERING (yyerrflag!=0)
|
||||||
#define YYPREFIX "yy"
|
#define YYPREFIX "yy"
|
||||||
/* NetHack 3.6 lev_comp.y $NHDT-Date: 1449233826 2015/12/04 12:57:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $ */
|
/* NetHack 3.6 lev_comp.y $NHDT-Date: 1453249314 2016/01/20 00:21:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.20 $ */
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -79,13 +79,15 @@ extern void FDECL(start_level_def, (sp_lev * *, char *));
|
|||||||
|
|
||||||
extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *));
|
extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *));
|
||||||
extern void FDECL(funcdef_free_all, (struct lc_funcdefs *));
|
extern void FDECL(funcdef_free_all, (struct lc_funcdefs *));
|
||||||
extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int));
|
extern struct lc_funcdefs *FDECL(funcdef_defined, (struct lc_funcdefs *,
|
||||||
|
char *, int));
|
||||||
extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *));
|
extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *));
|
||||||
extern char *FDECL(decode_parm_str, (char *));
|
extern char *FDECL(decode_parm_str, (char *));
|
||||||
|
|
||||||
extern struct lc_vardefs *FDECL(vardef_new, (long,char *));
|
extern struct lc_vardefs *FDECL(vardef_new, (long,char *));
|
||||||
extern void FDECL(vardef_free_all, (struct lc_vardefs *));
|
extern void FDECL(vardef_free_all, (struct lc_vardefs *));
|
||||||
extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int));
|
extern struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *,
|
||||||
|
char *, int));
|
||||||
|
|
||||||
extern void NDECL(break_stmt_start);
|
extern void NDECL(break_stmt_start);
|
||||||
extern void FDECL(break_stmt_end, (sp_lev *));
|
extern void FDECL(break_stmt_end, (sp_lev *));
|
||||||
@@ -95,7 +97,8 @@ extern void FDECL(splev_add_from, (sp_lev *, sp_lev *));
|
|||||||
|
|
||||||
extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long));
|
extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long));
|
||||||
extern void FDECL(vardef_used, (struct lc_vardefs *, char *));
|
extern void FDECL(vardef_used, (struct lc_vardefs *, char *));
|
||||||
extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long));
|
extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *,
|
||||||
|
char *, long));
|
||||||
|
|
||||||
extern int FDECL(reverse_jmp_opcode, (int));
|
extern int FDECL(reverse_jmp_opcode, (int));
|
||||||
|
|
||||||
@@ -3222,7 +3225,7 @@ case 148:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* first, define a variable for the for-loop end value */
|
/* first, define a variable for the for-loop end value */
|
||||||
snprintf(buf, 255, "%s end", yyvsp[-4].map);
|
Sprintf(buf, "%s end", yyvsp[-4].map);
|
||||||
/* the value of which is already in stack (the 2nd math_expr) */
|
/* the value of which is already in stack (the 2nd math_expr) */
|
||||||
add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT));
|
add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT));
|
||||||
|
|
||||||
@@ -3232,7 +3235,7 @@ case 148:
|
|||||||
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
add_opvars(splev, "iso", VA_PASS3(0, yyvsp[-4].map, SPO_VAR_INIT));
|
||||||
|
|
||||||
/* calculate value for the loop "step" variable */
|
/* calculate value for the loop "step" variable */
|
||||||
snprintf(buf2, 255, "%s step", yyvsp[-4].map);
|
Sprintf(buf2, "%s step", yyvsp[-4].map);
|
||||||
/* end - start */
|
/* end - start */
|
||||||
add_opvars(splev, "vvo",
|
add_opvars(splev, "vvo",
|
||||||
VA_PASS3(buf, yyvsp[-4].map, SPO_MATH_SUB));
|
VA_PASS3(buf, yyvsp[-4].map, SPO_MATH_SUB));
|
||||||
@@ -3258,9 +3261,10 @@ break;
|
|||||||
case 150:
|
case 150:
|
||||||
{
|
{
|
||||||
char buf[256], buf2[256];
|
char buf[256], buf2[256];
|
||||||
|
|
||||||
n_forloops--;
|
n_forloops--;
|
||||||
snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname);
|
Sprintf(buf, "%s step", forloop_list[n_forloops].varname);
|
||||||
snprintf(buf2, 255, "%s end", forloop_list[n_forloops].varname);
|
Sprintf(buf2, "%s end", forloop_list[n_forloops].varname);
|
||||||
/* compare for-loop var to end value */
|
/* compare for-loop var to end value */
|
||||||
add_opvars(splev, "vvo",
|
add_opvars(splev, "vvo",
|
||||||
VA_PASS3(forloop_list[n_forloops].varname,
|
VA_PASS3(forloop_list[n_forloops].varname,
|
||||||
@@ -4421,7 +4425,8 @@ case 329:
|
|||||||
lc_error("Unknown monster \"%s\"!", yyvsp[0].map);
|
lc_error("Unknown monster \"%s\"!", yyvsp[0].map);
|
||||||
yyval.i = -1;
|
yyval.i = -1;
|
||||||
} else
|
} else
|
||||||
yyval.i = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym);
|
yyval.i = SP_MONST_PACK(m,
|
||||||
|
def_monsyms[(int) mons[m].mlet].sym);
|
||||||
Free(yyvsp[0].map);
|
Free(yyvsp[0].map);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -4810,13 +4815,21 @@ break;
|
|||||||
case 404:
|
case 404:
|
||||||
{
|
{
|
||||||
if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO)
|
if (yyvsp[-7].i <= 0 || yyvsp[-7].i >= COLNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (x1)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO)
|
else if (yyvsp[-5].i < 0 || yyvsp[-5].i >= ROWNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (y1)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO)
|
else if (yyvsp[-3].i <= 0 || yyvsp[-3].i >= COLNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (x2)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO)
|
else if (yyvsp[-1].i < 0 || yyvsp[-1].i >= ROWNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (y2)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
yyval.lregn.x1 = yyvsp[-7].i;
|
yyval.lregn.x1 = yyvsp[-7].i;
|
||||||
yyval.lregn.y1 = yyvsp[-5].i;
|
yyval.lregn.y1 = yyvsp[-5].i;
|
||||||
yyval.lregn.x2 = yyvsp[-3].i;
|
yyval.lregn.x2 = yyvsp[-3].i;
|
||||||
@@ -4829,13 +4842,21 @@ case 405:
|
|||||||
/* This series of if statements is a hack for MSC 5.1. It seems that its
|
/* This series of if statements is a hack for MSC 5.1. It seems that its
|
||||||
tiny little brain cannot compile if these are all one big if statement. */
|
tiny little brain cannot compile if these are all one big if statement. */
|
||||||
if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int) max_x_map)
|
if (yyvsp[-7].i < 0 || yyvsp[-7].i > (int) max_x_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (x1)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int) max_y_map)
|
else if (yyvsp[-5].i < 0 || yyvsp[-5].i > (int) max_y_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (y1)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int) max_x_map)
|
else if (yyvsp[-3].i < 0 || yyvsp[-3].i > (int) max_x_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (x2)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int) max_y_map)
|
else if (yyvsp[-1].i < 0 || yyvsp[-1].i > (int) max_y_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (y2)!",
|
||||||
|
yyvsp[-7].i, yyvsp[-5].i, yyvsp[-3].i, yyvsp[-1].i);
|
||||||
yyval.lregn.area = 0;
|
yyval.lregn.area = 0;
|
||||||
yyval.lregn.x1 = yyvsp[-7].i;
|
yyval.lregn.x1 = yyvsp[-7].i;
|
||||||
yyval.lregn.y1 = yyvsp[-5].i;
|
yyval.lregn.y1 = yyvsp[-5].i;
|
||||||
|
|||||||
+3
-3
@@ -102,9 +102,9 @@ FILE *orig_yyin = NULL;
|
|||||||
#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0);
|
#define ST_RETF(y, x) do { savetoken(yytext); y; return x; } while (0);
|
||||||
|
|
||||||
%}
|
%}
|
||||||
%e 2000
|
%e 2500
|
||||||
%p 5000
|
%p 10000
|
||||||
%n 700
|
%n 1500
|
||||||
%s MAPC
|
%s MAPC
|
||||||
%%
|
%%
|
||||||
<MAPC>ENDMAP {
|
<MAPC>ENDMAP {
|
||||||
|
|||||||
+37
-16
@@ -67,13 +67,15 @@ extern void FDECL(start_level_def, (sp_lev * *, char *));
|
|||||||
|
|
||||||
extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *));
|
extern struct lc_funcdefs *FDECL(funcdef_new, (long,char *));
|
||||||
extern void FDECL(funcdef_free_all, (struct lc_funcdefs *));
|
extern void FDECL(funcdef_free_all, (struct lc_funcdefs *));
|
||||||
extern struct lc_funcdefs *FDECL(funcdef_defined,(struct lc_funcdefs *,char *, int));
|
extern struct lc_funcdefs *FDECL(funcdef_defined, (struct lc_funcdefs *,
|
||||||
|
char *, int));
|
||||||
extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *));
|
extern char *FDECL(funcdef_paramtypes, (struct lc_funcdefs *));
|
||||||
extern char *FDECL(decode_parm_str, (char *));
|
extern char *FDECL(decode_parm_str, (char *));
|
||||||
|
|
||||||
extern struct lc_vardefs *FDECL(vardef_new, (long,char *));
|
extern struct lc_vardefs *FDECL(vardef_new, (long,char *));
|
||||||
extern void FDECL(vardef_free_all, (struct lc_vardefs *));
|
extern void FDECL(vardef_free_all, (struct lc_vardefs *));
|
||||||
extern struct lc_vardefs *FDECL(vardef_defined,(struct lc_vardefs *,char *, int));
|
extern struct lc_vardefs *FDECL(vardef_defined, (struct lc_vardefs *,
|
||||||
|
char *, int));
|
||||||
|
|
||||||
extern void NDECL(break_stmt_start);
|
extern void NDECL(break_stmt_start);
|
||||||
extern void FDECL(break_stmt_end, (sp_lev *));
|
extern void FDECL(break_stmt_end, (sp_lev *));
|
||||||
@@ -83,7 +85,8 @@ extern void FDECL(splev_add_from, (sp_lev *, sp_lev *));
|
|||||||
|
|
||||||
extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long));
|
extern void FDECL(check_vardef_type, (struct lc_vardefs *, char *, long));
|
||||||
extern void FDECL(vardef_used, (struct lc_vardefs *, char *));
|
extern void FDECL(vardef_used, (struct lc_vardefs *, char *));
|
||||||
extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *, char *, long));
|
extern struct lc_vardefs *FDECL(add_vardef_type, (struct lc_vardefs *,
|
||||||
|
char *, long));
|
||||||
|
|
||||||
extern int FDECL(reverse_jmp_opcode, (int));
|
extern int FDECL(reverse_jmp_opcode, (int));
|
||||||
|
|
||||||
@@ -979,7 +982,7 @@ forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_va
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* first, define a variable for the for-loop end value */
|
/* first, define a variable for the for-loop end value */
|
||||||
snprintf(buf, 255, "%s end", $2);
|
Sprintf(buf, "%s end", $2);
|
||||||
/* the value of which is already in stack (the 2nd math_expr) */
|
/* the value of which is already in stack (the 2nd math_expr) */
|
||||||
add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT));
|
add_opvars(splev, "iso", VA_PASS3(0, buf, SPO_VAR_INIT));
|
||||||
|
|
||||||
@@ -989,7 +992,7 @@ forstmt_start : FOR_ID any_var_or_unk '=' math_expr_var for_to_span math_expr_va
|
|||||||
add_opvars(splev, "iso", VA_PASS3(0, $2, SPO_VAR_INIT));
|
add_opvars(splev, "iso", VA_PASS3(0, $2, SPO_VAR_INIT));
|
||||||
|
|
||||||
/* calculate value for the loop "step" variable */
|
/* calculate value for the loop "step" variable */
|
||||||
snprintf(buf2, 255, "%s step", $2);
|
Sprintf(buf2, "%s step", $2);
|
||||||
/* end - start */
|
/* end - start */
|
||||||
add_opvars(splev, "vvo",
|
add_opvars(splev, "vvo",
|
||||||
VA_PASS3(buf, $2, SPO_MATH_SUB));
|
VA_PASS3(buf, $2, SPO_MATH_SUB));
|
||||||
@@ -1015,9 +1018,10 @@ forstatement : forstmt_start
|
|||||||
stmt_block
|
stmt_block
|
||||||
{
|
{
|
||||||
char buf[256], buf2[256];
|
char buf[256], buf2[256];
|
||||||
|
|
||||||
n_forloops--;
|
n_forloops--;
|
||||||
snprintf(buf, 255, "%s step", forloop_list[n_forloops].varname);
|
Sprintf(buf, "%s step", forloop_list[n_forloops].varname);
|
||||||
snprintf(buf2, 255, "%s end", forloop_list[n_forloops].varname);
|
Sprintf(buf2, "%s end", forloop_list[n_forloops].varname);
|
||||||
/* compare for-loop var to end value */
|
/* compare for-loop var to end value */
|
||||||
add_opvars(splev, "vvo",
|
add_opvars(splev, "vvo",
|
||||||
VA_PASS3(forloop_list[n_forloops].varname,
|
VA_PASS3(forloop_list[n_forloops].varname,
|
||||||
@@ -2207,7 +2211,8 @@ encodemonster : STRING
|
|||||||
lc_error("Unknown monster \"%s\"!", $1);
|
lc_error("Unknown monster \"%s\"!", $1);
|
||||||
$$ = -1;
|
$$ = -1;
|
||||||
} else
|
} else
|
||||||
$$ = SP_MONST_PACK(m, def_monsyms[(int)mons[m].mlet].sym);
|
$$ = SP_MONST_PACK(m,
|
||||||
|
def_monsyms[(int) mons[m].mlet].sym);
|
||||||
Free($1);
|
Free($1);
|
||||||
}
|
}
|
||||||
| CHAR
|
| CHAR
|
||||||
@@ -2593,13 +2598,21 @@ lev_region : region
|
|||||||
| LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
|
| LEV '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
|
||||||
{
|
{
|
||||||
if ($3 <= 0 || $3 >= COLNO)
|
if ($3 <= 0 || $3 >= COLNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (x1)!", $3, $5, $7, $9);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (x1)!",
|
||||||
|
$3, $5, $7, $9);
|
||||||
else if ($5 < 0 || $5 >= ROWNO)
|
else if ($5 < 0 || $5 >= ROWNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (y1)!", $3, $5, $7, $9);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (y1)!",
|
||||||
|
$3, $5, $7, $9);
|
||||||
else if ($7 <= 0 || $7 >= COLNO)
|
else if ($7 <= 0 || $7 >= COLNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (x2)!", $3, $5, $7, $9);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (x2)!",
|
||||||
|
$3, $5, $7, $9);
|
||||||
else if ($9 < 0 || $9 >= ROWNO)
|
else if ($9 < 0 || $9 >= ROWNO)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of level range (y2)!", $3, $5, $7, $9);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of level range (y2)!",
|
||||||
|
$3, $5, $7, $9);
|
||||||
$$.x1 = $3;
|
$$.x1 = $3;
|
||||||
$$.y1 = $5;
|
$$.y1 = $5;
|
||||||
$$.x2 = $7;
|
$$.x2 = $7;
|
||||||
@@ -2613,13 +2626,21 @@ region : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
|
|||||||
/* This series of if statements is a hack for MSC 5.1. It seems that its
|
/* This series of if statements is a hack for MSC 5.1. It seems that its
|
||||||
tiny little brain cannot compile if these are all one big if statement. */
|
tiny little brain cannot compile if these are all one big if statement. */
|
||||||
if ($2 < 0 || $2 > (int) max_x_map)
|
if ($2 < 0 || $2 > (int) max_x_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (x1)!", $2, $4, $6, $8);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (x1)!",
|
||||||
|
$2, $4, $6, $8);
|
||||||
else if ($4 < 0 || $4 > (int) max_y_map)
|
else if ($4 < 0 || $4 > (int) max_y_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (y1)!", $2, $4, $6, $8);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (y1)!",
|
||||||
|
$2, $4, $6, $8);
|
||||||
else if ($6 < 0 || $6 > (int) max_x_map)
|
else if ($6 < 0 || $6 > (int) max_x_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (x2)!", $2, $4, $6, $8);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (x2)!",
|
||||||
|
$2, $4, $6, $8);
|
||||||
else if ($8 < 0 || $8 > (int) max_y_map)
|
else if ($8 < 0 || $8 > (int) max_y_map)
|
||||||
lc_error("Region (%li,%li,%li,%li) out of map range (y2)!", $2, $4, $6, $8);
|
lc_error(
|
||||||
|
"Region (%ld,%ld,%ld,%ld) out of map range (y2)!",
|
||||||
|
$2, $4, $6, $8);
|
||||||
$$.area = 0;
|
$$.area = 0;
|
||||||
$$.x1 = $2;
|
$$.x1 = $2;
|
||||||
$$.y1 = $4;
|
$$.y1 = $4;
|
||||||
|
|||||||
+1
-1
@@ -939,7 +939,7 @@ long spovar;
|
|||||||
|
|
||||||
togl = ((togl + 1) % 2);
|
togl = ((togl + 1) % 2);
|
||||||
|
|
||||||
snprintf(buf[togl], 127, "%s%s", n, (is_array ? " array" : ""));
|
Sprintf(buf[togl], "%s%s", n, (is_array ? " array" : ""));
|
||||||
return buf[togl];
|
return buf[togl];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user