httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/misc/unix misc.h start.c
Date Sat, 08 Jul 2000 11:59:48 GMT
gstein      00/07/08 04:59:48

  Modified:    src/lib/apr/include apr_general.h
               src/lib/apr/misc/unix misc.h start.c
  Log:
  damn. went through all that work to const-ify "key" but missed the data.
  I'll get the rest later, but this constifies the two core userdata
  functions.
  
  Revision  Changes    Path
  1.39      +2 -2      apache-2.0/src/lib/apr/include/apr_general.h
  
  Index: apr_general.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_general.h,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- apr_general.h	2000/07/08 11:15:48	1.38
  +++ apr_general.h	2000/07/08 11:59:48	1.39
  @@ -346,7 +346,7 @@
   
   =cut
    */
  -ap_status_t ap_set_userdata(void *data, const char *key, 
  +ap_status_t ap_set_userdata(const void *data, const char *key, 
                               ap_status_t (*cleanup) (void *), 
                               ap_pool_t *cont);
   
  @@ -362,7 +362,7 @@
   
   =cut
    */
  -ap_status_t ap_get_userdata(void **, const char *key, ap_pool_t *cont);
  +ap_status_t ap_get_userdata(void **data, const char *key, ap_pool_t *cont);
   
   /*
   
  
  
  
  1.20      +2 -2      apache-2.0/src/lib/apr/misc/unix/misc.h
  
  Index: misc.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/misc.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- misc.h	2000/06/22 16:05:33	1.19
  +++ misc.h	2000/07/08 11:59:48	1.20
  @@ -84,8 +84,8 @@
   #endif
    
   typedef struct datastruct {
  -    void *data;
  -    char *key;
  +    const void *data;
  +    const char *key;
       struct datastruct *next;
       struct datastruct *prev;
   } datastruct;
  
  
  
  1.36      +5 -2      apache-2.0/src/lib/apr/misc/unix/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/unix/start.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- start.c	2000/07/08 11:31:47	1.35
  +++ start.c	2000/07/08 11:59:48	1.36
  @@ -77,7 +77,7 @@
       return APR_SUCCESS;
   }
   
  -ap_status_t ap_set_userdata(void *data, const char *key,
  +ap_status_t ap_set_userdata(const void *data, const char *key,
                               ap_status_t (*cleanup) (void *),
                               ap_pool_t *cont)
   {
  @@ -123,7 +123,10 @@
           dptr = dptr->next;
       }
       if (dptr) {
  -        (*data) = dptr->data;
  +        /* ->data is const because we never change it. however, we want to
  +           cast because the caller may want to change the contents (and
  +           it knows whether it can). */
  +        (*data) = (void *)dptr->data;
       }
       else {
           (*data) = NULL;
  
  
  

Mime
View raw message