mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-02 05:29:20 -06:00
Use glib gboolean.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2780 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
6930df4374
commit
ebec283bb4
@ -47,14 +47,12 @@
|
||||
|
||||
|
||||
/** Constants *******************************************************/
|
||||
#define GUID_TRUE (0 == 0)
|
||||
#define GUID_FALSE (! GUID_TRUE)
|
||||
#define BLOCKSIZE 4096
|
||||
#define THRESHOLD (2 * BLOCKSIZE)
|
||||
|
||||
|
||||
/** Static global variables *****************************************/
|
||||
static int guid_initialized = GUID_FALSE;
|
||||
static gboolean guid_initialized = FALSE;
|
||||
static struct md5_ctx guid_context;
|
||||
|
||||
|
||||
@ -340,7 +338,7 @@ guid_init(void)
|
||||
"WARNING: guid_init only got %u bytes.\n"
|
||||
"The identifiers might not be very random.\n", bytes);
|
||||
|
||||
guid_initialized = GUID_TRUE;
|
||||
guid_initialized = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -358,7 +356,7 @@ guid_init_only_salt(const void *salt, size_t salt_len)
|
||||
|
||||
md5_process_bytes(salt, salt_len, &guid_context);
|
||||
|
||||
guid_initialized = GUID_TRUE;
|
||||
guid_initialized = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -393,7 +391,7 @@ encode_md5_data(const unsigned char *data, char *buffer)
|
||||
/* returns true if the first 32 bytes of buffer encode
|
||||
* a hex number. returns false otherwise. Decoded number
|
||||
* is packed into data in little endian order. */
|
||||
static int
|
||||
static gboolean
|
||||
decode_md5_string(const char *string, unsigned char *data)
|
||||
{
|
||||
unsigned char n1, n2;
|
||||
@ -401,17 +399,17 @@ decode_md5_string(const char *string, unsigned char *data)
|
||||
char c1, c2;
|
||||
|
||||
if (string == NULL)
|
||||
return GUID_FALSE;
|
||||
return FALSE;
|
||||
|
||||
for (count = 0; count < 16; count++)
|
||||
{
|
||||
c1 = tolower(string[2 * count]);
|
||||
if (!isxdigit(c1))
|
||||
return GUID_FALSE;
|
||||
return FALSE;
|
||||
|
||||
c2 = tolower(string[2 * count + 1]);
|
||||
if (!isxdigit(c2))
|
||||
return GUID_FALSE;
|
||||
return FALSE;
|
||||
|
||||
if (isdigit(c1))
|
||||
n1 = c1 - '0';
|
||||
@ -427,7 +425,7 @@ decode_md5_string(const char *string, unsigned char *data)
|
||||
data[count] = (n1 << 4) | n2;
|
||||
}
|
||||
|
||||
return GUID_TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *
|
||||
@ -443,7 +441,7 @@ guid_to_string(const GUID * guid)
|
||||
return string;
|
||||
}
|
||||
|
||||
int
|
||||
gboolean
|
||||
string_to_guid(const char * string, GUID * guid)
|
||||
{
|
||||
return decode_md5_string(string, (guid != NULL) ? guid->data : NULL);
|
||||
|
@ -81,11 +81,11 @@ char * guid_to_string(const GUID * guid);
|
||||
|
||||
|
||||
/* Given a string, decode the id into the guid if guid is non-NULL.
|
||||
* The function returns true if the string was a valid 32 character
|
||||
* The function returns TRUE if the string was a valid 32 character
|
||||
* hexadecimal number. This function accepts both upper and lower case
|
||||
* hex digits. If the return value if false, the effect on guid is
|
||||
* hex digits. If the return value is FALSE, the effect on guid is
|
||||
* undefined. */
|
||||
int string_to_guid(const char * string, GUID * guid);
|
||||
gboolean string_to_guid(const char * string, GUID * guid);
|
||||
|
||||
|
||||
/* Given two GUIDs, return TRUE if they are non-NULL and equal.
|
||||
|
Loading…
Reference in New Issue
Block a user