From afe0eca5e85f5b114236d09969d52267adb7803c Mon Sep 17 00:00:00 2001 From: an-tao Date: Tue, 4 Dec 2018 22:46:33 +0800 Subject: [PATCH] Fix a compiler warning --- drogon_ctl/create_model.cc | 2 -- drogon_ctl/create_model.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index 8ebbe1de..4cf11bd9 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -87,7 +87,6 @@ void create_model::createModelClassFromPG(const std::string &path, const DbClien { auto row = r[i]; ColumnInfo info; - memset(&info, 0, sizeof(info)); info._index = i; info._dbType = "pg"; info._colName = row["column_name"].as(); @@ -315,7 +314,6 @@ void create_model::createModelClassFromMysql(const std::string &path, const DbCl if (!isNull) { ColumnInfo info; - memset(&info, 0, sizeof(info)); info._index = i; info._dbType = "pg"; info._colName = field; diff --git a/drogon_ctl/create_model.h b/drogon_ctl/create_model.h index 987f4995..d0e82c02 100644 --- a/drogon_ctl/create_model.h +++ b/drogon_ctl/create_model.h @@ -38,7 +38,7 @@ struct ColumnInfo std::string _colDatabaseType; std::string _dbType; ssize_t _colLength = -1; - size_t _index; + size_t _index = 0; bool _isAutoVal = false; bool _isPrimaryKey = false; bool _notNull = false;