diff options
author | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-03-18 13:13:25 +0000 |
---|---|---|
committer | jthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-03-18 13:13:25 +0000 |
commit | c8953e9995e040f5f54a57781bbd898d11113fea (patch) | |
tree | 30d839fd217c23156c4640cf05093828af571b8f /src/util/Table.c | |
parent | fc339f0240540b88a97643d13b0685ae925f3712 (diff) |
move some debug printf() calls closer to the start of their functions
(all inside #ifdef UTIL_TABLE_TEST)
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4010 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/Table.c')
-rw-r--r-- | src/util/Table.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/util/Table.c b/src/util/Table.c index 2b122bc4..b8ec30f6 100644 --- a/src/util/Table.c +++ b/src/util/Table.c @@ -4834,6 +4834,12 @@ static int type_code, int N_elements, const void *value, const char *key) { + #ifdef UTIL_TABLE_DEBUG + printf("internal_set(handle=%d, type_code=%d, N_elements=%d, key=\"%s\")\n", + handle, type_code, N_elements, key); + #endif + + { struct table_header *const thp = get_table_header_ptr(handle); if (thp == NULL) { @@ -4849,11 +4855,6 @@ static return UTIL_ERROR_BAD_INPUT; } - #ifdef UTIL_TABLE_DEBUG - printf("internal_set(handle=%d, type_code=%d, N_elements=%d, key=\"%s\")\n", - handle, type_code, N_elements, key); - #endif - /* if key is already in table, delete it */ /* ... this is a harmless no-op if it's not already in the table */ { @@ -4887,6 +4888,7 @@ static return return_value; } } + } } /******************************************************************************/ @@ -4961,6 +4963,13 @@ static int type_code, int N_value_buffer, void *value_buffer, const char *key) { + #ifdef UTIL_TABLE_DEBUG + printf( + "internal_get(handle=%d, type_code=%d, N_value_buffer=%d, key=\"%s\")\n", + handle, type_code, N_value_buffer, key); + #endif + + { const struct table_header *const thp = get_table_header_ptr(handle); if (thp == NULL) { @@ -4972,12 +4981,6 @@ static return UTIL_ERROR_TABLE_BAD_KEY; } - #ifdef UTIL_TABLE_DEBUG - printf( - "internal_get(handle=%d, type_code=%d, N_value_buffer=%d, key=\"%s\")\n", - handle, type_code, N_value_buffer, key); - #endif - { const struct table_entry *const tep = find_table_entry(thp, key, NULL); if (tep == NULL) @@ -5010,6 +5013,7 @@ static return tep->N_elements; } + } } /******************************************************************************/ @@ -5163,6 +5167,12 @@ static const char *key, int type_code, int N_elements, const void *value) { + #ifdef UTIL_TABLE_DEBUG + printf("insert_table_entry(type_code=%d, N_elements=%d, key=\"%s\")...\n", + type_code, N_elements, key); + #endif + + { struct table_entry *tep = (struct table_entry *) malloc(sizeof(struct table_entry)); if (tep == NULL) @@ -5170,11 +5180,6 @@ static return UTIL_ERROR_NO_MEMORY; /* can't allocate new table entry */ } - #ifdef UTIL_TABLE_DEBUG - printf("insert_table_entry(type_code=%d, N_elements=%d, key=\"%s\")...\n", - type_code, N_elements, key); - #endif - tep->key = Util_Strdup(key); if (tep->key == NULL) { @@ -5225,6 +5230,7 @@ static return 0; } } + } } /******************************************************************************/ |