Skip to content

Commit

Permalink
APREPRO: Revert bad change; fix MOD function; remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Oct 16, 2024
1 parent 84e88e4 commit 606ff32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/seacas/libraries/aprepro_lib/apr_getline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace {
int gl_width = 0; /* net size available for input */
int gl_extent = 0; /* how far to redraw, 0 means all */
int gl_overwrite = 0; /* overwrite mode */
size_t gl_pos, gl_cnt = 0; /* position and size of input */
int gl_pos, gl_cnt = 0; /* position and size of input */
char gl_killbuf[GL_BUF_SIZE] = ""; /* killed text */
const char *gl_prompt; /* to save the prompt string */
int gl_search_mode = 0; /* search mode flag */
Expand Down Expand Up @@ -452,7 +452,7 @@ namespace {
void gl_yank()
/* adds the kill buffer to the input buffer at current location */
{
auto len = strlen(gl_killbuf);
int len = strlen(gl_killbuf);
if (len > 0) {
if (gl_overwrite == 0) {
if (gl_cnt + len >= GL_BUF_SIZE) {
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/aprepro_lib/apr_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ namespace SEAMS {

case 174: // exp: exp MOD exp
{
if ((yystack_[0].value.val) == 0.) {
if ((int)(yystack_[0].value.val) == 0.) {
(yylhs.value.val) = (int)(yystack_[2].value.val);
yyerror(aprepro, "Zero divisor");
yyerrok;
Expand Down
2 changes: 1 addition & 1 deletion packages/seacas/libraries/aprepro_lib/aprepro.yy
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ exp: NUM { $$ = $1; }
}
else
$$ = $1 / $3; }
| exp MOD exp { if ($3 == 0.)
| exp MOD exp { if ((int)$3 == 0.)
{
$$ = (int)$1;
yyerror(aprepro, "Zero divisor");
Expand Down

0 comments on commit 606ff32

Please sign in to comment.