lib/base/pool.cpp | 10 +++++-----
lib/base/system.cpp | 8 ++++----
lib/libaccess/aclcache.cpp | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit c0c8da7ae44d0fe6d95453efba96a7783910830a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Fri Mar 7 17:57:40 2014 -0500
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!)
(cherry picked from commit 9698a97075e04219e103b2693ac5002d33b19486)
diff --git a/lib/base/pool.cpp b/lib/base/pool.cpp
index 433fc58..f085e4a 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;
@@ -270,7 +270,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;
}
@@ -291,7 +291,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;
}
@@ -388,7 +388,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
@@ -410,7 +410,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<DEBUG_MARGIN; index++)
if (cptr[index] != DEBUG_MARGIN_CHAR) {
- ereport(LOG_CATASTROPHE, "free: corrupt memory (prebounds
overwrite)");
+ ereport(LOG_CATASTROPHE, (char *)"free: corrupt memory (prebounds
overwrite)");
break;
}
cptr += DEBUG_MARGIN + *length;
for (index=0; index<DEBUG_MARGIN; index++)
if (cptr[index] != DEBUG_MARGIN_CHAR) {
- ereport(LOG_CATASTROPHE, "free: corrupt memory (prebounds
overwrite)");
+ ereport(LOG_CATASTROPHE, (char *)"free: corrupt memory (prebounds
overwrite)");
break;
}
memset(baseptr, DEBUG_FREE_CHAR, *length + 2*DEBUG_MARGIN+sizeof(int));
} else {
- ereport(LOG_CATASTROPHE, "free: freeing unallocated memory");
+ ereport(LOG_CATASTROPHE, (char *)"free: freeing unallocated memory");
}
free(baseptr);
#else
diff --git a/lib/libaccess/aclcache.cpp b/lib/libaccess/aclcache.cpp
index f814df7..8f58344 100644
--- a/lib/libaccess/aclcache.cpp
+++ b/lib/libaccess/aclcache.cpp
@@ -133,8 +133,8 @@ ACL_ListHashInit()
&ACLPermAllocOps,
NULL);
if (ACLListHash == NULL) {
- ereport(LOG_SECURITY, "Unable to allocate ACL List Hash\n");
- return;
+ ereport(LOG_SECURITY, (char *)"Unable to allocate ACL List Hash");
+ return;
}
return;