diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-04-24 08:12:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-04-24 08:12:25 +0200 |
commit | dd0833229e84999029e82f4f1e01ec015335f4d3 (patch) | |
tree | 1f22ff33864f679b83a4084daf55cbed28199edb | |
parent | 430d1036e57ac7ce502079e245a01e3969c9e300 (diff) |
Fix various warnings (uninitialized, loss of precision, macro redefinition)
-rw-r--r-- | libodb-sqlite/odb/sqlite/blob.hxx | 2 | ||||
-rw-r--r-- | odb-tests/common/query/basics/driver.cxx | 2 | ||||
-rw-r--r-- | odb-tests/common/section/polymorphism/driver.cxx | 2 | ||||
-rw-r--r-- | odb-tests/pgsql/bulk/driver.cxx | 6 |
4 files changed, 7 insertions, 5 deletions
diff --git a/libodb-sqlite/odb/sqlite/blob.hxx b/libodb-sqlite/odb/sqlite/blob.hxx index a4892a2..eecc13e 100644 --- a/libodb-sqlite/odb/sqlite/blob.hxx +++ b/libodb-sqlite/odb/sqlite/blob.hxx @@ -30,7 +30,7 @@ namespace odb // BLOB size to provision for. Set before calling persist() or update(). // explicit - blob (std::size_t size = 0): size_ (size) {} + blob (std::size_t size = 0): size_ (size), rowid_ (0) {} std::size_t size () const {return size_;} void size (std::size_t s) {size_ = s;} diff --git a/odb-tests/common/query/basics/driver.cxx b/odb-tests/common/query/basics/driver.cxx index 73b81d2..eb7e2a7 100644 --- a/odb-tests/common/query/basics/driver.cxx +++ b/odb-tests/common/query/basics/driver.cxx @@ -195,7 +195,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); string name; - unsigned short age; + unsigned short age (0); #if defined(MULTI_DATABASE) query q (query::age >= query::_ref (age) && diff --git a/odb-tests/common/section/polymorphism/driver.cxx b/odb-tests/common/section/polymorphism/driver.cxx index c15d317..bdde74f 100644 --- a/odb-tests/common/section/polymorphism/driver.cxx +++ b/odb-tests/common/section/polymorphism/driver.cxx @@ -1762,7 +1762,7 @@ main (int argc, char* argv[]) using namespace test9; using std::shared_ptr; - unsigned long long id; + unsigned long id; { container c (123); diff --git a/odb-tests/pgsql/bulk/driver.cxx b/odb-tests/pgsql/bulk/driver.cxx index ba25542..6b30073 100644 --- a/odb-tests/pgsql/bulk/driver.cxx +++ b/odb-tests/pgsql/bulk/driver.cxx @@ -12,10 +12,12 @@ #include <stddef.h> #include <sys/select.h> -// Note: hack. +// Note: hack (also, some platforms, like Mac OS, provide it). // #include <arpa/inet.h> -#define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) +#ifndef htonll +# define htonll(x) ((((long long)htonl(x)) << 32) + htonl((x) >> 32)) +#endif #undef NDEBUG #include <assert.h> |