Re: cleaning up the functions - any volunteers?
| From: | Jordan Wambaugh | Date: | Sun, 29 Jun 2008 22:54:54 +0000 |
| Subject: | Re: cleaning up the functions - any volunteers? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38683@lists.php.net to get a copy of this message | ||
On Jun 28, 2008, at 11:42 PM, Jordan Wambaugh wrote:
On Jun 28, 2008, at 3:20 PM, David Coallier wrote: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 Wambaugh2008/6/28 Jordan Wambaugh <jordan@wambaugh.org>: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.On Jun 28, 2008, at 7:27 AM, David Coallier wrote:Go ahead, you are pretty well started, I'll adjust after you are done :)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) {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?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.