Commit Graph

64 Commits

Author SHA1 Message Date
George Peter Banyard
fa8d9b1183 Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002
2020-08-28 15:41:27 +02:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
18bc3afdcb Micro-optimizations 2018-06-06 01:57:19 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Andy Postnikov
8c8679207a Fix ZEND_SIGNED_MULTIPLY_LONG for AArch64
Register operands are required in this context.
2017-01-09 23:32:02 +01:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
e3ce4dc098 add pragma 2016-12-03 20:05:49 +01:00
Anatol Belski
d109642656 suffix CS 2016-12-03 20:05:49 +01:00
Anatol Belski
c5af4b2585 Improve multiplication on x64.
Thanks Bob for the spot.
2016-12-03 15:50:21 +01:00
Stanislav Malyshev
bbdd6a65e2 Merge branch 'PHP-7.1'
* PHP-7.1:
  More int->size_t and string overflow fixes
2016-11-05 13:59:56 -07:00
Stanislav Malyshev
669763d88a More int->size_t and string overflow fixes 2016-11-05 13:22:17 -07:00
Anatol Belski
de2b00b403 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  rename publicly exposed symbol to avoid name conflicts
2016-10-13 15:25:25 +02:00
Anatol Belski
730288ae41 rename publicly exposed symbol to avoid name conflicts 2016-10-13 15:23:50 +02:00
Stanislav Malyshev
ff75665663 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix outlen for openssl function
  Syncronize with 5.6 - __toString should return ""
  Fix potential overflows in php_pcre_replace_impl
2016-10-12 23:26:15 -07:00
Stanislav Malyshev
9c50ba42d6 Fix potential overflows in php_pcre_replace_impl 2016-10-12 23:07:47 -07:00
Xinchen Hui
75017520c3 Check them in autoconf 2016-08-11 19:57:30 +08:00
Andrea Faulds
0987737397 Use checked arithmetic intrinsics instead of asm, when possible 2016-08-10 00:46:05 +01:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Anton Blanchard
305199a131 Improve performance of PowerPC64 ZEND_SIGNED_MULTIPLY_LONG
Detecting overflow with the XER is slow, partially because we have to
clear it before use. We can do better by using a trick where we compare
the high 64 bits of the result with the low 64 bits shifted right
63 bits.

This is 7% faster on a POWER8 running a simple testcase:

<?php
        function testcase($count = 100000000) {
                for ($i = 0; $i < $count; $i++) {
                        $x = 1;
                        $x = $x * 2;
                        $x = $x * 2;
                        $x = $x * 2;
                        $x = $x * 2;
                }
        }

        testcase();
?>
2015-07-28 18:38:23 +02:00
Elan Ruusamäe
ce73a47996 merge ZEND_SIGNED_MULTIPLY_LONG for i386 and x86_64
as the definitions are identical
refs b7eb3c1c5a
2015-02-28 01:43:53 +02:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Gustavo Frederico Temple Pedrosa
1e82da8d17 PowerPC64 support in safe_address function
Add a ppc64-specific implementation of the safe_address
function with overflow checking.
2014-12-16 08:20:01 +01:00
Gustavo Frederico Temple Pedrosa
87e0802a99 PowerPC64 support in long multiplication
In long integer multiplications, avoid casting
both operands to long double and use an inline
assembly-based overflow checking function instead.
2014-12-01 10:55:53 +01:00
Nikita Popov
53a8584123 Fix allocator for 64bit zend_long with 32bit long 2014-10-16 12:42:23 +02:00
Nikita Popov
2a9daf2e15 Drop zend_long64 in favor of int64_t
Also drop ZEND_HAVE_LONG64, because we already require the
presence of a int64_t type.
2014-10-16 12:42:22 +02:00
Dmitry Stogov
e439349e58 Expose zend_safe_address() and use it in zend_arena_calloc() 2014-09-18 13:31:25 +04:00
Nikita Popov
f4f9b54983 Revert "Move safe_address into zend_multiply.h"
This reverts commit 43b02e169c.

I'm getting symbol resolution issues for zend_error_noreturn in the
opcache.so, so reverting this for now.
2014-09-06 22:12:37 +02:00
Nikita Popov
43b02e169c Move safe_address into zend_multiply.h
This allows reuse in zend_arena_calloc.

Also renamed the function to zend_safe_address as it's no longer
private to the allocator.
2014-09-06 14:03:59 +02:00
Andrea Faulds
e622e28972 Fixed constants in Zend/zend_multiply.h
Conflicts:
	Zend/zend_multiply.h
2014-08-27 19:54:02 +01:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
5bb25776a0 further fixes on core 2014-08-16 15:34:04 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Gustavo Lopes
865cc3a800 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64729: compilation failure on x32

Conflicts:
	Zend/zend_alloc.c
2013-04-30 19:36:08 +02:00
Gustavo Lopes
514afd67b6 Fix bug #64729: compilation failure on x32 2013-04-30 19:28:24 +02:00
Ard Biesheuvel
e2453276e9 Low-level ARM optimizations
- added ARM versions of zend_mm_high_bit()/zend_mm_low_bit()
- improved safe_address()
2013-02-11 14:36:58 +01:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov
c270347c0b MFH: Arithmetic speedup. Inlined most probable code-paths for arithmetic operations directly into executor. 2011-05-31 12:05:25 +00:00
Dmitry Stogov
b7eb3c1c5a Arithmetic speedup. Inlined most probable code-paths for arithmetic operations directly into executor. 2011-05-23 08:05:44 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Sebastian Bergmann
35e83d2afb sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Sebastian Bergmann
7f4dc8702a Bump copyright year, 3 of 3. 2008-12-31 11:12:40 +00:00
Dmitry Stogov
0c77613d77 Optimized ZEND_SIGNED_MULTIPLY_LONG() (Matt) 2008-07-24 13:46:48 +00:00