added more test cases for MoveFootAction

--- test/common/action_test.cxx
+++ test/common/action_test.cxx
@@ -18,10 +18,10 @@
     EXPECT_TRUE(rru::update_local_db().component_allocator().in_configured_range(4U));
 }

-TEST(action_test, act_move_foot_basic)
-{
-    ren::energy original_energy1{rco::MoveFootAction::MAX_COST};
-    ren::inventory inventory1({0U, 100U});
+TEST(action_test, act_move_foot_forward_understock)
+{
+    ren::energy original_energy1{rco::MoveFootAction::MAX_COST / 2};
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
     ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
     ren::energy stock1{original_energy1.quantity};
     ren::physics::body_def body_def1;
@@ -34,6 +34,62 @@
     rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
     action1.setVelocity(rco::MoveFootAction::MAX_VELOCITY);
     ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::understock,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "act succeeded when stock was insufficient";
+    EXPECT_EQ(original_energy1.quantity, stock1.quantity) << "act failed but energy was still spent";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x == new_position1.x && original_position1.y == new_position1.y)
+	    << "unsuccessful act affected the simulation";
+}
+
+TEST(action_test, act_move_foot_backward_understock)
+{
+    ren::energy original_energy1{rco::MoveFootAction::MAX_COST / 2};
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{original_energy1.quantity};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(-rco::MoveFootAction::MAX_VELOCITY);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::understock,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "act succeeded when stock was insufficient";
+    EXPECT_EQ(original_energy1.quantity, stock1.quantity) << "act failed but energy was still spent";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x == new_position1.x && original_position1.y == new_position1.y)
+	    << "unsuccessful act affected the simulation";
+}
+
+TEST(action_test, act_move_foot_forward_basic)
+{
+    ren::energy original_energy1{rco::MoveFootAction::MAX_COST * 2};
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{original_energy1.quantity};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(rco::MoveFootAction::MAX_VELOCITY);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
     EXPECT_EQ(ren::inventory::spend_result::success,
 	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
 	    << "failed to act";
@@ -45,3 +101,139 @@
     EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
 	    << "action had no effect on simulation";
 }
+
+TEST(action_test, act_move_foot_backward_basic)
+{
+    ren::energy original_energy1{rco::MoveFootAction::MAX_COST * 2};
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{original_energy1.quantity};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(-rco::MoveFootAction::MAX_VELOCITY);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::success,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "failed to act";
+    EXPECT_NE(original_energy1.quantity, stock1.quantity) << "energy stock quantity is the same after successful action";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
+	    << "action had no effect on simulation";
+}
+
+TEST(action_test, act_move_foot_half_forward_velocity)
+{
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{rco::MoveFootAction::MAX_COST};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(rco::MoveFootAction::MAX_VELOCITY / 2);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::success,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "failed to act";
+    EXPECT_EQ(rco::MoveFootAction::MAX_COST / 2, stock1.quantity) << "energy spent was not proportional to the specified velocity";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
+	    << "action had no effect on simulation";
+}
+
+TEST(action_test, act_move_foot_half_backward_velocity)
+{
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{rco::MoveFootAction::MAX_COST};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(-rco::MoveFootAction::MAX_VELOCITY / 2);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::success,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "failed to act";
+    EXPECT_EQ(rco::MoveFootAction::MAX_COST / 2, stock1.quantity) << "energy spent was not proportional to the specified velocity";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
+	    << "action had no effect on simulation";
+}
+
+TEST(action_test, act_move_foot_excess_forward_velocity)
+{
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{rco::MoveFootAction::MAX_COST};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(rco::MoveFootAction::MAX_VELOCITY + 10);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::success,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "failed to act";
+    EXPECT_EQ(0U, stock1.quantity) << "energy spent was not equal to the max cost";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
+	    << "action had no effect on simulation";
+}
+
+TEST(action_test, act_move_foot_excess_backward_velocity)
+{
+    ren::inventory inventory1({0U, rco::MoveFootAction::MAX_COST * 2});
+    ren::physics physics1(ren::physics::vec2(0.0, 0.0), {8U, 4U});
+    ren::energy stock1{rco::MoveFootAction::MAX_COST};
+    ren::physics::body_def body_def1;
+    body_def1.type = b2_dynamicBody;
+    body_def1.position.Set(20.0, 20.0);
+    body_def1.angle = 0.0;
+    ren::physics_ptr<red::body> torso1 = physics1.make_body(0U, body_def1);
+    ren::physics_ptr<red::body> foot1 = physics1.make_body(0U, body_def1);
+    capnp::MallocMessageBuilder arena1;
+    rco::MoveFootAction::Builder action1 = arena1.initRoot<rco::MoveFootAction>();
+    action1.setVelocity(-rco::MoveFootAction::MAX_VELOCITY - 10);
+    ren::physics::vec2 original_position1 = foot1->GetPosition();
+    EXPECT_EQ(ren::inventory::spend_result::success,
+	    rco::act(inventory1, stock1, physics1, *torso1, *foot1, action1.asReader()))
+	    << "failed to act";
+    EXPECT_EQ(0U, stock1.quantity) << "energy spent was not equal to the max cost";
+    physics1.step(10.0,
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { },
+	    [&](const ren::physics::contact_participant&, const ren::physics::contact_participant&) -> void { });
+    ren::physics::vec2 new_position1 = foot1->GetPosition();
+    EXPECT_TRUE(original_position1.x != new_position1.x || original_position1.y != new_position1.y)
+	    << "action had no effect on simulation";
+}


No need to do an extra read

No need to do an extra read

--- test/cpp/qps/client_sync.cc
+++ test/cpp/qps/client_sync.cc
@@ -108,13 +108,10 @@
     if (stream_) {
       SimpleResponse response;
       stream_->WritesDone();
-      EXPECT_FALSE(stream_->Read(&response));
-
-      Status s = stream_->Finish();
-      EXPECT_TRUE(s.IsOk());
+      EXPECT_TRUE(stream_->Finish().IsOk());
     }
   }
-
+
   void ThreadFunc(Histogram* histogram, size_t thread_idx) GRPC_OVERRIDE {
     double start = Timer::Now();
     EXPECT_TRUE(stream_->Write(request_));
@@ -123,7 +120,8 @@
   }
   private:
     grpc::ClientContext context_;
-    std::unique_ptr<grpc::ClientReaderWriter<SimpleRequest,SimpleResponse>> stream_;
+    std::unique_ptr<grpc::ClientReaderWriter<SimpleRequest,
+                                             SimpleResponse>> stream_;
 };

 std::unique_ptr<Client>


D3D12 backend: removed ID3D12GraphicsCommandList5 that is not support by CI

--- Graphics/GraphicsEngineD3D12/src/CommandContext.cpp
+++ Graphics/GraphicsEngineD3D12/src/CommandContext.cpp
@@ -48,9 +48,7 @@
     m_PendingResourceBarriers.reserve(MaxPendingBarriers);
     CmdListManager.CreateNewCommandList(&m_pCommandList, &m_pCurrentAllocator);
 #ifdef DILIGENT_DEBUG
-    if (CComQIPtr<ID3D12GraphicsCommandList5>(m_pCommandList))
-        m_DbgMaxInterfaceVer = 5;
-    else if (CComQIPtr<ID3D12GraphicsCommandList4>(m_pCommandList))
+    if (CComQIPtr<ID3D12GraphicsCommandList4>(m_pCommandList))
         m_DbgMaxInterfaceVer = 4;
     else if (CComQIPtr<ID3D12GraphicsCommandList3>(m_pCommandList))
         m_DbgMaxInterfaceVer = 3;


COMP: Supply default seed on cygwin

COMP: Supply default seed on cygwin

--- Utilities/vxl/core/vnl/tests/test_cholesky.cxx
+++ Utilities/vxl/core/vnl/tests/test_cholesky.cxx
@@ -4,7 +4,6 @@
 #include <vnl/vnl_matrix.h>
 #include <vnl/algo/vnl_cholesky.h>
 #include <vnl/algo/vnl_svd.h>
-#include <vcl_ctime.h>
 #include <vnl/vnl_sample.h>

@@ -13,6 +12,7 @@
 void test_cholesky()
 {
   vnl_matrix<double> A(3,3);
+  vnl_sample_reseed(0x1234abcd);
   test_util_fill_random(A.begin(), A.end());
   A = A * A.transpose();


fix typo in error message

fix typo in error message

--- HLT/TPCLib/comp/AliHLTTPCDataCompressionDecoder.cxx
+++ HLT/TPCLib/comp/AliHLTTPCDataCompressionDecoder.cxx
@@ -319,7 +319,7 @@
   if (fCurrentClusterFlags->fVersion == 0) return(0); //Shipping of cluster flags was disabled during reconstruction
   if (fCurrentClusterFlags->fVersion >= 2)
   {
-    HLTError("Invalid version for compression of cluster flags. Version in the Data: %d, maximum version supported by this AliRoot Version: %d", fCurrentClusterFlags->fVersion, 2);
+    HLTError("Invalid version for compression of cluster flags. Version in the Data: %d, maximum version supported by this AliRoot Version: %d", fCurrentClusterFlags->fVersion, 1);
     return(0);
   }
   if (fCurrentClusterFlags->fVersion == 1)


Fixed compile error after rename on win32

--- final_platform_layer.hpp
+++ final_platform_layer.hpp
@@ -10245,7 +10245,7 @@
 				case VideoDriverType::OpenGL:
 				{
 #				if defined(FPL_PLATFORM_WIN32)
-					drivers::Win32UnloadVideoOpenGLApi(videoState->win32.opengl.glApi);
+					drivers::Win32UnloadVideoOpenGLApi(videoState->win32.opengl.api);
 #				elif defined(FPL_SUBPLATFORM_X11)
                     drivers::X11UnloadVideoOpenGLApi(videoState->x11.opengl.api);
 #				endif
@@ -10274,7 +10274,7 @@
 				case VideoDriverType::OpenGL:
 				{
 #				if defined(FPL_PLATFORM_WIN32)
-					result = drivers::Win32LoadVideoOpenGLApi(videoState->win32.opengl.glApi);
+					result = drivers::Win32LoadVideoOpenGLApi(videoState->win32.opengl.api);
 #				elif defined(FPL_SUBPLATFORM_X11)
                     result = drivers::X11LoadVideoOpenGLApi(videoState->x11.opengl.api);
 #				endif


uipcps: lower-flows: reorganize code layout

--- user/uipcps/uipcp-normal-lower-flows.cpp
+++ user/uipcps/uipcp-normal-lower-flows.cpp
@@ -192,6 +192,82 @@
     return 0;
 }

+void
+uipcp_rib::lfdb_update_address(rl_addr_t new_addr)
+{
+    LowerFlowList lfl;
+
+    /* Update local entries and propagate them. */
+    for (map<rl_addr_t, map<rl_addr_t, LowerFlow > >::iterator
+            it = lfdb.begin(); it != lfdb.end(); it++) {
+        for (map<rl_addr_t, LowerFlow>::iterator jt = it->second.begin();
+                                                jt != it->second.end(); jt++) {
+            LowerFlow &flow = jt->second;
+
+            if (flow.local_addr == myaddr) {
+                flow.local_addr = new_addr;
+                flow.seqnum ++;
+                lfl.flows.push_back(flow);
+                UPD(uipcp, "Local lower flow entry updated: %s\n",
+                           static_cast<string>(flow).c_str());
+            }
+        }
+    }
+
+    if (lfl.flows.size()) {
+        /* Update the routing table. */
+        re.update_kernel_routing(new_addr);
+    }
+
+}
+
+void
+age_incr_cb(struct uipcp *uipcp, void *arg)
+{
+    struct uipcp_rib *rib = (struct uipcp_rib *)arg;
+    ScopeLock(rib->lock);
+    bool discarded = false;
+
+    for (map<rl_addr_t, map< rl_addr_t, LowerFlow > >::iterator it
+                = rib->lfdb.begin(); it != rib->lfdb.end(); it++) {
+        list<map<rl_addr_t, LowerFlow >::iterator> discard_list;
+
+        if (it->first == rib->myaddr) {
+            /* Don't age local entries, we pretend they
+             * are always refreshed. */
+            continue;
+        }
+
+        for (map<rl_addr_t, LowerFlow >::iterator jt = it->second.begin();
+                                                jt != it->second.end(); jt++) {
+            jt->second.age += RL_AGE_INCR_INTERVAL;
+
+            if (jt->second.age > RL_AGE_MAX) {
+                /* Insert this into the list of entries to be discarded. */
+                discard_list.push_back(jt);
+                discarded = true;
+            }
+        }
+
+        for (list<map<rl_addr_t, LowerFlow >::iterator>::iterator dit
+                    = discard_list.begin(); dit != discard_list.end(); dit++) {
+            UPI(rib->uipcp, "Discarded lower-flow %s\n",
+                            static_cast<string>((*dit)->second).c_str());
+            it->second.erase(*dit);
+        }
+    }
+
+    if (discarded) {
+        /* Update the routing table. */
+        rib->re.update_kernel_routing(rib->myaddr);
+    }
+
+    /* Reschedule */
+    rib->age_incr_tmrid = uipcp_loop_schedule(uipcp,
+                                        RL_AGE_INCR_INTERVAL * 1000,
+                                        age_incr_cb, rib);
+}
+
 int
 RoutingEngine::compute_next_hops(rl_addr_t local_addr)
 {
@@ -373,79 +449,3 @@
     compute_fwd_table();
 }

-void
-age_incr_cb(struct uipcp *uipcp, void *arg)
-{
-    struct uipcp_rib *rib = (struct uipcp_rib *)arg;
-    ScopeLock(rib->lock);
-    bool discarded = false;
-
-    for (map<rl_addr_t, map< rl_addr_t, LowerFlow > >::iterator it
-                = rib->lfdb.begin(); it != rib->lfdb.end(); it++) {
-        list<map<rl_addr_t, LowerFlow >::iterator> discard_list;
-
-        if (it->first == rib->myaddr) {
-            /* Don't age local entries, we pretend they
-             * are always refreshed. */
-            continue;
-        }
-
-        for (map<rl_addr_t, LowerFlow >::iterator jt = it->second.begin();
-                                                jt != it->second.end(); jt++) {
-            jt->second.age += RL_AGE_INCR_INTERVAL;
-
-            if (jt->second.age > RL_AGE_MAX) {
-                /* Insert this into the list of entries to be discarded. */
-                discard_list.push_back(jt);
-                discarded = true;
-            }
-        }
-
-        for (list<map<rl_addr_t, LowerFlow >::iterator>::iterator dit
-                    = discard_list.begin(); dit != discard_list.end(); dit++) {
-            UPI(rib->uipcp, "Discarded lower-flow %s\n",
-                            static_cast<string>((*dit)->second).c_str());
-            it->second.erase(*dit);
-        }
-    }
-
-    if (discarded) {
-        /* Update the routing table. */
-        rib->re.update_kernel_routing(rib->myaddr);
-    }
-
-    /* Reschedule */
-    rib->age_incr_tmrid = uipcp_loop_schedule(uipcp,
-                                        RL_AGE_INCR_INTERVAL * 1000,
-                                        age_incr_cb, rib);
-}
-
-void
-uipcp_rib::lfdb_update_address(rl_addr_t new_addr)
-{
-    LowerFlowList lfl;
-
-    /* Update local entries and propagate them. */
-    for (map<rl_addr_t, map<rl_addr_t, LowerFlow > >::iterator
-            it = lfdb.begin(); it != lfdb.end(); it++) {
-        for (map<rl_addr_t, LowerFlow>::iterator jt = it->second.begin();
-                                                jt != it->second.end(); jt++) {
-            LowerFlow &flow = jt->second;
-
-            if (flow.local_addr == myaddr) {
-                flow.local_addr = new_addr;
-                flow.seqnum ++;
-                lfl.flows.push_back(flow);
-                UPD(uipcp, "Local lower flow entry updated: %s\n",
-                           static_cast<string>(flow).c_str());
-            }
-        }
-    }
-
-    if (lfl.flows.size()) {
-        /* Update the routing table. */
-        re.update_kernel_routing(new_addr);
-    }
-
-}
-


In tests/unit/fem/test_get_value.cpp, add constexpr to some 'dim' variables to avoid the use VLAs -- this generated warnings when building with -pedantic flag.

--- tests/unit/fem/test_get_value.cpp
+++ tests/unit/fem/test_get_value.cpp
@@ -287,7 +287,7 @@
 {
    int log = 1;
    int n = 1;
-   int dim = 2;
+   constexpr int dim = 2;
    int order = 1;
    int npts = 0;

@@ -560,7 +560,7 @@
 {
    int log = 1;
    int n = 1;
-   int dim = 3;
+   constexpr int dim = 3;
    int order = 1;
    int npts = 0;

@@ -872,7 +872,7 @@
 {
    int log = 1;
    int n = 1;
-   int dim = 2;
+   constexpr int dim = 2;
    int order = 1;
    int npts = 0;

@@ -1312,7 +1312,7 @@
 {
    int log = 1;
    int n = 1;
-   int dim = 3;
+   constexpr int dim = 3;
    int order = 1;
    int npts = 0;


Change loops to derive the number of tables automatically

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

--- utils/TableGen/X86DisassemblerTables.cpp
+++ utils/TableGen/X86DisassemblerTables.cpp
@@ -267,7 +267,7 @@
 DisassemblerTables::DisassemblerTables() {
   unsigned i;

-  for (i = 0; i < 4; i++) {
+  for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++) {
     Tables[i] = new ContextDecision;
     memset(Tables[i], 0, sizeof(ContextDecision));
   }
@@ -278,7 +278,7 @@
 DisassemblerTables::~DisassemblerTables() {
   unsigned i;

-  for (i = 0; i < 4; i++)
+  for (i = 0; i < sizeof(Tables) / sizeof(Tables[0]); i++)
     delete Tables[i];
 }


Remove trailing whitespace

Remove trailing whitespace

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

--- utils/TableGen/X86DisassemblerTables.cpp
+++ utils/TableGen/X86DisassemblerTables.cpp
@@ -24,7 +24,7 @@

 using namespace llvm;
 using namespace X86Disassembler;
-
+
 /// inheritsFrom - Indicates whether all instructions in one class also belong
 ///   to another class.
 ///
@@ -36,7 +36,7 @@
                                 bool VEX_LIG = false) {
   if (child == parent)
     return true;
-
+
   switch (parent) {
   case IC:
     return(inheritsFrom(child, IC_64BIT) ||
@@ -117,17 +117,17 @@
 /// @param upper  - The class that may be preferable
 /// @param lower  - The class that may be less preferable
 /// @return       - True if upper is to be preferred, false otherwise.
-static inline bool outranks(InstructionContext upper,
+static inline bool outranks(InstructionContext upper,
                             InstructionContext lower) {
   assert(upper < IC_max);
   assert(lower < IC_max);
-
+
 #define ENUM_ENTRY(n, r, d) r,
   static int ranks[IC_max] = {
     INSTRUCTION_CONTEXTS
   };
 #undef ENUM_ENTRY
-
+
   return (ranks[upper] > ranks[lower]);
 }

@@ -178,16 +178,16 @@
     o.indent(i * 2) << format("0x%hx", id);
   else
     o.indent(i * 2) << 0;
-
+
   if (addComma)
     o << ", ";
   else
     o << "  ";
-
+
   o << "/* ";
   o << InstructionSpecifiers[id].name;
   o << "*/";
-
+
   o << "\n";
 }

@@ -252,19 +252,19 @@
 ///   to a particular decision type.
 ///
 /// @param dt - The decision type.
-/// @return   - A pointer to the statically-allocated string (e.g.,
+/// @return   - A pointer to the statically-allocated string (e.g.,
 ///             "MODRM_ONEENTRY" for MODRM_ONEENTRY).
 static const char* stringForDecisionType(ModRMDecisionType dt)
 {
 #define ENUM_ENTRY(n) case n: return #n;
   switch (dt) {
     default:
-      llvm_unreachable("Unknown decision type");
+      llvm_unreachable("Unknown decision type");
     MODRMTYPES
-  };
+  };
 #undef ENUM_ENTRY
 }
-
+
 /// stringForModifierType - Returns a statically-allocated string corresponding
 ///   to an opcode modifier type.
 ///
@@ -281,25 +281,25 @@
   };
 #undef ENUM_ENTRY
 }
-
+
 DisassemblerTables::DisassemblerTables() {
   unsigned i;
-
+
   for (i = 0; i < array_lengthof(Tables); i++) {
     Tables[i] = new ContextDecision;
     memset(Tables[i], 0, sizeof(ContextDecision));
   }
-
+
   HasConflicts = false;
 }
-
+
 DisassemblerTables::~DisassemblerTables() {
   unsigned i;
-
+
   for (i = 0; i < array_lengthof(Tables); i++)
     delete Tables[i];
 }
-
+
 void DisassemblerTables::emitModRMDecision(raw_ostream &o1,
                                            raw_ostream &o2,
                                            uint32_t &i1,
@@ -444,11 +444,11 @@
   o2.indent(i2) << "};" << "\n";
 }

-void DisassemblerTables::emitInstructionInfo(raw_ostream &o, uint32_t &i)
+void DisassemblerTables::emitInstructionInfo(raw_ostream &o, uint32_t &i)
   const {
   o.indent(i * 2) << "static const struct InstructionSpecifier ";
   o << INSTRUCTIONS_STR "[" << InstructionSpecifiers.size() << "] = {\n";
-
+
   i++;

   uint16_t numInstructions = InstructionSpecifiers.size();
@@ -488,7 +488,7 @@

     i--;
     o.indent(i * 2) << "}," << "\n";
-
+
     o.indent(i * 2) << "/* " << InstructionSpecifiers[index].name << " */";
     o << "\n";

@@ -545,7 +545,7 @@
       o << "IC_64BIT_REXW_XS";
     else if ((index & ATTR_64BIT) && (index & ATTR_REXW) && (index & ATTR_XD))
       o << "IC_64BIT_REXW_XD";
-    else if ((index & ATTR_64BIT) && (index & ATTR_REXW) &&
+    else if ((index & ATTR_64BIT) && (index & ATTR_REXW) &&
              (index & ATTR_OPSIZE))
       o << "IC_64BIT_REXW_OPSIZE";
     else if ((index & ATTR_64BIT) && (index & ATTR_XD) && (index & ATTR_OPSIZE))
@@ -609,13 +609,13 @@
 void DisassemblerTables::emit(raw_ostream &o) const {
   uint32_t i1 = 0;
   uint32_t i2 = 0;
-
+
   std::string s1;
   std::string s2;
-
+
   raw_string_ostream o1(s1);
   raw_string_ostream o2(s2);
-
+
   emitInstructionInfo(o, i2);
   o << "\n";

@@ -653,10 +653,10 @@
           InstructionSpecifiers[uid];
         InstructionSpecifier &previousInfo =
           InstructionSpecifiers[decision.instructionIDs[index]];
-
+
         if(newInfo.filtered)
           continue; // filtered instructions get lowest priority
-
+
         if(previousInfo.name == "NOOP" && (newInfo.name == "XCHG16ar" ||
                                            newInfo.name == "XCHG32ar" ||
                                            newInfo.name == "XCHG32ar64" ||
@@ -665,7 +665,7 @@

         if (outranks(previousInfo.insnContext, newInfo.insnContext))
           continue;
-
+
         if (previousInfo.insnContext == newInfo.insnContext &&
             !previousInfo.filtered) {
           errs() << "Error: Primary decode conflict: ";
@@ -691,16 +691,16 @@
                                         bool                is32bit,
                                         bool                ignoresVEX_L) {
   unsigned index;
-
+
   ContextDecision &decision = *Tables[type];

   for (index = 0; index < IC_max; ++index) {
     if (is32bit && inheritsFrom((InstructionContext)index, IC_64BIT))
       continue;

-    if (inheritsFrom((InstructionContext)index,
+    if (inheritsFrom((InstructionContext)index,
                      InstructionSpecifiers[uid].insnContext, ignoresVEX_L))
-      setTableFields(decision.opcodeDecisions[index].modRMDecisions[opcode],
+      setTableFields(decision.opcodeDecisions[index].modRMDecisions[opcode],
                      filter,
                      uid,
                      opcode);


INTEGRATION: CWS vcl26 (1.2.86); FILE MERGED 2004/08/27 13:00:13 dv 1.2.86.3: #i33381# Better scrollbar positioning 2004/08/26 14:22:17 dv 1.2.86.2: #i33447# Always use GTK_SHADOW_IN for all kinds of edit fields 2004/08/25 13:05:44 dv 1.2.86.1: #i33381# Use theme settings for calculating scrollbar rectangles, enhanced painting of scrollbar

--- vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: salnativewidgets-gtk.cxx,v $
  *
- *  $Revision: 1.3 $
- *
- *  last change: $Author: rt $ $Date: 2004-09-08 15:12:32 $
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: hr $ $Date: 2004-09-08 16:10:27 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -147,6 +147,7 @@
 static void NWAddWidgetToCacheWindow( GtkWidget* widget );
 static void NWSetWidgetState( GtkWidget* widget, ControlState nState, GtkStateType nGtkState );

+static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow );

 /*
  * Individual helper functions
@@ -183,6 +184,9 @@

 static Rectangle NWGetListBoxIndicatorRect( ControlType nType, ControlPart nPart, Rectangle aAreaRect, ControlState nState,
                             const ImplControlValue& aValue, SalControlHandle& rControlHandle, OUString aCaption );
+//---
+
+static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect );
 //---

 /*********************************************************
@@ -373,7 +377,8 @@
         ((nType==CTRL_SCROLLBAR) &&
                 (  (nPart==PART_DRAW_BACKGROUND_HORZ)
                 || (nPart==PART_DRAW_BACKGROUND_VERT)
-                || (nPart==PART_ENTIRE_CONTROL) )               )   ||
+                || (nPart==PART_ENTIRE_CONTROL)
+                || (nPart==HAS_THREE_BUTTONS) )                 )   ||
         ((nType==CTRL_EDITBOX) &&
                 (  (nPart==PART_ENTIRE_CONTROL)
                 || (nPart==HAS_BACKGROUND_TEXTURE) )            )   ||
@@ -418,6 +423,85 @@
                                 SalControlHandle&   rControlHandle,
                                 BOOL&           rIsInside )
 {
+    if ( ( nType == CTRL_SCROLLBAR ) &&
+         ( ( nPart == PART_BUTTON_UP ) ||
+           ( nPart == PART_BUTTON_DOWN ) ||
+           ( nPart == PART_BUTTON_LEFT ) ||
+           ( nPart == PART_BUTTON_RIGHT ) ) )
+    {
+        NWEnsureGTKScrollbars();
+
+        // Grab some button style attributes
+        gboolean has_forward;
+        gboolean has_forward2;
+        gboolean has_backward;
+        gboolean has_backward2;
+
+        gtk_widget_style_get( gScrollHorizWidget, "has-forward-stepper", &has_forward,
+                                        "has-secondary-forward-stepper", &has_forward2,
+                                        "has-backward-stepper", &has_backward,
+                                           "has-secondary-backward-stepper", &has_backward2, NULL );
+        Rectangle aForward;
+        Rectangle aBackward;
+
+        rIsInside = FALSE;
+
+        ControlPart nCounterPart;
+        if ( nPart == PART_BUTTON_UP )
+            nCounterPart = PART_BUTTON_DOWN;
+        else if ( nPart == PART_BUTTON_DOWN )
+            nCounterPart = PART_BUTTON_UP;
+        else if ( nPart == PART_BUTTON_LEFT )
+            nCounterPart = PART_BUTTON_RIGHT;
+        else if ( nPart == PART_BUTTON_RIGHT )
+            nCounterPart = PART_BUTTON_LEFT;
+
+        aBackward = NWGetScrollButtonRect( nPart, rControlRegion.GetBoundRect() );
+        aForward = NWGetScrollButtonRect( nCounterPart, rControlRegion.GetBoundRect() );
+
+        if ( has_backward && has_forward2 )
+        {
+            if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
+                aBackward.setHeight( aBackward.getHeight() / 2 );
+            else
+                aBackward.setWidth( aBackward.getWidth() / 2 );
+
+            if ( nPart == PART_BUTTON_DOWN )
+                aBackward.Move( 0, aBackward.getHeight() / 2 );
+            else if ( nPart == PART_BUTTON_RIGHT )
+                aBackward.Move( aBackward.getWidth() / 2, 0 );
+        }
+
+        if ( has_backward2 && has_forward )
+        {
+            if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
+                aForward.setHeight( aForward.getHeight() / 2 );
+            else
+                aForward.setWidth( aForward.getWidth() / 2 );
+
+            if ( nPart == PART_BUTTON_DOWN )
+                aForward.Move( 0, aForward.getHeight() / 2 );
+            else if ( nPart == PART_BUTTON_RIGHT )
+                aForward.Move( aForward.getWidth() / 2, 0 );
+        }
+
+        if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_LEFT ) )
+        {
+            if ( has_backward )
+                rIsInside |= aBackward.IsInside( aPos );
+            if ( has_backward2 )
+                rIsInside |= aForward.IsInside( aPos );
+        }
+        else
+        {
+            if ( has_forward )
+                rIsInside |= aBackward.IsInside( aPos );
+            if ( has_forward2 )
+                rIsInside |= aForward.IsInside( aPos );
+        }
+        return ( TRUE );
+    }
+
     if( IsNativeControlSupported(nType, nPart) )
     {
         rIsInside = rControlRegion.IsInside( aPos );
@@ -606,6 +690,14 @@
         {
             rNativeBoundingRegion = NWGetListBoxButtonRect( nType, nPart, rControlRegion.GetBoundRect(), nState,
                                         aValue, rControlHandle, aCaption );
+            rNativeContentRegion = rNativeBoundingRegion;
+
+            returnVal = TRUE;
+        }
+        if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
+                                         (nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)  ) )
+        {
+            rNativeBoundingRegion = NWGetScrollButtonRect( nPart, rControlRegion.GetBoundRect() );
             rNativeContentRegion = rNativeBoundingRegion;

             returnVal = TRUE;
@@ -998,6 +1090,15 @@
 }

 //-------------------------------------
+static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow )
+{
+    // Size the arrow appropriately
+    rArrow.setWidth ( rButton.getWidth()  / 2 );
+    rArrow.setHeight( rButton.getHeight() / 2 );
+
+    rArrow.setX( rButton.getX() + ( rButton.getWidth()  - rArrow.getWidth()  ) / 2 );
+    rArrow.setY( rButton.getY() + ( rButton.getHeight() - rArrow.getHeight() ) / 2 );
+}

 BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType nType, ControlPart nPart,
                                           const Region& rControlRegion, ControlState nState,
@@ -1015,12 +1116,12 @@
     GtkAdjustment* scrollbarValues = NULL;
     GtkOrientation  scrollbarOrientation;
     Rectangle       thumbRect = pScrollbarVal->maThumbRect;
-    Rectangle       button1BoundRect = pScrollbarVal->maButton1Rect;
-    Rectangle       button2BoundRect = pScrollbarVal->maButton2Rect;
-    GtkArrowType    button1Type;
-    GtkArrowType    button2Type;
-    gint            nButton1Extra = 0;
-    gint            nButton2Extra = 0;
+    Rectangle       button11BoundRect = pScrollbarVal->maButton1Rect;   // backward
+    Rectangle       button22BoundRect = pScrollbarVal->maButton2Rect;   // forward
+    Rectangle       button12BoundRect = pScrollbarVal->maButton1Rect;   // secondary forward
+    Rectangle       button21BoundRect = pScrollbarVal->maButton2Rect;   // secondary backward
+    GtkArrowType    button1Type;                                        // backward
+    GtkArrowType    button2Type;                                        // forward
     gchar *     scrollbarTagH = (gchar *) "hscrollbar";
     gchar *     scrollbarTagV = (gchar *) "vscrollbar";
     gchar *     scrollbarTag = NULL;
@@ -1049,6 +1150,7 @@
     pixmapRect.setWidth( pixmapRect.getWidth() + 1 );
     pixmapRect.setHeight( pixmapRect.getHeight() + 1 );
     scrollbarRect = pixmapRect;
+
     if ( (scrollbarRect.getWidth() <= 1) || (scrollbarRect.getHeight() <= 1) )
         return( TRUE );

@@ -1058,10 +1160,24 @@
                                       "trough_border", &trough_border,
                                       "stepper_spacing", &stepper_spacing,
                                       "min_slider_length", &min_slider_length, NULL );
+    gboolean has_forward;
+    gboolean has_forward2;
+    gboolean has_backward;
+    gboolean has_backward2;
+
+    gtk_widget_style_get( gScrollHorizWidget, "has-forward-stepper", &has_forward,
+                                      "has-secondary-forward-stepper", &has_forward2,
+                                      "has-backward-stepper", &has_backward,
+                                         "has-secondary-backward-stepper", &has_backward2, NULL );
+    gint magic = trough_border ? 1 : 0;
+    gint nFirst = 0;
+
+    if ( has_backward )  nFirst  += 1;
+    if ( has_forward2 )  nFirst  += 1;

     if ( nPart == PART_DRAW_BACKGROUND_HORZ )
     {
-        unsigned int    sliderHeight = slider_width + (trough_border * 2);
+        unsigned int sliderHeight = slider_width + (trough_border * 2);
         vShim = (pixmapRect.getHeight() - sliderHeight) / 2;

         if ( sliderHeight < scrollbarRect.getHeight() );
@@ -1076,18 +1192,32 @@
         button1Type = GTK_ARROW_LEFT;
         button2Type = GTK_ARROW_RIGHT;

-        button1BoundRect.setX( (button1BoundRect.getWidth()-stepper_size) / 2 );
-        button1BoundRect.setY( ((button1BoundRect.getHeight()-vShim)-slider_width) / 2 );
-        button1BoundRect.setHeight( slider_width );
-        button1BoundRect.setWidth( stepper_size );
-        nButton1Extra = (pScrollbarVal->maButton1Rect.getX() + pScrollbarVal->maButton1Rect.getWidth()) -
-                (button1BoundRect.getX() + button1BoundRect.getWidth());
-
-        button2BoundRect.setX( scrollbarRect.getWidth() - button2BoundRect.getWidth() + ((button2BoundRect.getWidth()-stepper_size) / 2) );
-        button2BoundRect.setY( ((button2BoundRect.getHeight()-vShim)-slider_width) / 2 );
-        button2BoundRect.setHeight( slider_width );
-        button2BoundRect.setWidth( stepper_size );
-        nButton2Extra =  button2BoundRect.getX() - pScrollbarVal->maButton2Rect.getX();
+        if ( has_backward )
+        {
+            button12BoundRect.Move( stepper_size - trough_border,
+                                    (scrollbarRect.getHeight() - slider_width) / 2 );
+        }
+
+        button11BoundRect.Move( trough_border, (scrollbarRect.getHeight() - slider_width) / 2 );
+        button11BoundRect.setHeight( slider_width );
+        button11BoundRect.setWidth( stepper_size );
+        button12BoundRect.setHeight( slider_width );
+        button12BoundRect.setWidth( stepper_size );
+
+        if ( has_backward2 )
+        {
+            button22BoundRect.Move( stepper_size+(trough_border+1)/2, (scrollbarRect.getHeight() - slider_width) / 2 );
+            button21BoundRect.Move( (trough_border+1)/2, (scrollbarRect.getHeight() - slider_width) / 2 );
+        }
+        else
+        {
+            button22BoundRect.Move( (trough_border+1)/2, (scrollbarRect.getHeight() - slider_width) / 2 );
+        }
+
+        button21BoundRect.setHeight( slider_width );
+        button21BoundRect.setWidth( stepper_size );
+        button22BoundRect.setHeight( slider_width );
+        button22BoundRect.setWidth( stepper_size );

         thumbRect.setHeight( slider_width );
         // Make sure the thumb is at least the default width (so we don't get tiny thumbs),
@@ -1099,18 +1229,13 @@
             thumbRect.setWidth( min_slider_length );
 #endif

+        thumbRect.setWidth( thumbRect.getWidth() + magic );
         // Center vertically in the track
         thumbRect.Move( 0, (scrollbarRect.getHeight() - slider_width) / 2 );
-
-        // Themes may have a different idea of what the scrollbar stepper button
-        // size should be, so we have to adjust the Thumbs rectangle to account
-        // for the difference between OOo's idea and the theme's
-        thumbRect.Move( -nButton1Extra, 0 );
-        thumbRect.setWidth( thumbRect.getWidth() + nButton1Extra + nButton2Extra );
     }
     else
     {
-        unsigned int    sliderWidth = slider_width + (trough_border * 2);
+        unsigned int sliderWidth = slider_width + (trough_border * 2);
         hShim = (pixmapRect.getWidth() - sliderWidth) / 2;

         if ( sliderWidth < scrollbarRect.getWidth() );
@@ -1125,18 +1250,31 @@
         button1Type = GTK_ARROW_UP;
         button2Type = GTK_ARROW_DOWN;

-        button1BoundRect.setX( ((button1BoundRect.getWidth()-hShim)-slider_width) / 2 );
-        button1BoundRect.setY( (button1BoundRect.getHeight()-stepper_size) / 2 );
-        button1BoundRect.setHeight( stepper_size );
-        button1BoundRect.setWidth( slider_width );
-        nButton1Extra = (pScrollbarVal->maButton1Rect.getY() + pScrollbarVal->maButton1Rect.getHeight()) -
-                (button1BoundRect.getY() + button1BoundRect.getHeight());
-
-        button2BoundRect.setX( ((button2BoundRect.getWidth()-hShim)-slider_width) / 2 );
-        button2BoundRect.setY( scrollbarRect.getHeight() - button2BoundRect.getHeight() + ((button2BoundRect.getHeight()-stepper_size) / 2) );
-        button2BoundRect.setHeight( stepper_size );
-        button2BoundRect.setWidth( slider_width );
-        nButton2Extra =  button2BoundRect.getY() - pScrollbarVal->maButton2Rect.getY();
+        if ( has_backward )
+        {
+            button12BoundRect.Move( (scrollbarRect.getWidth() - slider_width) / 2,
+                                    stepper_size + trough_border );
+        }
+        button11BoundRect.Move( (scrollbarRect.getWidth() - slider_width) / 2, trough_border );
+        button11BoundRect.setHeight( stepper_size );
+        button11BoundRect.setWidth( slider_width );
+        button12BoundRect.setHeight( stepper_size );
+        button12BoundRect.setWidth( slider_width );
+
+        if ( has_backward2 )
+        {
+            button22BoundRect.Move( (scrollbarRect.getWidth() - slider_width) / 2, stepper_size+(trough_border+1)/2 );
+            button21BoundRect.Move( (scrollbarRect.getWidth() - slider_width) / 2, (trough_border+1)/2 );
+        }
+        else
+        {
+            button22BoundRect.Move( (scrollbarRect.getWidth() - slider_width) / 2, (trough_border+1)/2 );
+        }
+
+        button21BoundRect.setHeight( stepper_size );
+        button21BoundRect.setWidth( slider_width );
+        button22BoundRect.setHeight( stepper_size );
+        button22BoundRect.setWidth( slider_width );

         thumbRect.setWidth( slider_width );
 #if 0
@@ -1148,15 +1286,12 @@
             thumbRect.setHeight( min_slider_length );
 #endif

+        thumbRect.setHeight( thumbRect.getHeight() + magic );
         // Center horizontally in the track
         thumbRect.Move( (scrollbarRect.getWidth() - slider_width) / 2, 0 );
-
-        // Themes may have a different idea of what the scrollbar stepper button
-        // size should be, so we have to adjust the Thumbs rectangle to account
-        // for the difference between OOo's idea and the theme's
-        thumbRect.Move( 0, -nButton1Extra );
-        thumbRect.setHeight( thumbRect.getHeight() + nButton1Extra + nButton2Extra );
-    }
+    }
+
+    BOOL has_slider = ! ( thumbRect.IsEmpty() );

     scrollbarValues = gtk_range_get_adjustment( GTK_RANGE(scrollbarWidget) );
     if ( scrollbarValues == NULL )
@@ -1176,17 +1311,6 @@
         scrollbarValues->page_size = scrollbarRect.getHeight() / 2;
     }
     gtk_adjustment_changed( scrollbarValues );
-
-    // Size the arrow appropriately
-    arrow1Rect.setWidth ( button1BoundRect.getWidth()  / 2 );
-    arrow1Rect.setHeight( button1BoundRect.getHeight() / 2 );
-    arrow2Rect.setWidth ( button2BoundRect.getWidth()  / 2 );
-    arrow2Rect.setHeight( button2BoundRect.getHeight() / 2 );
-
-    arrow1Rect.setX( button1BoundRect.getX() + (button1BoundRect.getWidth()  - arrow1Rect.getWidth() ) / 2 );
-    arrow1Rect.setY( button1BoundRect.getY() + (button1BoundRect.getHeight() - arrow1Rect.getHeight()) / 2 );
-    arrow2Rect.setX( button2BoundRect.getX() + (button2BoundRect.getWidth()  - arrow2Rect.getWidth() ) / 2 );
-    arrow2Rect.setY( button2BoundRect.getY() + (button2BoundRect.getHeight() - arrow2Rect.getHeight()) / 2 );

     if( !bUseWindow )
     {
@@ -1234,38 +1358,77 @@
     }

     // ----------------- THUMB
-    NWConvertVCLStateToGTKState( pScrollbarVal->mnThumbState, &stateType, &shadowType );
-    if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED )  stateType = GTK_STATE_PRELIGHT;
-    gtk_paint_slider( style, gdkDrawable, stateType, GTK_SHADOW_OUT,
-                      gdkRect, GTK_WIDGET(scrollbarWidget), "slider",
-                      x+hShim+thumbRect.getX(), y+vShim+thumbRect.getY(),
-                      thumbRect.getWidth(), thumbRect.getHeight(), scrollbarOrientation );
-
-    // ----------------- BUTTON 1
-    NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
-    if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
-    gtk_paint_box( style, gdkDrawable, stateType, shadowType,
-                   gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
-                   x+hShim+button1BoundRect.getX(), y+vShim+button1BoundRect.getY(),
-                   button1BoundRect.getWidth(), button1BoundRect.getHeight() );
-    // ----------------- ARROW 1
-    gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
-                     gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
-                     x+hShim+arrow1Rect.getX(), y+vShim+arrow1Rect.getY(),
-                     arrow1Rect.getWidth(), arrow1Rect.getHeight() );
-
+    if ( has_slider )
+    {
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnThumbState, &stateType, &shadowType );
+        if ( pScrollbarVal->mnThumbState & CTRL_STATE_PRESSED )  stateType = GTK_STATE_PRELIGHT;
+        gtk_paint_slider( style, gdkDrawable, stateType, GTK_SHADOW_OUT,
+                        gdkRect, GTK_WIDGET(scrollbarWidget), "slider",
+                        x+hShim+thumbRect.getX(), y+vShim+thumbRect.getY(),
+                        thumbRect.getWidth(), thumbRect.getHeight(), scrollbarOrientation );
+    }
+    // ----------------- BUTTON 1 //
+    if ( has_backward )
+    {
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
+        gtk_paint_box( style, gdkDrawable, stateType, shadowType,
+                       gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+                       x+hShim+button11BoundRect.getX(), y+vShim+button11BoundRect.getY(),
+                       button11BoundRect.getWidth(), button11BoundRect.getHeight() );
+        // ----------------- ARROW 1
+        NWCalcArrowRect( button11BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
+                         gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+                         x+hShim+arrowRect.getX(), y+vShim+arrowRect.getY(),
+                         arrowRect.getWidth(), arrowRect.getHeight() );
+    }
+    if ( has_forward2 )
+    {
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
+        gtk_paint_box( style, gdkDrawable, stateType, shadowType,
+                       gdkRect, GTK_WIDGET(scrollbarWidget), "stepper",
+                       x+hShim+button12BoundRect.getX(), y+vShim+button12BoundRect.getY(),
+                       button12BoundRect.getWidth(), button12BoundRect.getHeight() );
+        // ----------------- ARROW 1
+        NWCalcArrowRect( button12BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
+                         gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+                         x+hShim+arrowRect.getX(), y+vShim+arrowRect.getY(),
+                         arrowRect.getWidth(), arrowRect.getHeight() );
+    }
     // ----------------- BUTTON 2
-    NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
-    if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
-    gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
-                   GTK_WIDGET(scrollbarWidget), "stepper",
-                   x+hShim+button2BoundRect.getX(), y+vShim+button2BoundRect.getY(),
-                   button2BoundRect.getWidth(), button2BoundRect.getHeight() );
-    // ----------------- ARROW 2
-    gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
-                     gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
-                     x+hShim+arrow2Rect.getX(), y+vShim+arrow2Rect.getY(),
-                     arrow2Rect.getWidth(), arrow2Rect.getHeight() );
+    if ( has_backward2 )
+    {
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnButton1State, &stateType, &shadowType );
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
+        gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
+                       GTK_WIDGET(scrollbarWidget), "stepper",
+                       x+hShim+button21BoundRect.getX(), y+vShim+button21BoundRect.getY(),
+                       button21BoundRect.getWidth(), button21BoundRect.getHeight() );
+        // ----------------- ARROW 2
+        NWCalcArrowRect( button21BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
+                         gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button1Type, TRUE,
+                         x+hShim+arrowRect.getX(), y+vShim+arrowRect.getY(),
+                         arrowRect.getWidth(), arrowRect.getHeight() );
+    }
+    if ( has_forward )
+    {
+        NWConvertVCLStateToGTKState( pScrollbarVal->mnButton2State, &stateType, &shadowType );
+        if ( stateType == GTK_STATE_INSENSITIVE )   stateType = GTK_STATE_NORMAL;
+        gtk_paint_box( style, gdkDrawable, stateType, shadowType, gdkRect,
+                       GTK_WIDGET(scrollbarWidget), "stepper",
+                       x+hShim+button22BoundRect.getX(), y+vShim+button22BoundRect.getY(),
+                       button22BoundRect.getWidth(), button22BoundRect.getHeight() );
+        // ----------------- ARROW 2
+        NWCalcArrowRect( button22BoundRect, arrowRect );
+        gtk_paint_arrow( style, gdkDrawable, stateType, shadowType,
+                         gdkRect, GTK_WIDGET(scrollbarWidget), scrollbarTag, button2Type, TRUE,
+                         x+hShim+arrowRect.getX(), y+vShim+arrowRect.getY(),
+                         arrowRect.getWidth(), arrowRect.getHeight() );
+    }

     if( !bUseWindow )
     {
@@ -1277,6 +1440,88 @@
         g_object_unref( pixmap );
     }
     return( TRUE );
+}
+
+//---
+
+static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect )
+{
+    gint slider_width;
+    gint stepper_size;
+    gint stepper_spacing;
+    gint trough_border;
+
+    NWEnsureGTKScrollbars();
+
+    // Grab some button style attributes
+    gtk_widget_style_get( gScrollHorizWidget, "slider-width", &slider_width,
+                                      "stepper-size", &stepper_size,
+                                      "trough-border", &trough_border,
+                                         "stepper-spacing", &stepper_spacing, NULL );
+
+    gboolean has_forward;
+    gboolean has_forward2;
+    gboolean has_backward;
+    gboolean has_backward2;
+
+    gtk_widget_style_get( gScrollHorizWidget, "has-forward-stepper", &has_forward,
+                                      "has-secondary-forward-stepper", &has_forward2,
+                                      "has-backward-stepper", &has_backward,
+                                         "has-secondary-backward-stepper", &has_backward2, NULL );
+    gint       buttonWidth;
+    gint       buttonHeight;
+    Rectangle  buttonRect;
+
+    gint nFirst = 0;
+    gint nSecond = 0;
+
+    if ( has_forward )   nSecond += 1;
+    if ( has_forward2 )  nFirst  += 1;
+    if ( has_backward )  nFirst  += 1;
+    if ( has_backward2 ) nSecond += 1;
+
+    if ( ( nPart == PART_BUTTON_UP ) || ( nPart == PART_BUTTON_DOWN ) )
+    {
+        buttonWidth = slider_width + 2 * trough_border;
+        buttonHeight = stepper_size + trough_border + stepper_spacing;
+    }
+    else
+    {
+        buttonWidth = stepper_size + trough_border + stepper_spacing;
+        buttonHeight = slider_width + 2 * trough_border;
+    }
+
+    if ( nPart == PART_BUTTON_UP )
+    {
+        buttonHeight *= nFirst;
+        buttonHeight -= 1;
+        buttonRect.setX( aAreaRect.getX() );
+        buttonRect.setY( aAreaRect.getY() );
+    }
+    else if ( nPart == PART_BUTTON_LEFT )
+    {
+        buttonWidth *= nFirst;
+        buttonWidth -= 1;
+        buttonRect.setX( aAreaRect.getX() );
+        buttonRect.setY( aAreaRect.getY() );
+    }
+    else if ( nPart == PART_BUTTON_DOWN )
+    {
+        buttonHeight *= nSecond;
+        buttonRect.setX( aAreaRect.getX() );
+        buttonRect.setY( aAreaRect.getY() + aAreaRect.getHeight() - buttonHeight );
+    }
+    else if ( nPart == PART_BUTTON_RIGHT )
+    {
+        buttonWidth *= nSecond;
+        buttonRect.setX( aAreaRect.getX() + aAreaRect.getWidth() - buttonWidth );
+        buttonRect.setY( aAreaRect.getY() );
+    }
+
+    buttonRect.setWidth( buttonWidth );
+    buttonRect.setHeight( buttonHeight );
+
+    return( buttonRect );
 }

 //-------------------------------------
@@ -1375,6 +1620,8 @@
     NWEnsureGTKCombo();
     NWConvertVCLStateToGTKState( nState, &stateType, &shadowType );

+    shadowType = GTK_SHADOW_IN;
+
     switch ( nType )
     {
         case CTRL_COMBOBOX:


Implement some sdCard stuff

Implement some sdCard stuff

--- Drivers/DevicesInterop/GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper.cpp
+++ Drivers/DevicesInterop/GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper.cpp
@@ -2,9 +2,13 @@
 #include "GHIElectronics_TinyCLR_InteropUtil.h"

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::get_IsPresent___BOOLEAN(const TinyCLR_Interop_MethodData md) {
+    auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));

+    TinyCLR_Interop_ClrValue ret;

-    return TinyCLR_Result::NotImplemented;
+    md.InteropManager->GetReturn(md.InteropManager, md.Stack, ret);
+
+    return api->IsPresent(api, ret.Data.Numeric->Boolean);
 }

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::get_Descriptor___GHIElectronicsTinyCLRDevicesStorageStorageDescriptor(const TinyCLR_Interop_MethodData md) {
@@ -14,18 +18,18 @@
 }

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Open___VOID(const TinyCLR_Interop_MethodData md) {
+    auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));

-
-    return TinyCLR_Result::NotImplemented;
+    return api->Open(api);
 }

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Close___VOID(const TinyCLR_Interop_MethodData md) {
+    auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));

-
-    return TinyCLR_Result::NotImplemented;
+    return api->Close(api);
 }

-TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Read___I4__I8__I4__SZARRAY_U1__I4__I8(const TinyCLR_Interop_MethodData md) {
+TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Read___I4__I8__I4__SZARRAY_U1__I4__I8(const TinyCLR_Interop_MethodData md) {
     auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));

     TinyCLR_Interop_ClrValue arg0, arg1, arg2, arg3, arg4;
@@ -55,7 +59,7 @@
     return result;
 }

-TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Write___I4__I8__I4__SZARRAY_U1__I4__I8(const TinyCLR_Interop_MethodData md) {
+TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Write___I4__I8__I4__SZARRAY_U1__I4__I8(const TinyCLR_Interop_MethodData md) {
     auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));

     TinyCLR_Interop_ClrValue arg0, arg1, arg2, arg3, arg4;
@@ -111,8 +115,16 @@
 }

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::IsErased___BOOLEAN__I8__I4(const TinyCLR_Interop_MethodData md) {
+    auto api = reinterpret_cast<const TinyCLR_Storage_Controller*>(TinyCLR_Interop_GetApi(md, FIELD___impl___I));
+    TinyCLR_Interop_ClrValue arg0, arg1, ret;

-    return TinyCLR_Result::NotImplemented;
+    md.InteropManager->GetArgument(md.InteropManager, md.Stack, 0, arg0);
+    md.InteropManager->GetArgument(md.InteropManager, md.Stack, 1, arg1);
+    md.InteropManager->GetReturn(md.InteropManager, md.Stack, ret);
+
+    size_t count = arg1.Data.Numeric->I4;
+
+    return api->IsErased(api, arg0.Data.Numeric->I8, count, ret.Data.Numeric->Boolean);
 }

 TinyCLR_Result Interop_GHIElectronics_TinyCLR_Devices_GHIElectronics_TinyCLR_Devices_Storage_Provider_StorageControllerApiWrapper::Acquire___VOID(const TinyCLR_Interop_MethodData md) {


Adjusted get_random_data to include runs of same values

--- test/rocprim/test_utils.hpp
+++ test/rocprim/test_utils.hpp
@@ -43,6 +43,9 @@
 namespace test_utils
 {

+static constexpr uint32_t random_data_generation_segments = 8;
+static constexpr uint32_t random_data_generation_repeat_strides = 2;
+
 // Support half operators on host side

 ROCPRIM_HOST inline
@@ -209,7 +212,26 @@
     gen.seed(seed_value);
     std::uniform_int_distribution<T> distribution(min, max);
     std::vector<T> data(size);
-    std::generate(data.begin(), data.end(), [&]() { return distribution(gen); });
+    uint32_t segment_size = size / random_data_generation_segments;
+    for(uint32_t segment_index = 0; segment_index < random_data_generation_segments; segment_index++)
+    {
+        if(segment_index % random_data_generation_repeat_strides == 0)
+        {
+            T repeated_value = distribution(gen);
+            std::fill(
+                data.begin() + segment_size * segment_index,
+                data.begin() + segment_size * (segment_index + 1),
+                repeated_value);
+
+        }
+        else
+        {
+            std::generate(
+                data.begin() + segment_size * segment_index,
+                data.begin() + segment_size * (segment_index + 1),
+                [&]() { return distribution(gen); });
+        }
+    }
     return data;
 }

@@ -224,7 +246,26 @@
     using dis_type = typename std::conditional<std::is_same<rocprim::half, T>::value, float, T>::type;
     std::uniform_real_distribution<dis_type> distribution(min, max);
     std::vector<T> data(size);
-    std::generate(data.begin(), data.end(), [&]() { return distribution(gen); });
+    uint32_t segment_size = size / random_data_generation_segments;
+    for(uint32_t segment_index = 0; segment_index < random_data_generation_segments; segment_index++)
+    {
+        if(segment_index % random_data_generation_repeat_strides == 0)
+        {
+            T repeated_value = distribution(gen);
+            std::fill(
+                data.begin() + segment_size * segment_index,
+                data.begin() + segment_size * (segment_index + 1),
+                repeated_value);
+
+        }
+        else
+        {
+            std::generate(
+                data.begin() + segment_size * segment_index,
+                data.begin() + segment_size * (segment_index + 1),
+                [&]() { return distribution(gen); });
+        }
+    }
     return data;
 }

@@ -252,7 +293,7 @@
 inline auto get_random_value(T min, T max, int seed_value)
     -> typename std::enable_if<rocprim::is_arithmetic<T>::value, T>::type
 {
-    return get_random_data(1, min, max, seed_value)[0];
+    return get_random_data(random_data_generation_segments, min, max, seed_value)[0];
 }

 // Can't use std::prefix_sum for inclusive/exclusive scan, because


Fix VisualBench to hold onto a surface

Fix VisualBench to hold onto a surface

BUG=skia:

Review URL: https://codereview.chromium.org/1236723003

--- tools/VisualBench/VisualBench.cpp
+++ tools/VisualBench/VisualBench.cpp
@@ -74,8 +74,13 @@
 }

 SkSurface* VisualBench::createSurface() {
-    SkSurfaceProps props(INHERITED::getSurfaceProps());
-    return SkSurface::NewRenderTargetDirect(fRenderTarget, &props);
+    if (!fSurface) {
+        SkSurfaceProps props(INHERITED::getSurfaceProps());
+        fSurface.reset(SkSurface::NewRenderTargetDirect(fRenderTarget, &props));
+    }
+
+    // The caller will wrap the SkSurface in an SkAutoTUnref
+    return SkRef(fSurface.get());
 }

 bool VisualBench::setupBackend() {


still fixing

still fixing

--- test/src/unit-allocator.cpp
+++ test/src/unit-allocator.cpp
@@ -240,9 +240,14 @@
 template<class T>
 struct allocator_no_forward : std::allocator<T>
 {
-    template <typename U>
+    using std::allocator<T>::allocator;
+
+    template <class U>
+    allocator_no_forward(allocator_no_forward<U>) {}
+
+    template <class U>
     struct rebind {
-        typedef allocator_no_forward<U> other;
+        using other =  allocator_no_forward<U>;
     };

     template <class... Args>


addGoalWhileExecuting works.

addGoalWhileExecuting works.

--- test/test_goal_queueing.cpp
+++ test/test_goal_queueing.cpp
@@ -139,9 +139,10 @@
 	EXPECT_FALSE(next_goal_available);
 	EXPECT_EQ(3.0, received_goal->target_pose.pose.position.x);
 	finishExecuting();
-}
-
-/*
+	ros::Duration(0.5).sleep();
+	EXPECT_FALSE(qserv->isActive());
+}
+
 TEST_F(GoalQueueSuite, addGoalWhileExecuting) {
 	move_base_msgs::MoveBaseGoal goal;

@@ -149,7 +150,6 @@
 	goal.target_pose.pose.position.x = 3.0;
 	cli->sendGoal(goal);
 	ros::spinOnce();
-
 	sleepExecuting();
 	EXPECT_TRUE(got_goal);
 	EXPECT_FALSE(goal_preempted);
@@ -161,29 +161,30 @@
 	cli->sendGoal(goal);
 	ros::spinOnce();

-	sleepExecuting();
-// 	ASSERT_TRUE(next_goal_available); // TODO: Why is this failling?
-
-	// Cancelling the last goal - TODO: Doesnt work!
-	cli->cancelGoal(); // Cancels the last goal sent
-	ros::spinOnce();
+	resumeExecuting();
+	ros::Duration(0.5).sleep();
+	sleepExecuting();
+ 	EXPECT_TRUE(next_goal_available);
+
+	// Cancel the last goal sent
+	cli->cancelGoal();
 	ros::Duration(1.0).sleep();
-	EXPECT_EQ(3.0, received_goal->target_pose.pose.position.x);
+	ros::spinOnce();
+	EXPECT_EQ(3.0, received_goal->target_pose.pose.position.x); // Making sure we are in the first goal thread
  	finishExecuting(); // Finish 1st goal
-	ros::Duration(3.0).sleep();
-	// ASSERT_TRUE(goal_preempted); // TODO:  Why is this failling?
+	ros::Duration(0.5).sleep();
+	EXPECT_TRUE(goal_preempted);
  	finishExecuting(); // Finish 2nd (canceled) goal
-	ros::Duration(3.0).sleep();
+	ros::Duration(0.5).sleep();

 	// New goal
 	goal.target_pose.pose.position.x = 13.0;
 	cli->sendGoal(goal);
 	ros::spinOnce();
-
 	sleepExecuting();
 	EXPECT_TRUE(got_goal);
 	EXPECT_FALSE(goal_preempted);
-	EXPECT_EQ(13.0, received_goal->target_pose.pose.position.x); // BUG: X=7 (from canceled goal)
+	EXPECT_EQ(13.0, received_goal->target_pose.pose.position.x);
 	finishExecuting(); // Finish new goal

 // 	- if another goal is received add it to the queue (DONE)
@@ -191,6 +192,7 @@
 // 	- start executing the new goal in queue (after the current)
 }

+/*
 TEST_F(GoalQueueSuite, goalPreempting) {
 	move_base_msgs::MoveBaseGoal goal;

@@ -278,11 +280,11 @@
 	ros::Duration(1.0).sleep();
 	ros::spinOnce();
  	finishExecuting(); // finish 1st goal
- 	ros::Duration(1.0).sleep(); // Needs to wait so the executeCallback can finish
+ 	ros::Duration(0.5).sleep(); // Needs to wait so the executeCallback can finish

 	EXPECT_TRUE(goal_preempted); // Must be checked in the goal-thread that is cancelled
 	finishExecuting(); // Finish the cancelled goal
-	ros::Duration(1.0).sleep();
+	ros::Duration(0.5).sleep();
 	ASSERT_FALSE(qserv->isActive());

 // 	- if a cancel request on the "next_goal" received, remove it from the queue and set it as cancelled


Tentative generator fix.

Tentative generator fix.

--- tools/journal_proto_processor.cpp
+++ tools/journal_proto_processor.cpp
@@ -827,12 +827,17 @@
     std::string const& field_descriptor_name = field_descriptor->name();
     ProcessField(field_descriptor);

+    std::string const deserialize_field_checker =
+        parameter_name + ".has_" + field_descriptor_name + "()";
     std::string const deserialize_field_getter =
         parameter_name + "." + field_descriptor_name + "()";
     std::string const serialize_member_name =
         parameter_name + "." + field_descriptor_name;
     deserialized_expressions.push_back(
-        field_cxx_deserializer_fn_[field_descriptor](deserialize_field_getter));
+        field_cxx_optional_pointer_fn_[field_descriptor](
+            deserialize_field_checker,
+            field_cxx_deserializer_fn_[field_descriptor](
+                deserialize_field_getter)));
     cxx_serialize_definition_[descriptor] +=
         field_cxx_optional_assignment_fn_[field_descriptor](
             serialize_member_name,


[llvm-cov] Make 'adjustColumnWidths' do less work

This drops some redundant calls to get{UniqueSourceFiles,
CoveredFunctions}. We can figure out the right column widths without
re-doing this expensive work.

This isn't NFC, but I don't want to check in another binary *.covmapping
file with long filenames in it. I tested this locally on a project with
some long filenames (FileCheck).

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@281873 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 6360ab9da47db7cd5c4841b39568c8a1ae11e836)

--- tools/llvm-cov/CoverageReport.cpp
+++ tools/llvm-cov/CoverageReport.cpp
@@ -89,14 +89,13 @@
 size_t FunctionReportColumns[] = {25, 10, 8, 8, 10, 8, 8};

 /// \brief Adjust column widths to fit long file paths and function names.
-void adjustColumnWidths(const coverage::CoverageMapping &CM) {
-  for (StringRef Filename : CM.getUniqueSourceFiles()) {
+void adjustColumnWidths(ArrayRef<StringRef> Files,
+                        ArrayRef<StringRef> Functions) {
+  for (StringRef Filename : Files)
     FileReportColumns[0] = std::max(FileReportColumns[0], Filename.size());
-    for (const auto &F : CM.getCoveredFunctions(Filename)) {
-      FunctionReportColumns[0] =
-          std::max(FunctionReportColumns[0], F.Name.size());
-    }
-  }
+  for (StringRef Funcname : Functions)
+    FunctionReportColumns[0] =
+        std::max(FunctionReportColumns[0], Funcname.size());
 }

 /// \brief Prints a horizontal divider long enough to cover the given column
@@ -205,13 +204,20 @@

 void CoverageReport::renderFunctionReports(ArrayRef<StringRef> Files,
                                            raw_ostream &OS) {
-  adjustColumnWidths(Coverage);
   bool isFirst = true;
   for (StringRef Filename : Files) {
+    auto Functions = Coverage.getCoveredFunctions(Filename);
+
     if (isFirst)
       isFirst = false;
     else
       OS << "\n";
+
+    std::vector<StringRef> Funcnames;
+    for (const auto &F : Functions)
+      Funcnames.emplace_back(F.Name);
+    adjustColumnWidths({}, Funcnames);
+
     OS << "File '" << Filename << "':\n";
     OS << column("Name", FunctionReportColumns[0])
        << column("Regions", FunctionReportColumns[1], Column::RightAlignment)
@@ -224,7 +230,7 @@
     renderDivider(FunctionReportColumns, OS);
     OS << "\n";
     FunctionCoverageSummary Totals("TOTAL");
-    for (const auto &F : Coverage.getCoveredFunctions(Filename)) {
+    for (const auto &F : Functions) {
       FunctionCoverageSummary Function = FunctionCoverageSummary::get(F);
       ++Totals.ExecutionCount;
       Totals.RegionCoverage += Function.RegionCoverage;
@@ -267,7 +273,14 @@

 void CoverageReport::renderFileReports(raw_ostream &OS,
                                        ArrayRef<StringRef> Files) const {
-  adjustColumnWidths(Coverage);
+  FileCoverageSummary Totals("TOTAL");
+  auto FileReports = prepareFileReports(Totals, Files);
+
+  std::vector<StringRef> Filenames;
+  for (const FileCoverageSummary &FCS : FileReports)
+    Filenames.emplace_back(FCS.Name);
+  adjustColumnWidths(Filenames, {});
+
   OS << column("Filename", FileReportColumns[0])
      << column("Regions", FileReportColumns[1], Column::RightAlignment)
      << column("Missed Regions", FileReportColumns[2], Column::RightAlignment)
@@ -281,8 +294,6 @@
   renderDivider(FileReportColumns, OS);
   OS << "\n";

-  FileCoverageSummary Totals("TOTAL");
-  auto FileReports = prepareFileReports(Totals, Files);
   for (const FileCoverageSummary &FCS : FileReports)
     render(FCS, OS);


In Nodes, GC-related fields exported in Stable- and UnstableNode instead of Node.

--- vm/main/store.hh
+++ vm/main/store.hh
@@ -51,31 +51,28 @@

   inline void reset(VM vm);

+  const Type* type;
+  MemWord value;
+};
+
+/**
+ * Stable node, which is guaranteed never to change
+ */
+class StableNode {
+public:
+  inline void init(VM vm, UnstableNode& from);
+private:
+  friend class UnstableNode;
+public: // TODO make it private once the development has been bootstrapped
   union {
-    // Regular structure of a node
-    struct {
-      const Type* type;
-      MemWord value;
-    };
+    Node node;

     // Garbage collector hack
     struct {
-      Node* gcNext;
+      StableNode* gcNext;
       Node* gcFrom;
     };
   };
-};
-
-/**
- * Stable node, which is guaranteed never to change
- */
-class StableNode {
-public:
-  inline void init(VM vm, UnstableNode& from);
-private:
-  friend class UnstableNode;
-public: // TODO make it private once the development has been bootstrapped
-  Node node;
 };

 /**
@@ -105,7 +102,15 @@
 private:
   friend class StableNode;
 public: // TODO make it private once the development has been bootstrapped
-  Node node;
+  union {
+    Node node;
+
+    // Garbage collector hack
+    struct {
+      UnstableNode* gcNext;
+      Node* gcFrom;
+    };
+  };
 };

 /**


adapted scale of variables

adapted scale of variables

--- vmc_optimize.cpp
+++ vmc_optimize.cpp
@@ -166,10 +166,14 @@

     //ask waiting processes to start calculating
     MPI_Bcast(&count,1,MPI_INT,0,MPI_COMM_WORLD);
+    double phi,neel,hx;
+    phi=gsl_vector_get(x,0)/4.0*M_PI;
+    neel=gsl_vector_get(x,1)*2;
+    hx=gsl_vector_get(x,2);
     //send variational parameters value
-    MPI_Bcast(x->data,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//phi
-    MPI_Bcast(x->data+1,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//neel
-    MPI_Bcast(x->data+2,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//hx
+    MPI_Bcast(&phi,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//phi
+    MPI_Bcast(&neel,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//neel
+    MPI_Bcast(&hx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);//hx
     // Setup calculation parameters
     ostringstream ostr;
     ostr<<inmap["prefix"]<<"-"<<count;
@@ -269,7 +273,6 @@
         simap["meas_interv"]=pow(simap["L"],2);
     if(!comm_rank) cout<<"seed="<<inmap["seed"]<<endl;
     RanGen::srand(inmap["seed"]+100*comm_rank);
-    domap["phi"]*=M_PI;
     Params_s params;
     params.bomap=bomap;
     params.simap=simap;
@@ -287,12 +290,12 @@
         int status;
         double size;
         x=gsl_vector_alloc(3);
-        gsl_vector_set(x,0,domap["phi"]);
-        gsl_vector_set(x,1,domap["neel"]);
-        gsl_vector_set(x,2,domap["hx"]);
+        gsl_vector_set(x,0,domap["phi"]*4);
+        gsl_vector_set(x,1,domap["neel"]/2);
+        gsl_vector_set(x,2,domap["hx"]);// scale params such that they have approximate same scale
         ss=gsl_vector_alloc(3);
-        gsl_vector_set(ss,0,domap["step_phi"]*M_PI);
-        gsl_vector_set(ss,1,domap["step_neel"]);
+        gsl_vector_set(ss,0,domap["step_phi"]*4);
+        gsl_vector_set(ss,1,domap["step_neel"]/2);
         gsl_vector_set(ss,2,domap["step_hx"]);
         minexc_func.n=3;
         minexc_func.f=var_energy;
@@ -309,7 +312,7 @@
             if (status==GSL_SUCCESS){
                 cout<<"converged to minimum at"<<endl;
             }
-            cout<<iter<<" "<<gsl_vector_get(s->x,0)<<" "<<gsl_vector_get(s->x,1)<<" "<<gsl_vector_get(s->x,2)<<" = "<<s->fval<<" size = "<<size<<endl;
+            cout<<iter<<" "<<gsl_vector_get(s->x,0)/4.0<<" "<<gsl_vector_get(s->x,1)*2<<" "<<gsl_vector_get(s->x,2)<<" = "<<s->fval<<" size = "<<size<<endl;
         } while(status==GSL_CONTINUE && iter<100);
         gsl_vector_free(x);
         gsl_vector_free(ss);


Fixed change voxel type in VoxelBuffer

Fixed change voxel type in VoxelBuffer

--- voxel_buffer.cpp
+++ voxel_buffer.cpp
@@ -65,12 +65,13 @@

     Channel & channel = _channels[channel_index];

-    if (channel.defval != value) {
+    //FIX: if VOXEL_AT(channel.data, x, y, z) is not channel.defval we have to set that voxel nethertheless
+    //if (channel.defval != value) {
         if (channel.data == NULL) {
             create_channel(channel_index, _size);
         }
         VOXEL_AT(channel.data, x, y, z) = value;
-    }
+    //}
 }

 void VoxelBuffer::set_voxel_v(int value, Vector3 pos, unsigned int channel_index) {


Lower audio resample quality

Lower audio resample quality

--- src/engine/audio/src/audio_filter_resample.cpp
+++ src/engine/audio/src/audio_filter_resample.cpp
@@ -31,7 +31,7 @@

 	if (resamplers.empty()) {
 		for (size_t i = 0; i < nChannels; ++i) {
-			resamplers.push_back(std::make_unique<AudioResampler>(fromHz, toHz, 1, Debug::isDebug() ? 0.0f : 0.3f));
+			resamplers.push_back(std::make_unique<AudioResampler>(fromHz, toHz, 1, 0.0f));
 		}
 	}


Default axis field is (1,0,0) and not (0,0,0)

--- urdf/src/joint.cpp
+++ urdf/src/joint.cpp
@@ -471,26 +471,24 @@
   }

   // Get Joint Axis
-  if (this->type != FLOATING)
+  if (this->type != FLOATING && this->type != FIXED)
   {
     // axis
     TiXmlElement *axis_xml = config->FirstChildElement("axis");
-    if (axis_xml)
-    {
-      if (!axis_xml->Attribute("xyz"))
-        ROS_INFO("no xyz attribute for axis element for Joint link '%s', using default values", this->name.c_str());
-      else
-      {
+    if (!axis_xml){
+      ROS_DEBUG("no axis elemement for Joint link '%s', defaulting to (1,0,0) axis", this->name.c_str());
+      this->axis = Vector3(1.0, 0.0, 0.0);
+    }
+    else{
+      if (!axis_xml->Attribute("xyz")){
+        ROS_ERROR("no xyz attribute for axis element for Joint link '%s'", this->name.c_str());
+      }
+      else {
         if (!this->axis.init(axis_xml->Attribute("xyz")))
         {
-          if (this->type == PLANAR)
-            ROS_DEBUG("PLANAR Joint '%s' will require an axis tag in the future which indicates the surface normal of the plane.", this->name.c_str());
-          else
-          {
-            ROS_ERROR("Malformed axis element for joint '%s'", this->name.c_str());
-            this->axis.clear();
-            return false;
-          }
+          ROS_ERROR("Malformed axis element for joint '%s'", this->name.c_str());
+          this->axis.clear();
+          return false;
         }
       }
     }


libs: cdap: fix compiler warning

libs: cdap: fix compiler warning

--- user/libs/cdap.cpp
+++ user/libs/cdap.cpp
@@ -1040,7 +1040,7 @@
     }

     n = write(fd, serbuf, serlen);
-    if (n != serlen) {
+    if (n != (ssize_t)serlen) {
         if (n < 0) {
             perror("write(cdap_msg)");
         } else {


Remove extra semi-colons

Remove extra semi-colons

Found by oss-fuzz build using -Wextra-semi-stmt

Bug: oss-fuzz:12147
Change-Id: I88c9f66ce5902a44129e432d50c76d1b1b66ebe3
Reviewed-on: https://skia-review.googlesource.com/c/180367
Reviewed-by: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>

--- src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp
+++ src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp
@@ -19,113 +19,113 @@
     // https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt
     // eglGetProcAddress() is not guaranteed to support the querying of non-extension EGL functions.
     #define M(X) if (0 == strcmp(#X, name)) { return (GrGLFuncPtr) X; }
-    M(eglGetCurrentDisplay);
-    M(eglQueryString);
-    M(glActiveTexture);
-    M(glAttachShader);
-    M(glBindAttribLocation);
-    M(glBindBuffer);
-    M(glBindFramebuffer);
-    M(glBindRenderbuffer);
-    M(glBindTexture);
-    M(glBlendColor);
-    M(glBlendEquation);
-    M(glBlendFunc);
-    M(glBufferData);
-    M(glBufferSubData);
-    M(glCheckFramebufferStatus);
-    M(glClear);
-    M(glClearColor);
-    M(glClearStencil);
-    M(glColorMask);
-    M(glCompileShader);
-    M(glCompressedTexImage2D);
-    M(glCompressedTexSubImage2D);
-    M(glCopyTexSubImage2D);
-    M(glCreateProgram);
-    M(glCreateShader);
-    M(glCullFace);
-    M(glDeleteBuffers);
-    M(glDeleteFramebuffers);
-    M(glDeleteProgram);
-    M(glDeleteRenderbuffers);
-    M(glDeleteShader);
-    M(glDeleteTextures);
-    M(glDepthMask);
-    M(glDisable);
-    M(glDisableVertexAttribArray);
-    M(glDrawArrays);
-    M(glDrawElements);
-    M(glEnable);
-    M(glEnableVertexAttribArray);
-    M(glFinish);
-    M(glFlush);
-    M(glFramebufferRenderbuffer);
-    M(glFramebufferTexture2D);
-    M(glFrontFace);
-    M(glGenBuffers);
-    M(glGenFramebuffers);
-    M(glGenRenderbuffers);
-    M(glGenTextures);
-    M(glGenerateMipmap);
-    M(glGetBufferParameteriv);
-    M(glGetError);
-    M(glGetFramebufferAttachmentParameteriv);
-    M(glGetIntegerv);
-    M(glGetProgramInfoLog);
-    M(glGetProgramiv);
-    M(glGetRenderbufferParameteriv);
-    M(glGetShaderInfoLog);
-    M(glGetShaderPrecisionFormat);
-    M(glGetShaderiv);
-    M(glGetString);
-    M(glGetUniformLocation);
-    M(glIsTexture);
-    M(glLineWidth);
-    M(glLinkProgram);
-    M(glPixelStorei);
-    M(glReadPixels);
-    M(glRenderbufferStorage);
-    M(glScissor);
-    M(glShaderSource);
-    M(glStencilFunc);
-    M(glStencilFuncSeparate);
-    M(glStencilMask);
-    M(glStencilMaskSeparate);
-    M(glStencilOp);
-    M(glStencilOpSeparate);
-    M(glTexImage2D);
-    M(glTexParameterf);
-    M(glTexParameterfv);
-    M(glTexParameteri);
-    M(glTexParameteriv);
-    M(glTexSubImage2D);
-    M(glUniform1f);
-    M(glUniform1fv);
-    M(glUniform1i);
-    M(glUniform1iv);
-    M(glUniform2f);
-    M(glUniform2fv);
-    M(glUniform2i);
-    M(glUniform2iv);
-    M(glUniform3f);
-    M(glUniform3fv);
-    M(glUniform3i);
-    M(glUniform3iv);
-    M(glUniform4f);
-    M(glUniform4fv);
-    M(glUniform4i);
-    M(glUniform4iv);
-    M(glUniformMatrix2fv);
-    M(glUniformMatrix3fv);
-    M(glUniformMatrix4fv);
-    M(glUseProgram);
-    M(glVertexAttrib1f);
-    M(glVertexAttrib2fv);
-    M(glVertexAttrib3fv);
-    M(glVertexAttrib4fv);
-    M(glVertexAttribPointer);
-    M(glViewport);
+    M(eglGetCurrentDisplay)
+    M(eglQueryString)
+    M(glActiveTexture)
+    M(glAttachShader)
+    M(glBindAttribLocation)
+    M(glBindBuffer)
+    M(glBindFramebuffer)
+    M(glBindRenderbuffer)
+    M(glBindTexture)
+    M(glBlendColor)
+    M(glBlendEquation)
+    M(glBlendFunc)
+    M(glBufferData)
+    M(glBufferSubData)
+    M(glCheckFramebufferStatus)
+    M(glClear)
+    M(glClearColor)
+    M(glClearStencil)
+    M(glColorMask)
+    M(glCompileShader)
+    M(glCompressedTexImage2D)
+    M(glCompressedTexSubImage2D)
+    M(glCopyTexSubImage2D)
+    M(glCreateProgram)
+    M(glCreateShader)
+    M(glCullFace)
+    M(glDeleteBuffers)
+    M(glDeleteFramebuffers)
+    M(glDeleteProgram)
+    M(glDeleteRenderbuffers)
+    M(glDeleteShader)
+    M(glDeleteTextures)
+    M(glDepthMask)
+    M(glDisable)
+    M(glDisableVertexAttribArray)
+    M(glDrawArrays)
+    M(glDrawElements)
+    M(glEnable)
+    M(glEnableVertexAttribArray)
+    M(glFinish)
+    M(glFlush)
+    M(glFramebufferRenderbuffer)
+    M(glFramebufferTexture2D)
+    M(glFrontFace)
+    M(glGenBuffers)
+    M(glGenFramebuffers)
+    M(glGenRenderbuffers)
+    M(glGenTextures)
+    M(glGenerateMipmap)
+    M(glGetBufferParameteriv)
+    M(glGetError)
+    M(glGetFramebufferAttachmentParameteriv)
+    M(glGetIntegerv)
+    M(glGetProgramInfoLog)
+    M(glGetProgramiv)
+    M(glGetRenderbufferParameteriv)
+    M(glGetShaderInfoLog)
+    M(glGetShaderPrecisionFormat)
+    M(glGetShaderiv)
+    M(glGetString)
+    M(glGetUniformLocation)
+    M(glIsTexture)
+    M(glLineWidth)
+    M(glLinkProgram)
+    M(glPixelStorei)
+    M(glReadPixels)
+    M(glRenderbufferStorage)
+    M(glScissor)
+    M(glShaderSource)
+    M(glStencilFunc)
+    M(glStencilFuncSeparate)
+    M(glStencilMask)
+    M(glStencilMaskSeparate)
+    M(glStencilOp)
+    M(glStencilOpSeparate)
+    M(glTexImage2D)
+    M(glTexParameterf)
+    M(glTexParameterfv)
+    M(glTexParameteri)
+    M(glTexParameteriv)
+    M(glTexSubImage2D)
+    M(glUniform1f)
+    M(glUniform1fv)
+    M(glUniform1i)
+    M(glUniform1iv)
+    M(glUniform2f)
+    M(glUniform2fv)
+    M(glUniform2i)
+    M(glUniform2iv)
+    M(glUniform3f)
+    M(glUniform3fv)
+    M(glUniform3i)
+    M(glUniform3iv)
+    M(glUniform4f)
+    M(glUniform4fv)
+    M(glUniform4i)
+    M(glUniform4iv)
+    M(glUniformMatrix2fv)
+    M(glUniformMatrix3fv)
+    M(glUniformMatrix4fv)
+    M(glUseProgram)
+    M(glVertexAttrib1f)
+    M(glVertexAttrib2fv)
+    M(glVertexAttrib3fv)
+    M(glVertexAttrib4fv)
+    M(glVertexAttribPointer)
+    M(glViewport)
     #undef M
     return eglGetProcAddress(name);
 }


Missed this in commit with improvements in camera intrinsics.

--- src/libmv/simple_pipeline/camera_intrinsics.cc
+++ src/libmv/simple_pipeline/camera_intrinsics.cc
@@ -24,7 +24,7 @@
 namespace libmv {

 struct Offset {
-  signed char ix, iy;
+  short ix, iy;
   unsigned char fx,fy;
 };

@@ -208,13 +208,9 @@
       if( iy < 0 ) { iy = 0, fy = 0; }
       if( ix >= width-2 ) ix = width-2;
       if( iy >= height-2 ) iy = height-2;
-      if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) {
-        Offset offset = { ix-x, iy-y, fx, fy };
-        grid->offset[y*width+x] = offset;
-      } else {
-        Offset offset = { 0, 0, 0, 0 };
-        grid->offset[y*width+x] = offset;
-      }
+
+      Offset offset = { ix-x, iy-y, fx, fy };
+      grid->offset[y*width+x] = offset;
     }
   }
 }


Update info items in object list after repair by netfabb, painted data are removed and the info line stays hanging

--- src/slic3r/GUI/GUI_ObjectList.cpp
+++ src/slic3r/GUI/GUI_ObjectList.cpp
@@ -3953,6 +3953,7 @@
     wxGetApp().plater()->fix_through_netfabb(obj_idx, vol_idx);

     update_item_error_icon(obj_idx, vol_idx);
+    update_info_items(obj_idx);
 }

 void ObjectList::simplify()


Fix string conversion in ObjectList

Fix string conversion in ObjectList

--- src/slic3r/GUI/GUI_ObjectList.cpp
+++ src/slic3r/GUI/GUI_ObjectList.cpp
@@ -1178,7 +1178,7 @@
     const auto obj_idx = get_selected_obj_idx();
     if (obj_idx < 0) return;

-    const std::string name = _(L("Generic")) + "-" + _(type_name);
+    const wxString name = _(L("Generic")) + "-" + _(type_name);
     TriangleMesh mesh;

     auto& bed_shape = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionPoints>("bed_shape")->values;
@@ -1230,7 +1230,7 @@
     }
 #endif // ENABLE_GENERIC_SUBPARTS_PLACEMENT

-    new_volume->name = name;
+    new_volume->name = into_u8(name);
     // set a default extruder value, since user can't add it manually
     new_volume->config.set_key_value("extruder", new ConfigOptionInt(0));

@@ -1238,7 +1238,7 @@
     parts_changed(obj_idx);

     const auto object_item = m_objects_model->GetTopParent(GetSelection());
-    select_item(m_objects_model->AddVolumeChild(object_item, from_u8(name), type));
+    select_item(m_objects_model->AddVolumeChild(object_item, name, type));
 #ifndef __WXOSX__ //#ifdef __WXMSW__ // #ys_FIXME
     selection_changed();
 #endif //no __WXOSX__ //__WXMSW__


OpenSSLSocketImpl: Move state checks inside mutex

Checking the state of the connection is unreliable if SSL_read and
SSL_write are happening in another thread. Move the state checks inside
our application mutex so we don't run into another thread mutating the
state at the same time.

Bug: 15606096

(cherry picked from commit 0931d51c58b2dc2f612298f99fbf0fa6ed4c3706)

Change-Id: I151ecbc57278374007a56827a65295b4c9476732

--- src/main/native/org_conscrypt_NativeCrypto.cpp
+++ src/main/native/org_conscrypt_NativeCrypto.cpp
@@ -8540,10 +8540,6 @@
     JNI_TRACE("ssl=%p sslRead appData=%p", ssl, appData);
     if (appData == NULL) {
         return THROW_SSLEXCEPTION;
-    } else if (!SSL_is_init_finished(ssl) && !SSL_cutthrough_complete(ssl) &&
-               !SSL_renegotiate_pending(ssl)) {
-        JNI_TRACE("ssl=%p sslRead => init is not finished (state=0x%x)", ssl, SSL_get_state(ssl));
-        return THROW_SSLEXCEPTION;
     }

     while (appData->aliveAndKicking) {
@@ -8551,6 +8547,14 @@

         if (MUTEX_LOCK(appData->mutex) == -1) {
             return -1;
+        }
+
+        if (!SSL_is_init_finished(ssl) && !SSL_cutthrough_complete(ssl) &&
+               !SSL_renegotiate_pending(ssl)) {
+            JNI_TRACE("ssl=%p sslRead => init is not finished (state=0x%x)", ssl,
+                    SSL_get_state(ssl));
+            MUTEX_UNLOCK(appData->mutex);
+            return THROW_SSLEXCEPTION;
         }

         unsigned int bytesMoved = BIO_number_read(rbio) + BIO_number_written(wbio);
@@ -8857,10 +8861,6 @@
     JNI_TRACE("ssl=%p sslWrite appData=%p", ssl, appData);
     if (appData == NULL) {
         return THROW_SSLEXCEPTION;
-    } else if (!SSL_is_init_finished(ssl) && !SSL_cutthrough_complete(ssl) &&
-               !SSL_renegotiate_pending(ssl)) {
-        JNI_TRACE("ssl=%p sslWrite => init is not finished (state=0x%x)", ssl, SSL_get_state(ssl));
-        return THROW_SSLEXCEPTION;
     }

     int count = len;
@@ -8870,6 +8870,14 @@

         if (MUTEX_LOCK(appData->mutex) == -1) {
             return -1;
+        }
+
+        if (!SSL_is_init_finished(ssl) && !SSL_cutthrough_complete(ssl) &&
+               !SSL_renegotiate_pending(ssl)) {
+            JNI_TRACE("ssl=%p sslWrite => init is not finished (state=0x%x)", ssl,
+                    SSL_get_state(ssl));
+            MUTEX_UNLOCK(appData->mutex);
+            return THROW_SSLEXCEPTION;
         }

         unsigned int bytesMoved = BIO_number_read(rbio) + BIO_number_written(wbio);


Code style fix

Code style fix

--- apps/px4io/mixer.cpp
+++ apps/px4io/mixer.cpp
@@ -97,7 +97,7 @@
 	 */

 	/* this is for planes, where manual override makes sense */
-	if(system_state.manual_override_ok) {
+	if (system_state.manual_override_ok) {
 		/* if everything is ok */
 		if (!system_state.mixer_manual_override && system_state.mixer_fmu_available) {
 			/* we have recent control data from the FMU */
@@ -118,7 +118,7 @@
 	/* this is for multicopters, etc. where manual override does not make sense */
 	} else {
 		/* if the fmu is available whe are good */
-		if(system_state.mixer_fmu_available) {
+		if (system_state.mixer_fmu_available) {
 			control_count = PX4IO_CONTROL_CHANNELS;
 			control_values = &system_state.fmu_channel_data[0];
 		/* we better shut everything off */


added operators = and ==

added operators = and ==

--- source/SOLVATION/reissCavFreeEnergyProcessor.C
+++ source/SOLVATION/reissCavFreeEnergyProcessor.C
@@ -1,4 +1,4 @@
-// $Id: reissCavFreeEnergyProcessor.C,v 1.8 2001/06/05 15:53:29 anker Exp $
+// $Id: reissCavFreeEnergyProcessor.C,v 1.9 2001/09/11 10:00:05 aubertin Exp $

 #include <BALL/SOLVATION/reissCavFreeEnergyProcessor.h>
 #include <BALL/STRUCTURE/numericalSAS.h>
@@ -56,6 +56,38 @@
 		setDefaultOptions();

 		valid_ = true;
+	}
+
+
+        const ReissCavFreeEnergyProcessor& ReissCavFreeEnergyProcessor::operator = (const ReissCavFreeEnergyProcessor& proc) throw()
+        {
+	         valid_=proc.valid_;
+                 energy_=proc.energy_;
+                 fragment_=proc.fragment_;
+                 return *this;
+        }
+
+        bool ReissCavFreeEnergyProcessor::operator == (const ReissCavFreeEnergyProcessor& proc) const throw()
+        {
+          bool result;
+		if ((fragment_ == 0) && (proc.fragment_ == 0))
+		{
+			result = ((energy_ == proc.energy_) && (valid_ == proc.valid_));
+		}
+		else
+		{
+			if ((fragment_ == 0) || (proc.fragment_ == 0))
+			{
+				result = false;
+			}
+			else
+			{
+				result = ((*fragment_ == *proc.fragment_)
+						&& (energy_ 	 == proc.energy_)
+						&& (valid_ 	 == proc.valid_));
+			}
+		}
+		return result;
 	}


Stateserver: Fix get_all for non-loaded objects (needs to have context)

--- src/stateserver/DBStateServer.cpp
+++ src/stateserver/DBStateServer.cpp
@@ -169,6 +169,7 @@

 			// Prepare SSGetAllResp
 			Datagram dg(caller.sender, caller.do_id, STATESERVER_OBJECT_GET_ALL_RESP);
+			dg.add_uint32(caller.context);
 			dg.add_uint32(caller.do_id);
 			dg.add_uint32(INVALID_DO_ID);
 			dg.add_uint32(INVALID_ZONE);


Fixed a fundamental bug in the GUI_TFT.cpp drawRectangle routine, by using the inherited method.

--- GUI_TFT.cpp
+++ GUI_TFT.cpp
@@ -14,10 +14,12 @@
  */
 void Guitft::drawRectangle(uint16_t poX, uint16_t poY, uint16_t length, uint16_t width,uint16_t color)
 {
-	drawFastHLine(poX,poY,length,color);
-	drawFastHLine(poX, poY+width, length, color);
-	drawFastVLine(poX, poY, width,color);
-	drawFastVLine(poX+length,poY,width,color);
+	this->drawRect(poX,poY,length,width,color);
+
+	//drawFastHLine(poX,poY,length,color);
+	//drawFastHLine(poX, poY+width, length, color);
+	//drawFastVLine(poX, poY, width,color);
+	//drawFastVLine(poX+length,poY,width,color);
 }

 /*


Read IDs rather than labels.

Read IDs rather than labels.

--- GeneNet.cpp
+++ GeneNet.cpp
@@ -192,7 +192,7 @@
     if (strstr(temp,"shape")!=NULL) {
       strcpy(species[num],temp);
       (*strchr(species[num],' '))='\0';
-      char *temp2 = strstr(temp,"label")+7;
+      char *temp2 = strstr(temp,"ID")+4;
       *strchr(temp2,'\"') = '\0';
       strcpy(speciesLabel[num],temp2);
       printf("%d %s %s\n",num,species[num],speciesLabel[num]);


Swith to using action_time values in most places.

--- src/structures/vroom/tw_route.cpp
+++ src/structures/vroom/tw_route.cpp
@@ -84,7 +84,7 @@
   PreviousInfo previous(v_start, 0);
   if (rank > 0) {
     const auto& previous_job = input.jobs[route[rank - 1]];
-    previous.earliest = earliest[rank - 1] + previous_job.service;
+    previous.earliest = earliest[rank - 1] + action_time[rank - 1];
     previous.travel = v.duration(previous_job.index(), j.index());
     previous.location_index = previous_job.location.index();
   } else {
@@ -126,7 +126,7 @@
     const auto& next_j = input.jobs[route[i]];
     Duration remaining_travel_time =
       v.duration(input.jobs[route[i - 1]].index(), next_j.index());
-    Duration previous_service = input.jobs[route[i - 1]].service;
+    Duration previous_action_time = action_time[i - 1];

     // Update earliest dates and margins for breaks.
     assert(breaks_at_rank[i] <= breaks_counts[i]);
@@ -135,7 +135,7 @@
     for (Index r = 0; r < breaks_at_rank[i]; ++r, ++break_rank) {
       const auto& b = v.breaks[break_rank];

-      current_earliest += previous_service;
+      current_earliest += previous_action_time;

       const auto b_tw =
         std::find_if(b.tws.begin(), b.tws.end(), [&](const auto& tw) {
@@ -158,11 +158,11 @@
       }

       break_earliest[break_rank] = current_earliest;
-      previous_service = v.breaks[break_rank].service;
+      previous_action_time = v.breaks[break_rank].service;
     }

     // Back to the job after breaks.
-    current_earliest += previous_service + remaining_travel_time;
+    current_earliest += previous_action_time + remaining_travel_time;

     const auto j_tw =
       std::find_if(next_j.tws.begin(), next_j.tws.end(), [&](const auto& tw) {
@@ -192,14 +192,14 @@
         ? v.duration(input.jobs[route[i - 1]].index(), v.end.value().index())
         : 0;

-    Duration previous_service = input.jobs[route[i - 1]].service;
+    Duration previous_action_time = action_time[i - 1];

     assert(breaks_at_rank[i] <= breaks_counts[i]);
     Index break_rank = breaks_counts[i] - breaks_at_rank[i];

     for (Index r = 0; r < breaks_at_rank[i]; ++r, ++break_rank) {
       const auto& b = v.breaks[break_rank];
-      current_earliest += previous_service;
+      current_earliest += previous_action_time;

       const auto b_tw =
         std::find_if(b.tws.begin(), b.tws.end(), [&](const auto& tw) {
@@ -222,10 +222,11 @@
       }

       break_earliest[break_rank] = current_earliest;
-      previous_service = v.breaks[break_rank].service;
-    }
-
-    earliest_end = current_earliest + previous_service + remaining_travel_time;
+      previous_action_time = v.breaks[break_rank].service;
+    }
+
+    earliest_end =
+      current_earliest + previous_action_time + remaining_travel_time;
     assert(earliest_end <= v_end);
   }
 }
@@ -276,7 +277,7 @@
     }

     // Back to the job after breaks.
-    auto gap = previous_j.service + remaining_travel_time;
+    auto gap = action_time[next_i - 1] + remaining_travel_time;
     assert(gap <= current_latest);
     current_latest -= gap;

@@ -543,6 +544,9 @@
   auto current = previous_info(input, job_rank, rank);
   auto next = next_info(input, job_rank, rank);

+  const auto job_action_time =
+    (j.index() == current.location_index) ? j.service : j.setup + j.service;
+
   bool job_added = false;

   assert(breaks_at_rank[rank] <= breaks_counts[rank]);
@@ -563,7 +567,8 @@
         return false;
       }

-      current.earliest = std::max(current.earliest, j_tw->start) + j.service;
+      current.earliest =
+        std::max(current.earliest, j_tw->start) + job_action_time;
       break;
     }

@@ -628,7 +633,8 @@
     }
     if (oc.add_job_first) {
       current.earliest =
-        std::max(current.earliest + current.travel, oc.j_tw->start) + j.service;
+        std::max(current.earliest + current.travel, oc.j_tw->start) +
+        job_action_time;
       job_added = true;
     }
   }
@@ -662,7 +668,7 @@

     if (first_rank > 0) {
       const auto& previous_job = input.jobs[route[first_rank - 1]];
-      current.earliest = earliest[first_rank - 1] + previous_job.service;
+      current.earliest = earliest[first_rank - 1] + action_time[first_rank - 1];
       current.location_index = previous_job.index();

       if (last_rank < route.size()) {
@@ -741,8 +747,11 @@
       if (j_tw == j.tws.end()) {
         return false;
       }
-
-      current.earliest = std::max(current.earliest, j_tw->start) + j.service;
+      const auto job_action_time =
+        (j.index() == current.location_index) ? j.service : j.setup + j.service;
+      current.location_index = j.index();
+      current.earliest =
+        std::max(current.earliest, j_tw->start) + job_action_time;

       ++current_job;
       if (current_job != last_job) {
@@ -785,8 +794,13 @@
       ++current_break;
     }
     if (oc.add_job_first) {
+      const auto job_action_time =
+        (j.index() == current.location_index) ? j.service : j.setup + j.service;
+      current.location_index = j.index();
+
       current.earliest =
-        std::max(current.earliest + current.travel, oc.j_tw->start) + j.service;
+        std::max(current.earliest + current.travel, oc.j_tw->start) +
+        job_action_time;

       ++current_job;
       if (current_job != last_job) {


Group application settings

Group application settings

--- src/system/ApplicationSettings.cc
+++ src/system/ApplicationSettings.cc
@@ -242,25 +242,25 @@
 ApplicationSettings::keyToString(const Key key) {
 	switch (key) {
 		case Key::ShowBorderlessWindow:
-			return "showBorderlessWindow";
+			return "theme/ShowBorderlessWindow";
 		case Key::ShowFramesPerSecond:
-			return "showFramesPerSecond";
+			return "debug/ShowFramesPerSecond";
 		case Key::PrimitiveTopology:
-			return "primitiveTopology";
+			return "renderingcontext/PrimitiveTopology";
 		case Key::EnableClipping:
-			return "enableClipping";
+			return "renderingcontext/EnableClipping";
 		case Key::EnableBackfaceCulling:
-			return "enableBackfaceCulling";
+			return "renderingcontext/EnableBackfaceCulling";
 		case Key::PolygonMode:
-			return "polygonMode";
+			return "renderingcontext/PolygonMode";
 		case Key::ShadeModel:
-			return "shadeModel";
+			return "renderingcontext/ShadeModel";
 		case Key::EnableScissorTest:
-			return "enableScissorTest";
+			return "renderingcontext/EnableScissorTest";
 		case Key::EnableStencilTest:
-			return "enableStencilTest";
+			return "renderingcontext/EnableStencilTest";
 		case Key::EnableDepthTest:
-			return "enableDepthTest";
+			return "renderingcontext/EnableDepthTest";
 		default:
 			qFatal("[ApplicationSettings::keyToString] Undefined key!");
 	}


Fix goto : use jmp instead of goto instruction...

--- src/tac/IntelX86CodeGenerator.cpp
+++ src/tac/IntelX86CodeGenerator.cpp
@@ -276,7 +276,7 @@
     void operator()(std::shared_ptr<tac::Goto>& goto_){
         current = goto_;

-       writer.stream() << "goto " << labels[goto_->block] << std::endl;
+       writer.stream() << "jmp " << labels[goto_->block] << std::endl;
     }

     void operator()(std::shared_ptr<tac::Call>& call){