From 20b136f559f72241d2bf7c8b2bdf75b6cb54d668 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Fri, 7 Mar 2014 17:57:40 -0500 Subject: [PATCH] Ticket 47700 - Fix compiler warnings The original fix for ticket 47700 caused new compiler warnings Addresses these new warnings: warning: deprecated conversion from string constant to 'char*' https://fedorahosted.org/389/ticket/47700 Reveiwed by: nhosoi(Thanks!) --- lib/base/pool.cpp | 10 +++++----- lib/base/system.cpp | 8 ++++---- lib/libaccess/aclcache.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/base/pool.cpp b/lib/base/pool.cpp index 9ee1b8c..3398dad 100644 --- a/lib/base/pool.cpp +++ b/lib/base/pool.cpp @@ -178,7 +178,7 @@ _create_block(int size) crit_exit(freelist_lock); if (((newblock = (block_t *)PERM_MALLOC(sizeof(block_t))) == NULL) || ((newblock->data = (char *)PERM_MALLOC(bytes)) == NULL)) { - ereport(LOG_CATASTROPHE, "%s", XP_GetAdminStr(DBT_poolCreateBlockOutOfMemory_)); + ereport(LOG_CATASTROPHE, (char *)XP_GetAdminStr(DBT_poolCreateBlockOutOfMemory_)); if (newblock) PERM_FREE(newblock); return NULL; @@ -259,7 +259,7 @@ pool_create() } if ( (newpool->curr_block =_create_block(BLOCK_SIZE)) == NULL) { - ereport(LOG_CATASTROPHE, "%s", XP_GetAdminStr(DBT_poolCreateOutOfMemory_)); + ereport(LOG_CATASTROPHE, (char *)XP_GetAdminStr(DBT_poolCreateOutOfMemory_)); PERM_FREE(newpool); return NULL; } @@ -280,7 +280,7 @@ pool_create() crit_exit(known_pools_lock); } else - ereport(LOG_CATASTROPHE, "%s", XP_GetAdminStr(DBT_poolCreateOutOfMemory_1)); + ereport(LOG_CATASTROPHE, (char *)XP_GetAdminStr(DBT_poolCreateOutOfMemory_1)); return (pool_handle_t *)newpool; } @@ -386,7 +386,7 @@ pool_malloc(pool_handle_t *pool_handle, size_t size) */ blocksize = ( (size + BLOCK_SIZE-1) / BLOCK_SIZE ) * BLOCK_SIZE; if ( (pool->curr_block = _create_block(blocksize)) == NULL) { - ereport(LOG_CATASTROPHE, "%s", XP_GetAdminStr(DBT_poolMallocOutOfMemory_)); + ereport(LOG_CATASTROPHE, (char *)XP_GetAdminStr(DBT_poolMallocOutOfMemory_)); #ifdef POOL_LOCKING crit_exit(pool->lock); #endif @@ -408,7 +408,7 @@ pool_malloc(pool_handle_t *pool_handle, size_t size) void _pool_free_error() { - ereport(LOG_WARN, "%s", XP_GetAdminStr(DBT_freeUsedWherePermFreeShouldHaveB_)); + ereport(LOG_WARN, (char *)XP_GetAdminStr(DBT_freeUsedWherePermFreeShouldHaveB_)); return; } diff --git a/lib/base/system.cpp b/lib/base/system.cpp index 287d5a8..b62a814 100644 --- a/lib/base/system.cpp +++ b/lib/base/system.cpp @@ -201,7 +201,7 @@ NSAPI_PUBLIC void *system_realloc_perm(void *ptr, int size) return ptr; } } else { - ereport(LOG_WARN, "realloc: attempt to realloc to smaller size"); + ereport(LOG_WARN, (char*)"realloc: attempt to realloc to smaller size"); return realloc(ptr, size); } @@ -228,20 +228,20 @@ NSAPI_PUBLIC void system_free_perm(void *ptr) cptr += sizeof(int); for (index=0; index