Skip to content

Commit 820f695

Browse files
authored
Use bit shift to set bitflags in standard/file.h (#8428)
Nitpicking, this makes it practically impossible to accidentally use a number with 2 bits set in the future, it's also my personal preference, its trivial to see "PHP_FILE_NO_DEFAULT_CONTEXT use bit 4" and that "the next unused bit is bit 5"
1 parent f06410a commit 820f695

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/standard/file.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ PHPAPI ssize_t php_fputcsv(php_stream *stream, zval *fields, char delimiter, cha
5353

5454
#define META_DEF_BUFSIZE 8192
5555

56-
#define PHP_FILE_USE_INCLUDE_PATH 1
57-
#define PHP_FILE_IGNORE_NEW_LINES 2
58-
#define PHP_FILE_SKIP_EMPTY_LINES 4
59-
#define PHP_FILE_APPEND 8
60-
#define PHP_FILE_NO_DEFAULT_CONTEXT 16
56+
#define PHP_FILE_USE_INCLUDE_PATH (1 << 0)
57+
#define PHP_FILE_IGNORE_NEW_LINES (1 << 1)
58+
#define PHP_FILE_SKIP_EMPTY_LINES (1 << 2)
59+
#define PHP_FILE_APPEND (1 << 3)
60+
#define PHP_FILE_NO_DEFAULT_CONTEXT (1 << 4)
6161

6262
typedef enum _php_meta_tags_token {
6363
TOK_EOF = 0,

0 commit comments

Comments
 (0)