]> git.stg.codes - stg.git/commitdiff
Another set of minor fixes.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 8 Jun 2014 20:56:46 +0000 (23:56 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 9 Jan 2015 20:14:08 +0000 (22:14 +0200)
projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp
projects/stargazer/plugins/store/mysql/mysql_store.cpp
projects/stargazer/stg_timer.cpp

index d6ff1a3aed90d842cd01c83d0b8307a4b7e44b20..8fd23569dcacb26c4f4fae3e70631373b24dcc40 100644 (file)
@@ -127,8 +127,6 @@ STG_LOCKER lock(&mutex, __FILE__, __LINE__);
 IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
 IBPP::Statement st = IBPP::StatementFactory(db, tr);
 
-int32_t id, i;
-
 try
     {
     tr->Start();
@@ -142,6 +140,7 @@ try
     printfd(__FILE__, "Tariff '%s' not found in database\n", tariffName.c_str());
     return -1;
     }
+    int32_t id;
     st->Get(1, id);
     st->Close();
     if (schemaVersion > 0)
@@ -180,7 +179,7 @@ try
     IBPP::Time tb;
     IBPP::Time te;
 
-    for(i = 0; i < DIR_NUM; i++)
+    for(int i = 0; i < DIR_NUM; i++)
         {
 
         tb.SetTime(td.dirPrice[i].hDay, td.dirPrice[i].mDay, 0);
index 8f64acdfa994036df9c23540fe6a3a1df3d25318..609c49ea17bf28fea35034247ca121dcb89e7850 100644 (file)
@@ -116,8 +116,7 @@ MYSQL_STORE_SETTINGS::MYSQL_STORE_SETTINGS()
       dbUser(),
       dbPass(),
       dbName(),
-      dbHost(),
-      schemaVersion(0)
+      dbHost()
 {
 }
 //-----------------------------------------------------------------------------
@@ -164,6 +163,7 @@ MYSQL_STORE::MYSQL_STORE()
       version("mysql_store v.0.67"),
       storeSettings(),
       settings(),
+      schemaVersion(0),
       logger(GetPluginLogger(GetStgLogger(), "store_mysql"))
 {
 }
index 81128c7a776a867dcf5f8f0f7d2c7c8d1b0c0d8c..d39c61db0a15a9d45be125b54bc22e36086f1425 100644 (file)
@@ -1,12 +1,12 @@
-#include <pthread.h>
+#include "stg_timer.h"
+
+#include "stg/common.h"
 
 #include <ctime>
 #include <cstring>
 #include <csignal>
 
-#include "stg/common.h"
-
-#include "stg_timer.h"
+#include <pthread.h>
 
 void * StgTimer(void *);
 
@@ -15,6 +15,7 @@ static pthread_t thrStgTimer;
 static bool isTimerRunning = false;
 volatile time_t stgTime;
 
+#ifdef STG_TIMER_DEBUG
 const int TIME_SPEED = 1;
 /*
  1  - 1x  speed
@@ -29,6 +30,7 @@ const int START_TIME = 0;
  1 - start before new day (3 min before)   29.11.2005 23:57:00
  2 - start before new month (3 min before) 30.11.2005 23:57:00
  */
+#endif
 
 //-----------------------------------------------------------------------------
 void * StgTimer(void *)