Convert SN_MAKE_TERMINATOR and SN_IS_TERMINATOR to inline functions to avoid clang+ccache warnings about over-parenthesized equality expressions. No bug, rs=terrence
authorJeff Walden <jwalden@mit.edu>
Mon, 15 Jul 2013 15:26:04 -0700
changeset 138694 cc877a2930f82b50bcc5b6dfa0d29c37b5826af8
parent 138693 31aa18b9b25073aa2a6b82d3f95a54821e81cdb3
child 138695 80ce41a4e6ee705064a192dbfb0fcd2438ef8dd7
push id24964
push userryanvm@gmail.com
push dateTue, 16 Jul 2013 20:04:09 +0000
treeherderautoland@fd10ead17ace [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Convert SN_MAKE_TERMINATOR and SN_IS_TERMINATOR to inline functions to avoid clang+ccache warnings about over-parenthesized equality expressions. No bug, rs=terrence
js/src/frontend/SourceNotes.h
--- a/js/src/frontend/SourceNotes.h
+++ b/js/src/frontend/SourceNotes.h
@@ -76,16 +76,29 @@ enum SrcNoteType {
     SRC_UNUSED20    = 20,
     SRC_UNUSED21    = 21,
     SRC_UNUSED22    = 22,
     SRC_UNUSED23    = 23,
 
     SRC_XDELTA      = 24        /* 24-31 are for extended delta notes */
 };
 
+/* A source note array is terminated by an all-zero element. */
+inline void
+SN_MAKE_TERMINATOR(jssrcnote *sn)
+{
+    *sn = SRC_NULL;
+}
+
+inline bool
+SN_IS_TERMINATOR(jssrcnote *sn)
+{
+    return *sn == SRC_NULL;
+}
+
 }  // namespace js
 
 #define SN_TYPE_BITS            5
 #define SN_DELTA_BITS           3
 #define SN_XDELTA_BITS          6
 #define SN_TYPE_MASK            (JS_BITMASK(SN_TYPE_BITS) << SN_DELTA_BITS)
 #define SN_DELTA_MASK           ((ptrdiff_t)JS_BITMASK(SN_DELTA_BITS))
 #define SN_XDELTA_MASK          ((ptrdiff_t)JS_BITMASK(SN_XDELTA_BITS))
@@ -136,20 +149,16 @@ enum SrcNoteType {
 #define SN_COLSPAN_DOMAIN       ptrdiff_t(SN_3BYTE_OFFSET_FLAG << 16)
 
 #define SN_MAX_OFFSET ((size_t)((ptrdiff_t)SN_3BYTE_OFFSET_FLAG << 16) - 1)
 
 #define SN_LENGTH(sn)           ((js_SrcNoteSpec[SN_TYPE(sn)].arity == 0) ? 1 \
                                  : js_SrcNoteLength(sn))
 #define SN_NEXT(sn)             ((sn) + SN_LENGTH(sn))
 
-/* A source note array is terminated by an all-zero element. */
-#define SN_MAKE_TERMINATOR(sn)  (*(sn) = SRC_NULL)
-#define SN_IS_TERMINATOR(sn)    (*(sn) == SRC_NULL)
-
 struct JSSrcNoteSpec {
     const char      *name;      /* name for disassembly/debugging output */
     int8_t          arity;      /* number of offset operands */
 };
 
 extern JS_FRIEND_DATA(const JSSrcNoteSpec) js_SrcNoteSpec[];
 extern JS_FRIEND_API(unsigned)         js_SrcNoteLength(jssrcnote *sn);