aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-06-25 12:52:37 -0700
committerPaul Eggert2017-06-25 12:54:12 -0700
commitb2bff45d0f27b3d8c3dfbf6df51dd7adbcb9d9fc (patch)
tree5003498b1abebae9ac238bc972c8cbeffdbc2163 /src
parentc05e3aafc86869ba826809effd8ef7e9e5650f83 (diff)
downloademacs-b2bff45d0f27b3d8c3dfbf6df51dd7adbcb9d9fc.tar.gz
emacs-b2bff45d0f27b3d8c3dfbf6df51dd7adbcb9d9fc.zip
Omit null-pointer test in intervals.h FRAME
* src/intervals.h (ROOT_INTERVAL_P, ONLY_INTERVAL_P) (INTERVAL_LAST_POS): Omit unnecessary parens. (LENGTH): Omit test for null pointer. The argument is never null. The unnecessary test causes GCC 7.1.0 to assume that the argument might be null, and therefore to issue false alarms when the argument is dereferenced in other expressions.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/intervals.h b/src/intervals.h
index db91b3f21a0..a0da6f37801 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -85,10 +85,10 @@ struct interval
85#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) 85#define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL)
86 86
87/* True if this interval has no parent and is therefore the root. */ 87/* True if this interval has no parent and is therefore the root. */
88#define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) 88#define ROOT_INTERVAL_P(i) NULL_PARENT (i)
89 89
90/* True if this interval is the only interval in the interval tree. */ 90/* True if this interval is the only interval in the interval tree. */
91#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) 91#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P (i) && LEAF_INTERVAL_P (i))
92 92
93/* True if this interval has both left and right children. */ 93/* True if this interval has both left and right children. */
94#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) 94#define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL)
@@ -98,13 +98,13 @@ struct interval
98#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) 98#define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length)
99 99
100/* The size of text represented by this interval alone. */ 100/* The size of text represented by this interval alone. */
101#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ 101#define LENGTH(i) ((i)->total_length \
102 - TOTAL_LENGTH ((i)->right) \ 102 - TOTAL_LENGTH ((i)->right) \
103 - TOTAL_LENGTH ((i)->left))) 103 - TOTAL_LENGTH ((i)->left))
104 104
105/* The position of the character just past the end of I. Note that 105/* The position of the character just past the end of I. Note that
106 the position cache i->position must be valid for this to work. */ 106 the position cache i->position must be valid for this to work. */
107#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) 107#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH (i))
108 108
109/* The total size of the left subtree of this interval. */ 109/* The total size of the left subtree of this interval. */
110#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) 110#define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0)