Updates from clangformat

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-06-18 14:57:38 +02:00
parent 3d7444ba9b
commit 71d07fd0bf
2 changed files with 35 additions and 20 deletions

View File

@ -40,10 +40,7 @@ const std::string &IdString::str(Context *ctx) const
return *ctx->idstring_idx_to_str->at(index); return *ctx->idstring_idx_to_str->at(index);
} }
const char *IdString::c_str(Context *ctx) const const char *IdString::c_str(Context *ctx) const { return str(ctx).c_str(); }
{
return str(ctx).c_str();
}
void IdString::initialize_add(Context *ctx, const char *s, int idx) void IdString::initialize_add(Context *ctx, const char *s, int idx)
{ {

View File

@ -71,10 +71,7 @@ struct IdString
const std::string &str(Context *ctx) const; const std::string &str(Context *ctx) const;
const char *c_str(Context *ctx) const; const char *c_str(Context *ctx) const;
bool operator<(const IdString &other) const bool operator<(const IdString &other) const { return index < other.index; }
{
return index < other.index;
}
bool operator==(const IdString &other) const bool operator==(const IdString &other) const
{ {
@ -120,14 +117,35 @@ struct IdString
return c_str(global_ctx); return c_str(global_ctx);
} }
operator const char *() const __attribute__ ((deprecated)) { return c_str(); } operator const char *() const __attribute__((deprecated))
operator const std::string &() const __attribute__ ((deprecated)) { return str(); } {
return c_str();
}
bool operator==(const std::string &s) const __attribute__ ((deprecated)) { return str() == s; } operator const std::string &() const __attribute__((deprecated))
bool operator==(const char *s) const __attribute__ ((deprecated)) { return str() == s; } {
return str();
}
bool operator!=(const std::string &s) const __attribute__ ((deprecated)) { return str() != s; } bool operator==(const std::string &s) const __attribute__((deprecated))
bool operator!=(const char *s) const __attribute__ ((deprecated)) { return str() != s; } {
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(); }
}; };