Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76849 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63405 invoked from network); 24 Aug 2014 12:35:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2014 12:35:04 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:34615] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/50-61668-4FBD9F35 for ; Sun, 24 Aug 2014 08:35:01 -0400 Received: by mail-lb0-f179.google.com with SMTP id v6so10825417lbi.24 for ; Sun, 24 Aug 2014 05:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Y2FY1WS4gPulNMlxUqI/7f3njUr1cvSwPINVgUe8MKw=; b=nCGjy2wSnmDh9WjqS+2EiG6haJNLKvclmnhrDVJioKtUMr1VEvJrXzg9f0efZKjWZ3 DDdkLTnVpDpXdNNMl/rzcG8rOlECBHrvQn9XKJbEj7+W5FAStOJNmheDm0QgCesIgKmy xEpDHg8n4Z3mTcPkw1eSzUoxtWqOz/5DB/7A1coG11b6fOKNi/cgvksFzFIO1G94Qq3Z hf8abRLwejcaiXOLylSHt3NPY8pjsyyeLEriyOctZLsd0mx0+BWRqZN4RZL9Bm6Lnkq6 Ef06CAJ5Wbusbib99Z52KoDp5OFQlZi4wsid3F64GvfX2EKPI3v3m2EbMxqCeWOpzRT2 53Ww== X-Received: by 10.112.29.147 with SMTP id k19mr1444469lbh.102.1408883697385; Sun, 24 Aug 2014 05:34:57 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.114.187.72 with HTTP; Sun, 24 Aug 2014 05:34:37 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Aug 2014 20:34:37 +0800 X-Google-Sender-Auth: Z3UH1Zr2s5WaCeChO8xNijn6io8 Message-ID: To: Pierre Joye Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Naming issues, solutions From: laruence@php.net (Laruence) Hey: On Sun, Aug 24, 2014 at 8:30 PM, Pierre Joye wrote: > Hi, > > Nikita, Xinchen and I have sit down together this morning to solve a > couple of naming issues, those having > caused some flames, trolls and FUDs in the last couple of days. The > good news is we have found a consensus > that solves our concerns, consistency and reduce the amount of changes > in existing code. > > Please not that this mail is not my personal taste or wishes, but the > results of a refreshing, constructive > and good discussions with Xinchen and Nikita earlier this morning. > > Summary: > zend_uint > int32_t > zend_size_t > size_t > zend_int_t > zend_long > IS_INT > IS_LONG > Z_IVAL > Z_LVAL > Z_STRSIZE > Z_STRLEN > zend_str_* > zend_string_* > STR_* macros > droped > > Details: > > We have a header available by default to define c9* stdint, see > main/php_stdint.h. This header ensures > consistency accross platforms and that the size of each type is > correct. It is important to keep > that in mind while reading the rest of this mail. > > * zend_uint > zend_uint is used exclusevely in the engine (maybe some debugger or > engine related extensions) and has been around for a while. We like to > drop it and use int32_t instead anywhere where zend_uint is used. > Using int32_t is good because this will ensure that we use the correct > type even on ILP64 - zend_uint would currently totally blow up on > those systems. > > *zend_size_t > Given that size_t is a standard type, adding zend_size_t makes little sense. > > * zend_int_t, zend_long, IS_INT/IS_LONG > One of my main concerns is consistency between APIs and macros names > and the underlying types. A solution to this problem was quite > obvious (only not on Friday ;). zend_int_t will be renamed to > zend_long, IS_INT and Z_IVAL will renamed to their old names, IS_LONG > and Z_LVAL, respectively. > > * Strings > First change, Z_STRSIZE will be renamed to Z_STRLEN (old name). We > also like to drop STR_ macros and rely directly on the zend_string_* > APIs. While doing at it the zend_string APIs will be prefix > zend_string and not zend_str_* as it is now, for the same reason: > > During the NG works and the ports of many extensions, numerous bugs > appear due to bad usage of STR_* macros with either char* or other > char/string related types. Making the name more obvious will help. > > > PS: IRC log available if anyone likes to double check it, #php.pecl thanks. I am glad we have reach a agreement here. actually to me, the naming issue has blocked me to start porting work on my own exts, so if no objections, I'd like to see it settled down and commit to trunk asap :) thanks > > Cheers, > -- > Pierre > > @pierrejoye | http://www.libgd.org > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Xinchen Hui @Laruence http://www.laruence.com/