From 6387a3b6bfd835e3bf3075f0030a57739b82d995 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Tue, 29 Apr 2003 15:05:19 +0000 Subject: [PATCH] #include . Print unsigned long with %lu, not %d. --- servers/slapd/back-meta/cache-query.c | 10 ++++++---- servers/slapd/back-meta/cache-search.c | 24 ++++++++++++------------ servers/slapd/back-meta/init.c | 1 + 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/servers/slapd/back-meta/cache-query.c b/servers/slapd/back-meta/cache-query.c index 98a67882a7..2353e61bb1 100644 --- a/servers/slapd/back-meta/cache-query.c +++ b/servers/slapd/back-meta/cache-query.c @@ -20,6 +20,8 @@ #include +#include + #include "slap.h" #include "../back-ldap/back-ldap.h" #include "back-meta.h" @@ -331,11 +333,11 @@ void add_query( new_cached_query->lru_down = NULL; new_cached_query->expiry_time = slap_get_time() + templ->ttl; #ifdef NEW_LOGGING - LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %d\n", - new_cached_query->expiry_time, 0, 0 ); + LDAP_LOG( BACK_META, DETAIL1, "Added query expires at %ld\n", + (long) new_cached_query->expiry_time, 0, 0 ); #else - Debug( LDAP_DEBUG_ANY, "Added query expires at %d\n", - new_cached_query->expiry_time, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "Added query expires at %ld\n", + (long) new_cached_query->expiry_time, 0, 0 ); #endif new_query = (Query*)new_cached_query; diff --git a/servers/slapd/back-meta/cache-search.c b/servers/slapd/back-meta/cache-search.c index 9e31a226ab..7a09e9447c 100644 --- a/servers/slapd/back-meta/cache-search.c +++ b/servers/slapd/back-meta/cache-search.c @@ -1491,11 +1491,11 @@ cache_entries( cm->num_cached_queries--; #ifdef NEW_LOGGING LDAP_LOG( BACK_META, DETAIL1, - "STORED QUERIES = %d\n", + "STORED QUERIES = %lu\n", cm->num_cached_queries, 0, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, - "STORED QUERIES = %d\n", + "STORED QUERIES = %lu\n", cm->num_cached_queries, 0, 0 ); #endif /* !NEW_LOGGING */ ldap_pvt_thread_mutex_unlock( @@ -1506,13 +1506,13 @@ cache_entries( #ifdef NEW_LOGGING LDAP_LOG( BACK_META, DETAIL1, "QUERY REMOVED, CACHE SIZE=" - "%d bytes %d entries\n", + "%lu bytes %d entries\n", cm->cache_size, cm->total_entries, 0 ); #else /* !NEW_LOGGING */ Debug( LDAP_DEBUG_ANY, "QUERY REMOVED, CACHE SIZE=" - "%d bytes %d entries\n", + "%lu bytes %d entries\n", cm->cache_size, cm->total_entries, 0 ); #endif /* !NEW_LOGGING */ @@ -1523,11 +1523,11 @@ cache_entries( cm->cache_size += return_val; #ifdef NEW_LOGGING 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 ); #else /* !NEW_LOGGING */ 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 ); #endif /* !NEW_LOGGING */ #ifdef NEW_LOGGING @@ -1561,10 +1561,10 @@ cache_entries( ldap_pvt_thread_mutex_lock(&cm->cache_mutex); cm->num_cached_queries++; #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 ); #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 ); #endif /* !NEW_LOGGING */ 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->num_cached_queries--; #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 ); #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 ); #endif /* !NEW_LOGGING */ 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); #ifdef NEW_LOGGING 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, cm->total_entries, 0 ); #else /* !NEW_LOGGING */ 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, cm->total_entries, 0 ); #endif /* !NEW_LOGGING */ diff --git a/servers/slapd/back-meta/init.c b/servers/slapd/back-meta/init.c index 20c783902a..e6ccf06a47 100644 --- a/servers/slapd/back-meta/init.c +++ b/servers/slapd/back-meta/init.c @@ -68,6 +68,7 @@ #include +#include #include #include "slap.h" -- 2.39.5