Use strstart() instead of strncmp().
[cparser] / ast_t.h
diff --git a/ast_t.h b/ast_t.h
index 4ed8563..41367a9 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -479,7 +479,7 @@ union initializer_t {
  * The statement kinds.
  */
 typedef enum statement_kind_t {
-       STATEMENT_INVALID,
+       STATEMENT_ERROR = 1,
        STATEMENT_EMPTY,
        STATEMENT_COMPOUND,
        STATEMENT_RETURN,
@@ -514,14 +514,6 @@ struct statement_base_t {
 #endif
 };
 
-struct invalid_statement_t {
-       statement_base_t  base;
-};
-
-struct empty_statement_t {
-       statement_base_t  base;
-};
-
 struct return_statement_t {
        statement_base_t  base;
        expression_t     *value;    /**< The return value if any. */
@@ -667,11 +659,6 @@ struct translation_unit_t {
        statement_t *global_asm;
 };
 
-static inline bool is_invalid_statement(statement_t *statement)
-{
-       return statement->base.kind == STATEMENT_INVALID;
-}
-
 /**
  * Allocate an AST node with given size and
  * initialize all fields with zero.