com php-src: Convert CRLF line endings to LF: ext/ffi/tests/300.h ext/ffi/tests/list.phpt
| From: | Peter Kokot | Date: | Tue, 07 May 2019 02:40:01 +0000 |
| Subject: | com php-src: Convert CRLF line endings to LF: ext/ffi/tests/300.h ext/ffi/tests/list.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106048@lists.php.net to get a copy of this message | ||
Commit: 361d0b3426093927ef4e54a995090e7c32cd2df1
Author: Peter Kokot <peterkokot@gmail.com> Tue, 7 May 2019 04:40:01 +0200
Parents: c453196be40b51d3810f390218c06bdb134ab82b
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=361d0b3426093927ef4e54a995090e7c32cd2df1
Log:
Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.
Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)
To see which line endings are in the index and in the working copy the
following command can be used:
git ls-files --eol
Git additionally provides .gitattributes file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).
Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.
Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
Changed paths:
M ext/ffi/tests/300.h
M ext/ffi/tests/list.phpt
Diff:
diff --git a/ext/ffi/tests/300.h b/ext/ffi/tests/300.h
index 3426ec1..b2f4e5d 100644
--- a/ext/ffi/tests/300.h
+++ b/ext/ffi/tests/300.h
@@ -1,3 +1,3 @@
-#define FFI_SCOPE "TEST_300"
-
-int printf(const char *format, ...);
+#define FFI_SCOPE "TEST_300"
+
+int printf(const char *format, ...);
diff --git a/ext/ffi/tests/list.phpt b/ext/ffi/tests/list.phpt
index 9a8f25e..a7696fa 100644
--- a/ext/ffi/tests/list.phpt
+++ b/ext/ffi/tests/list.phpt
@@ -1,95 +1,95 @@
---TEST--
-FFI Double linked lists
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
---INI--
-ffi.enable=1
---FILE--
-<?php
-class DList {
- private static $ffi = null;
- private $root;
-
- function __construct() {
- if (is_null(self::$ffi)) {
- self::$ffi =
- FFI::cdef("
- typedef struct _dlist dlist;
- struct _dlist {
- int data;
- dlist *prev;
- dlist *next;
- };
- ");
- }
- $node = FFI::addr(self::$ffi->new("dlist", false));
- $node->data = 0;
- $node->next = $node;
- $node->prev = $node;
- $this->root = $node;
- }
-
- function __destruct() {
- $root = $this->root;
- $node = $root->next;
- while ($node != $root) {
- $prev = $node;
- $node = $node->next;
- FFI::free($prev);
- }
- FFI::free($root);
- }
-
- function add(int $data) {
- $node = FFI::addr(self::$ffi->new("dlist", false));
- $node->data = $data;
- $node->next = $this->root;
- $node->prev = $this->root->prev;
- $this->root->prev->next = $node;
- $this->root->prev = $node;
- }
-
- function del(int $data) {
- $root = $this->root;
- $node = $root->next;
- while ($node != $root) {
- if ($node->data == $data) {
- $node->prev->next = $node->next;
- $node->next->prev = $node->prev;
- FFI::free($node);
- break;
- }
- $node = $node->next;
- }
- }
-
- function print() {
- echo "[";
- $first = true;
- $root = $this->root;
- $node = $root->next;
- while ($node != $root) {
- if (!$first) {
- echo ", ";
- } else {
- $first = false;
- }
- echo $node->data;
- $node = $node->next;
- }
- echo "]\n";
- }
-}
-
-$dlist = new Dlist;
-$dlist->add(1);
-$dlist->add(3);
-$dlist->add(5);
-$dlist->print();
-$dlist->del(3);
-$dlist->print();
-echo "OK\n";
---EXPECT--
-[1, 3, 5]
-[1, 5]
-OK
+--TEST--
+FFI Double linked lists
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+ffi.enable=1
+--FILE--
+<?php
+class DList {
+ private static $ffi = null;
+ private $root;
+
+ function __construct() {
+ if (is_null(self::$ffi)) {
+ self::$ffi =
+ FFI::cdef("
+ typedef struct _dlist dlist;
+ struct _dlist {
+ int data;
+ dlist *prev;
+ dlist *next;
+ };
+ ");
+ }
+ $node = FFI::addr(self::$ffi->new("dlist", false));
+ $node->data = 0;
+ $node->next = $node;
+ $node->prev = $node;
+ $this->root = $node;
+ }
+
+ function __destruct() {
+ $root = $this->root;
+ $node = $root->next;
+ while ($node != $root) {
+ $prev = $node;
+ $node = $node->next;
+ FFI::free($prev);
+ }
+ FFI::free($root);
+ }
+
+ function add(int $data) {
+ $node = FFI::addr(self::$ffi->new("dlist", false));
+ $node->data = $data;
+ $node->next = $this->root;
+ $node->prev = $this->root->prev;
+ $this->root->prev->next = $node;
+ $this->root->prev = $node;
+ }
+
+ function del(int $data) {
+ $root = $this->root;
+ $node = $root->next;
+ while ($node != $root) {
+ if ($node->data == $data) {
+ $node->prev->next = $node->next;
+ $node->next->prev = $node->prev;
+ FFI::free($node);
+ break;
+ }
+ $node = $node->next;
+ }
+ }
+
+ function print() {
+ echo "[";
+ $first = true;
+ $root = $this->root;
+ $node = $root->next;
+ while ($node != $root) {
+ if (!$first) {
+ echo ", ";
+ } else {
+ $first = false;
+ }
+ echo $node->data;
+ $node = $node->next;
+ }
+ echo "]\n";
+ }
+}
+
+$dlist = new Dlist;
+$dlist->add(1);
+$dlist->add(3);
+$dlist->add(5);
+$dlist->print();
+$dlist->del(3);
+$dlist->print();
+echo "OK\n";
+--EXPECT--
+[1, 3, 5]
+[1, 5]
+OK