diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-22 15:48:21 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-22 15:48:21 +0200 |
commit | ee3d0b73c5e4b4025f5bfb8347179a6440393387 (patch) | |
tree | fd0d73749d4d3feda46e1493b869b4c308173328 | |
parent | 9278e054e9a9a2aa8c73aed98cb42bf1f9bfd0fe (diff) |
ODBC: avoid clang warning
clang 3.4 points out that the ! in !aQuoteMode!=qm_none in
quoteStringAppend() only gets applied to aQuoteMode. Explicit
brackets silence the compiler warning without changing the
expression.
The compiler indeed points out some unusual code. The if branch is
taken for aQuoteMode == qm_none (probably what was intended) because
!qm_none != qm_none with qm_none == 0 and not taken for all other
values where !aQuoteMode is false and thus equal to qm_none.
It probably would be simpler to write "if (aQuoteMode == qm_none)" but
I don't want to change the meaning of the code.
-rw-r--r-- | src/DB_interfaces/odbc_db/odbcapiagent.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/DB_interfaces/odbc_db/odbcapiagent.cpp b/src/DB_interfaces/odbc_db/odbcapiagent.cpp index 1069d53..0cecdeb 100644 --- a/src/DB_interfaces/odbc_db/odbcapiagent.cpp +++ b/src/DB_interfaces/odbc_db/odbcapiagent.cpp @@ -1570,7 +1570,7 @@ const char *quoteString(const char *aIn, string &aOut, TQuotingModes aQuoteMode) //void sysync::quoteStringAppend(const char *aIn, string &aOut, TQuotingModes aQuoteMode) void quoteStringAppend(const char *aIn, string &aOut, TQuotingModes aQuoteMode) { - if (!aQuoteMode!=qm_none) aOut.append(aIn); + if ((!aQuoteMode)!=qm_none) aOut.append(aIn); else { sInt16 n=strlen(aIn); aOut.reserve(n+2); |