diff --git a/CHANGES b/CHANGES index 49742d3..30cf1f3 100644 --- a/CHANGES +++ b/CHANGES @@ -174,6 +174,18 @@ Following is the change from calc version 2.11.0t1 to date: to correctly hash a V_STR value-type that has an \0 byte inside it. + A patch from Ernest Bowen now defines + special meaning to the first 2 bits of config("lib_debug"): + + bit 0 set => messages printed when inputisterminal + bit 1 set => messages printed when reading from a file + + The lib/regress.cal regression suite does: + + config("lib_debug", -4); + + to eliminate lib messages (both bit 0 and bit 1 are not set). + Fixed misc compile warnings and notices. diff --git a/addop.c b/addop.c index 76fe5d1..abec25c 100644 --- a/addop.c +++ b/addop.c @@ -164,7 +164,8 @@ endfunc(void) size += dumpop(&fp->f_opcodes[size]); } } - if (inputisterminal() || conf->lib_debug >= 0) { + if ((inputisterminal() && conf->lib_debug & 1) || + (!inputisterminal() && conf->lib_debug & 2)) { printf("%s(", fp->f_name); for (index = 0; index < fp->f_paramcount; index++) { if (index) @@ -237,7 +238,8 @@ rmuserfunc(char *name) return; freenumbers(functions[index]); free(functions[index]); - if (inputisterminal() && conf->lib_debug >= 0) + if ((inputisterminal() && conf->lib_debug & 1) || + (!inputisterminal() && conf->lib_debug & 2)) printf("%s() undefined\n", name); functions[index] = NULL; } diff --git a/config.c b/config.c index 1388677..1e03256 100644 --- a/config.c +++ b/config.c @@ -93,7 +93,7 @@ CONFIG oldstd = { /* backward compatible standard configuration */ FALSE, /* skip duplicate block output lines */ BLK_BASE_HEX, /* block octet print base */ BLK_FMT_HD_STYLE, /* block output format */ - 0, /* calc library debug level */ + 3, /* calc library debug level */ 0, /* internal calc debug level */ 0 /* user defined debug level */ }; @@ -128,7 +128,7 @@ CONFIG newstd = { /* new non-backward compatible configuration */ FALSE, /* skip duplicate block output lines */ BLK_BASE_HEX, /* block octet print base */ BLK_FMT_HD_STYLE, /* block output format */ - 0, /* calc library debug level */ + 3, /* calc library debug level */ 0, /* internal calc debug level */ 0 /* user defined debug level */ }; diff --git a/custom/c_pzasusb8.c b/custom/c_pzasusb8.c index 9c9bbf0..d9410d3 100644 --- a/custom/c_pzasusb8.c +++ b/custom/c_pzasusb8.c @@ -58,7 +58,7 @@ c_pzasusb8(char *name, int count, VALUE **vals) */ h = (USB8 *) z.v; for (i=0; i < half_cnt; ++i) { - printf("%d:\t", i); + printf("%ld:\t", i); for (j=0; j < half_len; ++j) { printf("%02x", (int)(*h++)); } diff --git a/endian.c b/endian.c index da0a32e..8669026 100644 --- a/endian.c +++ b/endian.c @@ -76,5 +76,5 @@ main(void) exit(1); } /* exit(0); */ - return 0; + return 0; } diff --git a/hash.c b/hash.c index 33b99ae..a045c59 100644 --- a/hash.c +++ b/hash.c @@ -604,7 +604,7 @@ hash_str(int type, char *str, HASH *state) */ return state; } - + /* * hash_STR - hash a STRING diff --git a/lib/README b/lib/README index 92b8921..476ea23 100644 --- a/lib/README +++ b/lib/README @@ -12,7 +12,7 @@ If you write something that you think is useful, please send it to: By convention, a lib file only defines and/or initializes functions, objects and variables. (The regress.cal and testxxx.cal regression test -suite is an exception.) Also by convention, an additional usage message +suite is an exception.) Also by convention, an additional usage message regarding important object and functions is printed. If a lib file needs to load another lib file, it should use the -once @@ -537,7 +537,7 @@ test3500.cal testh(str, n, N, verbose) test3500(verbose, n, N) - This script is used by regress.cal to test the functions frem, + This script is used by regress.cal to test the functions frem, fcnt, gcdrem. test4000.cal diff --git a/lib/regress.cal b/lib/regress.cal index dcac0be..019fa9e 100644 --- a/lib/regress.cal +++ b/lib/regress.cal @@ -28,7 +28,7 @@ global ecnt; /* expected value of errcount() */ ecnt = 0; /* clear expected errcount() value */ initcfg = config("all", "oldstd"); /* set config to startup default */ -initcfg = config("lib_debug", -1); /* disable lib startup messages */ +initcfg = config("lib_debug", -4); /* disable lib startup messages */ initcfg = config("calc_debug", 1); /* enable more internal debugging */ initcfg = config("all"); /* save state for later use */ diff --git a/version.c b/version.c index 9ee0316..c14b0d9 100644 --- a/version.c +++ b/version.c @@ -12,7 +12,7 @@ #define MAJOR_VER 2 /* major version */ #define MINOR_VER 11 /* minor version */ #define MAJOR_PATCH 0 /* patch level or 0 if no patch */ -#define MINOR_PATCH "6" /* test number or empty string if no patch */ +#define MINOR_PATCH "6.1" /* test number or empty string if no patch */ /* * calc version constants