You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by be...@apache.org on 2001/05/19 17:35:45 UTC

cvs commit: apr/memory/unix apr_sms.c

ben         01/05/19 08:35:45

  Modified:    include  apr_sms.h
               memory/unix apr_sms.c
  Log:
  Fix warnings.
  
  Revision  Changes    Path
  1.3       +2 -0      apr/include/apr_sms.h
  
  Index: apr_sms.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_sms.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- apr_sms.h	2001/05/19 13:53:06	1.2
  +++ apr_sms.h	2001/05/19 15:35:44	1.3
  @@ -312,6 +312,8 @@
    */
   APR_DECLARE(apr_status_t) apr_sms_std_create(apr_sms_t **mem_sys);
   
  +APR_DECLARE(apr_status_t) apr_sms_threadsafe_lock(apr_sms_t *mem_sys);
  +APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys);
   
   #ifdef __cplusplus
   }
  
  
  
  1.4       +5 -1      apr/memory/unix/apr_sms.c
  
  Index: apr_sms.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_sms.c	2001/05/19 13:53:06	1.3
  +++ apr_sms.c	2001/05/19 15:35:45	1.4
  @@ -193,7 +193,7 @@
       mem_sys->accounting_mem_sys = mem_sys;
   
       if (parent_mem_sys != NULL){
  -        if (mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys){
  +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)){
               mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
           }
           mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
  @@ -498,6 +498,8 @@
   
       if (mem_sys->lock_fn)
           return mem_sys->lock_fn(mem_sys);
  +
  +    return APR_SUCCESS;
   }
   
   APR_DECLARE(apr_status_t) apr_sms_threadsafe_unlock(apr_sms_t *mem_sys)
  @@ -510,6 +512,8 @@
           
       if (mem_sys->unlock_fn)
           return mem_sys->unlock_fn(mem_sys);
  +
  +    return APR_SUCCESS;
   }
   
   /*
  
  
  

Re: cvs commit: apr/memory/unix apr_sms.c

Posted by Cliff Woolley <cl...@yahoo.com>.
On Sat, 19 May 2001, Ben Laurie wrote:

> > Just to verify (haven't looked at this section of the code itself yet),
> > assignment IS what's intended here, right?  If so, a ((foo = bar) != NULL)
> > might make that more clear.
>
> Good point. I foolishly assumed the assignment was intentional - it
> still looks like it is, but confirmation from someone who knows would be
> good. I agree with != NULL if it is so.

Looking closer, I agree.  Confirmation would still be nice, but I
agree that it looks intentional.  So I'll go ahead and throw a !=NULL in
there.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Re: cvs commit: apr/memory/unix apr_sms.c

Posted by Ben Laurie <be...@algroup.co.uk>.
Cliff Woolley wrote:
> 
> On 19 May 2001 ben@apache.org wrote:
> 
> >   --- apr_sms.c       2001/05/19 13:53:06     1.3
> >   +++ apr_sms.c       2001/05/19 15:35:45     1.4
> >   @@ -193,7 +193,7 @@
> >        mem_sys->accounting_mem_sys = mem_sys;
> >
> >        if (parent_mem_sys != NULL){
> >   -        if (mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys){
> >   +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)){
> >                mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
> >            }
> >            mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;
> 
> Just to verify (haven't looked at this section of the code itself yet),
> assignment IS what's intended here, right?  If so, a ((foo = bar) != NULL)
> might make that more clear.

Good point. I foolishly assumed the assignment was intentional - it
still looks like it is, but confirmation from someone who knows would be
good. I agree with != NULL if it is so.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: cvs commit: apr/memory/unix apr_sms.c

Posted by Cliff Woolley <cl...@yahoo.com>.
On 19 May 2001 ben@apache.org wrote:

>   --- apr_sms.c	2001/05/19 13:53:06	1.3
>   +++ apr_sms.c	2001/05/19 15:35:45	1.4
>   @@ -193,7 +193,7 @@
>        mem_sys->accounting_mem_sys = mem_sys;
>
>        if (parent_mem_sys != NULL){
>   -        if (mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys){
>   +        if ((mem_sys->sibling_mem_sys = parent_mem_sys->child_mem_sys)){
>                mem_sys->sibling_mem_sys->ref_mem_sys = &mem_sys->sibling_mem_sys;
>            }
>            mem_sys->ref_mem_sys = &parent_mem_sys->child_mem_sys;

Just to verify (haven't looked at this section of the code itself yet),
assignment IS what's intended here, right?  If so, a ((foo = bar) != NULL)
might make that more clear.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA