You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by dr...@apache.org on 2001/05/09 20:12:02 UTC

cvs commit: apr/memory/unix apr_memory_system.c

dreid       01/05/09 11:12:01

  Modified:    include  apr_memory_system.h
               memory/unix apr_memory_system.c
  Log:
  Some small changes to the return values of some functions.  Basically
  these changes allow us to check that all went well.  However, as we're
  not yet passing errors "up" from the lower levels this also needs fixed.
  
  Revision  Changes    Path
  1.3       +3 -2      apr/include/apr_memory_system.h
  
  Index: apr_memory_system.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_memory_system.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_memory_system.h	2001/05/09 16:44:46	1.2
  +++ apr_memory_system.h	2001/05/09 18:11:51	1.3
  @@ -56,6 +56,7 @@
   #define APR_MEMORY_SYSTEM_H
   
   #include "apr.h"
  +#include "apr_errno.h"
   
   #ifdef __cplusplus
   extern "C" {
  @@ -135,7 +136,7 @@
    * @deffunc void apr_memory_system_free(apr_memory_system_t *memory_system,
    *					void *mem)
    */
  -APR_DECLARE(void)
  +APR_DECLARE(apr_status_t)
   apr_memory_system_free(apr_memory_system_t *memory_system,
                          void *mem);
   
  @@ -197,7 +198,7 @@
    * @param memory_system The memory system to be destroyed
    * @deffunc void apr_memory_system_destroy(apr_memory_system_t *memory_system)
    */
  -APR_DECLARE(void)
  +APR_DECLARE(apr_status_t)
   apr_memory_system_destroy(apr_memory_system_t *memory_system);
   
   /**
  
  
  
  1.2       +7 -5      apr/memory/unix/apr_memory_system.c
  
  Index: apr_memory_system.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_memory_system.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apr_memory_system.c	2001/05/09 15:36:13	1.1
  +++ apr_memory_system.c	2001/05/09 18:11:57	1.2
  @@ -115,14 +115,14 @@
       return memory_system->realloc_fn(memory_system, mem, size);
   }
   
  -APR_DECLARE(void)
  +APR_DECLARE(apr_status_t)
   apr_memory_system_free(apr_memory_system_t *memory_system,
                          void *mem)
   {
       assert(memory_system != NULL);
     
       if (mem == NULL)
  -        return;
  +        return APR_EINVAL; /* Hmm, is this an error??? */
   
       if (memory_system->free_fn != NULL)
           memory_system->free_fn(memory_system, mem);  
  @@ -135,6 +135,7 @@
            */
       }
   #endif /* APR_MEMORY_SYSTEM_DEBUG */
  +    return APR_SUCCESS;
   }
   
   /*
  @@ -157,7 +158,7 @@
       apr_memory_system_t *memory_system;
   
       if (memory == NULL)
  -      return NULL;
  +        return NULL;
   
       /* Just typecast it, and clear it */
       memory_system = (apr_memory_system_t *)memory;
  @@ -332,7 +333,7 @@
       memory_system->reset_fn(memory_system);
   }
   
  -APR_DECLARE(void)
  +APR_DECLARE(apr_status_t)
   apr_memory_system_destroy(apr_memory_system_t *memory_system)
   {
       apr_memory_system_t *child_memory_system;
  @@ -460,13 +461,14 @@
       while (memory_system)
       {
           if (apr_memory_system_is_tracking(memory_system))
  -            return;
  +            return APR_SUCCESS;
   
           memory_system = memory_system->parent_memory_system;
       }
   
       assert(0); /* Made the wrong assumption, so we assert */
   #endif /* APR_MEMORY_SYSTEM_DEBUG */
  +    return APR_SUCCESS;
   }
   
   APR_DECLARE(apr_status_t)
  
  
  

RE: cvs commit: apr/memory/unix apr_memory_system.c

Posted by Sander Striker <st...@samba-tng.org>.
Don't forget to update the in code documentation aswell, otherwise
scandoc will cough up the bad info ;-)

Samder

> -----Original Message-----
> From: dreid@apache.org [mailto:dreid@apache.org]
> Sent: 09 May 2001 20:12
> To: apr-cvs@apache.org
> Subject: cvs commit: apr/memory/unix apr_memory_system.c
>
>
> dreid       01/05/09 11:12:01
>
>   Modified:    include  apr_memory_system.h
>                memory/unix apr_memory_system.c
>   Log:
>   Some small changes to the return values of some functions.  Basically
>   these changes allow us to check that all went well.  However, as we're
>   not yet passing errors "up" from the lower levels this also needs fixed.
>
>   Revision  Changes    Path
>   1.3       +3 -2      apr/include/apr_memory_system.h
>