mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
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:
@@ -691,6 +691,7 @@ c_argv.o: ../alloc.h
|
||||
c_argv.o: ../attribute.h
|
||||
c_argv.o: ../banned.h
|
||||
c_argv.o: ../block.h
|
||||
c_argv.o: ../bool.h
|
||||
c_argv.o: ../byteswap.h
|
||||
c_argv.o: ../calc.h
|
||||
c_argv.o: ../calcerr.h
|
||||
@@ -722,6 +723,7 @@ c_devnull.o: ../alloc.h
|
||||
c_devnull.o: ../attribute.h
|
||||
c_devnull.o: ../banned.h
|
||||
c_devnull.o: ../block.h
|
||||
c_devnull.o: ../bool.h
|
||||
c_devnull.o: ../byteswap.h
|
||||
c_devnull.o: ../calcerr.h
|
||||
c_devnull.o: ../charbit.h
|
||||
@@ -753,6 +755,7 @@ c_help.o: ../alloc.h
|
||||
c_help.o: ../attribute.h
|
||||
c_help.o: ../banned.h
|
||||
c_help.o: ../block.h
|
||||
c_help.o: ../bool.h
|
||||
c_help.o: ../byteswap.h
|
||||
c_help.o: ../calcerr.h
|
||||
c_help.o: ../charbit.h
|
||||
@@ -784,6 +787,7 @@ c_pmodm127.o: ../alloc.h
|
||||
c_pmodm127.o: ../attribute.h
|
||||
c_pmodm127.o: ../banned.h
|
||||
c_pmodm127.o: ../block.h
|
||||
c_pmodm127.o: ../bool.h
|
||||
c_pmodm127.o: ../byteswap.h
|
||||
c_pmodm127.o: ../calcerr.h
|
||||
c_pmodm127.o: ../charbit.h
|
||||
@@ -814,6 +818,7 @@ c_pzasusb8.o: ../alloc.h
|
||||
c_pzasusb8.o: ../attribute.h
|
||||
c_pzasusb8.o: ../banned.h
|
||||
c_pzasusb8.o: ../block.h
|
||||
c_pzasusb8.o: ../bool.h
|
||||
c_pzasusb8.o: ../byteswap.h
|
||||
c_pzasusb8.o: ../calcerr.h
|
||||
c_pzasusb8.o: ../charbit.h
|
||||
@@ -844,6 +849,7 @@ c_register.o: ../alloc.h
|
||||
c_register.o: ../attribute.h
|
||||
c_register.o: ../banned.h
|
||||
c_register.o: ../block.h
|
||||
c_register.o: ../bool.h
|
||||
c_register.o: ../byteswap.h
|
||||
c_register.o: ../calc.h
|
||||
c_register.o: ../calcerr.h
|
||||
@@ -875,6 +881,7 @@ c_sysinfo.o: ../alloc.h
|
||||
c_sysinfo.o: ../attribute.h
|
||||
c_sysinfo.o: ../banned.h
|
||||
c_sysinfo.o: ../block.h
|
||||
c_sysinfo.o: ../bool.h
|
||||
c_sysinfo.o: ../byteswap.h
|
||||
c_sysinfo.o: ../calc.h
|
||||
c_sysinfo.o: ../calcerr.h
|
||||
@@ -913,6 +920,7 @@ custtbl.o: ../alloc.h
|
||||
custtbl.o: ../attribute.h
|
||||
custtbl.o: ../banned.h
|
||||
custtbl.o: ../block.h
|
||||
custtbl.o: ../bool.h
|
||||
custtbl.o: ../byteswap.h
|
||||
custtbl.o: ../calcerr.h
|
||||
custtbl.o: ../charbit.h
|
||||
|
@@ -70,7 +70,7 @@ ZVALUE p255 = {
|
||||
|
||||
/* static declarations */
|
||||
S_FUNC void zmod5_or_zmod(ZVALUE *zp);
|
||||
STATIC BOOL havelastmod = FALSE;
|
||||
STATIC bool havelastmod = false;
|
||||
STATIC ZVALUE lastmod[1];
|
||||
STATIC ZVALUE lastmodinv[1];
|
||||
|
||||
@@ -122,14 +122,14 @@ c_pmodm127(char *UNUSED(name), int UNUSED(count), VALUE **vals)
|
||||
if (havelastmod && zcmp(q, *lastmod)) {
|
||||
zfree(*lastmod);
|
||||
zfree(*lastmodinv);
|
||||
havelastmod = FALSE;
|
||||
havelastmod = false;
|
||||
}
|
||||
if (!havelastmod) {
|
||||
zcopy(q, lastmod);
|
||||
zbitvalue(2 * q.len * BASEB, &temp);
|
||||
zquo(temp, q, lastmodinv, 0);
|
||||
zfree(temp);
|
||||
havelastmod = TRUE;
|
||||
havelastmod = true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -136,8 +136,8 @@ STATIC struct infoname sys_info[] = {
|
||||
(FULL)E__COUNT},
|
||||
{"E__HIGHEST", "highest calc error", NULL,
|
||||
(FULL)E__HIGHEST},
|
||||
{"FALSE", "boolean false", NULL,
|
||||
(FULL)FALSE},
|
||||
{"false", "boolean false", NULL,
|
||||
(FULL)false},
|
||||
{"FILEPOS_BITS", "file position size in bits", NULL,
|
||||
(FULL)FILEPOS_BITS},
|
||||
{"FULL_BITS", "bits in a FULL", NULL,
|
||||
@@ -248,8 +248,8 @@ STATIC struct infoname sys_info[] = {
|
||||
(FULL)TOPHALF},
|
||||
{"TOPLONG", "top long bit", NULL,
|
||||
(FULL)TOPLONG},
|
||||
{"TRUE", "boolean true", NULL,
|
||||
(FULL)TRUE},
|
||||
{"true", "boolean true", NULL,
|
||||
(FULL)true},
|
||||
{"USUAL_ELEMENTS", "usual number of elements for objects", NULL,
|
||||
(FULL)USUAL_ELEMENTS},
|
||||
{"REGNUM_MAX", "highest custom register number", NULL,
|
||||
|
@@ -39,16 +39,16 @@
|
||||
* custom_compiled - determine if custom functions are compiled into libcustcalc
|
||||
*
|
||||
* returns:
|
||||
s* TRUE ==> libcustcalc was compiled with CUSTOM defined
|
||||
* FALSE ==> libcustcalc was compiled with CUSTOM undefined
|
||||
s* true ==> libcustcalc was compiled with CUSTOM defined
|
||||
* false ==> libcustcalc was compiled with CUSTOM undefined
|
||||
*/
|
||||
E_FUNC BOOL
|
||||
E_FUNC bool
|
||||
custom_compiled(void)
|
||||
{
|
||||
#if defined(CUSTOM)
|
||||
return TRUE;
|
||||
return true;
|
||||
#else /* CUSTOM */
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif /* CUSTOM */
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user