#include <ac/string.h>.

Print unsigned long with %lu, not %d.
This commit is contained in:
Hallvard Furuseth 2003-04-29 15:05:19 +00:00
parent 9d9ac9e4d9
commit 6387a3b6bf
3 changed files with 19 additions and 16 deletions

View File

@ -20,6 +20,8 @@
#include <stdio.h> #include <stdio.h>
#include <ac/string.h>
#include "slap.h" #include "slap.h"
#include "../back-ldap/back-ldap.h" #include "../back-ldap/back-ldap.h"
#include "back-meta.h" #include "back-meta.h"
@ -331,11 +333,11 @@ void add_query(
new_cached_query->lru_down = NULL; new_cached_query->lru_down = NULL;
new_cached_query->expiry_time = slap_get_time() + templ->ttl; new_cached_query->expiry_time = slap_get_time() + templ->ttl;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %d\n", LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %ld\n",
new_cached_query->expiry_time, 0, 0 ); (long) new_cached_query->expiry_time, 0, 0 );
#else #else
Debug( LDAP_DEBUG_ANY, "Added query expires at %d\n", Debug( LDAP_DEBUG_ANY, "Added query expires at %ld\n",
new_cached_query->expiry_time, 0, 0 ); (long) new_cached_query->expiry_time, 0, 0 );
#endif #endif
new_query = (Query*)new_cached_query; new_query = (Query*)new_cached_query;

View File

@ -1491,11 +1491,11 @@ cache_entries(
cm->num_cached_queries--; cm->num_cached_queries--;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, LDAP_LOG( BACK_META, DETAIL1,
"STORED QUERIES = %d\n", "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"STORED QUERIES = %d\n", "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock( ldap_pvt_thread_mutex_unlock(
@ -1506,13 +1506,13 @@ cache_entries(
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, LDAP_LOG( BACK_META, DETAIL1,
"QUERY REMOVED, CACHE SIZE=" "QUERY REMOVED, CACHE SIZE="
"%d bytes %d entries\n", "%lu bytes %d entries\n",
cm->cache_size, cm->cache_size,
cm->total_entries, 0 ); cm->total_entries, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"QUERY REMOVED, CACHE SIZE=" "QUERY REMOVED, CACHE SIZE="
"%d bytes %d entries\n", "%lu bytes %d entries\n",
cm->cache_size, cm->cache_size,
cm->total_entries, 0 ); cm->total_entries, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */
@ -1523,11 +1523,11 @@ cache_entries(
cm->cache_size += return_val; cm->cache_size += return_val;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, LDAP_LOG( BACK_META, DETAIL1,
"ENTRY ADDED/MERGED, CACHE SIZE=%d bytes\n", "ENTRY ADDED/MERGED, CACHE SIZE=%lu bytes\n",
cm->cache_size, 0, 0 ); cm->cache_size, 0, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"ENTRY ADDED/MERGED, CACHE SIZE=%d bytes\n", "ENTRY ADDED/MERGED, CACHE SIZE=%lu bytes\n",
cm->cache_size, 0, 0 ); cm->cache_size, 0, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
@ -1561,10 +1561,10 @@ cache_entries(
ldap_pvt_thread_mutex_lock(&cm->cache_mutex); ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
cm->num_cached_queries++; cm->num_cached_queries++;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %d\n", LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %d\n", Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex); ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
@ -1668,10 +1668,10 @@ consistency_check(Backend* be, Backend* glue_be, Connection* conn)
cm->total_entries -= result.rc; cm->total_entries -= result.rc;
cm->num_cached_queries--; cm->num_cached_queries--;
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %d\n", LDAP_LOG( BACK_META, DETAIL1, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %d\n", Debug( LDAP_DEBUG_ANY, "STORED QUERIES = %lu\n",
cm->num_cached_queries, 0, 0 ); cm->num_cached_queries, 0, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */
ldap_pvt_thread_mutex_unlock(&cm->cache_mutex); ldap_pvt_thread_mutex_unlock(&cm->cache_mutex);
@ -1679,12 +1679,12 @@ consistency_check(Backend* be, Backend* glue_be, Connection* conn)
0: (cm->cache_size-return_val); 0: (cm->cache_size-return_val);
#ifdef NEW_LOGGING #ifdef NEW_LOGGING
LDAP_LOG( BACK_META, DETAIL1, LDAP_LOG( BACK_META, DETAIL1,
"STALE QUERY REMOVED, CACHE SIZE=%d bytes %d " "STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size, "entries\n", cm->cache_size,
cm->total_entries, 0 ); cm->total_entries, 0 );
#else /* !NEW_LOGGING */ #else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"STALE QUERY REMOVED, CACHE SIZE=%d bytes %d " "STALE QUERY REMOVED, CACHE SIZE=%lu bytes %d "
"entries\n", cm->cache_size, "entries\n", cm->cache_size,
cm->total_entries, 0 ); cm->total_entries, 0 );
#endif /* !NEW_LOGGING */ #endif /* !NEW_LOGGING */

View File

@ -68,6 +68,7 @@
#include <stdio.h> #include <stdio.h>
#include <ac/string.h>
#include <ac/socket.h> #include <ac/socket.h>
#include "slap.h" #include "slap.h"