Skip to content

Commit

Permalink
Change NUMVAL_FMT to FLOATVAL_FMT.
Browse files Browse the repository at this point in the history
Courtesy of "David M. Lloyd" <dmlloyd@tds.net>


git-svn-id: https://svn.parrot.org/parrot/trunk@832 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
dsugalski committed Jan 13, 2002
1 parent d58e1a4 commit 3e12d79
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Configure.pl
Expand Up @@ -171,7 +171,7 @@ END
longsize => undef,

intvalfmt => '%ld',
numvalfmt => '%f',
floatvalfmt => '%f',

cc => $Config{cc},

Expand Down Expand Up @@ -562,9 +562,9 @@ END
}

if ($c{nv} eq "double") {
$c{numvalfmt} = "%f";
$c{floatvalfmt} = "%f";
} elsif ($c{nv} eq "long double") {
$c{numvalfmt} = "%lf";
$c{floatvalfmt} = "%lf";
} else {
die "Configure.pl: Can't find a printf-style format specifier for type \"$c{nv}\"\n";
}
Expand Down
4 changes: 2 additions & 2 deletions classes/perlnum.pmc
Expand Up @@ -64,9 +64,9 @@ fprintf(stderr,"morph not implemented\n");
char* buff = mem_sys_allocate(80);
STRING* s;
#ifdef HAS_SNPRINTF
snprintf(buff,80,NUMVAL_FMT,SELF->cache.num_val);
snprintf(buff,80,FLOATVAL_FMT,SELF->cache.num_val);
#else
sprintf(buff,NUMVAL_FMT,SELF->cache.num_val); /* XXX buffer overflow! */
sprintf(buff,FLOATVAL_FMT,SELF->cache.num_val); /* XXX buffer overflow! */
#endif
s = string_make(INTERP,buff,strlen(buff),NULL,0,NULL);
free(buff);
Expand Down
2 changes: 1 addition & 1 deletion config_h.in
Expand Up @@ -50,7 +50,7 @@ typedef void SYNC;
#define PARROT_CORE_OPLIB_INIT Parrot_DynOp_core_${MAJOR}_${MINOR}_${PATCH}

#define INTVAL_FMT "${intvalfmt}"
#define NUMVAL_FMT "${numvalfmt}"
#define FLOATVAL_FMT "${floatvalfmt}"

${headers}

Expand Down
4 changes: 2 additions & 2 deletions core.ops
Expand Up @@ -258,7 +258,7 @@ inline op print(in INT) {
}

inline op print(in NUM) {
printf(NUMVAL_FMT, $1);
printf(FLOATVAL_FMT, $1);
goto NEXT();
}

Expand Down Expand Up @@ -316,7 +316,7 @@ op print(in INT, in NUM) {
break;
default: file = (FILE *)$1;
}
fprintf(file, NUMVAL_FMT, $2);
fprintf(file, FLOATVAL_FMT, $2);
goto NEXT();
}

Expand Down
4 changes: 2 additions & 2 deletions ops/core.ops
Expand Up @@ -258,7 +258,7 @@ inline op print(in INT) {
}

inline op print(in NUM) {
printf(NUMVAL_FMT, $1);
printf(FLOATVAL_FMT, $1);
goto NEXT();
}

Expand Down Expand Up @@ -316,7 +316,7 @@ op print(in INT, in NUM) {
break;
default: file = (FILE *)$1;
}
fprintf(file, NUMVAL_FMT, $2);
fprintf(file, FLOATVAL_FMT, $2);
goto NEXT();
}

Expand Down

0 comments on commit 3e12d79

Please sign in to comment.