Fix -Wduplicated-cond warnings
[babeltrace.git] / src / plugins / ctf / common / metadata / parser.y
index ef89fcf8bfeb714ce750cd982857cc5305f4425a..16868179282c18b66da6a110becc880336d3cc68 100644 (file)
 #include "common/list.h"
 #include "common/assert.h"
 #include "scanner.h"
-#include "parser.h"
 #include "ast.h"
 #include "objstack.h"
 
-#if BT_LOG_ENABLED_TRACE
-# define YYDEBUG 1
-# define YYFPRINTF(_stream, _fmt, args...) BT_LOGT(_fmt, ## args)
-#else
-# define YYDEBUG 0
-#endif
+#include "parser-wrap.h"
 
 /* Join two lists, put "add" at the end of "head".  */
 static inline void
@@ -1044,6 +1038,17 @@ void ctf_scanner_free(struct ctf_scanner *scanner)
 
 %}
 
+/*
+ * This ends up in parser.h and makes sure those who want to include it pass
+ * through parser-wrap.h.
+ */
+%code requires {
+#ifndef ALLOW_INCLUDE_PARSER_H
+# error "Don't include parser.h directly, include parser-wrap.h instead."
+#endif
+}
+
+
 %define api.pure
        /* %locations */
 %error-verbose
@@ -1305,7 +1310,7 @@ unary_expression:
                                $$->u.unary_expression.type = UNARY_SIGNED_CONSTANT;
                                $$->u.unary_expression.u.signed_constant =
                                        -($$->u.unary_expression.u.unsigned_constant);
-                       } else if ($$->u.unary_expression.type == UNARY_UNSIGNED_CONSTANT) {
+                       } else if ($$->u.unary_expression.type == UNARY_SIGNED_CONSTANT) {
                                $$->u.unary_expression.u.signed_constant =
                                        -($$->u.unary_expression.u.signed_constant);
                        } else {
This page took 0.026647 seconds and 4 git commands to generate.