expanded on scoping test

expanded on scoping test

--- ScopeTest.cpp
+++ ScopeTest.cpp
@@ -9,3 +9,32 @@
   AutoGlobalContext global;
   EXPECT_TRUE(nullptr != global.get()) << "Failed to autowire the global context";
 }
+
+class A : public ContextMember {};
+class B : public ContextMember {};
+
+TEST_F(ScopeTest, VerifyInherit) {
+  AutoCurrentContext ctxt;
+
+  //Add a member to the current context
+  ctxt->Add<A>();
+
+  std::shared_ptr<CoreContext> pContext = ctxt->CreateAnonymous();
+  //Create and switch to a sub-context
+  {
+    CurrentContextPusher pusher;
+    pContext->SetCurrent();
+
+    EXPECT_TRUE(ctxt.get() != pContext.get()) << "Failed to create a sub-context";
+
+    //try and autowire a member from the parent context
+    Autowired<A> autoA;
+    EXPECT_FALSE(!autoA.get()) << "Autowired member not wired from parent context";
+
+    //add a member in the subcontext
+    pContext->Add<B>();
+  }
+
+  Autowired<B> autoB;
+  EXPECT_TRUE(!autoB.get()) << "Autowired member wired from sub-context";
+}


UC

UC

Former-commit-id: 2faffe2870a178d44e3ffc266ec26e0c6164c8f0

--- src/backend/benchmark/hyadapt/workload.cpp
+++ src/backend/benchmark/hyadapt/workload.cpp
@@ -168,11 +168,13 @@

   }

-  end = std::chrono::system_clock::now();
-  std::chrono::duration<double> elapsed_seconds = end-start;
-  double time_per_transaction = ((double)elapsed_seconds.count())/txn_count;
-
-  WriteOutput(time_per_transaction);
+  if(state.verbose == false) {
+    end = std::chrono::system_clock::now();
+    std::chrono::duration<double> elapsed_seconds = end-start;
+    double time_per_transaction = ((double)elapsed_seconds.count())/txn_count;
+
+    WriteOutput(time_per_transaction);
+  }
 }

 void RunDirectTest() {
@@ -671,6 +673,8 @@
   auto orig_tuple_count = state.scale_factor * state.tuples_per_tilegroup;
   auto bulk_insert_count = state.write_ratio * orig_tuple_count;

+  std::cout << "BI Count  :: " << bulk_insert_count << "\n";
+
   planner::InsertPlan insert_node(hyadapt_table, project_info, bulk_insert_count);
   executor::InsertExecutor insert_executor(&insert_node, context.get());


Adding the omp.h include

Adding the omp.h include

--- SearchLab.cpp
+++ SearchLab.cpp
@@ -6,6 +6,9 @@
 #include <cstdlib>
 #include <iomanip>

+#ifdef _OPENMP
+#include <omp.h>
+#endif

 // Point
 #include "point.h"


liteeditor: remove nav toolbar sep

liteeditor: remove nav toolbar sep

--- liteidex/src/plugins/liteeditor/liteeditor.cpp
+++ liteidex/src/plugins/liteeditor/liteeditor.cpp
@@ -849,13 +849,18 @@
         QStringList paths = QDir::fromNativeSeparators(info.filePath()).split("/");
         if (paths.size() >= 2) {
             QString head = "<style> a{text-decoration: none; color:darkgray;} </style>";
-            m_editNavHeadAct = m_editNavBar->addSeparator();
-            QString last = paths[0];
+            //m_editNavHeadAct = m_editNavBar->addSeparator();
+            QString last;
+#ifdef Q_OS_WIN
+            last = paths[0];
+#endif
             for (int i = 1; i < paths.size(); i++) {
                 QString name = paths[i];
+#ifdef Q_OS_WIN
                 if (i == 1) {
                     name = paths[0]+"\\"+paths[1];
                 }
+#endif
                 QString path = last+"/"+paths[i];
                 last = path;
                 if (i != paths.size()-1) {
@@ -867,6 +872,7 @@
                 m_editNavBar->addWidget(lbl);
                 connect(lbl,SIGNAL(linkActivated(QString)),this,SLOT(pathLinkActivated(QString)));
             }
+            m_editNavHeadAct = m_editNavBar->actions().first();
         }
     }
     QAction *emptyAct = new QAction(this);
@@ -1512,13 +1518,17 @@

     QToolBar *toolBar = new QToolBar(parent);
     toolBar->setIconSize(LiteApi::getToolBarIconSize(m_liteApp));
-    toolBar->addSeparator();
-    QString last = paths[0];
+    QString last;
+#ifdef Q_OS_WIN
+    last = paths[0];
+#endif
     for (int i = 1; i < paths.size(); i++) {
         QString name = paths[i];
-        if (i == 1 && paths[0].endsWith(":")) {
+#ifdef Q_OS_WIN
+        if (i == 1) {
             name = paths[0]+"\\"+paths[1];
         }
+#endif
         QString path = last+"/"+paths[i];
         last = path;
         if (i != paths.size()-1) {


Update default selectivitiy

Update default selectivitiy

Former-commit-id: 8f9ef3f9a7e18654fdf50ac9118554e53d519c27

--- src/backend/benchmark/hyadapt/workload.cpp
+++ src/backend/benchmark/hyadapt/workload.cpp
@@ -565,7 +565,7 @@

 void RunProjectivityExperiment() {

-  state.selectivity = 1.0;
+  state.selectivity = 0.1;

   // Go over all layouts
   for(auto layout : layouts) {


UC

UC

Former-commit-id: 4e0f260651b1421ac88b29e92fb7c9d8daf76412

--- src/backend/benchmark/hyadapt/workload.cpp
+++ src/backend/benchmark/hyadapt/workload.cpp
@@ -180,7 +180,7 @@
       WriteOutput(time_per_transaction);

       // Record sample
-      if(state.fsm == true) {
+      if(state.fsm == true && cost != 0) {
         hyadapt_table->RecordSample(sample);
       }

@@ -759,9 +759,8 @@
   /////////////////////////////////////////////////////////
   // COLLECT STATS
   /////////////////////////////////////////////////////////
-  double cost = 10;
-  column_ids.push_back(0);
-  auto columns_accessed = GetColumnsAccessed(column_ids);
+  double cost = 0;
+  std::vector<double> columns_accessed;

   ExecuteTest(executors, columns_accessed, cost);

@@ -829,9 +828,8 @@
   /////////////////////////////////////////////////////////
   // COLLECT STATS
   /////////////////////////////////////////////////////////
-  double cost = 10;
-  column_ids.push_back(0);
-  auto columns_accessed = GetColumnsAccessed(column_ids);
+  double cost = 0;
+  std::vector<double> columns_accessed;

   ExecuteTest(executors, columns_accessed, cost);

@@ -1181,7 +1179,7 @@
   state.operator_type = OPERATOR_TYPE_UPDATE;
   RunUpdateTest();

-  state.projectivity = 0.9;
+  state.projectivity = 0.3;
   state.operator_type = OPERATOR_TYPE_DIRECT;
   RunDirectTest();

@@ -1189,9 +1187,11 @@
   state.operator_type = OPERATOR_TYPE_UPDATE;
   RunUpdateTest();

-  state.projectivity = 0.06;
-  state.operator_type = OPERATOR_TYPE_DIRECT;
-  RunDirectTest();
+  state.write_ratio = 0.5;
+  state.operator_type = OPERATOR_TYPE_INSERT;
+  RunInsertTest();
+  state.write_ratio = 0.0;
+
 }

 std::vector<LayoutType> adapt_layouts = { LAYOUT_HYBRID, LAYOUT_ROW, LAYOUT_COLUMN};
@@ -1202,7 +1202,7 @@
   auto orig_transactions = state.transactions;
   std::thread transformer;

-  state.transactions = 50;
+  state.transactions = 40;

   state.write_ratio = 0.0;
   state.selectivity = 1.0;
@@ -1235,6 +1235,8 @@

     RunAdaptTest();

+    RunAdaptTest();
+
     // Stop transformer
     if(state.layout == LAYOUT_HYBRID) {
       state.fsm = false;


Parallize tpcc loader

Parallize tpcc loader

--- src/backend/benchmark/tpcc/tpcc_loader.cpp
+++ src/backend/benchmark/tpcc/tpcc_loader.cpp
@@ -23,6 +23,7 @@
 #include "backend/benchmark/tpcc/tpcc_configuration.h"
 #include "backend/catalog/manager.h"
 #include "backend/catalog/schema.h"
+#include "backend/common/timer.h"
 #include "backend/concurrency/transaction.h"
 #include "backend/concurrency/transaction_manager_factory.h"
 #include "backend/executor/abstract_executor.h"
@@ -112,7 +113,7 @@

 const int syllable_count = 10;
 const char *syllables[syllable_count] = {"BAR", "OUGHT", "ABLE", "PRI", "PRES",
-                           "ESES", "ANTI", "CALLY", "ATION", "EING"};
+    "ESES", "ANTI", "CALLY", "ATION", "EING"};

 NURandConstant nu_rand_const;
 /////////////////////////////////////////////////////////
@@ -270,8 +271,8 @@
   bool unique = true;

   index::IndexMetadata* index_metadata = new index::IndexMetadata(
-    "district_pkey", district_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);
+      "district_pkey", district_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);

@@ -327,8 +328,8 @@
   bool unique = true;

   index::IndexMetadata* index_metadata = new index::IndexMetadata(
-    "item_pkey", item_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);
+      "item_pkey", item_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   item_table->AddIndex(pkey_index);
@@ -436,8 +437,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "customer_pkey", customer_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);
+      "customer_pkey", customer_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   customer_table->AddIndex(pkey_index);
@@ -450,8 +451,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "customer_skey", customer_table_skey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);
+      "customer_skey", customer_table_skey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);

   index::Index *skey_index = index::IndexFactory::GetInstance(index_metadata);
   customer_table->AddIndex(skey_index);
@@ -593,8 +594,8 @@
   bool unique = true;

   index::IndexMetadata* index_metadata = new index::IndexMetadata(
-    "stock_pkey", stock_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);
+      "stock_pkey", stock_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   stock_table->AddIndex(pkey_index);
@@ -664,8 +665,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "orders_pkey", orders_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);
+      "orders_pkey", orders_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   orders_table->AddIndex(pkey_index);
@@ -676,8 +677,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "orders_skey", orders_table_skey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);
+      "orders_skey", orders_table_skey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);

   index::Index *skey_index = index::IndexFactory::GetInstance(index_metadata);
   orders_table->AddIndex(skey_index);
@@ -727,8 +728,8 @@
   bool unique = true;

   index::IndexMetadata* index_metadata = new index::IndexMetadata(
-    "new_order_pkey", new_order_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);
+      "new_order_pkey", new_order_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, unique);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   new_order_table->AddIndex(pkey_index);
@@ -804,8 +805,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "order_line_pkey", order_line_table_pkey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);
+      "order_line_pkey", order_line_table_pkey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_PRIMARY_KEY, tuple_schema, key_schema, true);

   index::Index *pkey_index = index::IndexFactory::GetInstance(index_metadata);
   order_line_table->AddIndex(pkey_index);
@@ -816,8 +817,8 @@
   key_schema->SetIndexedColumns(key_attrs);

   index_metadata = new index::IndexMetadata(
-    "order_line_skey", order_line_table_skey_index_oid, INDEX_TYPE_BTREE,
-    INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);
+      "order_line_skey", order_line_table_skey_index_oid, INDEX_TYPE_BTREE,
+      INDEX_CONSTRAINT_TYPE_INVALID, tuple_schema, key_schema, false);

   index::Index *skey_index = index::IndexFactory::GetInstance(index_metadata);
   order_line_table->AddIndex(skey_index);
@@ -1360,125 +1361,139 @@
   txn_manager.CommitTransaction();
 }

-void LoadWarehouses() {
+void LoadWarehouse(oid_t warehouse_itr) {
   auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
   std::unique_ptr<executor::ExecutorContext> context;

-  // WAREHOUSES
-  for (auto warehouse_itr = 0; warehouse_itr < state.warehouse_count; warehouse_itr++) {
-    std::unique_ptr<VarlenPool> pool(new VarlenPool(BACKEND_TYPE_MM));
-
+  std::unique_ptr<VarlenPool> pool(new VarlenPool(BACKEND_TYPE_MM));
+
+  auto txn = txn_manager.BeginTransaction();
+  context.reset(new executor::ExecutorContext(txn));
+
+  auto warehouse_tuple = BuildWarehouseTuple(warehouse_itr, pool);
+  planner::InsertPlan warehouse_node(warehouse_table, std::move(warehouse_tuple));
+  executor::InsertExecutor warehouse_executor(&warehouse_node, context.get());
+  warehouse_executor.Execute();
+
+  txn_manager.CommitTransaction();
+
+  // DISTRICTS
+  for (auto district_itr = 0; district_itr < state.districts_per_warehouse; district_itr++) {
     auto txn = txn_manager.BeginTransaction();
     context.reset(new executor::ExecutorContext(txn));

-    auto warehouse_tuple = BuildWarehouseTuple(warehouse_itr, pool);
-    planner::InsertPlan warehouse_node(warehouse_table, std::move(warehouse_tuple));
-    executor::InsertExecutor warehouse_executor(&warehouse_node, context.get());
-    warehouse_executor.Execute();
+    auto district_tuple = BuildDistrictTuple(district_itr, warehouse_itr, pool);
+    planner::InsertPlan district_node(district_table, std::move(district_tuple));
+    executor::InsertExecutor district_executor(&district_node, context.get());
+    district_executor.Execute();

     txn_manager.CommitTransaction();

-    // DISTRICTS
-    for (auto district_itr = 0; district_itr < state.districts_per_warehouse; district_itr++) {
+    // CUSTOMERS
+    for (auto customer_itr = 0; customer_itr < state.customers_per_district; customer_itr++) {
       auto txn = txn_manager.BeginTransaction();
       context.reset(new executor::ExecutorContext(txn));

-      auto district_tuple = BuildDistrictTuple(district_itr, warehouse_itr, pool);
-      planner::InsertPlan district_node(district_table, std::move(district_tuple));
-      executor::InsertExecutor district_executor(&district_node, context.get());
-      district_executor.Execute();
+      auto customer_tuple = BuildCustomerTuple(customer_itr, district_itr, warehouse_itr, pool);
+      planner::InsertPlan customer_node(customer_table, std::move(customer_tuple));
+      executor::InsertExecutor customer_executor(&customer_node, context.get());
+      customer_executor.Execute();
+
+      // HISTORY
+
+      int history_district_id = district_itr;
+      int history_warehouse_id = warehouse_itr;
+      auto history_tuple = BuildHistoryTuple(customer_itr, district_itr, warehouse_itr,
+                                             history_district_id, history_warehouse_id, pool);
+      planner::InsertPlan history_node(history_table, std::move(history_tuple));
+      executor::InsertExecutor history_executor(&history_node, context.get());
+      history_executor.Execute();

       txn_manager.CommitTransaction();

-      // CUSTOMERS
-      for (auto customer_itr = 0; customer_itr < state.customers_per_district; customer_itr++) {
-        auto txn = txn_manager.BeginTransaction();
-        context.reset(new executor::ExecutorContext(txn));
-
-        auto customer_tuple = BuildCustomerTuple(customer_itr, district_itr, warehouse_itr, pool);
-        planner::InsertPlan customer_node(customer_table, std::move(customer_tuple));
-        executor::InsertExecutor customer_executor(&customer_node, context.get());
-        customer_executor.Execute();
-
-        // HISTORY
-
-        int history_district_id = district_itr;
-        int history_warehouse_id = warehouse_itr;
-        auto history_tuple = BuildHistoryTuple(customer_itr, district_itr, warehouse_itr,
-                                               history_district_id, history_warehouse_id, pool);
-        planner::InsertPlan history_node(history_table, std::move(history_tuple));
-        executor::InsertExecutor history_executor(&history_node, context.get());
-        history_executor.Execute();
-
-        txn_manager.CommitTransaction();
-
-      } // END CUSTOMERS
-
-
-      // ORDERS
-      for(auto orders_itr = 0; orders_itr < state.customers_per_district; orders_itr++) {
-        auto txn = txn_manager.BeginTransaction();
-        context.reset(new executor::ExecutorContext(txn));
-
-        // New order ?
-        auto new_order_threshold = state.customers_per_district-new_orders_per_district;
-        bool new_order = (orders_itr > new_order_threshold);
-        auto o_ol_cnt = GetRandomInteger(orders_min_ol_cnt, orders_max_ol_cnt);
-
-        auto orders_tuple = BuildOrdersTuple(orders_itr, district_itr, warehouse_itr,
-                                             new_order, o_ol_cnt);
-        planner::InsertPlan orders_node(orders_table, std::move(orders_tuple));
-        executor::InsertExecutor orders_executor(&orders_node, context.get());
-        orders_executor.Execute();
-
-        // NEW_ORDER
-        if(new_order){
-          auto new_order_tuple = BuildNewOrderTuple(orders_itr, district_itr, warehouse_itr);
-          planner::InsertPlan new_order_node(new_order_table, std::move(new_order_tuple));
-          executor::InsertExecutor new_order_executor(&new_order_node, context.get());
-          new_order_executor.Execute();
-        }
-
-        // ORDER_LINE
-        for (auto order_line_itr = 0; order_line_itr < o_ol_cnt; order_line_itr++) {
-
-          int ol_supply_w_id = warehouse_itr;
-          auto order_line_tuple = BuildOrderLineTuple(orders_itr, district_itr, warehouse_itr,
-                                                      order_line_itr, ol_supply_w_id, new_order, pool);
-          planner::InsertPlan order_line_node(order_line_table, std::move(order_line_tuple));
-          executor::InsertExecutor order_line_executor(&order_line_node, context.get());
-          order_line_executor.Execute();
-        }
-
-        txn_manager.CommitTransaction();
-
-      }
-
-    } // END DISTRICTS
-
-    // STOCK
-    for(auto stock_itr = 0; stock_itr < state.item_count; stock_itr++) {
+    } // END CUSTOMERS
+
+
+    // ORDERS
+    for(auto orders_itr = 0; orders_itr < state.customers_per_district; orders_itr++) {
       auto txn = txn_manager.BeginTransaction();
       context.reset(new executor::ExecutorContext(txn));

-      int s_w_id = warehouse_itr;
-      auto stock_tuple = BuildStockTuple(stock_itr, s_w_id, pool);
-      planner::InsertPlan stock_node(stock_table, std::move(stock_tuple));
-      executor::InsertExecutor stock_executor(&stock_node, context.get());
-      stock_executor.Execute();
+      // New order ?
+      auto new_order_threshold = state.customers_per_district-new_orders_per_district;
+      bool new_order = (orders_itr > new_order_threshold);
+      auto o_ol_cnt = GetRandomInteger(orders_min_ol_cnt, orders_max_ol_cnt);
+
+      auto orders_tuple = BuildOrdersTuple(orders_itr, district_itr, warehouse_itr,
+                                           new_order, o_ol_cnt);
+      planner::InsertPlan orders_node(orders_table, std::move(orders_tuple));
+      executor::InsertExecutor orders_executor(&orders_node, context.get());
+      orders_executor.Execute();
+
+      // NEW_ORDER
+      if(new_order){
+        auto new_order_tuple = BuildNewOrderTuple(orders_itr, district_itr, warehouse_itr);
+        planner::InsertPlan new_order_node(new_order_table, std::move(new_order_tuple));
+        executor::InsertExecutor new_order_executor(&new_order_node, context.get());
+        new_order_executor.Execute();
+      }
+
+      // ORDER_LINE
+      for (auto order_line_itr = 0; order_line_itr < o_ol_cnt; order_line_itr++) {
+
+        int ol_supply_w_id = warehouse_itr;
+        auto order_line_tuple = BuildOrderLineTuple(orders_itr, district_itr, warehouse_itr,
+                                                    order_line_itr, ol_supply_w_id, new_order, pool);
+        planner::InsertPlan order_line_node(order_line_table, std::move(order_line_tuple));
+        executor::InsertExecutor order_line_executor(&order_line_node, context.get());
+        order_line_executor.Execute();
+      }

       txn_manager.CommitTransaction();
+
     }

-  } // END WAREHOUSES
+  } // END DISTRICTS
+
+  // STOCK
+  for(auto stock_itr = 0; stock_itr < state.item_count; stock_itr++) {
+    auto txn = txn_manager.BeginTransaction();
+    context.reset(new executor::ExecutorContext(txn));
+
+    int s_w_id = warehouse_itr;
+    auto stock_tuple = BuildStockTuple(stock_itr, s_w_id, pool);
+    planner::InsertPlan stock_node(stock_table, std::move(stock_tuple));
+    executor::InsertExecutor stock_executor(&stock_node, context.get());
+    stock_executor.Execute();
+
+    txn_manager.CommitTransaction();
+  }

 }

 void LoadTPCCDatabase() {

+  std::vector<std::thread> thread_group;
+
+  Timer<> timer;
+  timer.Start();
+
   LoadItems();

-  LoadWarehouses();
+  // Launch a group of threads
+  for (auto thread_itr = 0; thread_itr < state.warehouse_count; ++thread_itr) {
+    thread_group.push_back(std::move(std::thread(LoadWarehouse, thread_itr)));
+  }
+
+  // Join the threads with the main thread
+  for (auto thread_itr = 0; thread_itr < state.warehouse_count; ++thread_itr) {
+    thread_group[thread_itr].join();
+  }
+
+  timer.Stop();
+
+  auto loading_time = timer.GetDuration();
+  LOG_INFO("loading_time = %lf", loading_time);

   LOG_INFO("warehouse count = %lf", warehouse_table->GetNumberOfTuples());
   LOG_INFO("district count  = %lf", district_table->GetNumberOfTuples());


ChannelizerBase: Fix memory leak

ChannelizerBase: Fix memory leak

The memory leak was reported by ASan:

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f23b488e459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x558e83e39e3c in ChannelizerBase::initFilters() /osmo-trx/Transceiver52M/ChannelizerBase.cpp:84
    #2 0x558e83e3a8a0 in ChannelizerBase::init() /osmo-trx/Transceiver52M/ChannelizerBase.cpp:188
    #3 0x558e83e2d263 in RadioInterfaceMulti::init(int) /osmo-trx/Transceiver52M/radioInterfaceMulti.cpp:197
    #4 0x558e83de76d2 in makeRadioInterface(trx_ctx*, RadioDevice*, int) /osmo-trx/Transceiver52M/osmo-trx.cpp:115
    #5 0x558e83dea663 in trx_start /osmo-trx/Transceiver52M/osmo-trx.cpp:600
    #6 0x558e83dead6f in main /osmo-trx/Transceiver52M/osmo-trx.cpp:695
    #7 0x7f23b2576151 in __libc_start_main (/usr/lib/libc.so.6+0x28151)

Change-Id: Ibc4c7edeb9bba517db08fce152d863e6cc0c7bbb

--- Transceiver52M/ChannelizerBase.cpp
+++ Transceiver52M/ChannelizerBase.cpp
@@ -244,6 +244,7 @@
 		free(subFilters[i]);
 		delete[] hist[i];
 	}
+	free(subFilters);

 	fft_free(fftInput);
 	fft_free(fftOutput);


Add copyright to scheme.cpp

Add copyright to scheme.cpp

--- scheme.cpp
+++ scheme.cpp
@@ -1,3 +1,28 @@
+/*
+Copyright (c) 2015, Aaditya Kalsi
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
 /**
  * \file scheme.cpp
  * \date 2015


Register stat callbacks after rate observer is registered.

Currently the stats callback is registered too early.
For now we ignore media transport for these callbacks (it was ignored
already), and we will introduce changes to media transport in the
future.

Bug: webrtc:9719
Bug: chromium:906998
Bug: chromium:906533
Change-Id: I24c0265d46ec2eb35743de6cd96a11d8c41fefbe
Reviewed-on: https://webrtc-review.googlesource.com/c/114904
Reviewed-by: Sebastian Jansson <c24d1bc144eb7c11e553f59153fa17dba85ca83e@webrtc.org>
Commit-Queue: Peter Slatala <7380603cea218c08053abc8e2257a75ccb7371d4@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#26062}

--- call/call.cc
+++ call/call.cc
@@ -455,15 +455,6 @@
   RTC_DCHECK(config.event_log != nullptr);
   transport_send_ = std::move(transport_send);
   transport_send_ptr_ = transport_send_.get();
-
-  call_stats_->RegisterStatsObserver(&receive_side_cc_);
-  call_stats_->RegisterStatsObserver(transport_send_->GetCallStatsObserver());
-
-  module_process_thread_->RegisterModule(
-      receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
-  module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
-  module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE);
-  module_process_thread_->Start();
 }

 Call::~Call() {
@@ -475,13 +466,16 @@
   RTC_CHECK(audio_receive_streams_.empty());
   RTC_CHECK(video_receive_streams_.empty());

-  module_process_thread_->DeRegisterModule(
-      receive_side_cc_.GetRemoteBitrateEstimator(true));
-  module_process_thread_->DeRegisterModule(&receive_side_cc_);
-  module_process_thread_->DeRegisterModule(call_stats_.get());
-  module_process_thread_->Stop();
-  call_stats_->DeregisterStatsObserver(&receive_side_cc_);
-  call_stats_->DeregisterStatsObserver(transport_send_->GetCallStatsObserver());
+  if (!media_transport_) {
+    module_process_thread_->DeRegisterModule(
+        receive_side_cc_.GetRemoteBitrateEstimator(true));
+    module_process_thread_->DeRegisterModule(&receive_side_cc_);
+    module_process_thread_->DeRegisterModule(call_stats_.get());
+    module_process_thread_->Stop();
+    call_stats_->DeregisterStatsObserver(&receive_side_cc_);
+    call_stats_->DeregisterStatsObserver(
+        transport_send_->GetCallStatsObserver());
+  }

   int64_t first_sent_packet_ms = transport_send_->GetFirstPacketTimeMs();
   // Only update histograms after process threads have been shut down, so that
@@ -504,9 +498,21 @@
   is_target_rate_observer_registered_ = true;

   if (media_transport_) {
+    // TODO(bugs.webrtc.org/9719): We should report call_stats_ from
+    // media transport (at least Rtt). We should extend media transport
+    // interface to include "receive_side bwe" if needed.
     media_transport_->AddTargetTransferRateObserver(this);
   } else {
     transport_send_ptr_->RegisterTargetTransferRateObserver(this);
+
+    call_stats_->RegisterStatsObserver(&receive_side_cc_);
+    call_stats_->RegisterStatsObserver(transport_send_->GetCallStatsObserver());
+
+    module_process_thread_->RegisterModule(
+        receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
+    module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
+    module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE);
+    module_process_thread_->Start();
   }
 }

@@ -695,6 +701,7 @@
     const webrtc::AudioReceiveStream::Config& config) {
   TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream");
   RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_);
+  RegisterRateObserver();
   event_log_->Log(absl::make_unique<RtcEventAudioReceiveStreamConfig>(
       CreateRtcLogStreamConfig(config)));
   AudioReceiveStream* receive_stream = new AudioReceiveStream(
@@ -848,6 +855,8 @@
     webrtc::VideoReceiveStream::Config configuration) {
   TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream");
   RTC_DCHECK_CALLED_SEQUENTIALLY(&configuration_sequence_checker_);
+
+  RegisterRateObserver();

   VideoReceiveStream* receive_stream = new VideoReceiveStream(
       &video_receiver_controller_, num_cpu_cores_,


Remove illegal dependency: zorbautils/thread.h

--- doc/cxx/examples/debugger.cpp
+++ doc/cxx/examples/debugger.cpp
@@ -20,11 +20,16 @@
 #include <zorba/debugger_client.h>
 #include <zorba/debugger_default_event_handler.h>
 #include <simplestore/simplestore.h>
-#include <zorbautils/thread.h>
 #include <zorbaerrors/errors.h>
 #ifdef WIN32
 #include <windows.h>
 #define sleep(s) Sleep(s*1000)
+#endif
+#ifdef ZORBA_HAVE_PTHREAD_H
+#include <pthread.h>
+#define ZORBA_THREAD_RETURN void *
+#else
+#define ZORBA_THREAD_RETURN DWORD WINAPI
 #endif

 using namespace zorba;
@@ -125,19 +130,47 @@
   Zorba *lZorba = Zorba::getInstance( lStore );
   bool res = false;
   {
-    Thread lThread(runClient, 0);
+#ifdef ZORBA_HAVE_PTHREAD_H
+    pthread_t lThread;
+    if ( pthread_create( &lThread, 0, runClient, 0 ) != 0 )
+#else
+    HANDLE lThread;
+    if ( ( lThread = CreateThread(0, 0, runClient, 0, 0, 0) ) == 0 )
+#endif
+    {
+      std::cerr << "Couldn't start the thread" << std::endl;
+      return 1;
+    }
     std::cout << "executing example 1" << std::endl;
     res = debugger_example_1(lZorba);
-    lThread.join();
+#ifdef ZORBA_HAVE_PTHREAD_H
+    pthread_join( lThread, 0 );
+#else
+    WaitForSingleObject( lThread, INFINITE );
+#endif
     if ( !res ) return 1;
     std::cout << std::endl;
   }

   {
-    Thread lThread(runClient, 0);
     std::cout << "executing example 2" << std::endl;
+#ifdef ZORBA_HAVE_PTHREAD_H
+    pthread_t lThread;
+    if ( pthread_create( &lThread, 0, runClient, 0 ) != 0 )
+#else
+    HANDLE lThread;
+    if ( ( lThread = CreateThread(0, 0, runClient, 0, 0, 0) ) == 0 )
+#endif
+    {
+      std::cerr << "Couldn't start the thread" << std::endl;
+      return 1;
+    }
     res = debugger_example_2(lZorba);
-    lThread.join();
+#ifdef ZORBA_HAVE_PTHREAD_H
+    pthread_join( lThread, 0 );
+#else
+    WaitForSingleObject( lThread, INFINITE );
+#endif
     if ( !res ) return 1;
     std::cout << std::endl;
   }


fixed a warning

fixed a warning

--- doc/cxx/examples/debugger.cpp
+++ doc/cxx/examples/debugger.cpp
@@ -109,7 +109,7 @@
     lQuery->compile("1+2");
     lQuery->debug();
     lQuery->close();
-  } catch( ZorbaException &e ) {
+  } catch( ZorbaException & ) {
     return true;
   }
   return false;


Force frame timestamp.

Force frame timestamp.

--- plugins/mmstd_volume/src/DifferenceVolume.cpp
+++ plugins/mmstd_volume/src/DifferenceVolume.cpp
@@ -172,6 +172,8 @@

     /* Retrieve info about incoming data and pass it on to the caller. */
     *src = *dst;
+    src->SetFrameID(dst->FrameID(), true);  // Use the force!
+    assert(src->IsFrameForced());
     if (!VolumetricDataCall::GetMetadata(*src)) {
         return false;
     }
@@ -218,6 +220,9 @@

     /* If the data we have need an update, compute it. */
     if (this->frameID != src->FrameID()) {
+        Log::DefaultLog.WriteInfo(L"%hs is rebuilding the volume.",
+            DifferenceVolume::ClassName());
+
         if (!VolumetricDataCall::GetMetadata(*src)) {
             return false;
         }
@@ -258,7 +263,7 @@
             /* We do not have the previous frame cached, so get it. */
             Log::DefaultLog.WriteInfo(L"Load previous frame %u to compute the "
                 L"difference to the current one.", src->FrameID() - 1);
-            src->SetFrameID(src->FrameID() - 1);
+            src->SetFrameID(src->FrameID() - 1, true);
             if (!VolumetricDataCall::GetMetadata(*src)) {
                 return false;
             }
@@ -268,6 +273,7 @@
                 return false;
             }

+            assert(src->IsFrameForced());
             if (!(*src)(VolumetricDataCall::IDX_GET_DATA)) {
                 Log::DefaultLog.WriteError(L"%hs failed to call %hs.",
                     DifferenceVolume::ClassName(),


iterate over connected serial devices(YEI trackers) and register them

--- plugins/multiserver/DevicesWithParameters.cpp
+++ plugins/multiserver/DevicesWithParameters.cpp
@@ -26,7 +26,7 @@
 #include "DevicesWithParameters.h"
 #include "GetSerialPortState.h"
 #include <osvr/VRPNServer/VRPNDeviceRegistration.h>
-#include <osvr/USBSerial/USBSerial.h>
+#include <osvr/USBSerial/USBSerialEnum.h>

 // Library/third-party includes
 #include <json/reader.h>
@@ -84,28 +84,31 @@
         throw std::runtime_error("Could not parse configuration: " +
                                  reader.getFormattedErrorMessages());
     }
+	uint16_t vID = 0x9AC;
+	uint16_t pID = 0x3F2;
+	for (auto dev : osvr::usbserial::Enumerator(vID, pID)){

-    osvr::usbserial::USBSerialDevice serialDevice(root["vendorID"].asString(),
-                                                  root["productID"].asString());
+		std::string port = normalizeAndVerifySerialPort(dev->getPort());

-    std::string port = normalizeAndVerifySerialPort(serialDevice.getPort());
-    bool calibrate_gyros_on_setup =
-        root.get("calibrateGyrosOnSetup", false).asBool();
-    bool tare_on_setup = root.get("tareOnSetup", false).asBool();
-    double frames_per_second = root.get("framesPerSecond", 250).asFloat();
+		bool calibrate_gyros_on_setup =
+			root.get("calibrateGyrosOnSetup", false).asBool();
+		bool tare_on_setup = root.get("tareOnSetup", false).asBool();
+		double frames_per_second = root.get("framesPerSecond", 250).asFloat();

-    Json::Value commands = root.get("resetCommands", Json::arrayValue);
-    CStringArray reset_commands;
+		Json::Value commands = root.get("resetCommands", Json::arrayValue);
+		CStringArray reset_commands;

-    for (Json::ArrayIndex i = 0, e = commands.size(); i < e; ++i) {
-        reset_commands.push_back(commands[i].asString());
-    }
+		for (Json::ArrayIndex i = 0, e = commands.size(); i < e; ++i) {
+			reset_commands.push_back(commands[i].asString());
+		}

-    osvr::vrpnserver::VRPNDeviceRegistration reg(ctx);
+		osvr::vrpnserver::VRPNDeviceRegistration reg(ctx);

-    reg.registerDevice(new vrpn_YEI_3Space_Sensor(
-        reg.useDecoratedName(data.getName("YEI_3Space_Sensor")).c_str(),
-        reg.getVRPNConnection(), port.c_str(), 115200, calibrate_gyros_on_setup,
-        tare_on_setup, frames_per_second, 0, 0, 1, 0,
-        reset_commands.get_array()));
+		reg.registerDevice(new vrpn_YEI_3Space_Sensor(
+			reg.useDecoratedName(data.getName("YEI_3Space_Sensor")).c_str(),
+			reg.getVRPNConnection(), port.c_str(), 115200, calibrate_gyros_on_setup,
+			tare_on_setup, frames_per_second, 0, 0, 1, 0,
+			reset_commands.get_array()));
+	}
+
 }


lxqt-config-appearance: mkpath if settings of GTK doesn't exists.

--- lxqt-config-appearance/configothertoolkits.cpp
+++ lxqt-config-appearance/configothertoolkits.cpp
@@ -212,6 +212,10 @@
     path = _get_config_path(path);

     QFile file(path);
+    if(! file.exists()) {
+        QFileInfo fileInfo(file);
+        QDir::home().mkpath(fileInfo.path());
+    }
     if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
         return;
     }


Make constants const.

Make constants const.

--- plugins/multiserver/DevicesWithParameters.cpp
+++ plugins/multiserver/DevicesWithParameters.cpp
@@ -84,8 +84,8 @@
         throw std::runtime_error("Could not parse configuration: " +
                                  reader.getFormattedErrorMessages());
     }
-    uint16_t vID = 0x9AC;
-    uint16_t pID = 0x3F2;
+    static const uint16_t vID = 0x9AC;
+    static const uint16_t pID = 0x3F2;
     for (auto dev : osvr::usbserial::Enumerator(vID, pID)) {

         std::string port = normalizeAndVerifySerialPort(dev->getPort());


[index] Avoid using a RecursiveASTVisitor for SyntacticFormIndexer and iterate the DesignatedInitExprs of the InitListExpr directly.

This is more efficient, as per feedback by Richard.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@285666 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Index/IndexBody.cpp
+++ lib/Index/IndexBody.cpp
@@ -293,48 +293,6 @@
   // Also visit things that are in the syntactic form but not the semantic one,
   // for example the indices in DesignatedInitExprs.
   bool TraverseInitListExpr(InitListExpr *S, DataRecursionQueue *Q = nullptr) {
-
-    class SyntacticFormIndexer :
-              public RecursiveASTVisitor<SyntacticFormIndexer> {
-      IndexingContext &IndexCtx;
-      const NamedDecl *Parent;
-      const DeclContext *ParentDC;
-      bool Visited = false;
-
-    public:
-      SyntacticFormIndexer(IndexingContext &indexCtx,
-                            const NamedDecl *Parent, const DeclContext *DC)
-        : IndexCtx(indexCtx), Parent(Parent), ParentDC(DC) { }
-
-      bool shouldWalkTypesOfTypeLocs() const { return false; }
-
-      bool TraverseInitListExpr(InitListExpr *S, DataRecursionQueue *Q = nullptr) {
-        // Don't visit nested InitListExprs, this visitor will be called again
-        // later on for the nested ones.
-        if (Visited)
-          return true;
-        Visited = true;
-        InitListExpr *SyntaxForm = S->isSemanticForm() ? S->getSyntacticForm() : S;
-        if (SyntaxForm) {
-          for (Stmt *SubStmt : SyntaxForm->children()) {
-            if (!TraverseStmt(SubStmt, Q))
-              return false;
-          }
-        }
-        return true;
-      }
-
-      bool VisitDesignatedInitExpr(DesignatedInitExpr *E) {
-        for (DesignatedInitExpr::Designator &D : llvm::reverse(E->designators())) {
-          if (D.isFieldDesignator())
-            return IndexCtx.handleReference(D.getField(), D.getFieldLoc(),
-                                            Parent, ParentDC, SymbolRoleSet(),
-                                            {}, E);
-        }
-        return true;
-      }
-    };
-
     auto visitForm = [&](InitListExpr *Form) {
       for (Stmt *SubStmt : Form->children()) {
         if (!TraverseStmt(SubStmt, Q))
@@ -343,13 +301,26 @@
       return true;
     };

+    auto visitSyntacticDesignatedInitExpr = [&](DesignatedInitExpr *E) -> bool {
+      for (DesignatedInitExpr::Designator &D : llvm::reverse(E->designators())) {
+        if (D.isFieldDesignator())
+          return IndexCtx.handleReference(D.getField(), D.getFieldLoc(),
+                                          Parent, ParentDC, SymbolRoleSet(),
+                                          {}, E);
+      }
+      return true;
+    };
+
     InitListExpr *SemaForm = S->isSemanticForm() ? S : S->getSemanticForm();
     InitListExpr *SyntaxForm = S->isSemanticForm() ? S->getSyntacticForm() : S;

     if (SemaForm) {
       // Visit things present in syntactic form but not the semantic form.
       if (SyntaxForm) {
-        SyntacticFormIndexer(IndexCtx, Parent, ParentDC).TraverseStmt(SyntaxForm);
+        for (Expr *init : SyntaxForm->inits()) {
+          if (auto *DIE = dyn_cast<DesignatedInitExpr>(init))
+            visitSyntacticDesignatedInitExpr(DIE);
+        }
       }
       return visitForm(SemaForm);
     }


Make ReplayPoseDevice rate 1KHz by default

--- SurgSim/Devices/ReplayPoseDevice/ReplayPoseDevice.cpp
+++ SurgSim/Devices/ReplayPoseDevice/ReplayPoseDevice.cpp
@@ -27,7 +27,8 @@

 ReplayPoseDevice::ReplayPoseDevice(const std::string& uniqueName) :
 	SurgSim::Input::CommonDevice(uniqueName, ReplayPoseScaffold::buildDeviceInputData()),
-	m_fileName("ReplayPoseDevice.txt")
+	m_fileName("ReplayPoseDevice.txt"),
+	m_rate(1000.0)
 {
 }


Add reciprocal test

Add reciprocal test

--- tile/lang/tile_cc_test.cc
+++ tile/lang/tile_cc_test.cc
@@ -581,6 +581,21 @@
 )"));
 }

+TEST(TileCC, Reciprocal) {
+  Tensor A("A", tile::SimpleShape(tile::DataType::FLOAT32, {10}));
+  auto program = to_string(Evaluate("reciprocal", {1 / A}).program);
+  IVLOG(1, program);
+  EXPECT_THAT(program, Eq(R"(function (
+  A[A_0]
+) -> (
+  _X1
+) {
+  _X0 = 1;
+  _X1 = div(_X0, A);
+}
+)"));
+}
+
 }  // namespace
 }  // namespace lang
 }  // namespace tile


Initialize the graphics meshes with correct scale.

--- SurgSim/Physics/RenderTests/RenderTestRigidBodies.cpp
+++ SurgSim/Physics/RenderTests/RenderTestRigidBodies.cpp
@@ -20,6 +20,7 @@
 #include "SurgSim/DataStructures/TriangleMeshBase.h"
 #include "SurgSim/Framework/ApplicationData.h"
 #include "SurgSim/Framework/BasicSceneElement.h"
+#include "SurgSim/Graphics/Mesh.h"
 #include "SurgSim/Graphics/OsgBoxRepresentation.h"
 #include "SurgSim/Graphics/OsgMeshRepresentation.h"
 #include "SurgSim/Graphics/OsgPlaneRepresentation.h"
@@ -176,7 +177,7 @@
 	// Graphic representation of the physics model
 	std::shared_ptr<OsgMeshRepresentation> osgRepresentation =
 		std::make_shared<OsgMeshRepresentation>("OsgRepresentation");
-	osgRepresentation->setFilename(foundFilename);
+	*osgRepresentation->getMesh() = *(std::make_shared<SurgSim::Graphics::Mesh>(*mesh));
 	osgRepresentation->setDrawAsWireFrame(true);

 	std::shared_ptr<BasicSceneElement> sceneElement = std::make_shared<BasicSceneElement>(name);


simplify marker code

simplify marker code

--- tksao/frame/basepolygon.C
+++ tksao/frame/basepolygon.C
@@ -220,43 +220,29 @@
 			   Coord::SkyFormat format)
 {
   Matrix mm = fwdMatrix();
-  switch (sys) {
-  case Coord::IMAGE:
-  case Coord::PHYSICAL:
-  case Coord::DETECTOR:
-  case Coord::AMPLIFIER:
-    {
-      str << type_ << '(';
-      int first=1;
-      vertex.head();
-      do {
-	if (!first)
-	  str << ',';
-	first=0;
-
-	Vector vv = ptr->mapFromRef(vertex.current()->vector*mm,sys);
-	str << setprecision(parent->precLinear_) << vv;
-      }
-      while (vertex.next());
-      str << ')';
-    }
-    break;
-  default:
-    {
-      str << type_ << '(';
-      int first=1;
-      vertex.head();
-      do {
-	if (!first)
-	  str << ',';
-	first=0;
-
-	listWCS(ptr,vertex.current()->vector*mm,sys,sky,format);
-	str << ra << ',' << dec;
-      }
-      while (vertex.next());
-      str << ')';
-    }
-  }
-}
-
+
+  str << type_ << '(';
+  int first=1;
+  vertex.head();
+  do {
+    if (!first)
+      str << ',';
+    first=0;
+
+    Vector vv = vertex.current()->vector*mm;
+    switch (sys) {
+    case Coord::IMAGE:
+    case Coord::PHYSICAL:
+    case Coord::DETECTOR:
+    case Coord::AMPLIFIER:
+      str << setprecision(parent->precLinear_) << ptr->mapFromRef(vv,sys);
+      break;
+    default:
+      listWCS(ptr,vv,sys,sky,format);
+      str << ra << ',' << dec;
+      break;
+    }
+  } while (vertex.next());
+  str << ')';
+}
+


Fix kmicro deleted twice[548321]

Fix kmicro deleted twice[548321]

--- TTKCore/musicToolsSetsKits/musicsoundkmicrowidget.cpp
+++ TTKCore/musicToolsSetsKits/musicsoundkmicrowidget.cpp
@@ -33,8 +33,8 @@
 #if defined MUSIC_GREATER_NEW
     setAttribute(Qt::WA_TranslucentBackground, false);
 #endif
-    setAttribute(Qt::WA_DeleteOnClose, true);
-    setAttribute(Qt::WA_QuitOnClose, true);
+//    setAttribute(Qt::WA_DeleteOnClose, true);
+//    setAttribute(Qt::WA_QuitOnClose, true);

     m_ui->topTitleCloseButton->setIcon(QIcon(":/functions/btn_close_hover"));
     m_ui->topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle04);


Fix up local changes after r349125

Fix up local changes after r349125

warn_attribute_type_not_supported needs the Sema diag header.

rdar://problem/46720351

--- lib/Parse/ParseDecl.cpp
+++ lib/Parse/ParseDecl.cpp
@@ -24,6 +24,7 @@
 #include "clang/Sema/Lookup.h"
 #include "clang/Sema/ParsedTemplate.h"
 #include "clang/Sema/Scope.h"
+#include "clang/Sema/SemaDiagnostic.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallString.h"


Fixed bug: name of window in CreateWindow must match the one in RegisterClass

Signed-off-by: eddie.cohen <1e537d25673622e1d4539f671eae90e034ae76b3@primesense.com>

--- ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp
+++ ThirdParty/PSCommon/XnLib/Source/Win32/XnUSBWin32.cpp
@@ -62,7 +62,10 @@
 //---------------------------------------------------------------------------
 DWORD __stdcall DevDetectThread(LPVOID Arg)
 {
-	g_xnUsbhDevDetectWnd = CreateWindow("xnUsbDeviceDetector", "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+	char className[MAX_PATH];
+	sprintf_s(className, "xnUsbDeviceDetector%x", &g_xnUsbhModule);
+
+	g_xnUsbhDevDetectWnd = CreateWindow(className, "", WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);

 	SetEvent((HANDLE)Arg);


delete dead code

delete dead code

--- SNAPLib/FASTQ.cpp
+++ SNAPLib/FASTQ.cpp
@@ -390,21 +390,6 @@
         return false;
     }
     bytesConsumed += FASTQReader::getReadFromBuffer(buffer + bytesConsumed, validBytes - bytesConsumed, read1, fileName, data, context);
-
-#if 0   // We don't rely on this read ID format anymore since it's non-standard.  We stopped using the seeking version of PairedInterleavedFATSQ reader for that reason.
-    //
-    // Validate the Read IDs.
-    //
-    if (read0->getIdLength() < 2 || memcmp(read0->getId() + read0->getIdLength() - 2, "/1", 2)) {
-        WriteErrorMessage("PairedInterleavedFASTQReader: first read of batch doesn't have ID ending with /1: '%.*s'\n", read0->getIdLength(), read0->getId());
-        soft_exit(1);
-    }
-
-    if (read1->getIdLength() < 2 || memcmp(read1->getId() + read1->getIdLength() - 2, "/2", 2)) {
-        WriteErrorMessage("PairedInterleavedFASTQReader: second read of batch doesn't have ID ending with /2: '%.*s'\n", read1->getIdLength(), read1->getId());
-        soft_exit(1);
-    }
-#endif // 0

     data->advance(bytesConsumed);
     return true;


Added files via upload

Added files via upload

--- SmartCOM3.cpp
+++ SmartCOM3.cpp
@@ -13,19 +13,16 @@

 	STDMETHODIMP_(ULONG) IStClient::AddRef(void)
 	{
-		//printf("AddRef\n");
 		return InterlockedIncrement(&m_cRef);
 	}
 	STDMETHODIMP_(ULONG) IStClient::Release(void)
 	{
-		//printf("Release\n");
 		LONG cRef = InterlockedDecrement(&m_cRef);
 		if (cRef == 0) delete this;
 		return cRef;
 	}
 	STDMETHODIMP IStClient::QueryInterface(REFIID iid, void ** ppv)
 	{
-		//printf("QueryInterface\n");
 		*ppv = nullptr;
 		HRESULT hr = E_NOINTERFACE;

@@ -43,14 +40,12 @@

 	STDMETHODIMP IStClient::GetTypeInfoCount(UINT *pctinfo)
 	{
-		//printf("GetTypeInfoCount\n");
 		if (pctinfo == NULL) return E_NOTIMPL;
 		*pctinfo = 1;
 		return NOERROR;
 	}
 	STDMETHODIMP IStClient::GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo ** pptinfo)
 	{
-		//printf("GetTypeInfo\n");
 		if (pptinfo == NULL) return E_INVALIDARG;
 		if (itinfo != 0) return DISP_E_BADINDEX;
 		*pptinfo = NULL;
@@ -60,12 +55,10 @@
 	}
 	STDMETHODIMP IStClient::GetIDsOfNames(REFIID riid, OLECHAR ** rgszNames, UINT cNames, LCID lcid, DISPID * rgdispid)
 	{
-		//printf("GetIDsOfNames\n");
 		return m_ptinfo->GetIDsOfNames(rgszNames, cNames, rgdispid);
 	}
 	STDMETHODIMP IStClient::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr)
 	{
-		//printf("Invoke\n");
 		if (pvarResult) VariantInit(pvarResult);

 		InvokeDispatch(dispidMember, pdispparams);


Use smallstring instead of new[]'ing a string.  This simplifies
the code and speeds it up.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59604 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Parse/ParseObjc.cpp
+++ lib/Parse/ParseObjc.cpp
@@ -203,15 +203,11 @@
 /// has been capitalized.
 static IdentifierInfo *constructSetterName(IdentifierTable &Idents,
                                            const IdentifierInfo *Name) {
-  unsigned N = Name->getLength();
-  char *SelectorName = new char[3 + N];
-  memcpy(SelectorName, "set", 3);
-  memcpy(&SelectorName[3], Name->getName(), N);
+  llvm::SmallString<100> SelectorName;
+  SelectorName += "set";
+  SelectorName.append(Name->getName(), Name->getName()+Name->getLength());
   SelectorName[3] = toupper(SelectorName[3]);
-
-  IdentifierInfo *Setter = &Idents.get(SelectorName, &SelectorName[3 + N]);
-  delete[] SelectorName;
-  return Setter;
+  return &Idents.get(&SelectorName[0], &SelectorName[SelectorName.size()]);
 }

 ///   objc-interface-decl-list:


More instant feedback on progressive rendering for first sample

Main purpose of this change is to make material preview appearing more
instant after the shader tweaks.

--- src/render/session.cpp
+++ src/render/session.cpp
@@ -891,7 +891,7 @@

 	if(current_time - last_update_time < params.progressive_update_timeout) {
 		/* if last sample was processed, we need to write buffers anyway  */
-		if(!write)
+		if(!write && sample != 1)
 			return false;
 	}


Always handle mouse scrolling; ScintillaTerm.cxx Mouse coordinates are not always reliably reported when scrolling the mouse.

--- ScintillaTerm.cxx
+++ ScintillaTerm.cxx
@@ -1143,7 +1143,8 @@
   WINDOW *win = sciterm->GetWINDOW();
   int begy = 0, begx = 0, maxy = getmaxy(win), maxx = getmaxx(win);
   getbegyx(win, begy, begx);
-  if (x < begx || x > maxx || y < begy || y > maxy) return;
+  if ((x < begx || x > maxx || y < begy || y > maxy) &&
+      button != 4 && button != 5) return; // ignore most events outside windows
   y = y - begy, x = x - begx;
   if (event == SCM_PRESS)
     sciterm->MousePress(button, time, y, x, shift, ctrl, alt);


Fix wrong viewport transparent-bg

Fix wrong viewport transparent-bg

--- servers/visual/visual_server_viewport.cpp
+++ servers/visual/visual_server_viewport.cpp
@@ -505,7 +505,7 @@
 	ERR_FAIL_COND(!viewport);

 	VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_TRANSPARENT, p_enabled);
-	viewport->transparent_bg = true;
+	viewport->transparent_bg = p_enabled;
 }

 void VisualServerViewport::viewport_set_global_canvas_transform(RID p_viewport, const Transform2D &p_transform) {


Return with "unknown" peer if no peer supplied

In requester.Received() if we supply a null for a peer when we
handle a block that was received then print out "unknown" for
the peers name.

--- src/requestManager.cpp
+++ src/requestManager.cpp
@@ -285,14 +285,14 @@
         LOG(REQ, "ReqMgr: TX received for %s.\n", item->second.obj.ToString().c_str());
         cleanup(item);
     }
-    else if (pfrom && (obj.type == MSG_BLOCK || obj.type == MSG_THINBLOCK || obj.type == MSG_XTHINBLOCK))
+    else if (obj.type == MSG_BLOCK || obj.type == MSG_THINBLOCK || obj.type == MSG_XTHINBLOCK)
     {
         OdMap::iterator item = mapBlkInfo.find(obj.hash);
         if (item == mapBlkInfo.end())
             return;

         LOG(BLK, "%s removed from request queue (received from %s).\n", item->second.obj.ToString().c_str(),
-            pfrom->GetLogName());
+            pfrom ? pfrom->GetLogName() : "unknown");
         cleanup(item);
     }
 }


[CSBindings] Fix early return condition in `TypeVariableBinding::attempt`

When `reportHole()` returns `true` it indicates a failure and
`attempt` has to return `false` right away.

--- lib/Sema/CSBindings.cpp
+++ lib/Sema/CSBindings.cpp
@@ -2208,8 +2208,9 @@
   if (Binding.isDefaultableBinding()) {
     cs.DefaultedConstraints.insert(srcLocator);

+    // Fail if hole reporting fails.
     if (type->isPlaceholder() && reportHole())
-      return true;
+      return false;
   }

   if (cs.simplify())


made some minor mods to the request_parser readline method

--- src/request_parser.cpp
+++ src/request_parser.cpp
@@ -16,6 +16,8 @@

 #include "request_parser.h"
 #include <sstream>
+#include <iostream>
+#include <list>

 void request_parser_c::add_input( const std::string &input )
@@ -29,9 +31,16 @@
 		return std::string();
 	}
 	std::istringstream str( m_input );
+	std::list< std::string > lines;
 	std::string line;
-	std::getline( str, line );
-	m_input = str.str();
+	do {
+		std::getline( str, line );
+		lines.push_back( line );
+		std::cerr << "line: " << line;
+	} while ( ! str.eof() );
+
+	// m_input = remainder;
+	m_input = std::string();

 	return line;
 }


Update stel.cpp

Update stel.cpp

--- Steg/stel.cpp
+++ Steg/stel.cpp
@@ -3,7 +3,7 @@

 namespace steg
 {
-
+jmp_buf StelJmp;
 lua_State* L = NULL;

 static int cLuaLoadLibs(lua_State* L)
@@ -308,4 +308,8 @@
 	return status;
 }

-}
+DBG_Status JLuaCallRegisteredFunction(const char* file, const char* functionPath, const char* argTypes, const char* retTypes, ...)
+{
+}
+
+}


[CSSimplify] Change equality semantics between base and result of unresolved member ref

Since it's now possible to infer base type of an unresolved member
reference to be a protocol type we need to adjust `matchTypes` to
check conformance instead of type equality between base (represented
by a protocol) and chain's concrete result type.

--- lib/Sema/CSSimplify.cpp
+++ lib/Sema/CSSimplify.cpp
@@ -5507,6 +5507,19 @@
         }
       }
     }
+
+    if (elt->is<LocatorPathElt::UnresolvedMemberChainResult>()) {
+      if (type1->is<ProtocolType>() && !type2->isTypeVariableOrMember()) {
+        auto result = simplifyConformsToConstraint(
+            type2, type1, ConstraintKind::ConformsTo,
+            locator.withPathElement(LocatorPathElt::TypeParameterRequirement(
+                0, RequirementKind::Conformance)),
+            subflags);
+
+        return result == SolutionKind::Error ? getTypeMatchFailure(locator)
+                                             : getTypeMatchSuccess();
+      }
+    }
   }

   if (kind == ConstraintKind::BindParam) {


rgw: don't check for time skew when Expires was set

--- src/rgw/rgw_rest_s3.cc
+++ src/rgw/rgw_rest_s3.cc
@@ -691,8 +691,8 @@
   RGW_LOG(10) << "auth_hdr:\n" << auth_hdr << dendl;

   time_t req_sec = s->header_time.sec();
-  if (req_sec < now - RGW_AUTH_GRACE_MINS * 60 ||
-      req_sec > now + RGW_AUTH_GRACE_MINS * 60) {
+  if ((req_sec < now - RGW_AUTH_GRACE_MINS * 60 ||
+      req_sec > now + RGW_AUTH_GRACE_MINS * 60) && !qsr) {
     RGW_LOG(10) << "req_sec=" << req_sec << " now=" << now << "; now - RGW_AUTH_GRACE_MINS=" << now - RGW_AUTH_GRACE_MINS * 60 << "; now + RGW_AUTH_GRACE_MINS=" << now + RGW_AUTH_GRACE_MINS * 60 << dendl;
     RGW_LOG(0) << "request time skew too big now=" << utime_t(now, 0) << " req_time=" << s->header_time << dendl;
     return -ERR_REQUEST_TIME_SKEWED;


Fix [3538259]: Use _tempnam on Windows to generate temporary file name in OgreDeflate.cpp

--- OgreMain/src/OgreDeflate.cpp
+++ OgreMain/src/OgreDeflate.cpp
@@ -119,9 +119,23 @@
             if(mTempFileName.empty())
             {
                 // Write to temp file
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+                char* tmpname = _tempnam(".", "ogre");
+                if (!tmpname)
+                {
+                    // Having no file name here will cause various problems later.
+                    OGRE_EXCEPT(Exception::ERR_INTERNAL_ERROR, "Temporary file name generation failed.", "DeflateStream::init");
+                }
+                else
+                {
+                    mTempFileName = tmpname;
+                    free(tmpname);
+                }
+#else
                 char tmpname[L_tmpnam];
                 tmpnam(tmpname);
                 mTempFileName = tmpname;
+#endif
             }

 			std::fstream *f = OGRE_NEW_T(std::fstream, MEMCATEGORY_GENERAL)();


Check for contact actually being valid before using it

When the account goes offline, the connection is invalidated and so is
the KTp::Contact, at which point it needs to used the cached data

--- kpeople/datasourceplugin/im-persons-data-source.cpp
+++ kpeople/datasourceplugin/im-persons-data-source.cpp
@@ -87,7 +87,8 @@
 public:
     virtual QVariant customProperty(const QString &key) const Q_DECL_OVERRIDE
     {
-        if (m_contact && m_account) {
+        // Check if the contact is valid first
+        if (m_contact && m_contact->manager() && m_contact->manager()->connection() && m_account) {
             if (key == AbstractContact::NameProperty)
                 return m_contact->alias();
             else if(key == AbstractContact::GroupsProperty)


For PR1297:
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
   type actually provided. ExpectedBits is the type expected for the
   intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
   suffix expected and making sure the suffix matches the function name. It
   also includes some intrinsic-specific checks such as ensuring that the
   bswap parameter and result are the same width and an even number of bytes.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@35540 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/VMCore/Verifier.cpp
+++ lib/VMCore/Verifier.cpp
@@ -212,7 +212,7 @@
     void visitUserOp2(Instruction &I) { visitUserOp1(I); }
     void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);

-    void VerifyIntrinsicPrototype(Function *F, ...);
+    void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F, ...);

     void WriteValue(const Value *V) {
       if (!V) return;
@@ -961,12 +961,17 @@
 /// VerifyIntrinsicPrototype - TableGen emits calls to this function into
 /// Intrinsics.gen.  This implements a little state machine that verifies the
 /// prototype of intrinsics.
-void Verifier::VerifyIntrinsicPrototype(Function *F, ...) {
+void Verifier::VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F, ...) {
   va_list VA;
   va_start(VA, F);

   const FunctionType *FTy = F->getFunctionType();

+  // For overloaded intrinsics, the Suffix of the function name must match the
+  // types of the arguments. This variable keeps track of the expected
+  // suffix, to be checked at the end.
+  std::string Suffix;
+
   // Note that "arg#0" is the return type.
   for (unsigned ArgNo = 0; 1; ++ArgNo) {
     int TypeID = va_arg(VA, int);
@@ -987,7 +992,7 @@
     }

     const Type *Ty;
-    if (ArgNo == 0)
+    if (ArgNo == 0)
       Ty = FTy->getReturnType();
     else
       Ty = FTy->getParamType(ArgNo-1);
@@ -1001,10 +1006,12 @@
     }

     if (TypeID == Type::IntegerTyID) {
-      unsigned GotBits = (unsigned) va_arg(VA, int);
-      unsigned ExpectBits = cast<IntegerType>(Ty)->getBitWidth();
-      if (GotBits != ExpectBits) {
-        std::string bitmsg = " Expecting " + utostr(ExpectBits) + " but got " +
+      unsigned ExpectedBits = (unsigned) va_arg(VA, int);
+      unsigned GotBits = cast<IntegerType>(Ty)->getBitWidth();
+      if (ExpectedBits == 0) {
+        Suffix += ".i" + utostr(GotBits);
+      } else if (GotBits != ExpectedBits) {
+        std::string bitmsg = " Expected " + utostr(ExpectedBits) + " but got "+
                              utostr(GotBits) + " bits.";
         if (ArgNo == 0)
           CheckFailed("Intrinsic prototype has incorrect integer result width!"
@@ -1013,6 +1020,21 @@
           CheckFailed("Intrinsic parameter #" + utostr(ArgNo-1) + " has "
                       "incorrect integer width!" + bitmsg, F);
         break;
+      }
+      // Check some constraints on various intrinsics.
+      switch (ID) {
+        default: break; // Not everything needs to be checked.
+        case Intrinsic::bswap:
+          if (GotBits < 16 || GotBits % 16 != 0)
+            CheckFailed("Intrinsic requires even byte width argument", F);
+          if (ArgNo == 1) {
+            unsigned ResultBits =
+              cast<IntegerType>(FTy->getReturnType())->getBitWidth();
+            if (GotBits != ResultBits)
+              CheckFailed("Intrinsic requires parameter and result bit "
+                          "widths to match", F);
+          }
+          break;
       }
     } else if (TypeID == Type::VectorTyID) {
       // If this is a packed argument, verify the number and type of elements.
@@ -1042,6 +1064,19 @@
   }

   va_end(VA);
+
+  // If we computed a Suffix then the intrinsic is overloaded and we need to
+  // make sure that the name of the function is correct. We add the suffix to
+  // the name of the intrinsic and compare against the given function name. If
+  // they are not the same, the function name is invalid. This ensures that
+  // overloading of intrinsics uses a sane and consistent naming convention.
+  if (!Suffix.empty()) {
+    std::string Name(Intrinsic::getName(ID));
+    if (Name + Suffix != F->getName())
+      CheckFailed("Overloaded intrinsic has incorrect suffix: '" +
+                  F->getName().substr(Name.length()) + "'. It should be '" +
+                  Suffix + "'", F);
+  }
 }


Unify "invalid action argument" error (fix scantxoutset)

--- src/rpc/blockchain.cpp
+++ src/rpc/blockchain.cpp
@@ -2459,7 +2459,7 @@
         result.pushKV("unspents", unspents);
         result.pushKV("total_amount", ValueFromAmount(total_in));
     } else {
-        throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid command");
+        throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid action argument");
     }
     return result;
 },


Add proTxHash to masternode list rpc response (#2887)

--- src/rpc/masternode.cpp
+++ src/rpc/masternode.cpp
@@ -19,7 +19,7 @@
 #include "utilmoneystr.h"
 #include "txmempool.h"

-#include "wallet/rpcwallet.h"
+#include "wallet/rpcwallet.h"

 #include "evo/specialtx.h"
 #include "evo/deterministicmns.h"
@@ -565,7 +565,8 @@
             obj.push_back(Pair(strOutpoint, strInfo));
         } else if (strMode == "json") {
             std::ostringstream streamInfo;
-            streamInfo <<  dmn->pdmnState->addr.ToString() << " " <<
+            streamInfo <<  dmn->proTxHash.ToString() << " " <<
+                           dmn->pdmnState->addr.ToString() << " " <<
                            payeeStr << " " <<
                            dmnToStatus(dmn) << " " <<
                            dmnToLastPaidTime(dmn) << " " <<
@@ -578,6 +579,7 @@
             if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&
                 strOutpoint.find(strFilter) == std::string::npos) return;
             UniValue objMN(UniValue::VOBJ);
+            objMN.push_back(Pair("proTxHash", dmn->proTxHash.ToString()));
             objMN.push_back(Pair("address", dmn->pdmnState->addr.ToString()));
             objMN.push_back(Pair("payee", payeeStr));
             objMN.push_back(Pair("status", dmnToStatus(dmn)));


remove if in case

remove if in case

--- X10_Project/Classes/StageScene.cpp
+++ X10_Project/Classes/StageScene.cpp
@@ -186,17 +186,14 @@
 	case 13:
 		addChild(m_lightManager->GetLight(12));
 	case 12:
-		if (m_stageToPlay <= 14)
-		{
-			CocosDenshion::SimpleAudioEngine::sharedEngine()->stopBackgroundMusic(true);
-			CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(FileStuff::SOUND_BEFORE_ENDING_BACKGROUND, true);
-		}
 		addChild(m_lightManager->GetLight(11));
 	case 11:
 		addChild(m_lightManager->GetLight(10));
 	case 10:
 		addChild(m_lightManager->GetLight(9));
 	case 9:
+		CocosDenshion::SimpleAudioEngine::sharedEngine()->stopBackgroundMusic(true);
+		CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(FileStuff::SOUND_BEFORE_ENDING_BACKGROUND, true);
 		addChild(m_lightManager->GetLight(8));
 	case 8:
 		addChild(m_lightManager->GetLight(7));
@@ -205,11 +202,8 @@
 	case 6:
 		addChild(m_lightManager->GetLight(5));
 	case 5:
-		if (m_stageToPlay <= 5)
-		{
-			CocosDenshion::SimpleAudioEngine::sharedEngine()->stopBackgroundMusic(true);
-			CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(FileStuff::SOUND_MIDDLE_PHASE_BACKGROUND, true);
-		}
+		CocosDenshion::SimpleAudioEngine::sharedEngine()->stopBackgroundMusic(true);
+		CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic(FileStuff::SOUND_MIDDLE_PHASE_BACKGROUND, true);
 		addChild(m_lightManager->GetLight(4));
 	case 4:
 		addChild(m_lightManager->GetLight(3));


fix type

fix type

--- src/rpc_connection.cpp
+++ src/rpc_connection.cpp
@@ -4735,7 +4735,7 @@
         else
         {
             auto pt_error = create_error_object(
-                error_code_invalid_params, "invalid parameter coiunt"
+                error_code_invalid_params, "invalid parameter count"
             );

             /**


rt: Turn on stack alignment checks for mac

--- src/rt/rust_upcall.cpp
+++ src/rt/rust_upcall.cpp
@@ -19,8 +19,8 @@
 // correctly. Strategically placed at entry to upcalls because they begin on
 // the rust stack and happen frequently enough to catch most stack changes,
 // including at the beginning of all landing pads.
-// FIXME: Only seems to work on linux
-#ifdef __linux__
+// FIXME: Enable this for windows
+#if defined __linux__ || defined __APPLE__
 extern "C" void
 check_stack_alignment() __attribute__ ((aligned (16)));
 #else


Make failing to resolve a symbol an error

--- src/rt/rust_upcall.cpp
+++ src/rt/rust_upcall.cpp
@@ -486,7 +486,7 @@
         task->log(rust_log::UPCALL | rust_log::CACHE,
                   "found-or-cached addr: 0x%" PRIxPTR, addr);
     } else {
-        task->log(rust_log::UPCALL | rust_log::CACHE,
+        task->log(rust_log::UPCALL | rust_log::CACHE | rust_log::ERR,
                   "failed to resolve symbol");
         task->fail(7);
     }


rtos/thread: auto*

rtos/thread: auto*

--- src/rtos/os-thread.cpp
+++ src/rtos/os-thread.cpp
@@ -1069,7 +1069,7 @@
           mutexes_list& mx_list = reinterpret_cast<mutexes_list&> (mutexes_);
           while (not mx_list.empty ())
             {
-              auto mx = mx_list.unlink_head ();
+              auto* mx = mx_list.unlink_head ();

               mx->internal_mark_owner_dead_ ();


check if server channel is removed from requesting server

--- server.cpp
+++ server.cpp
@@ -433,6 +433,10 @@

   // Remove requester from server channel.
   servers.find(request_ip_port)->second->channels.erase(leave->req_channel);
+
+  for (auto c : servers.find(request_ip_port)->second->channels) {
+    std::cout << c.first << std::endl;
+  }
 }


added test line

added test line

--- server.cpp
+++ server.cpp
@@ -288,6 +288,7 @@
 			max_sd = s;
 			cout << endl << "before select" << endl;
 			int t = select(max_sd + 1, &stReadFDS, NULL, NULL, &stTimeOut);
+			cout << "after select" << endl;
 			if (t == -1){
 				perror("select()");
 			}


Testing for the fix's fix's fix (again)

Testing for the fix's fix's fix (again)

--- server.cpp
+++ server.cpp
@@ -272,6 +272,9 @@

 	if (dropPck == 1) return false;
 	if (delayPck == 1) sleep(delayT);
+
+	cout << "Made it to sending mode..." << endl;
+
     if(sendto(s, p.str(), BUFSIZE + 7, 0, (struct sockaddr *)&ca, sizeof(ca)) < 0) {
 		cout << "Package sending failed. (socket s, server address sa, message m)" << endl;
 		return false;


print test in list

print test in list

--- server.cpp
+++ server.cpp
@@ -319,6 +319,7 @@
     strncpy(list->txt_channels[i++].ch_channel, ch.first.c_str(), CHANNEL_MAX);
   }

+  // TODO Print test
   std::cout << "Channels" << std::endl;
   for (i = 0; i < list->txt_nchannels; i++) {
     std::cout << list->txt_channels[i].ch_channel << std::endl;
@@ -362,6 +363,49 @@
   std::cout << "server_socket: " << server_socket << std::endl;
   std::cout << "request_address: " << request_address << std::endl;
   std::cout << "request_port: " << request_port << std::endl;
+
+//  struct sockaddr_in client_addr;
+//  const size_t list_size = sizeof(text_list) + (kChannels.size() * sizeof(channel_info));
+//  struct text_list *list = (text_list *) malloc(list_size);
+//  memset(list, '\0', list_size);;
+//
+//  list->txt_type = TXT_LIST;
+//  list->txt_nchannels = (int) kChannels.size();
+//
+//  // Fills the packet's channels array.
+//  int i = 0;
+//  for (auto ch : kChannels) {
+//    strncpy(list->txt_channels[i++].ch_channel, ch.first.c_str(), CHANNEL_MAX);
+//  }
+//
+//  std::cout << "Channels" << std::endl;
+//  for (i = 0; i < list->txt_nchannels; i++) {
+//    std::cout << list->txt_channels[i].ch_channel << std::endl;
+//  }
+//
+//  // Finds the requesting users address and port and sends the packet.
+//  for (auto user : kUsers) {
+//    unsigned short current_port = user.second->port;
+//    in_addr_t current_address = user.second->address;
+//
+//    if (current_port == request_port && current_address == request_address) {
+//      memset(&client_addr, 0, sizeof(struct sockaddr_in));
+//      client_addr.sin_family = AF_INET;
+//      client_addr.sin_port = current_port;
+//      client_addr.sin_addr.s_addr = current_address;
+//
+//      size_t message_size = sizeof(list);
+//
+//      if (sendto(server_socket, &list, message_size, 0, (struct sockaddr*) &client_addr, sizeof(client_addr)) < 0) {
+//        Error("server: failed to send list\n");
+//      }
+//
+//      std::cout << "server: " << user.first << " lists channels" << std::endl;
+//      break;
+//    }
+//  }
+//
+//  free(list);
 }


Small fix to make sure we always start connection ID sequences to the same value.

BUG=None
TEST=None
Review URL: http://codereview.chromium.org/5372005

git-svn-id: http://src.chromium.org/svn/trunk/src@67595 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 468b03d9a621390ace8a6af43b6f4a8ec6e43bb8

--- ceee/ie/plugin/bho/extension_port_manager.cc
+++ ceee/ie/plugin/bho/extension_port_manager.cc
@@ -7,16 +7,18 @@
 #include "ceee/ie/plugin/bho/extension_port_manager.h"
 #include "base/logging.h"
 #include "base/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
 #include "base/values.h"
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
+#include "base/win/scoped_bstr.h"
 #include "ceee/ie/common/chrome_frame_host.h"
 #include "ceee/ie/plugin/scripting/content_script_native_api.h"
 #include "chrome/browser/automation/extension_automation_constants.h"

 namespace ext = extension_automation_constants;

-ExtensionPortManager::ExtensionPortManager() {
+ExtensionPortManager::ExtensionPortManager() : next_connection_id_(0) {
 }

 ExtensionPortManager::~ExtensionPortManager() {
@@ -186,6 +188,7 @@
                                                 const std::string& target) {
   // Post our message through the ChromeFrameHost. We allow queueing,
   // because we don't synchronize to the destination extension loading.
-  return chrome_frame_host_->PostMessage(CComBSTR(message.c_str()),
-                                         CComBSTR(target.c_str()));
+  return chrome_frame_host_->PostMessage(
+      base::win::ScopedBstr(ASCIIToWide(message).c_str()),
+      base::win::ScopedBstr(ASCIIToWide(target).c_str()));
 }


master final program push

master final program push

--- TicTacToe.cpp
+++ TicTacToe.cpp
@@ -985,4 +985,4 @@
 	glutIdleFunc(idle);
 	glutMainLoop();
 	return 0;
-}+}


list files recursively

list files recursively

--- cli/main.cpp
+++ cli/main.cpp
@@ -6,11 +6,14 @@
 #include <silicium/sending_observable.hpp>
 #include <silicium/received_from_socket_source.hpp>
 #include <silicium/observable_source.hpp>
+#include <silicium/for_each.hpp>
 #include <silicium/optional.hpp>
 #include <silicium/http/http.hpp>
+#include <silicium/thread.hpp>
 #include <boost/interprocess/sync/null_mutex.hpp>
 #include <boost/container/string.hpp>
 #include <boost/unordered_map.hpp>
+#include <boost/filesystem/operations.hpp>

 namespace
 {
@@ -199,6 +202,38 @@

 	//TODO: use unique_observable
 	using session_handle = Si::shared_observable<Si::nothing>;
+
+	namespace detail
+	{
+		void list_files_recursively(Si::yield_context_2<boost::filesystem::path> &yield, boost::filesystem::path const &root)
+		{
+			for (boost::filesystem::directory_iterator i(root); i != boost::filesystem::directory_iterator(); ++i)
+			{
+				switch (i->status().type())
+				{
+				case boost::filesystem::file_type::regular_file:
+					yield.push_result(i->path());
+					break;
+
+				case boost::filesystem::file_type::directory_file:
+					list_files_recursively(yield, i->path());
+					break;
+
+				default:
+					//ignore
+					break;
+				}
+			}
+		}
+	}
+
+	Si::unique_observable<boost::filesystem::path> list_files_recursively(boost::filesystem::path const &root)
+	{
+		return Si::erase_unique(Si::make_thread<boost::filesystem::path, Si::boost_threading>([root](Si::yield_context_2<boost::filesystem::path> &yield)
+		{
+			return detail::list_files_recursively(yield, root);
+		}));
+	}
 }

 int main()
@@ -248,5 +283,12 @@
 	auto all_sessions_finished = Si::flatten<boost::interprocess::null_mutex>(std::move(accept_all));
 	auto done = Si::make_total_consumer(std::move(all_sessions_finished));
 	done.start();
+
+	auto listed = Si::for_each(list_files_recursively(boost::filesystem::current_path()), [](boost::filesystem::path const &file)
+	{
+		std::cerr << file << '\n';
+	});
+	listed.start();
+
 	io.run();
 }


Removed archiving crash dump

Removed archiving crash dump

--- YorozuyaGS/CrashDump/CrashDump.cpp
+++ YorozuyaGS/CrashDump/CrashDump.cpp
@@ -5,7 +5,6 @@
 #include <dbghelp.h>
 #pragma comment(lib, "dbghelp.lib")

-#include "../../Common/Helpers/zip.h"
 #include "../../Common/Helpers/RapidHelper.hpp"

 namespace GameServer
@@ -152,43 +151,6 @@

             if (bWriteDump != TRUE)
                 return;
-
-            ::std::vector<fs::path> vecRequiredFiles {
-                pathFileDump,
-                GetGameServerExePath(),
-                GetDllPath(),
-                GetDllPath().replace_extension(L"pdb")
-            };
-
-            auto pathZip = fs::path(pathFileDump).replace_extension(L"zip");
-
-            do
-            {
-                HZIP hZip = CreateZip(pathZip.generic_wstring().c_str(), 0);
-                if (hZip == nullptr)
-                    break;
-
-                size_t count = 0;
-                ZRESULT hResult = ZR_OK;
-                for (auto& file : vecRequiredFiles)
-                {
-                    hResult = ZipAdd(
-                        hZip, file.filename().c_str(),
-                        file.generic_wstring().c_str());
-
-                    if (hResult == ZR_OK)
-                    {
-                        ++count;
-                    }
-                }
-
-                CloseZip(hZip);
-
-                if (count != vecRequiredFiles.size())
-                    break;
-
-                fs::remove(pathFileDump);
-            } while (false);
         }

         LONG WINAPI CCrashDump::UnhandledExceptionFilter(::_EXCEPTION_POINTERS * ExceptionInfo)


chart49: #i114953# don't crash with very complex categories

--- chart2/source/tools/InternalDataProvider.cxx
+++ chart2/source/tools/InternalDataProvider.cxx
@@ -356,9 +356,11 @@
                         if( xSeq.is() )
                             aStringSeq = xSeq->getTextualData(); // @todo: be able to deal with XDataSequence, too
                         sal_Int32 nLength = aStringSeq.getLength();
-                        if( static_cast< sal_Int32 >(aNewCategories.size()) < nLength )
+                        sal_Int32 nCatLength = static_cast< sal_Int32 >(aNewCategories.size());
+                        if( nCatLength < nLength )
                             aNewCategories.resize( nLength );
-
+                        else if( nLength < nCatLength )
+                            aStringSeq.realloc( nCatLength );
                         transform( aNewCategories.begin(), aNewCategories.end(), aStringSeq.getConstArray(),
                             aNewCategories.begin(), lcl_setStringAtLevel(nL) );
                     }


Added net::LOAD_DO_NOT_SEND_COOKIES to autofil_download to fix:
118932:  URLFetcher::Create calls in chrome/browser/autofill/autofill_download.cc

BUG=118932
TEST=verified success of the requests

Review URL: http://codereview.chromium.org/9730008

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@127603 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/autofill/autofill_download.cc
+++ chrome/browser/autofill/autofill_download.cc
@@ -178,7 +178,8 @@
   fetcher->SetAutomaticallyRetryOn5xx(false);
   fetcher->SetRequestContext(request_context);
   fetcher->SetUploadData("text/plain", form_xml);
-  fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
+  fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
+                        net::LOAD_DO_NOT_SEND_COOKIES);
   fetcher->Start();
   return true;
 }


Update count-of-smaller-number-before-itself.cpp

--- C++/count-of-smaller-number-before-itself.cpp
+++ C++/count-of-smaller-number-before-itself.cpp
@@ -1,7 +1,54 @@
 // Time:  O(nlogn)
 // Space: O(n)

+// BIT solution. (281ms)
 class Solution {
+public:
+   /**
+     * @param A: An integer array
+     * @return: Count the number of element before this element 'ai' is
+     *          smaller than it and return count number array
+     */
+    vector<int> countOfSmallerNumberII(vector<int> &A) {
+        vector<int> sorted_A(A), orderings(A.size());
+        sort(sorted_A.begin(), sorted_A.end());
+        for (int i = 0; i < A.size(); ++i) {
+            orderings[i] =
+                lower_bound(sorted_A.begin(), sorted_A.end(), A[i]) -
+                sorted_A.begin();
+        }
+        vector<int> bit(A.size() + 1), ans(A.size());
+        for (int i = 0; i < orderings.size(); ++i) {
+            ans[i] = query(bit, orderings[i]);
+            add(bit, orderings[i] + 1, 1);
+        }
+        return ans;
+    }
+
+private:
+    void add(vector<int>& bit, int i, int val) {
+        for (; i < bit.size(); i += lower_bit(i)) {
+            bit[i] += val;
+        }
+    }
+
+    int query(const vector<int>& bit, int i) {
+        int sum = 0;
+        for (; i > 0; i -= lower_bit(i)) {
+            sum += bit[i];
+        }
+        return sum;
+    }
+
+    int lower_bit(int i) {
+        return i & -i;
+    }
+};
+
+// Time:  O(nlogn)
+// Space: O(n)
+// BST solution. (743ms)
+class Solution2 {
 public:
     class BSTreeNode {
     public:


Fix "Same expression on both sides of '&&'" (reported by cppcheck)

--- basegfx/source/polygon/b2dpolypolygoncutter.cxx
+++ basegfx/source/polygon/b2dpolypolygoncutter.cxx
@@ -282,7 +282,7 @@
                                 bOnEdge = false;
                             }
                         }
-                        while(bOnEdge && pPNa2 != &rPNa && pPNa2 != &rPNa);
+                        while(bOnEdge && pPNa2 != &rPNa && pPNb2 != &rPNb);

                         if(bOnEdge)
                         {
@@ -408,7 +408,7 @@
                                 bOnEdge = false;
                             }
                         }
-                        while(bOnEdge && pPNa2 != &rPNa && pPNa2 != &rPNa);
+                        while(bOnEdge && pPNa2 != &rPNa && pPNb2 != &rPNb);

                         if(bOnEdge)
                         {


Mark failing test OnMsgPaintAtSize failing
TBR=noelutz
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3470011

git-svn-id: http://src.chromium.org/svn/trunk/src@60390 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: be7c535bc1685a594854b6c0b81a2a03d3216d2b

--- chrome/renderer/render_widget_browsertest.cc
+++ chrome/renderer/render_widget_browsertest.cc
@@ -136,6 +136,6 @@
       bitmap_data->size()));
 }

-TEST_F(RenderWidgetTest, OnMsgPaintAtSize) {
+TEST_F(RenderWidgetTest, FAILS_OnMsgPaintAtSize) {
   TestResizeAndPaint();
 }


Update for llvm api change in r209266.

Update for llvm api change in r209266.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@209303 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Expression/ClangExpressionParser.cpp
+++ source/Expression/ClangExpressionParser.cpp
@@ -311,7 +311,8 @@
     diag_buf->FlushDiagnostics (m_compiler->getDiagnostics());

     const char *expr_text = m_expr.Text();
-
+
+    clang::SourceManager &SourceMgr = m_compiler->getSourceManager();
     bool created_main_file = false;
     if (m_compiler->getCodeGenOpts().getDebugInfo() == CodeGenOptions::FullDebugInfo)
     {
@@ -340,7 +341,9 @@
                 if (bytes_written == expr_text_len)
                 {
                     file.Close();
-                    m_compiler->getSourceManager().createMainFileID(m_file_manager->getFile(temp_source_path));
+                    SourceMgr.setMainFileID(SourceMgr.createFileID(
+                        m_file_manager->getFile(temp_source_path),
+                        SourceLocation(), SrcMgr::C_User));
                     created_main_file = true;
                 }
             }
@@ -350,7 +353,7 @@
     if (!created_main_file)
     {
         MemoryBuffer *memory_buffer = MemoryBuffer::getMemBufferCopy(expr_text, __FUNCTION__);
-        m_compiler->getSourceManager().createMainFileIDForMemBuffer (memory_buffer);
+        SourceMgr.setMainFileID(SourceMgr.createFileID(memory_buffer));
     }

     diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor());


using function pointer for better code readability


Setting depthFunc based on reverse depth buffer flag

--- src/BabylonCpp/src/sprites/sprite_renderer.cpp
+++ src/BabylonCpp/src/sprites/sprite_renderer.cpp
@@ -183,10 +183,7 @@
   const auto culling = engine->depthCullingState()->cull().value_or(true);
   const auto zOffset = engine->depthCullingState()->zOffset();

-  // Handle Right Handed
-  if (useRightHandedSystem && _scene) {
-    _scene->getEngine()->setState(culling, zOffset, false, false);
-  }
+  engine->setState(culling, zOffset, false, false);

   // Render
   engine->enableEffect(drawWrapper);
@@ -217,7 +214,8 @@
   }

   // Draw order
-  engine->depthCullingState()->depthFunc = Constants::LEQUAL;
+  engine->depthCullingState()->depthFunc
+    = engine->useReverseDepthBuffer ? Constants::GEQUAL : Constants::LEQUAL;
   if (!disableDepthWrite) {
     effect->setBool("alphaTest", true);
     engine->setColorWrite(false);


fix LoadCursor calls

fix LoadCursor calls

--- Common/Input/Win32_OIS/ResourceW32Pointer.cpp
+++ Common/Input/Win32_OIS/ResourceW32Pointer.cpp
@@ -36,37 +36,37 @@
 				{
 					std::string value = info->getContent();
 					if (value == "IDC_ARROW")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_ARROW);
 					else if (value == "IDC_IBEAM")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_IBEAM);
 					else if (value == "IDC_WAIT")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_WAIT));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_WAIT);
 					else if (value == "IDC_CROSS")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_CROSS));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_CROSS);
 					else if (value == "IDC_UPARROW")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_UPARROW));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_UPARROW);
 					else if (value == "IDC_SIZE")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZE));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZE);
 					else if (value == "IDC_ICON")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ICON));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_ICON);
 					else if (value == "IDC_SIZENWSE")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENWSE));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENWSE);
 					else if (value == "IDC_SIZENESW")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENESW));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENESW);
 					else if (value == "IDC_SIZEWE")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEWE));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZEWE);
 					else if (value == "IDC_SIZENS")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZENS));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZENS);
 					else if (value == "IDC_SIZEALL")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_SIZEALL));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_SIZEALL);
 					else if (value == "IDC_NO")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_NO));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_NO);
 					else if (value == "IDC_HAND")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_HAND);
 					else if (value == "IDC_APPSTARTING")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_APPSTARTING));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_APPSTARTING);
 					else if (value == "IDC_HELP")
-						mHandle = (size_t)::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HELP));
+						mHandle = (size_t)::LoadCursor(NULL, IDC_HELP);
 				}
 			}
 		}


Added an additional two lines worth of band-aid for now; a fuller fix has been started in the codec_modernization branch

--- Core/ComponentRegistries/VariableRegistry.cpp
+++ Core/ComponentRegistries/VariableRegistry.cpp
@@ -92,7 +92,11 @@
 		ScarabDatum *serializedVariable = scarab_dict_get(datum, key);
 		scarab_free_datum(key);

-		if(serializedVariable) {
+		if(!serializedVariable) {
+            shared_ptr<EmptyVariable> empty_var(new EmptyVariable);
+            master_variable_list.push_back(empty_var);
+            continue;
+        } else {
 			if(serializedVariable->type != SCARAB_DICT) {
 				// these must be  placeholder datums in the package
 				// that we should ignore.


[cluster] make code more robust;

[cluster] make code more robust;

--- Core/src/sources/cluster/ClusterComponent.cpp
+++ Core/src/sources/cluster/ClusterComponent.cpp
@@ -146,7 +146,9 @@
 				localEvent{std::move(other.localEvent)} {}
 			void operator()(Susi::Events::SharedEventPtr remoteEvent){
 				LOG(DEBUG) << "Forwarding finished.";
-				*localEvent = *remoteEvent;
+				if(localEvent){
+					*localEvent = *remoteEvent;
+				}
 			}
 		};
 		auto & apiClient = apiClients[nodeId];


Mpeg2d - use C++ primitives (memspy => std::copy)

--- _studio/mfx_lib/decode/mpeg2/src/mfx_mpeg2_decode.cpp
+++ _studio/mfx_lib/decode/mpeg2/src/mfx_mpeg2_decode.cpp
@@ -615,9 +615,7 @@
     if (UMC::UMC_OK == umcSts)
     {
         // we store pts in float
-        mfxF64 pts;
-
-        memcpy_s(&pts, sizeof(mfxF64), ts, sizeof(mfxF64));
+        mfxF64 pts = *(reinterpret_cast<mfxF64*>(ts));

         *ts = GetMfxTimeStamp(pts);

@@ -870,7 +868,7 @@
                     size += 9;
             }

-            memcpy_s(spspps->SPSBuffer, size, pShStart, size);
+            std::copy(pShStart, pShStart + size, spspps->SPSBuffer);
             spspps->SPSBufSize = size;
         }

@@ -1016,7 +1014,7 @@

         mfxExtBuffer **pExtBuffer = out->ExtParam;
         mfxU16 numDistBuf = out->NumExtParam;
-        memcpy_s(out, sizeof(mfxVideoParam), in, sizeof(mfxVideoParam));
+        *out = *in;

         if (in->AsyncDepth == 0)
             out->AsyncDepth = 3;
@@ -1759,7 +1757,7 @@
         }
     }

-    memcpy_s(&(request->Info), sizeof(mfxFrameInfo), &(par->mfx.FrameInfo), sizeof(mfxFrameInfo));
+    request->Info = par->mfx.FrameInfo;

     // output color format is NV12
     request->Info.FourCC = MFX_FOURCC_NV12;
@@ -1884,7 +1882,7 @@
         m_implUmc->GetSignalInfoInformation(signal_info);
     }

-    memcpy_s(par->reserved,sizeof(m_vPar.reserved),m_vPar.reserved,sizeof(m_vPar.reserved));
+    std::copy(std::begin(m_vPar.reserved), std::end(m_vPar.reserved), std::begin(par->reserved));
     par->reserved2 = m_vPar.reserved2;

     return MFX_ERR_NONE;
@@ -2072,7 +2070,7 @@
         if (0 < m_last_bytes[3])
         {
             uint8_t *pData = m_frame[m_frame_free].Data + m_frame[m_frame_free].DataOffset + m_frame[m_frame_free].DataLength;
-            memcpy_s(pData, m_last_bytes[3], m_last_bytes, m_last_bytes[3]);
+            std::copy(m_last_bytes, m_last_bytes + m_last_bytes[3], pData);

             m_frame[m_frame_free].DataLength += m_last_bytes[3];
             memset(m_last_bytes, 0, NUM_REST_BYTES);


Fix memory leak https://github.com/MonkeyFirst/urho3d-component-tail-generator/issues/4

--- TailGenerator.cpp
+++ TailGenerator.cpp
@@ -100,6 +100,9 @@
         previousPosition_ = wordPosition;
         fullPointPath.Push(newPoint);    // Весь путь, все точки за все время работы компонента.
         //knots.Push(wordPosition);        // Для сплайна опорные
+
+        if (fullPointPath.Size() > tailNum_)
+            fullPointPath.Erase(0, fullPointPath.Size() - tailNum_);
     }
 }


Added mapping AddVsAddIf_Test_9 test

Added mapping AddVsAddIf_Test_9 test

--- Tests/16/Test.cpp
+++ Tests/16/Test.cpp
@@ -151,6 +151,25 @@
 }

 namespace {
+    namespace AddVsAddIf_Test_9_ {
+        void DoAll ()
+        {
+            {
+                Mapping<int, int> m;
+                m.Add (1,2);
+                VerifyTestResult (m[1] == 2);
+                m.Add (1,3);
+                VerifyTestResult (m[1] == 3);
+                VerifyTestResult (not m.AddIf (1,4));
+                VerifyTestResult (m[1] == 3);
+                VerifyTestResult (m.AddIf (2,3));
+                VerifyTestResult (m[2] == 3);
+            }
+        }
+    }
+}
+
+namespace {
     void DoRegressionTests_ ()
     {
         struct MySimpleClassWithoutComparisonOperators_ComparerWithEquals_ : Common::ComparisonRelationDeclaration<Common::ComparisonRelationType::eEquals> {
@@ -207,6 +226,7 @@
         Where_Test_6_::DoAll ();
         WithKeys_Test_7_::DoAll ();
         ClearBug_Test_8_::DoAll ();
+        AddVsAddIf_Test_9_::DoAll ();
     }
 }


more regression tests for edge cases of comparing ints converted to VariantValues and with JSON reader/Writer

--- Tests/22/Test.cpp
+++ Tests/22/Test.cpp
@@ -199,7 +199,6 @@
                     stringstream    tmp;
                     tmp << encodedRep;
                     VariantValue    vOut    =   DataExchangeFormat::JSON::Reader ().Read (tmp);
-                    VerifyTestResult (vOut.GetType () == v.GetType ());
                     VerifyTestResult (vOut == v);
                 }
             }
@@ -213,6 +212,20 @@
                 CheckRoundtrip_encode_decode_unchanged (VariantValue (L"\\u20a9")); //  ₩
                 CheckRoundtrip_encode_decode_unchanged (VariantValue (L"\u20a9"));  //  ₩
                 CheckRoundtrip_encode_decode_unchanged (VariantValue (L"\"apple\""));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<int>::min ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<int>::max ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<long int>::min ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<long int>::max ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<long long int>::min ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<long long int>::max ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned int>::min ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned int>::max ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned long int>::min ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned long int>::max ()));
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned long long int>::min ()));
+#if 0
+                CheckRoundtrip_encode_decode_unchanged (VariantValue (numeric_limits<unsigned long long int>::max ()));
+#endif
             }
         }


cleanup

cleanup

--- Tests/28/Test.cpp
+++ Tests/28/Test.cpp
@@ -371,8 +371,6 @@
                 DataExchange::JSON::Writer ().Write (v, out);
                 string x = out.As<string> ();
                 for (string::size_type i = 0; i < min (x.length (), expected.length ()); ++i) {
-                    wchar_t l = x[i];
-                    wchar_t r = expected[i];
                     if (x[i] != expected[i]) {
                         VerifyTestResult (false);
                     }


cleanup unused tests in regtest

cleanup unused tests in regtest

--- Tests/29/Test.cpp
+++ Tests/29/Test.cpp
@@ -325,9 +325,6 @@
                 using namespace Characters;
                 VerifyTestResult (Cryptography::Format<String> (Hash<string, USE_DIGESTER_>{}("x")) == L"9dd4e461268c8034f5c8564e155c67a6");
                 VerifyTestResult (Cryptography::Format<string> (Hash<string, USE_DIGESTER_>{}("x")) == "9dd4e461268c8034f5c8564e155c67a6");
-                auto a1 = Hash<string, USE_DIGESTER_>{}("x");
-                auto a2 = Common::GUID{Hash<string, USE_DIGESTER_>{}("x")}.ToString ();
-                auto a3 = Hash<string, USE_DIGESTER_, Common::GUID>{}("x").ToString ();
                 VerifyTestResult ((Common::GUID{Hash<string, USE_DIGESTER_>{}("x")} == Common::GUID{L"61e4d49d-8c26-3480-f5c8-564e155c67a6"}));
                 VerifyTestResult ((Hash<string, USE_DIGESTER_, Common::GUID>{}("x") == Common::GUID{L"61e4d49d-8c26-3480-f5c8-564e155c67a6"}));
             }


added regtest

added regtest

--- Tests/35/Test.cpp
+++ Tests/35/Test.cpp
@@ -193,7 +193,7 @@
                     throw std::system_error (ENOENT, std::system_category ());
                 }
                 catch (std::system_error const& e) {
-                    VerifyTestResult (e.code ().value() == static_cast<int> (std::errc::no_such_file_or_directory)); // workaround?
+                    VerifyTestResult (e.code ().value () == static_cast<int> (std::errc::no_such_file_or_directory)); // workaround?
 #if !qCompilerAndStdLib_error_code_compare_condition_Buggy
                     VerifyTestResult (e.code () == std::errc::no_such_file_or_directory); // <- FAILS!?
 #endif


fixed typo

fixed typo

--- Tests/35/Test.cpp
+++ Tests/35/Test.cpp
@@ -65,7 +65,7 @@
 }

 namespace {
-    namespace Test3_SystemException_ {
+    namespace Test3_SystemErrorException_ {
         namespace Private_ {
             void T1_system_error_ ()
             {
@@ -75,9 +75,9 @@

                 // One way
                 try {
-                    SystemException::ThrowPOSIXErrNo (kErr2TestFor_);
+                    SystemErrorException::ThrowPOSIXErrNo (kErr2TestFor_);
                 }
-                catch (const Execution::SystemException& e) {
+                catch (const Execution::SystemErrorException& e) {
                     VerifyTestResult (e.code ().value () == kErr2TestFor_);
                     VerifyTestResult (e.code ().category () == system_category () or e.code ().category () == generic_category ());
                     msg1 = Characters::ToString (e);
@@ -89,7 +89,7 @@
                 }
                 // But this works too
                 try {
-                    SystemException::ThrowPOSIXErrNo (kErr2TestFor_);
+					SystemErrorException::ThrowPOSIXErrNo (kErr2TestFor_);
                 }
                 catch (const std::system_error& e) {
                     VerifyTestResult (e.code ().value () == kErr2TestFor_);
@@ -104,7 +104,7 @@

                 const Characters::String kMsgWithUnicode_ = L"zß水𝄋"; // this works even if using a code page / locale which doesn't support UNICODE/Chinese
                 try {
-                    Execution::Throw (SystemException (kErr2TestFor_, generic_category (), kMsgWithUnicode_));
+                    Execution::Throw (SystemErrorException (kErr2TestFor_, generic_category (), kMsgWithUnicode_));
                 }
                 catch (const std::system_error& e) {
                     VerifyTestResult (e.code ().value () == kErr2TestFor_);
@@ -169,7 +169,7 @@
     {
         RegressionTest1_ ();
         Test2_ThrowCatchStringException_ ();
-        Test3_SystemException_::TestAll_ ();
+        Test3_SystemErrorException_::TestAll_ ();
     }
 }


uppted timeout in regtest from 2.5 to 5.0 for when running on rasberrypi - delays can be wierdly large

--- Tests/37/Test.cpp
+++ Tests/37/Test.cpp
@@ -223,7 +223,7 @@
             // At this point the thread SHOULD block and wait 60.0 seconds
             {
                 const Time::DurationSecondsType kMargingOfErrorLo_ = .5;
-                const Time::DurationSecondsType kMargingOfErrorHi_ = 2.5; // if sys busy, thread could be put to sleep almost any amount of time
+                const Time::DurationSecondsType kMargingOfErrorHi_ = 5.0; // if sys busy, thread could be put to sleep almost any amount of time
                 const Time::DurationSecondsType kWaitOnAbortFor    = 1.0;
                 Time::DurationSecondsType       startTestAt        = Time::GetTickCount ();
                 Time::DurationSecondsType       caughtExceptAt     = 0;
@@ -240,9 +240,9 @@
                 }
                 VerifyTestResult (expectedEndAt - kMargingOfErrorLo_ <= caughtExceptAt);
                 // FAILURE:
-                //      v2.0205 release - in regtests on raspberrypi-gcc-5, regtests for v2.0a205 - (caughtExceptAt - expectedEndAt) was 2.3,
+                //      2.0a208x release - in regtests on raspberrypi-gcc-5, regtests  - (caughtExceptAt - expectedEndAt) was 4.1,
                 //      so may need to be much larger occasionally (on slow raspberry pi) - but rarely fails.
-                //      But failed with kMargingOfErrorHi_=2.0, so up to 2.5 for future releases
+                //      But failed with kMargingOfErrorHi_=2.0, so from 2.5 5.0 for future releases
                 VerifyTestResult (caughtExceptAt <= expectedEndAt + kMargingOfErrorHi_);
             }


tweaked a few more regtests warning thresholds so we get fewer warnigns on debug-memleaks builds

--- Tests/47/Test.cpp
+++ Tests/47/Test.cpp
@@ -1541,7 +1541,7 @@
             Test_stdsharedptrBaseline, L"shared_ptr",
             Test_MemorySharedPtr, L"SharedPtr",
             26900,
-            .92,
+            .97,
             &failedTests
         );
 #endif
@@ -1720,7 +1720,7 @@
             Test_BLOB_Versus_Vector_Byte<vector<Byte>>, L"vector<Byte>",
             Test_BLOB_Versus_Vector_Byte<Memory::BLOB>, L"BLOB",
             10100,
-            0.43,
+            0.47,
             &failedTests
         );
         Tester (


Added path separator handling.

Added path separator handling.

--- TileGenerator.cpp
+++ TileGenerator.cpp
@@ -233,7 +233,12 @@

 void TileGenerator::generate(const std::string &input, const std::string &output)
 {
-	openDb(input);
+	string input_path = input;
+	if (input_path[input.length() - 1] != PATH_SEPARATOR) {
+		input_path += PATH_SEPARATOR;
+	}
+
+	openDb(input_path);
 	loadBlocks();
 	createImage();
 	renderMap();
@@ -244,7 +249,7 @@
 		renderOrigin();
 	}
 	if (m_drawPlayers) {
-		renderPlayers(input);
+		renderPlayers(input_path);
 	}
 	writeImage(output);
 	printUnknown();