Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68343 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13236 invoked from network); 31 Jul 2013 08:35:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2013 08:35:15 -0000 Authentication-Results: pb1.pair.com header.from=php@hristov.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@hristov.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hristov.com from 91.196.124.214 cause and error) X-PHP-List-Original-Sender: php@hristov.com X-Host-Fingerprint: 91.196.124.214 more.superhosting.bg Linux 2.6 Received: from [91.196.124.214] ([91.196.124.214:58447] helo=more.superhosting.bg) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/B0-07795-14CC8F15 for ; Wed, 31 Jul 2013 04:35:14 -0400 Received: from 78-83-82-27.spectrumnet.bg ([78.83.82.27]:52753 helo=[192.168.2.117]) by more.superhosting.bg with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1V4RsD-002MW2-QH; Wed, 31 Jul 2013 11:35:09 +0300 Message-ID: <51F8CC39.5080600@hristov.com> Date: Wed, 31 Jul 2013 10:35:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Sara Golemon CC: PHP internals list References: <51F63D70.70200@hristov.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - more.superhosting.bg X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Get-Message-Sender-Via: more.superhosting.bg: authenticated_id: php@hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] [PATCH] Constification of some PHP API calls From: php@hristov.com (Andrey Hristov) Hi Sara, On 07/31/2013 12:55 AM, Sara Golemon wrote: > At a glance, this looks awesome. There are a few changes where you > introduced #ifdef WIN32 checks that I want to spend a little more time > looking at... In the WIN32 code there was an additional variable, declared always, but switched from 0 to 1 only in under WIN32. It is a path, that is copied and the copy is assigned to the parameter. I have simplified the logic for all platforms by putting more WIN32 conditionals. > -Sara > > P.S. - Could I convince you to put it on a github fork to make it easier > to read? No big deal if not... I just like that web view. :) I have already done that : https://github.com/andreyhristov/php-src I have filled a pull request too. Best, Andrey > > On Mon, Jul 29, 2013 at 3:01 AM, Andrey Hristov > wrote: > > Hi, > after experiencing again warnings about conversion from const char * > to char * when calling some PHP API functions I decided to spend > some time and constify a few of these. The result is a patch that > constifies the Streams API, and few functions in Zend and TSRM (to > which I have no karma). Most of the changes are conversion of "char > *" to "const char *" parameters, where applicable. In a few places > string lengths are changed from int to size_t. Few functions return > now "const char *" instead of "char *" (the caller did not > modify/release these before). > > The patch is against php-src because it changes API which can be > only done in a new version. > > Opinions? > > Best, > Andrey > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >