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:
18
sha1.c
18
sha1.c
@@ -531,7 +531,7 @@ sha1_init_state(HASH *state)
|
||||
* initialize state
|
||||
*/
|
||||
state->hashtype = SHA1_HASH_TYPE;
|
||||
state->bytes = TRUE;
|
||||
state->bytes = true;
|
||||
state->update = sha1Update;
|
||||
state->chkpt = sha1_chkpt;
|
||||
state->note = sha1_note;
|
||||
@@ -622,8 +622,8 @@ sha1_final_state(HASH *state)
|
||||
* b second hash state
|
||||
*
|
||||
* returns:
|
||||
* TRUE => hash states are different
|
||||
* FALSE => hash states are the same
|
||||
* true => hash states are different
|
||||
* false => hash states are the same
|
||||
*/
|
||||
S_FUNC int
|
||||
sha1_cmp(HASH *a, HASH *b)
|
||||
@@ -633,18 +633,18 @@ sha1_cmp(HASH *a, HASH *b)
|
||||
*/
|
||||
if (a == b) {
|
||||
/* pointers to the same object */
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (a == NULL || b == NULL) {
|
||||
/* one is NULL, so they differ */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* compare data-reading modes
|
||||
*/
|
||||
if (a->bytes != b->bytes)
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
/*
|
||||
* compare bit counts
|
||||
@@ -652,7 +652,7 @@ sha1_cmp(HASH *a, HASH *b)
|
||||
if (a->h_union.h_sha1.countLo != b->h_union.h_sha1.countLo ||
|
||||
a->h_union.h_sha1.countHi != b->h_union.h_sha1.countHi) {
|
||||
/* counts differ */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -660,13 +660,13 @@ sha1_cmp(HASH *a, HASH *b)
|
||||
*/
|
||||
if (a->h_union.h_sha1.datalen != b->h_union.h_sha1.datalen) {
|
||||
/* buffer lengths differ */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
if (memcmp((USB8*)a->h_union.h_sha1.data,
|
||||
(USB8*)b->h_union.h_sha1.data,
|
||||
a->h_union.h_sha1.datalen) != 0) {
|
||||
/* buffer contents differ */
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user