From 36f5234afb6b8e16a658c09fa3d3db67e3c37b12 Mon Sep 17 00:00:00 2001 From: lzwdgc Date: Fri, 18 Sep 2020 23:30:04 +0300 Subject: [PATCH] Use exceptions in default case. --- src/common/db.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/db.cpp b/src/common/db.cpp index 503d25f..c226aca 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -21,6 +21,8 @@ #include "buffer.h" #include "common.h" +#include + std::string getSqlType(FieldType type) { switch (type) @@ -32,9 +34,8 @@ std::string getSqlType(FieldType type) case FieldType::Float: return "REAL"; default: - assert(false); + SW_UNIMPLEMENTED; } - return ""; } void table::load(const buffer &b) @@ -120,7 +121,7 @@ void value::load_fields(const tab &tab, buffer &b) std::cout << "small float field: " << fv.size << "\n"; break; default: - assert(false); + SW_UNIMPLEMENTED; } fields.push_back(fv); } @@ -180,7 +181,7 @@ polygon4::tools::db::processed_db db::process() const r[name] = f.f; break; default: - assert(false); + SW_UNIMPLEMENTED; } } auto table_name = process_string(tbl->second.name);