Use exceptions in default case.

This commit is contained in:
lzwdgc 2020-09-18 23:30:04 +03:00
parent fd543790dd
commit 36f5234afb

View file

@ -21,6 +21,8 @@
#include "buffer.h" #include "buffer.h"
#include "common.h" #include "common.h"
#include <primitives/exceptions.h>
std::string getSqlType(FieldType type) std::string getSqlType(FieldType type)
{ {
switch (type) switch (type)
@ -32,9 +34,8 @@ std::string getSqlType(FieldType type)
case FieldType::Float: case FieldType::Float:
return "REAL"; return "REAL";
default: default:
assert(false); SW_UNIMPLEMENTED;
} }
return "";
} }
void table::load(const buffer &b) 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"; std::cout << "small float field: " << fv.size << "\n";
break; break;
default: default:
assert(false); SW_UNIMPLEMENTED;
} }
fields.push_back(fv); fields.push_back(fv);
} }
@ -180,7 +181,7 @@ polygon4::tools::db::processed_db db::process() const
r[name] = f.f; r[name] = f.f;
break; break;
default: default:
assert(false); SW_UNIMPLEMENTED;
} }
} }
auto table_name = process_string(tbl->second.name); auto table_name = process_string(tbl->second.name);