From 827988c55323f1067566d6304c157601a7d7f445 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Sun, 27 Nov 2022 17:05:49 -0800 Subject: [PATCH] Fixed FILEPOS_LEN symbol and macro problems --- CHANGES | 2 ++ file.c | 2 +- fposval.c | 2 +- have_fpos_pos.c | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 3856fe7..65dead5 100644 --- a/CHANGES +++ b/CHANGES @@ -103,6 +103,8 @@ The following are the changes from calc version 2.14.1.0 to date: file failed to compile incorrectly, producing a potentially incorrect have_uid_t.h file for such systems. + Renamed #define FPOS_POS_LEN symbol to FPOSPOS_LEN. + The following are the changes from calc version 2.14.0.15 to 2.14.0.15: diff --git a/file.c b/file.c index 3f9fbe6..ffab850 100644 --- a/file.c +++ b/file.c @@ -1459,7 +1459,7 @@ z2filepos(ZVALUE zpos) if (zpos.len >= FILEPOS_BITS/BASEB) { /* copy the lower FILEPOS_BITS of the ZVALUE */ memset(&tmp, 0, sizeof(tmp)); /* FILEPOS could be non-scalar */ - memcpy(&tmp, zpos.v, MIN(sizeof(tmp), FILEPOS_LEN); + memcpy(&tmp, zpos.v, MIN(sizeof(tmp), FILEPOS_LEN)); } else { /* copy what bits we can into the temp value */ memset(&tmp, 0, sizeof(tmp)); /* FILEPOS could be non-scalar */ diff --git a/fposval.c b/fposval.c index 4cdea69..0fd7818 100644 --- a/fposval.c +++ b/fposval.c @@ -138,7 +138,7 @@ main(int UNUSED(argc), char **argv) */ printf("#define SWAP_HALF_IN_FILEPOS(dest, src)\t%s\n", "\\\n\tmemcpy((void *)(dest), (void *)(src), " - "sizeof(FPOS_POS_LEN))"); + "sizeof(FPOSPOS_LEN))"); #endif /* HAVE_FILEPOS_SCALAR */ #endif /* CALC_BYTE_ORDER == BIG_ENDIAN */ putchar('\n'); diff --git a/have_fpos_pos.c b/have_fpos_pos.c index b53fff8..9135e2c 100644 --- a/have_fpos_pos.c +++ b/have_fpos_pos.c @@ -51,20 +51,20 @@ main(void) /* determine __pos element size */ printf("#undef FPOS_POS_BITS\n"); - printf("#undef FPOS_POS_LEN\n"); + printf("#undef FPOSPOS_LEN\n"); # if defined(FPOS_POS_BITS) printf("#define FPOS_POS_BITS %d\n", FPOS_POS_BITS); - printf("#define FPOS_POS_LEN %d\n", int(FPOS_POS_BITS/8)); + printf("#define FPOSPOS_LEN %d\n", int(FPOS_POS_BITS/8)); # else printf("#define FPOS_POS_BITS %lu\n", sizeof(pos.__pos)*8); - printf("#define FPOS_POS_LEN %lu\n", sizeof(pos.__pos)); + printf("#define FPOSPOS_LEN %lu\n", sizeof(pos.__pos)); # endif #else /* we have no __pos element */ printf("#undef HAVE_FPOS_POS\t/* no */\n"); printf("#undef FPOS_POS_BITS\n"); - printf("#undef FPOS_POS_LEN\n"); + printf("#undef FPOSPOS_LEN\n"); #endif /* exit(0); */ return 0;