]> git.stg.codes - stg.git/commitdiff
Fix service payDay type for correct work on 32/64-bit
authorMaxim Mamontov <faust.madf@gmail.com>
Sat, 10 Sep 2011 16:54:09 +0000 (19:54 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sat, 10 Sep 2011 16:54:09 +0000 (19:54 +0300)
include/stg/service_conf.h
projects/stargazer/plugins/store/firebird/firebird_store_services.cpp

index 5f015d0b4fe05429ec6279712696c1d82397f915..ef487f8ee78a41e624191930dd12660604dc0257 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <string>
 
+#include "os_int.h"
+
 struct SERVICE_CONF
 {
 SERVICE_CONF()
@@ -25,7 +27,7 @@ SERVICE_CONF(const std::string & n, double c,
 std::string name;
 std::string comment;
 double      cost;
-unsigned    payDay;
+uint8_t     payDay;
 };
 
 inline
index f7167acbdb7fe9211d6156b7dfdaf1c9c63d0fd1..84eab5fa885b66a8ad593d5a0cbd791f61824f1e 100644 (file)
@@ -80,7 +80,7 @@ try
          where name = ?");
     st->Set(1, sc.comment);
     st->Set(2, sc.cost);
-    st->Set(3, static_cast<long>(sc.payDay));
+    st->Set(3, static_cast<int16_t>(sc.payDay));
     st->Set(4, sc.name);
     st->Execute();
     tr->Commit();
@@ -115,7 +115,7 @@ try
         {
         st->Get(3, sc->comment);
         st->Get(4, sc->cost);
-        long pd;
+        int16_t pd;
         st->Get(5, pd);
         sc->payDay = pd;
         }