WIP: reduced number of warnings with clang

This commit is contained in:
Matthias Koefferlein 2019-06-21 23:22:42 +02:00
parent a4d2be7fbf
commit 6f6b9e898b
4 changed files with 171 additions and 107 deletions

View File

@ -28,55 +28,56 @@ namespace db
namespace l2n_std_format
{
const char *l2n_magic_string_cstr = "#%l2n-klayout";
template<> DB_PUBLIC const std::string keys<false>::l2n_magic_string (l2n_magic_string_cstr);
template<> DB_PUBLIC const std::string keys<true>::l2n_magic_string (l2n_magic_string_cstr);
template<> DB_PUBLIC const std::string keys<false>::version_key ("version");
template<> DB_PUBLIC const std::string keys<false>::description_key ("description");
template<> DB_PUBLIC const std::string keys<false>::top_key ("top");
template<> DB_PUBLIC const std::string keys<false>::unit_key ("unit");
template<> DB_PUBLIC const std::string keys<false>::layer_key ("layer");
template<> DB_PUBLIC const std::string keys<false>::class_key ("class");
template<> DB_PUBLIC const std::string keys<false>::connect_key ("connect");
template<> DB_PUBLIC const std::string keys<false>::global_key ("global");
template<> DB_PUBLIC const std::string keys<false>::circuit_key ("circuit");
template<> DB_PUBLIC const std::string keys<false>::net_key ("net");
template<> DB_PUBLIC const std::string keys<false>::name_key ("name");
template<> DB_PUBLIC const std::string keys<false>::device_key ("device");
template<> DB_PUBLIC const std::string keys<false>::polygon_key ("polygon");
template<> DB_PUBLIC const std::string keys<false>::rect_key ("rect");
template<> DB_PUBLIC const std::string keys<false>::terminal_key ("terminal");
template<> DB_PUBLIC const std::string keys<false>::abstract_key ("abstract");
template<> DB_PUBLIC const std::string keys<false>::param_key ("param");
template<> DB_PUBLIC const std::string keys<false>::location_key ("location");
template<> DB_PUBLIC const std::string keys<false>::rotation_key ("rotation");
template<> DB_PUBLIC const std::string keys<false>::mirror_key ("mirror");
template<> DB_PUBLIC const std::string keys<false>::scale_key ("scale");
template<> DB_PUBLIC const std::string keys<false>::pin_key ("pin");
DB_PUBLIC std::string LongKeys::l2n_magic_string (l2n_magic_string_cstr);
DB_PUBLIC std::string ShortKeys::l2n_magic_string (l2n_magic_string_cstr);
DB_PUBLIC std::string LongKeys::version_key ("version");
DB_PUBLIC std::string LongKeys::description_key ("description");
DB_PUBLIC std::string LongKeys::top_key ("top");
DB_PUBLIC std::string LongKeys::unit_key ("unit");
DB_PUBLIC std::string LongKeys::layer_key ("layer");
DB_PUBLIC std::string LongKeys::class_key ("class");
DB_PUBLIC std::string LongKeys::connect_key ("connect");
DB_PUBLIC std::string LongKeys::global_key ("global");
DB_PUBLIC std::string LongKeys::circuit_key ("circuit");
DB_PUBLIC std::string LongKeys::net_key ("net");
DB_PUBLIC std::string LongKeys::name_key ("name");
DB_PUBLIC std::string LongKeys::device_key ("device");
DB_PUBLIC std::string LongKeys::polygon_key ("polygon");
DB_PUBLIC std::string LongKeys::rect_key ("rect");
DB_PUBLIC std::string LongKeys::terminal_key ("terminal");
DB_PUBLIC std::string LongKeys::abstract_key ("abstract");
DB_PUBLIC std::string LongKeys::param_key ("param");
DB_PUBLIC std::string LongKeys::location_key ("location");
DB_PUBLIC std::string LongKeys::rotation_key ("rotation");
DB_PUBLIC std::string LongKeys::mirror_key ("mirror");
DB_PUBLIC std::string LongKeys::scale_key ("scale");
DB_PUBLIC std::string LongKeys::pin_key ("pin");
// A, B, C, D, E, G, I, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y
template<> DB_PUBLIC const std::string keys<true>::version_key ("V");
template<> DB_PUBLIC const std::string keys<true>::description_key ("B");
template<> DB_PUBLIC const std::string keys<true>::top_key ("W");
template<> DB_PUBLIC const std::string keys<true>::unit_key ("U");
template<> DB_PUBLIC const std::string keys<true>::layer_key ("L");
template<> DB_PUBLIC const std::string keys<true>::class_key ("K");
template<> DB_PUBLIC const std::string keys<true>::connect_key ("C");
template<> DB_PUBLIC const std::string keys<true>::global_key ("G");
template<> DB_PUBLIC const std::string keys<true>::circuit_key ("X");
template<> DB_PUBLIC const std::string keys<true>::net_key ("N");
template<> DB_PUBLIC const std::string keys<true>::name_key ("I");
template<> DB_PUBLIC const std::string keys<true>::device_key ("D");
template<> DB_PUBLIC const std::string keys<true>::polygon_key ("Q");
template<> DB_PUBLIC const std::string keys<true>::rect_key ("R");
template<> DB_PUBLIC const std::string keys<true>::terminal_key ("T");
template<> DB_PUBLIC const std::string keys<true>::abstract_key ("A");
template<> DB_PUBLIC const std::string keys<true>::param_key ("E");
template<> DB_PUBLIC const std::string keys<true>::location_key ("Y");
template<> DB_PUBLIC const std::string keys<true>::rotation_key ("O");
template<> DB_PUBLIC const std::string keys<true>::mirror_key ("M");
template<> DB_PUBLIC const std::string keys<true>::scale_key ("S");
template<> DB_PUBLIC const std::string keys<true>::pin_key ("P");
DB_PUBLIC std::string ShortKeys::version_key ("V");
DB_PUBLIC std::string ShortKeys::description_key ("B");
DB_PUBLIC std::string ShortKeys::top_key ("W");
DB_PUBLIC std::string ShortKeys::unit_key ("U");
DB_PUBLIC std::string ShortKeys::layer_key ("L");
DB_PUBLIC std::string ShortKeys::class_key ("K");
DB_PUBLIC std::string ShortKeys::connect_key ("C");
DB_PUBLIC std::string ShortKeys::global_key ("G");
DB_PUBLIC std::string ShortKeys::circuit_key ("X");
DB_PUBLIC std::string ShortKeys::net_key ("N");
DB_PUBLIC std::string ShortKeys::name_key ("I");
DB_PUBLIC std::string ShortKeys::device_key ("D");
DB_PUBLIC std::string ShortKeys::polygon_key ("Q");
DB_PUBLIC std::string ShortKeys::rect_key ("R");
DB_PUBLIC std::string ShortKeys::terminal_key ("T");
DB_PUBLIC std::string ShortKeys::abstract_key ("A");
DB_PUBLIC std::string ShortKeys::param_key ("E");
DB_PUBLIC std::string ShortKeys::location_key ("Y");
DB_PUBLIC std::string ShortKeys::rotation_key ("O");
DB_PUBLIC std::string ShortKeys::mirror_key ("M");
DB_PUBLIC std::string ShortKeys::scale_key ("S");
DB_PUBLIC std::string ShortKeys::pin_key ("P");
}
}

View File

@ -136,38 +136,78 @@ namespace db
namespace l2n_std_format
{
template <bool Short>
struct DB_PUBLIC keys
struct DB_PUBLIC ShortKeys
{
static const std::string l2n_magic_string;
static std::string l2n_magic_string;
static const std::string version_key;
static const std::string description_key;
static const std::string top_key;
static const std::string unit_key;
static const std::string layer_key;
static const std::string class_key;
static const std::string connect_key;
static const std::string global_key;
static const std::string circuit_key;
static const std::string net_key;
static const std::string name_key;
static const std::string device_key;
static const std::string subcircuit_key;
static const std::string polygon_key;
static const std::string rect_key;
static const std::string terminal_key;
static const std::string abstract_key;
static const std::string param_key;
static const std::string location_key;
static const std::string rotation_key;
static const std::string mirror_key;
static const std::string scale_key;
static const std::string pin_key;
static const std::string indent1;
static const std::string indent2;
static std::string version_key;
static std::string description_key;
static std::string top_key;
static std::string unit_key;
static std::string layer_key;
static std::string class_key;
static std::string connect_key;
static std::string global_key;
static std::string circuit_key;
static std::string net_key;
static std::string name_key;
static std::string device_key;
static std::string subcircuit_key;
static std::string polygon_key;
static std::string rect_key;
static std::string terminal_key;
static std::string abstract_key;
static std::string param_key;
static std::string location_key;
static std::string rotation_key;
static std::string mirror_key;
static std::string scale_key;
static std::string pin_key;
static std::string indent1;
static std::string indent2;
};
inline static bool is_short () { return Short; }
struct DB_PUBLIC LongKeys
{
static std::string l2n_magic_string;
static std::string version_key;
static std::string description_key;
static std::string top_key;
static std::string unit_key;
static std::string layer_key;
static std::string class_key;
static std::string connect_key;
static std::string global_key;
static std::string circuit_key;
static std::string net_key;
static std::string name_key;
static std::string device_key;
static std::string subcircuit_key;
static std::string polygon_key;
static std::string rect_key;
static std::string terminal_key;
static std::string abstract_key;
static std::string param_key;
static std::string location_key;
static std::string rotation_key;
static std::string mirror_key;
static std::string scale_key;
static std::string pin_key;
static std::string indent1;
static std::string indent2;
};
template <bool Short> struct DB_PUBLIC keys;
template <> struct DB_PUBLIC keys<true> : public ShortKeys
{
inline static bool is_short () { return true; }
};
template <> struct DB_PUBLIC keys<false> : public LongKeys
{
inline static bool is_short () { return false; }
};
}

View File

@ -28,28 +28,28 @@ namespace db
namespace lvs_std_format
{
const char *lvs_magic_string_cstr = "#%lvsdb-klayout";
template<> DB_PUBLIC const std::string keys<false>::lvs_magic_string (lvs_magic_string_cstr);
template<> DB_PUBLIC const std::string keys<true>::lvs_magic_string (lvs_magic_string_cstr);
DB_PUBLIC std::string ShortKeys::lvs_magic_string (lvs_magic_string_cstr);
DB_PUBLIC std::string LongKeys::lvs_magic_string (lvs_magic_string_cstr);
template<> DB_PUBLIC const std::string keys<false>::reference_key ("reference");
template<> DB_PUBLIC const std::string keys<false>::layout_key ("layout");
template<> DB_PUBLIC const std::string keys<false>::xref_key ("xref");
DB_PUBLIC std::string ShortKeys::reference_key ("reference");
DB_PUBLIC std::string ShortKeys::layout_key ("layout");
DB_PUBLIC std::string ShortKeys::xref_key ("xref");
template<> DB_PUBLIC const std::string keys<false>::mismatch_key ("mismatch");
template<> DB_PUBLIC const std::string keys<false>::match_key ("match");
template<> DB_PUBLIC const std::string keys<false>::nomatch_key ("nomatch");
template<> DB_PUBLIC const std::string keys<false>::warning_key ("warning");
template<> DB_PUBLIC const std::string keys<false>::skipped_key ("skipped");
DB_PUBLIC std::string ShortKeys::mismatch_key ("mismatch");
DB_PUBLIC std::string ShortKeys::match_key ("match");
DB_PUBLIC std::string ShortKeys::nomatch_key ("nomatch");
DB_PUBLIC std::string ShortKeys::warning_key ("warning");
DB_PUBLIC std::string ShortKeys::skipped_key ("skipped");
template<> DB_PUBLIC const std::string keys<true>::reference_key ("H");
template<> DB_PUBLIC const std::string keys<true>::layout_key ("J");
template<> DB_PUBLIC const std::string keys<true>::xref_key ("Z");
DB_PUBLIC std::string LongKeys::reference_key ("H");
DB_PUBLIC std::string LongKeys::layout_key ("J");
DB_PUBLIC std::string LongKeys::xref_key ("Z");
template<> DB_PUBLIC const std::string keys<true>::mismatch_key ("0");
template<> DB_PUBLIC const std::string keys<true>::match_key ("1");
template<> DB_PUBLIC const std::string keys<true>::nomatch_key ("X");
template<> DB_PUBLIC const std::string keys<true>::warning_key ("W");
template<> DB_PUBLIC const std::string keys<true>::skipped_key ("S");
DB_PUBLIC std::string LongKeys::mismatch_key ("0");
DB_PUBLIC std::string LongKeys::match_key ("1");
DB_PUBLIC std::string LongKeys::nomatch_key ("X");
DB_PUBLIC std::string LongKeys::warning_key ("W");
DB_PUBLIC std::string LongKeys::skipped_key ("S");
}
}

View File

@ -121,25 +121,48 @@ namespace db
namespace lvs_std_format
{
template <bool Short>
struct DB_PUBLIC keys
: public l2n_std_format::keys<Short>
struct DB_PUBLIC ShortKeys
{
typedef l2n_std_format::keys<Short> l2n_keys;
static std::string lvs_magic_string;
static const std::string lvs_magic_string;
static std::string reference_key;
static std::string layout_key;
static std::string xref_key;
static const std::string reference_key;
static const std::string layout_key;
static const std::string xref_key;
static std::string mismatch_key;
static std::string match_key;
static std::string nomatch_key;
static std::string warning_key;
static std::string skipped_key;
};
static const std::string mismatch_key;
static const std::string match_key;
static const std::string nomatch_key;
static const std::string warning_key;
static const std::string skipped_key;
struct DB_PUBLIC LongKeys
{
static std::string lvs_magic_string;
inline static bool is_short () { return Short; }
static std::string reference_key;
static std::string layout_key;
static std::string xref_key;
static std::string mismatch_key;
static std::string match_key;
static std::string nomatch_key;
static std::string warning_key;
static std::string skipped_key;
};
template <bool Short> struct DB_PUBLIC keys;
template <> struct DB_PUBLIC keys<true> : public l2n_std_format::keys<true>, public ShortKeys
{
typedef l2n_std_format::keys<true> l2n_keys;
inline static bool is_short () { return true; }
};
template <> struct DB_PUBLIC keys<false> : public l2n_std_format::keys<false>, public LongKeys
{
typedef l2n_std_format::keys<false> l2n_keys;
inline static bool is_short () { return false; }
};
}