diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-18 14:57:38 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-18 14:57:38 +0200 |
commit | 71d07fd0bf0352608f62a4a4e1aef3826beef0cc (patch) | |
tree | 28ca3653ec9c222d3217b84e687709d905bc96f6 | |
parent | 3d7444ba9b7136904647d86a78dae8a40ffc6529 (diff) | |
download | nextpnr-71d07fd0bf0352608f62a4a4e1aef3826beef0cc.tar.gz nextpnr-71d07fd0bf0352608f62a4a4e1aef3826beef0cc.tar.bz2 nextpnr-71d07fd0bf0352608f62a4a4e1aef3826beef0cc.zip |
Updates from clangformat
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r-- | common/nextpnr.cc | 5 | ||||
-rw-r--r-- | common/nextpnr.h | 50 |
2 files changed, 35 insertions, 20 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 541d00ba..0b1008ac 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -40,10 +40,7 @@ const std::string &IdString::str(Context *ctx) const return *ctx->idstring_idx_to_str->at(index); } -const char *IdString::c_str(Context *ctx) const -{ - return str(ctx).c_str(); -} +const char *IdString::c_str(Context *ctx) const { return str(ctx).c_str(); } void IdString::initialize_add(Context *ctx, const char *s, int idx) { diff --git a/common/nextpnr.h b/common/nextpnr.h index bd1ed52b..c2352c1d 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -71,10 +71,7 @@ struct IdString const std::string &str(Context *ctx) const; const char *c_str(Context *ctx) const; - bool operator<(const IdString &other) const - { - return index < other.index; - } + bool operator<(const IdString &other) const { return index < other.index; } bool operator==(const IdString &other) const { @@ -90,46 +87,67 @@ struct IdString // --- deprecated old API --- - IdString(const std::string &s) __attribute__ ((deprecated)) + IdString(const std::string &s) __attribute__((deprecated)) { assert(global_ctx != nullptr); set(global_ctx, s); } - IdString(const char *s) __attribute__ ((deprecated)) + IdString(const char *s) __attribute__((deprecated)) { assert(global_ctx != nullptr); set(global_ctx, s); } - const std::string &global_str() const __attribute__ ((deprecated)) + const std::string &global_str() const __attribute__((deprecated)) { assert(global_ctx != nullptr); return str(global_ctx); } - const std::string &str() const __attribute__ ((deprecated)) + const std::string &str() const __attribute__((deprecated)) { assert(global_ctx != nullptr); return str(global_ctx); } - const char *c_str() const __attribute__ ((deprecated)) + const char *c_str() const __attribute__((deprecated)) { assert(global_ctx != nullptr); return c_str(global_ctx); } - operator const char *() const __attribute__ ((deprecated)) { return c_str(); } - operator const std::string &() const __attribute__ ((deprecated)) { return str(); } + operator const char *() const __attribute__((deprecated)) + { + return c_str(); + } - bool operator==(const std::string &s) const __attribute__ ((deprecated)) { return str() == s; } - bool operator==(const char *s) const __attribute__ ((deprecated)) { return str() == s; } + operator const std::string &() const __attribute__((deprecated)) + { + return str(); + } + + bool operator==(const std::string &s) const __attribute__((deprecated)) + { + return str() == s; + } - bool operator!=(const std::string &s) const __attribute__ ((deprecated)) { return str() != s; } - bool operator!=(const char *s) const __attribute__ ((deprecated)) { return str() != s; } + bool operator==(const char *s) const __attribute__((deprecated)) + { + return str() == s; + } + + bool operator!=(const std::string &s) const __attribute__((deprecated)) + { + return str() != s; + } + + bool operator!=(const char *s) const __attribute__((deprecated)) + { + return str() != s; + } - size_t size() const __attribute__ ((deprecated)) { return str().size(); } + size_t size() const __attribute__((deprecated)) { return str().size(); } }; NEXTPNR_NAMESPACE_END |