explicit type conversions to reduce MSVC warnings

This commit is contained in:
alex85k
2015-10-29 20:05:24 +05:00
parent fa7d4da049
commit f3f0a71a01
2 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ private:
int _lon;
int _lat;
int dbl2fix(const double x) const { return x * scale + 0.4; }
int dbl2fix(const double x) const { return (int) (x * scale + 0.4); }
double fix2dbl(const int x) const { return (double)x / scale; }
#else
public:

View File

@ -25,10 +25,10 @@ void escape(const std::string &src, std::string& dst);
inline void pgsql_CopyData(const char *context, PGconn *sql_conn, const char *sql) {
pgsql_CopyData(context, sql_conn, sql, strlen(sql));
pgsql_CopyData(context, sql_conn, sql, (int) strlen(sql));
}
inline void pgsql_CopyData(const char *context, PGconn *sql_conn, const std::string &sql) {
pgsql_CopyData(context, sql_conn, sql.c_str(), sql.length());
pgsql_CopyData(context, sql_conn, sql.c_str(), (int) sql.length());
}
#endif