changed C source to use C booleans with backward compatibility

Fix "Under source code control" date for new version.h file.

Sorted the order of symbols printed by "make env".

Test if <stdbool.h> exists and set HAVE_STDBOOL_H accordingly
in have_stdbool.h.  Added HAVE_STDBOOL_H to allow one to force
this value.

Added "bool.h" include file to support use of boolean symbols,
true and false for pre-c99 C compilers.  The "bool.h" include
file defines TRUE as true, FALSE as false, and BOOL as bool:
for backward compatibility.

The sign in a ZVALUE is now of type SIGN, whcih is either
SB32 when CALC2_COMPAT is defined, or a bool.

Replaced in C source, TRUE with true, FALSE with false, and
BOOL with bool.
This commit is contained in:
Landon Curt Noll
2023-08-19 19:20:32 -07:00
parent e18b715f3f
commit 3c18e6e25b
71 changed files with 1267 additions and 1043 deletions

34
value.h
View File

@@ -265,22 +265,22 @@ E_FUNC void sqrtvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres);
E_FUNC void rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres);
E_FUNC void absvalue(VALUE *v1, VALUE *v2, VALUE *vres);
E_FUNC void normvalue(VALUE *vp, VALUE *vres);
E_FUNC void shiftvalue(VALUE *v1, VALUE *v2, BOOL rightshift, VALUE *vres);
E_FUNC void shiftvalue(VALUE *v1, VALUE *v2, bool rightshift, VALUE *vres);
E_FUNC void scalevalue(VALUE *v1, VALUE *v2, VALUE *vres);
E_FUNC void powvalue(VALUE *v1, VALUE *v2, VALUE *vres);
E_FUNC void powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres);
E_FUNC void divvalue(VALUE *v1, VALUE *v2, VALUE *vres);
E_FUNC void quovalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres);
E_FUNC void modvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres);
E_FUNC BOOL testvalue(VALUE *vp);
E_FUNC BOOL comparevalue(VALUE *v1, VALUE *v2);
E_FUNC BOOL acceptvalue(VALUE *v1, VALUE *v2);
E_FUNC bool testvalue(VALUE *vp);
E_FUNC bool comparevalue(VALUE *v1, VALUE *v2);
E_FUNC bool acceptvalue(VALUE *v1, VALUE *v2);
E_FUNC void relvalue(VALUE *v1, VALUE *v2, VALUE *vres);
E_FUNC void sgnvalue(VALUE *vp, VALUE *vres);
E_FUNC QCKHASH hashvalue(VALUE *vp, QCKHASH val);
E_FUNC void printvalue(VALUE *vp, int flags);
E_FUNC void printestr(VALUE *vp);
E_FUNC BOOL precvalue(VALUE *v1, VALUE *v2);
E_FUNC bool precvalue(VALUE *v1, VALUE *v2);
E_FUNC VALUE error_value(int e);
E_FUNC int set_errno(int e);
E_FUNC int set_errcount(int e);
@@ -329,9 +329,9 @@ E_FUNC MATRIX *matappr(MATRIX *m, VALUE *v2, VALUE *v3);
E_FUNC VALUE mattrace(MATRIX *m);
E_FUNC MATRIX *mattrans(MATRIX *m);
E_FUNC MATRIX *matcross(MATRIX *m1, MATRIX *m2);
E_FUNC BOOL mattest(MATRIX *m);
E_FUNC bool mattest(MATRIX *m);
E_FUNC void matsum(MATRIX *m, VALUE *vres);
E_FUNC BOOL matcmp(MATRIX *m1, MATRIX *m2);
E_FUNC bool matcmp(MATRIX *m1, MATRIX *m2);
E_FUNC int matsearch(MATRIX *m, VALUE *vp, long start, long end, ZVALUE *index);
E_FUNC int matrsearch(MATRIX *m, VALUE *vp, long start, long end,
ZVALUE *index);
@@ -340,10 +340,10 @@ E_FUNC VALUE matdot(MATRIX *m1, MATRIX *m2);
E_FUNC void matfill(MATRIX *m, VALUE *v1, VALUE *v2);
E_FUNC void matfree(MATRIX *m);
E_FUNC void matprint(MATRIX *m, long max_print);
E_FUNC VALUE *matindex(MATRIX *mp, BOOL create, long dim, VALUE *indices);
E_FUNC VALUE *matindex(MATRIX *mp, bool create, long dim, VALUE *indices);
E_FUNC void matreverse(MATRIX *m);
E_FUNC void matsort(MATRIX *m);
E_FUNC BOOL matisident(MATRIX *m);
E_FUNC bool matisident(MATRIX *m);
E_FUNC MATRIX *matround(MATRIX *m, VALUE *v2, VALUE *v3);
E_FUNC MATRIX *matbround(MATRIX *m, VALUE *v2, VALUE *v3);
@@ -383,7 +383,7 @@ E_FUNC void listprint(LIST *lp, long max_print);
E_FUNC int listsearch(LIST *lp, VALUE *vp, long start, long end, ZVALUE *index);
E_FUNC int listrsearch(LIST *lp, VALUE *vp, long start, long end,
ZVALUE *index);
E_FUNC BOOL listcmp(LIST *lp1, LIST *lp2);
E_FUNC bool listcmp(LIST *lp1, LIST *lp2);
E_FUNC VALUE *listfindex(LIST *lp, long index);
E_FUNC LIST *listalloc(void);
E_FUNC LIST *listcopy(LIST *lp);
@@ -394,8 +394,8 @@ E_FUNC LIST *listround(LIST *m, VALUE *v2, VALUE *v3);
E_FUNC LIST *listbround(LIST *m, VALUE *v2, VALUE *v3);
E_FUNC LIST *listquo(LIST *lp, VALUE *v2, VALUE *v3);
E_FUNC LIST *listmod(LIST *lp, VALUE *v2, VALUE *v3);
E_FUNC BOOL evp(LISTELEM *cp, LISTELEM *x, VALUE *vres);
E_FUNC BOOL evalpoly(LIST *clist, LISTELEM *x, VALUE *vres);
E_FUNC bool evp(LISTELEM *cp, LISTELEM *x, VALUE *vres);
E_FUNC bool evalpoly(LIST *clist, LISTELEM *x, VALUE *vres);
E_FUNC void insertitems(LIST *lp1, LIST *lp2);
E_FUNC LISTELEM *listelement(LIST *, long);
E_FUNC LIST *listsegment(LIST *, long, long);
@@ -431,9 +431,9 @@ E_FUNC int assocsearch(ASSOC *ap, VALUE *vp, long start, long end,
ZVALUE *index);
E_FUNC int assocrsearch(ASSOC *ap, VALUE *vp, long start, long end,
ZVALUE *index);
E_FUNC BOOL assoccmp(ASSOC *ap1, ASSOC *ap2);
E_FUNC bool assoccmp(ASSOC *ap1, ASSOC *ap2);
E_FUNC VALUE *assocfindex(ASSOC *ap, long index);
E_FUNC VALUE *associndex(ASSOC *ap, BOOL create, long dim, VALUE *indices);
E_FUNC VALUE *associndex(ASSOC *ap, bool create, long dim, VALUE *indices);
/*
@@ -567,12 +567,12 @@ E_FUNC STRING *stringncpy(STRING *, STRING *, size_t);
E_FUNC long stringcontent(STRING *s);
E_FUNC long stringlowbit(STRING *s);
E_FUNC long stringhighbit(STRING *s);
E_FUNC BOOL stringcmp(STRING *, STRING *);
E_FUNC bool stringcmp(STRING *, STRING *);
E_FUNC FLAG stringrel(STRING *, STRING *);
E_FUNC FLAG stringcaserel(STRING *, STRING *);
E_FUNC int stringbit(STRING *, long);
E_FUNC BOOL stringtest(STRING *);
E_FUNC int stringsetbit(STRING *, long, BOOL);
E_FUNC bool stringtest(STRING *);
E_FUNC int stringsetbit(STRING *, long, bool);
E_FUNC int stringsearch(STRING *, STRING *, long, long, ZVALUE *);
E_FUNC int stringrsearch(STRING *, STRING *, long, long, ZVALUE *);