Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39899 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93967 invoked from network); 12 Aug 2008 21:32:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2008 21:32:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=oz@nixil.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=oz@nixil.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain nixil.net designates 161.58.222.1 as permitted sender) X-PHP-List-Original-Sender: oz@nixil.net X-Host-Fingerprint: 161.58.222.1 nixil.net FreeBSD 4.6-4.9 Received: from [161.58.222.1] ([161.58.222.1:1113] helo=nixil.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/8A-04075-25102A84 for ; Tue, 12 Aug 2008 17:32:03 -0400 Received: from demigorgon.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by nixil.net (8.13.6.20060614/8.13.6) with ESMTP id m7CLVqac021317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 12 Aug 2008 15:31:57 -0600 (MDT) Message-ID: <48A20148.5050902@nixil.net> Date: Tue, 12 Aug 2008 15:31:52 -0600 User-Agent: Thunderbird 2.0.0.14 (X11/20080623) MIME-Version: 1.0 To: Antony Dovgal CC: PHP Internals List References: <48A07CE7.7010404@nixil.net> <48A19790.20305@daylessday.org> In-Reply-To: <48A19790.20305@daylessday.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (nixil.net [161.58.222.1]); Tue, 12 Aug 2008 15:31:57 -0600 (MDT) X-Virus-Scanned: ClamAV 0.93.1/8021/Tue Aug 12 13:27:39 2008 on nixil.net X-Virus-Status: Clean Subject: Re: [PHP-DEV] pspell tweak. From: oz@nixil.net (Phil Oleson) Antony Dovgal wrote: > On 11.08.2008 21:54, Phil Oleson wrote: >> Was running pspell through g++ and found that a couple of error >> conditions segments in pspell.c >> are using the wrong cleanup methods. delete_pspell_manager() should >> be delete_pspell_can_have_error() > > We'd certainly need some more details to get this patch committed, not > just "this should that". > Well I thought the patch was fairly simple but if you'd like a full explination.. g++ -I. -I/usr/home/phil/vps2/user/contrib/php5/ext/pspell -DPHP_ATOM_INC -I/usr/home/phil/vps2/user/contrib/php5/ext/pspell/include -I/usr/home/phil/vps2/user/contrib/php5/ext/pspell/main -I/usr/home/phil/vps2/user/contrib/php5/ext/pspell -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -I/usr/local/include/pspell -DHAVE_CONFIG_H -g -O2 -c /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c -fPIC -DPIC -o .libs/pspell.o /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c: In function `void zif_pspell_new(int, zval*, zval**, zval*, int)': /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c:254: error: cannot convert `AspellCanHaveError*' to `AspellSpeller*' for argument `1' to `void delete_aspell_speller(AspellSpeller*)' /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c: In function `void zif_pspell_new_personal(int, zval*, zval**, zval*, int)': /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c:377: error: cannot convert `AspellCanHaveError*' to `AspellSpeller*' for argument `1' to `void delete_aspell_speller(AspellSpeller*)' /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c: In function `void zif_pspell_new_config(int, zval*, zval**, zval*, int)': /usr/home/phil/vps2/user/contrib/php5/ext/pspell/pspell.c:411: error: cannot convert `AspellCanHaveError*' to `AspellSpeller*' for argument `1' to `void delete_aspell_speller(AspellSpeller*)' as you can see we are using the wrong destructor in these three cases. Looking at the code you find: PspellCanHaveError *ret; ret = new_pspell_manager(config); delete_pspell_config(config); if(pspell_error_number(ret) != 0){ php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret)); delete_pspell_manager(ret); RETURN_FALSE; } ---- do a little grep'ing and we find the prototype is.. > grep delete_pspell_manager /usr/local/include/pspell/pspell.h #define delete_pspell_manager delete_aspell_speller > grep delete_aspell_speller /usr/local/include/aspell.h void delete_aspell_speller(struct AspellSpeller * ths); I do a little detective work and find... > grep delete_aspell_can_have_error /usr/local/include/aspell.h void delete_aspell_can_have_error(struct AspellCanHaveError * ths); transpose this to the pspell wrapper.. > grep delete_aspell_can_have_error /usr/local/include/pspell/pspell.h #define delete_pspell_can_have_error delete_aspell_can_have_error Thus the diff -u I sent in.. which resolves the above compiler failure with g++. -Phil.