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 ed64e1d commit 03f3b84
Show file tree
Hide file tree
Showing 578 changed files with 196 additions and 747 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 2015
Expand Down Expand Up @@ -47,4 +46,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 @@ -185,4 +185,3 @@ PHP_FUNCTION(module_name_drawtext)
php_error(E_WARNING, "module_name_drawtext: not yet implemented");
}
/* }}} */

1 change: 0 additions & 1 deletion README.REDIST.BINS
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,3 @@ OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

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

3 changes: 0 additions & 3 deletions README.TESTING2
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,3 @@ regular expect sections. For example:

--EXPECTHEADERS--
Status: 404



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 http://wiki.php.net/internals/windows/stepbystepbuild

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)

1 change: 0 additions & 1 deletion README.namespaces
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,3 @@ TODO
* Add getNamespace() methods to ReflectionClass and ReflectionFunction

* Rename namespaces to packages?

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 @@ -3,4 +3,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 TSRM/m4/gethostbyname.m4
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,3 @@ esac
AC_LANG_POP
]) dnl end AC_DEFUN

1 change: 0 additions & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -523,4 +523,3 @@ PHP 7.1 UPGRADE NOTES
========================================
13. Other Changes
========================================

1 change: 0 additions & 1 deletion UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ changes. See: https://wiki.php.net/phpng-upgrading
========================
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/README.ZEND_VM
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,3 @@ Zend Engine II currently includes two executors during the build process, one
is the specialized version and the other is the old one non-specialized with
function handlers. By default Zend Engine II uses the specialized one but you
can switch to the old executor at runtime by calling zend_vm_use_old_executor().

1 change: 0 additions & 1 deletion Zend/RFCs/001.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,3 @@ The new object model is not dependent on other features. Many of the
other Zend Engine 2.0 features, such as the $foo->bar()->barbara()
syntax, destructors and others completely rely on this new object
model.

4 changes: 0 additions & 4 deletions Zend/RFCs/003.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,3 @@ following could not reliably run.

Old code that does not take advantage of this will run without
modifications.




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_dtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data, zval *ret
/* }}} */

#endif /* HAVE_DTRACE */

1 change: 0 additions & 1 deletion Zend/zend_highlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,3 @@ ZEND_API void zend_strip(void)
* indent-tabs-mode: t
* End:
*/

1 change: 0 additions & 1 deletion Zend/zend_smart_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ static zend_always_inline void smart_str_setl(smart_str *dest, const char *src,
}

#endif

1 change: 0 additions & 1 deletion Zend/zend_strtod_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,3 @@ typedef unsigned long int uint32_t;
#endif

#endif /* ZEND_STRTOD_INT_H */

1 change: 0 additions & 1 deletion Zend/zend_vm_execute.skl
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ ZEND_API void zend_deserialize_opcode_handler(zend_op *op)
{
op->handler = zend_opcode_handlers[(zend_uintptr_t)op->handler];
}

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 @@ -57,4 +57,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 @@ -86,4 +86,3 @@ cd "%APPVEYOR_BUILD_FOLDER%"
nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp"

exit /b %errorlevel%

1 change: 0 additions & 1 deletion build/build2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ configure: aclocal.m4 configure.in $(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 @@ -38,5 +38,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 <philnelson@acm.org> 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 <phil@cs.wwu.edu>
2000-05-21 Phil Nelson <phil@cs.wwu.edu>

* 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/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ dist-hook:
cp $(srcdir)/doc/bcmath.1 $(distdir)/doc
cp $(srcdir)/src/private.h $(distdir)/src
cp $(srcdir)/FAQ $(distdir)

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@

/* Define to `size_t' if <sys/types.h> and <stddef.h> don't define. */
#undef ptrdiff_t

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,3 @@ for am_file in <<$1>>; do
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])

1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@

/* Version number of package */
#undef VERSION

2 changes: 0 additions & 2 deletions ext/bcmath/libbcmath/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1855,5 +1855,3 @@ EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1 change: 0 additions & 1 deletion ext/bcmath/libbcmath/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ AC_TYPE_SIZE_T
AC_CHECK_TYPE(ptrdiff_t, size_t)

AC_OUTPUT(Makefile src/Makefile doc/Makefile)

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 @@ -271,4 +271,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/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ bc_init_num (bc_num *num)
{
*num = bc_copy_num (BCG(_zero_));
}

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 @@ -243,4 +243,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 @@ -563,4 +563,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 @@ -604,5 +604,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 @@ -1124,4 +1124,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 @@ -645,5 +645,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);

?>
?>

0 comments on commit 03f3b84

Please sign in to comment.