From 6c7222e071ffe7d20c138faac0da1d708e0a7779 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 29 Aug 2021 15:12:57 +0100 Subject: Add -Wold-style-cast --- lib/compileTimeFormatter.h | 2 +- lib/input/mysqlBindings.cpp | 3 +-- lib/output/pq/pqConn.cpp | 7 ++++--- lib/output/pq/pqRecordSet.cpp | 8 ++++---- lib/output/pq/pqStmt.cpp | 6 +++--- lib/output/pq/writePqCopyStrm.cpp | 2 +- lib/row.cpp | 3 ++- lib/streamSupport.cpp | 3 ++- 8 files changed, 18 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/compileTimeFormatter.h b/lib/compileTimeFormatter.h index 647fb30..7d69d4b 100644 --- a/lib/compileTimeFormatter.h +++ b/lib/compileTimeFormatter.h @@ -344,7 +344,7 @@ namespace MyGrate { static inline void write(stream & s, Obj * const ptr, const Pn &... pn) { - s << std::showbase << std::hex << (long unsigned int)ptr; + s << std::showbase << std::hex << static_cast(ptr); s.copyfmt(std::ios(nullptr)); StreamWriter::next(s, pn...); } diff --git a/lib/input/mysqlBindings.cpp b/lib/input/mysqlBindings.cpp index 3895821..089ced5 100644 --- a/lib/input/mysqlBindings.cpp +++ b/lib/input/mysqlBindings.cpp @@ -22,7 +22,6 @@ namespace MyGrate::Input { MYSQL_TIME & operator<<(MYSQL_TIME & t, const DateTime & dt) { - return t << (Date)dt << (Time)dt; + return t << static_cast(dt) << static_cast