Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 16835 invoked by uid 500); 11 Apr 2001 16:40:30 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 16823 invoked from network); 11 Apr 2001 16:40:29 -0000 X-Authentication-Warning: cobra.cs.Virginia.EDU: jcw5q owned process doing -bs Date: Wed, 11 Apr 2001 12:40:46 -0400 (EDT) From: Cliff Woolley X-X-Sender: To: Greg Marr cc: Subject: Re: Buckets code question In-Reply-To: <5.1.0.12.2.20010411115713.00a96ec0@mail.charter.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Wed, 11 Apr 2001, Greg Marr wrote: > I agree. Having macros that look like functions, but have return > statements in them, is bad. It also prevents those macros from being > made into inline functions without changing all the places that call > them. I'll consider that three +1's on concept... me, Greg Marr (yes?), and FirstBill. I'll touch this up and commit it this afternoon. I'd also like to remove the return NULL; lines in the macro. There are two ways to do that: 1) ap__b = NULL; continue; 2) get rid of the malloc failure checking entirely 3) ignore this issue and leave the return NULL's in there. I prefer #1, but I predict being overruled by the group on this since many of you think it's better to segfault than attempt to gracefully handle malloc failures. So assuming #2 is preferred by the group, does everyone like the following as the new apr_bucket_do_create macro? #define apr_bucket_do_create(ap__b,do_make) \ do { \ apr_bucket *b; \ b = calloc(1, sizeof(*b)); \ ap__b = do_make; \ APR_RING_ELEM_INIT(ap__b, link); \ } while(0) --Cliff -------------------------------------------------------------- Cliff Woolley cliffwoolley@yahoo.com Charlottesville, VA