dreid 01/07/06 23:51:23
Modified: include apr_sms.h
memory/unix apr_sms.c
Log:
Constify the data in the sms cleanups.
Revision Changes Path
1.33 +17 -8 apr/include/apr_sms.h
Index: apr_sms.h
===================================================================
RCS file: /home/cvs/apr/include/apr_sms.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- apr_sms.h 2001/07/07 06:42:23 1.32
+++ apr_sms.h 2001/07/07 06:51:22 1.33
@@ -291,10 +291,12 @@
* @param cleanup_fn The function to call when the memory system is reset or
* destroyed
* @deffunc void apr_sms_cleanup_register(apr_sms_t *sms, apr_int32_t type,
- * void *data, apr_status_t (*cleanup_fn)(void *));
+ * const void *data,
+ * apr_status_t (*cleanup_fn)(void
*));
*/
-APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms,
apr_int32_t type,
- void *data,
+APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms,
+ apr_int32_t type,
+ const void *data,
apr_status_t
(*cleanup_fn)(void *));
/**
@@ -302,13 +304,17 @@
* @param sms The memory system the cleanup function is registered
* with
* @param type The type of the cleanup to unregister
+ * @param type The type of cleanup to run
* @param data The data associated with the cleanup function
* @param cleanup_fn The registered cleanup function
* @deffunc void apr_sms_cleanup_unregister(apr_sms_t *sms,
- * void *data, apr_status_t (*cleanup_fn)(void *));
+ * apr_int32_t type,
+ * const void *data,
+ * apr_status_t (*cleanup_fn)(void
*));
*/
-APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
apr_int32_t type,
- void *data,
+APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
+ apr_int32_t type,
+ const void *data,
apr_status_t
(*cleanup)(void *));
/**
@@ -331,10 +337,13 @@
* @param data The data associated with the cleanup function
* @param cleanup The registered cleanup function
* @deffunc apr_status_t apr_sms_cleanup_run(apr_sms_t *sms,
- * apr_int32_t type, void *data, apr_status_t
(*cleanup)(void *));
+ * apr_int32_t type,
+ * const void *data,
+ * apr_status_t (*cleanup)(void
*));
*/
APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms,
- apr_int32_t type, void *data,
+ apr_int32_t type,
+ const void *data,
apr_status_t (*cleanup)(void
*));
/**
1.43 +8 -8 apr/memory/unix/apr_sms.c
Index: apr_sms.c
===================================================================
RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- apr_sms.c 2001/07/07 06:42:23 1.42
+++ apr_sms.c 2001/07/07 06:51:23 1.43
@@ -85,7 +85,7 @@
{
struct apr_sms_cleanup *next;
apr_int32_t type;
- void *data;
+ const void *data;
apr_status_t (*cleanup_fn)(void *);
};
@@ -399,7 +399,7 @@
{
while (c) {
if (c->type == APR_ALL_CLEANUPS || c->type == APR_GENERAL_CLEANUP) {
- c->cleanup_fn(c->data);
+ c->cleanup_fn((void*)c->data);
}
c = c->next;
}
@@ -566,7 +566,7 @@
while (cleanup) {
if (cleanup->type == APR_GENERAL_CLEANUP)
- cleanup->cleanup_fn(cleanup->data);
+ cleanup->cleanup_fn((void*)cleanup->data);
next_cleanup = cleanup->next;
apr_sms_free(sms->accounting, cleanup);
@@ -679,7 +679,7 @@
APR_DECLARE(apr_status_t) apr_sms_cleanup_register(apr_sms_t *sms,
apr_int32_t type,
- void *data,
+ const void *data,
apr_status_t
(*cleanup_fn)(void *))
{
@@ -715,7 +715,7 @@
APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *sms,
apr_int32_t type,
- void *data,
+ const void *data,
apr_status_t
(*cleanup_fn)(void
*))
{
@@ -791,7 +791,7 @@
APR_DECLARE(apr_status_t) apr_sms_cleanup_run(apr_sms_t *sms,
apr_int32_t type,
- void *data,
+ const void *data,
apr_status_t
(*cleanup_fn)(void *))
{
@@ -801,7 +801,7 @@
data, cleanup_fn)) != APR_SUCCESS)
return rv;
- return cleanup_fn(data);
+ return cleanup_fn((void*)data);
}
APR_DECLARE(apr_status_t) apr_sms_cleanup_run_type(apr_sms_t *sms,
@@ -821,7 +821,7 @@
if (type == APR_ALL_CLEANUPS || cleanup->type == type) {
*cleanup_ref = cleanup->next;
- cleanup->cleanup_fn(cleanup->data);
+ cleanup->cleanup_fn((void*)cleanup->data);
if (sms->free_fn)
apr_sms_free(sms, cleanup);