diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-06-25 12:52:37 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-06-25 12:54:12 -0700 |
commit | b2bff45d0f27b3d8c3dfbf6df51dd7adbcb9d9fc (patch) | |
tree | 5003498b1abebae9ac238bc972c8cbeffdbc2163 /src/intervals.h | |
parent | c05e3aafc86869ba826809effd8ef7e9e5650f83 (diff) | |
download | emacs-b2bff45d0f27b3d8c3dfbf6df51dd7adbcb9d9fc.tar.gz |
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/intervals.h')
-rw-r--r-- | src/intervals.h | 12 |
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 #define LEAF_INTERVAL_P(i) ((i)->left == NULL && (i)->right == NULL) /* True if this interval has no parent and is therefore the root. */ -#define ROOT_INTERVAL_P(i) (NULL_PARENT (i)) +#define ROOT_INTERVAL_P(i) NULL_PARENT (i) /* True if this interval is the only interval in the interval tree. */ -#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P ((i)) && LEAF_INTERVAL_P ((i))) +#define ONLY_INTERVAL_P(i) (ROOT_INTERVAL_P (i) && LEAF_INTERVAL_P (i)) /* True if this interval has both left and right children. */ #define BOTH_KIDS_P(i) ((i)->left != NULL && (i)->right != NULL) @@ -98,13 +98,13 @@ struct interval #define TOTAL_LENGTH(i) ((i) == NULL ? 0 : (i)->total_length) /* The size of text represented by this interval alone. */ -#define LENGTH(i) ((i) == NULL ? 0 : (TOTAL_LENGTH ((i)) \ - - TOTAL_LENGTH ((i)->right) \ - - TOTAL_LENGTH ((i)->left))) +#define LENGTH(i) ((i)->total_length \ + - TOTAL_LENGTH ((i)->right) \ + - TOTAL_LENGTH ((i)->left)) /* The position of the character just past the end of I. Note that the position cache i->position must be valid for this to work. */ -#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH ((i))) +#define INTERVAL_LAST_POS(i) ((i)->position + LENGTH (i)) /* The total size of the left subtree of this interval. */ #define LEFT_TOTAL_LENGTH(i) ((i)->left ? (i)->left->total_length : 0) |