From 69eae91ad6b5f1a70a0de78cd5947c06ef14d82f Mon Sep 17 00:00:00 2001 From: Fons Rademakers <Fons.Rademakers@cern.ch> Date: Thu, 7 Oct 2010 14:33:51 +0000 Subject: [PATCH] fix clang warning (conversion specifies type 'long' but the argument has type 'SQLINTEGER' (aka 'int')). git-svn-id: http://root.cern.ch/svn/root/trunk@36159 27541ba8-7e3a-0410-8455-c3a389f83636 --- sql/odbc/src/TODBCStatement.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/odbc/src/TODBCStatement.cxx b/sql/odbc/src/TODBCStatement.cxx index 66e92db28b4..a884987b263 100644 --- a/sql/odbc/src/TODBCStatement.cxx +++ b/sql/odbc/src/TODBCStatement.cxx @@ -633,8 +633,13 @@ const char* TODBCStatement::ConvertToString(Int_t npar) char* buf = fBuffer[npar].fBstrbuffer; switch(fBuffer[npar].fBsqlctype) { - case SQL_C_SLONG: snprintf(buf, 100, (sizeof(long)==8 ? "%d" : "%ld"), *((SQLINTEGER*) addr)); break; - case SQL_C_ULONG: snprintf(buf, 100, (sizeof(long)==8 ? "%u" : "%lu"), *((SQLUINTEGER*) addr)); break; +#if (SIZEOF_LONG == 8) + case SQL_C_SLONG: snprintf(buf, 100, "%d", *((SQLINTEGER*) addr)); break; + case SQL_C_ULONG: snprintf(buf, 100, "%u", *((SQLUINTEGER*) addr)); break; +#else + case SQL_C_SLONG: snprintf(buf, 100, "%ld", *((SQLINTEGER*) addr)); break; + case SQL_C_ULONG: snprintf(buf, 100, "%lu", *((SQLUINTEGER*) addr)); break; +#endif case SQL_C_SBIGINT: snprintf(buf, 100, "%lld", *((Long64_t*) addr)); break; case SQL_C_UBIGINT: snprintf(buf, 100, "%llu", *((ULong64_t*) addr)); break; case SQL_C_SSHORT: snprintf(buf, 100, "%hd", *((SQLSMALLINT*) addr)); break; -- GitLab