Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38683 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46315 invoked from network); 29 Jun 2008 22:55:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2008 22:55:36 -0000 Authentication-Results: pb1.pair.com header.from=jordan@wambaugh.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jordan@wambaugh.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain wambaugh.org from 74.125.46.28 cause and error) X-PHP-List-Original-Sender: jordan@wambaugh.org X-Host-Fingerprint: 74.125.46.28 yw-out-2324.google.com Received: from [74.125.46.28] ([74.125.46.28:9959] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/23-25765-5E218684 for ; Sun, 29 Jun 2008 18:55:34 -0400 Received: by yw-out-2324.google.com with SMTP id 5so608295ywb.83 for ; Sun, 29 Jun 2008 15:55:27 -0700 (PDT) Received: by 10.150.217.14 with SMTP id p14mr1623629ybg.113.1214780127209; Sun, 29 Jun 2008 15:55:27 -0700 (PDT) Received: from ?192.168.1.3? ( [70.161.167.72]) by mx.google.com with ESMTPS id f24sm13756651pyh.21.2008.06.29.15.55.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 29 Jun 2008 15:55:26 -0700 (PDT) Cc: PHP Internals Message-ID: To: Jordan Wambaugh In-Reply-To: <7A96DF9E-810E-4EFC-BB5F-3108FBD29F0D@wambaugh.org> Content-Type: multipart/mixed; boundary=Apple-Mail-6-249693396 Mime-Version: 1.0 (Apple Message framework v924) Date: Sun, 29 Jun 2008 18:54:54 -0400 References: <485AE658.3050204@zend.com> <043C48F1-00DF-4882-AB70-A368C5D32DA1@wambaugh.org> <7439A4DE-6DBA-405E-9210-C3819AD1E59B@wambaugh.org> <7A96DF9E-810E-4EFC-BB5F-3108FBD29F0D@wambaugh.org> X-Mailer: Apple Mail (2.924) Subject: Re: [PHP-DEV] cleaning up the functions - any volunteers? From: jordan@wambaugh.org (Jordan Wambaugh) --Apple-Mail-6-249693396 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Jun 28, 2008, at 11:42 PM, Jordan Wambaugh wrote: > > On Jun 28, 2008, at 3:20 PM, David Coallier wrote: > >> 2008/6/28 Jordan Wambaugh : >>> >>> On Jun 28, 2008, at 7:27 AM, David Coallier wrote: >>> >>>> The idea of the new parsing parameter is to catch the number of >>>> parameters as well. For instance when you have >>>> >>>> if (ZEND_NUM_ARGS() < 2) { >>>> WRONG_PARAM_COUNT; >>>> } >>>> >>>> then your zend parse param function call should have 2 params or >>>> more >>>> Ex: >>>> >>>> int argc; >>>> char *name; >>>> zval **other; >>>> >>>> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ", &name, >>>> &other, &argc) == FAILURE) { >>>> return; >>>> } >>>> >>>> This way of parsing the parameters remove the ZEND_NUM_ARGS() and >>>> WRONG_PARAM_COUNT and adds consistency in the return error messages >>>> across the language. >>>> >>>> Also next time please read the previous entries of the thread : >>>> >>>> See: http://url.ie/hck that was about the 3rd or 4th message. >>>> >>>> Anyways that's ok, I lot of conflicts now in formatted_print.c and >>>> assert.c but I'll work around them to get the resolved. We just >>>> have >>>> to get organized on which files we'll be working on then. Right >>>> now, >>>> Olivier is working on file.c and has done string.c so please >>>> don't do >>>> those 2 files. >>> >>> Ok, sorry, I didn't catch the thread where you said you were going >>> to work >>> on standard. Do you want me to fix it so I'm not checking >>> ZEND_NUM_ARGS, or >>> should I just leave that to you? >> >> Go ahead, you are pretty well started, I'll adjust after you are >> done :) >> > > > Alright, I rewrote my patches for basic_functions.c, assert.c, and > formatted_print.c (attached) a few notes: > > fprintf and vsprintf - I'm not sure if this is the appropriate way > to work with a variable number of parameters, please let me know if > there is a better way. Also, because zend_parse_parameters is > generating a different error message if you don't pass enough > parameters, the *_error tests are failing. I didn't want to change > any of the tests until my patch has been reviewed, in case changes > need to be made. > Also, set_magic_quotes_runtime is not issuing a deprecated warning, > but the test is expecting it, causing some tests to fail. I noticed > in the documentation (http://us3.php.net/manual/en/function.set-magic-quotes-runtime.php > ) that its not documented as being deprecated, so I'm not sure what > the expectation should be in the test. I noticed a couple problems in my patch for error_log (a memory leak, for example). Here's a new version of the complete patch with those issues corrected. -- Jordan CM Wambaugh --Apple-Mail-6-249693396 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-6-249693396--