aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/pgsql/statement.cxx18
-rw-r--r--odb/pgsql/traits.hxx5
2 files changed, 12 insertions, 11 deletions
diff --git a/odb/pgsql/statement.cxx b/odb/pgsql/statement.cxx
index f3d37d9..68c9ace 100644
--- a/odb/pgsql/statement.cxx
+++ b/odb/pgsql/statement.cxx
@@ -182,36 +182,36 @@ namespace odb
{
case bind::smallint:
{
- *static_cast<short*> (b.buffer) = endian_traits::ntoh (
- *reinterpret_cast<const short*> (v));
+ *static_cast<short*> (b.buffer) =
+ *reinterpret_cast<const short*> (v);
break;
}
case bind::integer:
{
- *static_cast<int*> (b.buffer) = endian_traits::ntoh (
- *reinterpret_cast<const int*> (v));
+ *static_cast<int*> (b.buffer) =
+ *reinterpret_cast<const int*> (v);
break;
}
case bind::bigint:
{
*static_cast<long long*> (b.buffer) =
- endian_traits::ntoh (*reinterpret_cast<const long long*> (v));
+ *reinterpret_cast<const long long*> (v);
break;
}
case bind::real:
{
- *static_cast<float*> (b.buffer) = endian_traits::ntoh (
- *reinterpret_cast<const float*> (v));
+ *static_cast<float*> (b.buffer) =
+ *reinterpret_cast<const float*> (v);
break;
}
case bind::double_:
{
- *static_cast<double*> (b.buffer) = endian_traits::ntoh (
- *reinterpret_cast<const double*> (v));
+ *static_cast<double*> (b.buffer) =
+ *reinterpret_cast<const double*> (v);
break;
}
diff --git a/odb/pgsql/traits.hxx b/odb/pgsql/traits.hxx
index a1e3cf6..7d2bce0 100644
--- a/odb/pgsql/traits.hxx
+++ b/odb/pgsql/traits.hxx
@@ -19,6 +19,7 @@
#include <odb/pgsql/pgsql-types.hxx>
#include <odb/pgsql/details/export.hxx>
+#include <odb/pgsql/details/endian-traits.hxx>
namespace odb
{
@@ -129,7 +130,7 @@ namespace odb
set_value (T& v, const image_type& i, bool is_null)
{
if (!is_null)
- v = T (i);
+ v = T (details::endian_traits::ntoh (i));
else
v = T ();
}
@@ -138,7 +139,7 @@ namespace odb
set_image (image_type& i, bool& is_null, T v)
{
is_null = false;
- i = image_type (v);
+ i = image_type (details::endian_traits::hton (v));
}
};