Author: jfrederic.clere(a)jboss.com
Date: 2008-06-05 08:03:49 -0400 (Thu, 05 Jun 2008)
New Revision: 1659
Modified:
trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c
Log:
replace void * by char *.
Modified: trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c
===================================================================
--- trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c 2008-06-05 11:51:16 UTC (rev
1658)
+++ trunk/mod_cluster/native/mod_slotmem/sharedmem_util.c 2008-06-05 12:03:49 UTC (rev
1659)
@@ -123,15 +123,12 @@
apr_status_t cleanup_slotmem(void *param)
{
ap_slotmem_t **mem = param;
- apr_status_t rv;
- apr_pool_t *pool = NULL;
if (*mem) {
ap_slotmem_t *next = *mem;
- pool = next->globalpool;
while (next) {
store_slotmem(next);
- rv = apr_shm_destroy(next->shm);
+ apr_shm_destroy(next->shm);
/* XXX: remove the lock file ? */
next = next->next;
}
@@ -142,7 +139,7 @@
static apr_status_t ap_slotmem_do(ap_slotmem_t *mem, ap_slotmem_callback_fn_t *func, void
*data, apr_pool_t *pool)
{
int i, j, isfree, *ident;
- void *ptr;
+ char *ptr;
apr_status_t rv;
if (!mem) {
@@ -172,7 +169,7 @@
static apr_status_t ap_slotmem_create(ap_slotmem_t **new, const char *name, apr_size_t
item_size, int item_num, apr_pool_t *pool)
{
void *slotmem = NULL;
- void *ptr;
+ char *ptr;
struct sharedslotdesc desc;
ap_slotmem_t *res;
ap_slotmem_t *next = globallistmem;
@@ -248,7 +245,7 @@
memcpy(ptr, &desc, sizeof(desc));
ptr = ptr + sizeof(desc);
/* write the idents table */
- ident = ptr;
+ ident = (int *) ptr;
for (i=0; i<item_num+1; i++) {
ident[i] = i + 1;
}
@@ -267,7 +264,7 @@
/* For the chained slotmem stuff */
res->name = apr_pstrdup(globalpool, fname);
- res->ident = ptr;
+ res->ident = (int *) ptr;
res->base = ptr + sizeof(int) * (item_num + 1);
res->size = item_size;
res->num = item_num;
@@ -286,7 +283,7 @@
static apr_status_t ap_slotmem_attach(ap_slotmem_t **new, const char *name, apr_size_t
*item_size, int *item_num, apr_pool_t *pool)
{
void *slotmem = NULL;
- void *ptr;
+ char *ptr;
ap_slotmem_t *res;
ap_slotmem_t *next = globallistmem;
struct sharedslotdesc desc;
@@ -340,7 +337,7 @@
/* For the chained slotmem stuff */
res->name = apr_pstrdup(globalpool, fname);
- res->ident = ptr;
+ res->ident = (int *)ptr;
res->base = ptr + sizeof(int) * (desc.item_num + 1);
res->size = desc.item_size;
res->num = desc.item_num;
@@ -361,7 +358,7 @@
static apr_status_t ap_slotmem_mem(ap_slotmem_t *score, int id, void**mem)
{
- void *ptr;
+ char *ptr;
int i;
int *ident;
@@ -379,7 +376,7 @@
return APR_NOTFOUND;
}
- ptr = score->base + score->size * (id - 1);
+ ptr = (char *) score->base + score->size * (id - 1);
if (!ptr) {
return APR_ENOSHMAVAIL;
}
@@ -408,7 +405,7 @@
ident[0] = ident[ff];
ident[ff] = 0;
*item_id = ff;
- *mem = score->base + score->size * (ff - 1);
+ *mem = (char *) score->base + score->size * (ff - 1);
rv = APR_SUCCESS;
}
Show replies by date