Skip to content

Commit

Permalink
Merge pull request #36 from tomscii/fix-compile-with-integer-cells
Browse files Browse the repository at this point in the history
Fix compiling with integer cells
  • Loading branch information
zevv authored Jan 22, 2024
2 parents b33fa29 + cd7faae commit 2e0e793
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/atmega8/zfconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

typedef int32_t zf_cell;
#define ZF_CELL_FMT "%ld"
#define ZF_SCAN_FMT "%ld"


/* The type to use for pointers and adresses. 'unsigned int' is usually a good
Expand Down
2 changes: 1 addition & 1 deletion src/linux/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ zf_cell zf_host_parse_num(const char *buf)
{
zf_cell v;
int n = 0;
int r = sscanf(buf, "%f%n", &v, &n);
int r = sscanf(buf, ZF_SCAN_FMT"%n", &v, &n);
if(r != 1 || buf[n] != '\0') {
zf_abort(ZF_ABORT_NOT_A_WORD);
}
Expand Down
1 change: 1 addition & 0 deletions src/linux/zfconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

typedef float zf_cell;
#define ZF_CELL_FMT "%.14g"
#define ZF_SCAN_FMT "%f"


/* The type to use for pointers and adresses. 'unsigned int' is usually a good
Expand Down

0 comments on commit 2e0e793

Please sign in to comment.