From 10247628d01d0d0fbe71e79acced1108df2d26dd Mon Sep 17 00:00:00 2001 From: yuanbo Date: Sat, 5 Jun 2021 16:38:54 +0800 Subject: [PATCH 1/2] fix hc-gen compile warnings Signed-off-by: yuanbo --- tools/hc-gen/Makefile | 1 + tools/hc-gen/src/ast.h | 4 ++++ tools/hc-gen/src/lexer.h | 2 ++ tools/hc-gen/src/token.h | 3 +++ 4 files changed, 10 insertions(+) diff --git a/tools/hc-gen/Makefile b/tools/hc-gen/Makefile index 9ee07ed59..34ee1fbc1 100644 --- a/tools/hc-gen/Makefile +++ b/tools/hc-gen/Makefile @@ -22,6 +22,7 @@ $(OBJECTS): $(BUILD_DIR)/%.o : %.cpp $(Q) $(CXX) $(CXX_FLAGS) $(CXX_LD_FLAGS) -c $< -o $@ $(TARGET): $(OBJECTS) + $(Q) echo built $@ $(Q) $(CXX) $(CXX_FLAGS) $(CXX_LD_FLAGS) $^ -o $@ test: $(TARGET) diff --git a/tools/hc-gen/src/ast.h b/tools/hc-gen/src/ast.h index fb37bbfe1..543483391 100644 --- a/tools/hc-gen/src/ast.h +++ b/tools/hc-gen/src/ast.h @@ -434,6 +434,10 @@ private: bool redefineChecked_; }; +std::ostream& operator<<(std::ostream &s, const AstObject &obj); +std::ostream& operator<<(std::ostream &s, const ConfigNode &obj); +std::ostream& operator<<(std::ostream &s, const ConfigTerm &obj); + } // Hardware } // OHOS diff --git a/tools/hc-gen/src/lexer.h b/tools/hc-gen/src/lexer.h index 2fe699586..adbc063fe 100644 --- a/tools/hc-gen/src/lexer.h +++ b/tools/hc-gen/src/lexer.h @@ -76,6 +76,8 @@ private: int32_t lineLoc_; }; +std::ostream& operator<<(std::ostream &s, const Lexer &lexer); + } // Hardware } // OHOS diff --git a/tools/hc-gen/src/token.h b/tools/hc-gen/src/token.h index 80c16d255..7e702e4b5 100644 --- a/tools/hc-gen/src/token.h +++ b/tools/hc-gen/src/token.h @@ -17,6 +17,7 @@ namespace OHOS { namespace Hardware { + enum TokenType { NUMBER = 256, TEMPLATE, @@ -42,6 +43,8 @@ struct Token { friend std::ostream &operator<<(std::ostream &stream, const Token &t); }; +std::ostream& operator<<(std::ostream &s, const Token &t); + std::string TokenType2String(int32_t type); } // Hardware -- Gitee From b45488c5533cf94863125058c99c91b76e03c265 Mon Sep 17 00:00:00 2001 From: yuanbo Date: Sat, 5 Jun 2021 16:50:37 +0800 Subject: [PATCH 2/2] remove space line Signed-off-by: yuanbo --- tools/hc-gen/src/token.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/hc-gen/src/token.h b/tools/hc-gen/src/token.h index 7e702e4b5..cd27c22f7 100644 --- a/tools/hc-gen/src/token.h +++ b/tools/hc-gen/src/token.h @@ -17,7 +17,6 @@ namespace OHOS { namespace Hardware { - enum TokenType { NUMBER = 256, TEMPLATE, -- Gitee