Skip to content

Commit

Permalink
Sync leading and final newlines in source code files
Browse files Browse the repository at this point in the history
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
  • Loading branch information
petk committed Oct 14, 2018
1 parent a6d3e56 commit 1c850bf
Show file tree
Hide file tree
Showing 476 changed files with 129 additions and 623 deletions.
2 changes: 0 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

version: "{branch}.build.{build}"

image: Visual Studio 2017
Expand Down Expand Up @@ -50,4 +49,3 @@ build_script:

test_script:
- appveyor\test.bat

1 change: 0 additions & 1 deletion Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# Zend
#
Expand Down
1 change: 0 additions & 1 deletion Makefile.gcov
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# LCOV
#
Expand Down
1 change: 0 additions & 1 deletion README.EXT_SKEL
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ SOURCE AND HEADER FILE NAME
OTHER OPTIONS

Run php ext_skel.php --help to see the available options.

1 change: 0 additions & 1 deletion README.RELEASE_PROCESS
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,3 @@ New Release Manager Checklist
5. Request moderation access to [email protected] and [email protected] lists, to
be able to moderate your release announcements. All the announcements should be sent from
the @php.net alias.

1 change: 0 additions & 1 deletion README.SELF-CONTAINED-EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,3 @@ PECL SITE CONFORMITY

This macros has to be used within your foo_module_entry to indicate the
extension version.

1 change: 0 additions & 1 deletion README.WIN32-BUILD-SYSTEM
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ The Win32 Build System.
See https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

vim:tw=78:sw=1:ts=1:et

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ Guidelines for contributors
- [README.GIT-RULES](/README.GIT-RULES)
- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES)
- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS)

2 changes: 0 additions & 2 deletions TSRM/acinclude.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

AC_DEFUN([AM_SET_LIBTOOL_VARIABLE],[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])

1 change: 0 additions & 1 deletion TSRM/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c");
ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");

1 change: 0 additions & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -634,4 +634,3 @@ Standard:
========================================
13. Other Changes
========================================

1 change: 0 additions & 1 deletion UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,3 @@ PHP 7.3 INTERNALS UPGRADE NOTES
========================
3. Module changes
========================

1 change: 0 additions & 1 deletion Zend/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ depend:

zend_execute.lo: $(srcdir)/zend_execute.c
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c

1 change: 0 additions & 1 deletion Zend/buildconf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ if cmp configure.old configure > /dev/null 2>&1; then
else
echo "buildconf: created or modified ${1}configure"
fi

2 changes: 1 addition & 1 deletion Zend/tests/bug40236.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ function func5() { }
function func6() { }
function func7() { }
print ("ok\n");
?>
?>
2 changes: 1 addition & 1 deletion Zend/tests/methods-on-non-objects-nested.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
function nested() {
throw new LogicException('Should not be called');
}
}
1 change: 0 additions & 1 deletion Zend/tests/nowdoc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ class d { public function __construct() { $this->d = 4; } };
$d = new d;

?>

1 change: 0 additions & 1 deletion Zend/tests/return_types/classes.php.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

class A {}
class B extends A {}

1 change: 0 additions & 1 deletion Zend/zend_highlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,3 @@ ZEND_API void zend_strip(void)
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/

1 change: 0 additions & 1 deletion Zend/zend_vm_execute.skl
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ ZEND_API int zend_vm_kind(void)
{
return ZEND_VM_KIND;
}

1 change: 0 additions & 1 deletion appveyor/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
if %errorlevel% neq 0 exit /b 3

exit /b 0

1 change: 0 additions & 1 deletion appveyor/build_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,3 @@ nmake /NOLOGO
if %errorlevel% neq 0 exit /b 3

exit /b 0

1 change: 0 additions & 1 deletion appveyor/test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
if %errorlevel% neq 0 exit /b 3

exit /b 0

1 change: 0 additions & 1 deletion appveyor/test_task.bat
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,3 @@ set EXIT_CODE=%errorlevel%
powershell -Command "$wc = New-Object 'System.Net.WebClient'; $wc.UploadFile('https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%', 'c:\junit.out.xml')"

exit /b %EXIT_CODE%

1 change: 0 additions & 1 deletion build/build2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@ configure: aclocal.m4 configure.ac $(config_m4_files)
@echo rebuilding $@
@rm -f $@
$(PHP_AUTOCONF) -f $(SUPPRESS_WARNINGS)

2 changes: 0 additions & 2 deletions build/genif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ cat $infile | \
-e "s'@EXT_MODULE_PTRS@'$module_ptrs'" \
-e 's/@NEWLINE@/\
/g'


2 changes: 1 addition & 1 deletion buildconf.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SET PHP_BUILDCONF_PATH=%~dp0
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
SET PHP_SDK_SCRIPT_PATH=

IF NOT EXIST %PHP_BUILDCONF_PATH% (echo Error generating configure script, configure script was not copied) ELSE (echo Now run 'configure --help')
IF NOT EXIST %PHP_BUILDCONF_PATH% (echo Error generating configure script, configure script was not copied) ELSE (echo Now run 'configure --help')
2 changes: 0 additions & 2 deletions ext/bcmath/libbcmath/AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Phil Nelson <[email protected]> wrote bcmath library.


3 changes: 0 additions & 3 deletions ext/bcmath/libbcmath/COPYING.LIB
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999

Expand Down Expand Up @@ -511,5 +510,3 @@ Random Hacker.
Ty Coon, President of Vice

That's all there is to it!


1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ Wed Jun 7 09:39:02 2000 Phil Nelson <[email protected]>
2000-05-21 Phil Nelson <[email protected]>

* Initial setup of bcmath library., calling it version 0.1.

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ calculate an exact number of digits after the decimal point regardless
of the number of digits in the integer part. GMP floats have a
"fixed, but arbitrary" mantissa and so multiplying two floats will end
up dropping digits BC must calculate.

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,3 @@ bc_add (n1, n2, result, scale_min)
bc_free_num (result);
*result = sum;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,3 @@ bc_compare (n1, n2)
{
return _bc_do_compare (n1, n2, TRUE, FALSE);
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/div.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,3 @@ bc_divide (bc_num n1, bc_num n2, bc_num *quot, int scale)

return 0; /* Everything is OK. */
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/divmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ bc_modulo (bc_num num1, bc_num num2, bc_num *result, int scale)
{
return bc_divmod (num1, num2, NULL, result, scale);
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/doaddsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,3 @@ _bc_do_sub (n1, n2, scale_min)
_bc_rm_leading_zeros (diff);
return diff;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/int2num.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ bc_int2num (num, val)
while (ix-- > 0)
*vptr++ = *--bptr;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/nearzero.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ bc_is_near_zero (num, scale)
else
return TRUE;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/neg.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ bc_is_neg (num)
{
return num->n_sign == MINUS;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/num2long.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ bc_num2long (num)
else
return (-val);
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/raise.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale)
}
bc_free_num (&power);
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/rmzero.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ _bc_rm_leading_zeros (num)
num->n_len--;
}
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/sqrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ bc_sqrt (bc_num *num, int scale)
bc_free_num (&diff);
return 1;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/str2num.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@ bc_str2num (bc_num *num, char *str, int scale)
if (bc_is_zero (*num))
(*num)->n_sign = PLUS;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ bc_sub (n1, n2, result, scale_min)
bc_free_num (result);
*result = diff;
}

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/src/zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ bc_is_zero (bc_num num)
else
return TRUE;
}

1 change: 0 additions & 1 deletion ext/calendar/dow.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
Expand Down
1 change: 0 additions & 1 deletion ext/com_dotnet/com_iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,3 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
}
return NULL;
}

1 change: 0 additions & 1 deletion ext/com_dotnet/com_saproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,4 +562,3 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec

return &I->iter;
}

2 changes: 0 additions & 2 deletions ext/com_dotnet/com_typeinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,5 +601,3 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri

return ret;
}


1 change: 0 additions & 1 deletion ext/com_dotnet/com_variant.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,4 +1121,3 @@ PHP_FUNCTION(variant_cast)
VariantClear(&vres);
}
/* }}} */

2 changes: 0 additions & 2 deletions ext/com_dotnet/com_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,5 +643,3 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val)

return (IDispatch*)disp;
}


1 change: 0 additions & 1 deletion ext/ctype/ctype.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,3 @@ sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->

1 change: 0 additions & 1 deletion ext/curl/tests/server.inc
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ function curl_cli_server_start() {

return PHP_CURL_SERVER_ADDRESS;
}

2 changes: 1 addition & 1 deletion ext/dba/CREDITS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DBA
Sascha Schumann, Marcus Boerger
Sascha Schumann, Marcus Boerger
2 changes: 1 addition & 1 deletion ext/dba/README
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ This shows whether your combination of handlers works. Most problematic
are dbm and ndbm which conflict with many installations. The reason for
this is that on several systems these libraries are part of more than one
other library. The configuration test only prevents you from configuring
malfaunctioning single handlers but not combinations.
malfaunctioning single handlers but not combinations.
2 changes: 1 addition & 1 deletion ext/dba/tests/dba_handler.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ do {
}
} while(1);

?>
?>
1 change: 0 additions & 1 deletion ext/dom/tests/bug67081_0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
<!ELEMENT a EMPTY>
]>
<a></a>

1 change: 0 additions & 1 deletion ext/dom/tests/bug67081_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
<!ELEMENT b EMPTY>
]>
<a></a>

1 change: 0 additions & 1 deletion ext/dom/tests/bug67081_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<a></a>

2 changes: 1 addition & 1 deletion ext/dom/tests/dom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
]>
<root>
<foo bar="" />
</root>
</root>
2 changes: 1 addition & 1 deletion ext/dom/tests/nsdoc.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<root xmlns="http://ns" xmlns:ns2="http://ns2">
<ns2:child />
</root>
</root>
2 changes: 1 addition & 1 deletion ext/dom/tests/skipif.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php if (!extension_loaded('dom')) die('skip dom extension not available');?>
<?php if (!extension_loaded('dom')) die('skip dom extension not available');?>
1 change: 0 additions & 1 deletion ext/enchant/php_enchant.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ PHP_FUNCTION(enchant_dict_quick_check);
* indent-tabs-mode: t
* End:
*/

2 changes: 1 addition & 1 deletion ext/exif/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if(PHP_EXIF != 'no')

EXTENSION('exif', 'exif.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
}
}
}
1 change: 0 additions & 1 deletion ext/fileinfo/Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

$(builddir)/libmagic/apprentice.lo: $(srcdir)/data_file.c
1 change: 0 additions & 1 deletion ext/gd/gd_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ int overflow2(int a, int b)
}
return 0;
}

1 change: 0 additions & 1 deletion ext/hash/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ if (PHP_HASH != "no") {
WARNING("hash not enabled; libraries and headers not found");
}
}

1 change: 0 additions & 1 deletion ext/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,4 +1501,3 @@ ZEND_GET_MODULE(hash)
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/

1 change: 0 additions & 1 deletion ext/iconv/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ if (PHP_ICONV != "no") {
PHP_ICONV = "no";
}
}

2 changes: 1 addition & 1 deletion ext/iconv/tests/test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
// $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
// @dl("iconv$dlext");
//}
?>
?>
5 changes: 0 additions & 5 deletions ext/imap/tests/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Many of the tests in this directory require a mail server to be running, if there is no mail server the test will skip and warn, see skipif.inc for details.

To make the tests run parameters in the skipif.inc and imap_include.inc file will need to be changed to match the local mailserver configuration.
Expand Down Expand Up @@ -39,7 +38,3 @@ auth default {

user = root
}




Loading

0 comments on commit 1c850bf

Please sign in to comment.