gtest_tree.cpp roslint compliant

gtest_tree.cpp roslint compliant

--- behavior_tree_core/src/gtest/gtest_tree.cpp
+++ behavior_tree_core/src/gtest/gtest_tree.cpp
@@ -1,5 +1,18 @@
+/* Copyright (C) 2015-2017 Michele Colledanchise - All Rights Reserved
+*
+*   Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
+*   to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+*   and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+*   The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+*
+*   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+*   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+*   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+
 #include <gtest/gtest.h>
-#include "behavior_tree.h"
+#include <behavior_tree.h>

@@ -99,8 +112,6 @@
         root->AddChild(condition);
         root->AddChild(action);
     }
-
-
 };

@@ -175,8 +186,6 @@
         root->AddChild(condition);
         root->AddChild(action);
     }
-
-
 };

 struct ComplexSequenceWithMemoryTest : testing::Test
@@ -231,8 +240,6 @@
         root->AddChild(condition);
         root->AddChild(action);
     }
-
-
 };

 struct ComplexFallbackWithMemoryTest : testing::Test
@@ -252,7 +259,6 @@
     {
         action_1 = new BT::ActionTestNode("action 1");
         action_2 = new BT::ActionTestNode("action 2");
-        //action_1->set_boolean_value(false);
         condition_1 = new BT::ConditionTestNode("condition 1");
         condition_2 = new BT::ConditionTestNode("condition 2");

@@ -290,17 +296,14 @@
         action_2 = new BT::ActionTestNode("action 2");
         condition_2 = new BT::ConditionTestNode("condition 2");

-        root = new BT::ParallelNode("par",4);
+        root = new BT::ParallelNode("par", 4);

         root->AddChild(condition_1);
         root->AddChild(action_1);
         root->AddChild(condition_2);
         root->AddChild(action_2);
     }
-
-
-};
-
+};

 struct ComplexParallelTest : testing::Test
@@ -331,11 +334,9 @@
         action_3 = new BT::ActionTestNode("action 3");
         condition_3 = new BT::ConditionTestNode("condition 3");

-        root = new BT::ParallelNode("root",2);
-        parallel_1 = new BT::ParallelNode("par1",3);
-        parallel_2 = new BT::ParallelNode("par2",1);
-
-
+        root = new BT::ParallelNode("root", 2);
+        parallel_1 = new BT::ParallelNode("par1", 3);
+        parallel_2 = new BT::ParallelNode("par2", 1);

         parallel_1->AddChild(condition_1);
         parallel_1->AddChild(action_1);
@@ -347,27 +348,17 @@

         root->AddChild(parallel_1);
         root->AddChild(parallel_2);
-
-
-
-
-
-
-
-    }
-
-
-};
-
-
-
-/*************************************************TESTS START HERE**********************************************************************/
+    }
+};
+
+
+
+/****************TESTS START HERE***************************/

 TEST_F(SimpleSequenceTest, ConditionTrue)
 {
-
     std::cout << "Ticking the root node !" << std::endl << std::endl;
     // Ticking the root node
     BT::ReturnStatus state = root->Tick();
@@ -375,42 +366,33 @@
     ASSERT_EQ(BT::RUNNING, action->get_status());
     ASSERT_EQ(BT::RUNNING, state);
     root->Halt();
-
 }

 TEST_F(SimpleSequenceTest, ConditionTurnToFalse)
 {
-
-    BT::ReturnStatus state = root->Tick();
-
-
+    BT::ReturnStatus state = root->Tick();
     condition->set_boolean_value(false);

     state = root->Tick();
     ASSERT_EQ(BT::FAILURE, state);
     ASSERT_EQ(BT::HALTED, action->get_status());
     root->Halt();
-
 }

 TEST_F(ComplexSequenceTest, ComplexSequenceConditionsTrue)
 {
-
-    BT::ReturnStatus state = root->Tick();
-
-    ASSERT_EQ(BT::RUNNING, action_1->get_status());
-    ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
-
+    BT::ReturnStatus state = root->Tick();
+
+    ASSERT_EQ(BT::RUNNING, action_1->get_status());
+    ASSERT_EQ(BT::RUNNING, state);
+    root->Halt();
 }

 TEST_F(ComplexSequence2ActionsTest, ConditionsTrue)
 {
-
     BT::ReturnStatus state = root->Tick();

     state = root->Tick();
@@ -427,12 +409,10 @@
     ASSERT_EQ(BT::HALTED, action_2->get_status());

     root->Halt();
-
 }

 TEST_F(ComplexSequenceTest, ComplexSequenceConditions1ToFalse)
 {
-
     BT::ReturnStatus state = root->Tick();

     condition_1->set_boolean_value(false);
@@ -442,12 +422,10 @@
     ASSERT_EQ(BT::FAILURE, state);
     ASSERT_EQ(BT::HALTED, action_1->get_status());
     root->Halt();
-
 }

 TEST_F(ComplexSequenceTest, ComplexSequenceConditions2ToFalse)
 {
-
     BT::ReturnStatus state = root->Tick();

     condition_2->set_boolean_value(false);
@@ -457,14 +435,12 @@
     ASSERT_EQ(BT::FAILURE, state);
     ASSERT_EQ(BT::HALTED, action_1->get_status());
     root->Halt();
-
 }

 TEST_F(SimpleFallbackTest, ConditionTrue)
 {
-
     std::cout << "Ticking the root node !" << std::endl << std::endl;
     // Ticking the root node
     condition->set_boolean_value(true);
@@ -473,13 +449,11 @@
     ASSERT_EQ(BT::IDLE, action->get_status());
     ASSERT_EQ(BT::SUCCESS, state);
     root->Halt();
-
 }

 TEST_F(SimpleFallbackTest, ConditionToFalse)
 {
-
     condition->set_boolean_value(false);

     BT::ReturnStatus state = root->Tick();
@@ -491,13 +465,11 @@
     ASSERT_EQ(BT::SUCCESS, state);
     ASSERT_EQ(BT::HALTED, action->get_status());
     root->Halt();
-
 }

 TEST_F(ComplexFallbackTest, Condition1ToTrue)
 {
-
     condition_1->set_boolean_value(false);
     condition_2->set_boolean_value(false);

@@ -511,12 +483,10 @@

     ASSERT_EQ(BT::HALTED, action_1->get_status());
     root->Halt();
-
 }

 TEST_F(ComplexFallbackTest, Condition2ToTrue)
 {
-
     condition_1->set_boolean_value(false);
     condition_2->set_boolean_value(false);

@@ -529,14 +499,12 @@
     ASSERT_EQ(BT::SUCCESS, state);
     ASSERT_EQ(BT::HALTED, action_1->get_status());
     root->Halt();
-
 }

 TEST_F(BehaviorTreeTest, Condition1ToFalseCondition2True)
 {
-
     condition_1->set_boolean_value(false);
     condition_2->set_boolean_value(true);

@@ -544,13 +512,12 @@

     ASSERT_EQ(BT::RUNNING, state);
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(BehaviorTreeTest, Condition2ToFalseCondition1True)
 {
-
     condition_2->set_boolean_value(false);
     condition_1->set_boolean_value(true);

@@ -558,14 +525,13 @@

     ASSERT_EQ(BT::RUNNING, state);
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(SimpleSequenceWithMemoryTest, ConditionTrue)
 {
-
     std::cout << "Ticking the root node !" << std::endl << std::endl;
     // Ticking the root node
     BT::ReturnStatus state = root->Tick();
@@ -574,48 +540,38 @@
     ASSERT_EQ(BT::RUNNING, action->get_status());
     ASSERT_EQ(BT::RUNNING, state);
     root->Halt();
-
 }

 TEST_F(SimpleSequenceWithMemoryTest, ConditionTurnToFalse)
 {
-
-    BT::ReturnStatus state = root->Tick();
-
+    BT::ReturnStatus state = root->Tick();

     condition->set_boolean_value(false);

     state = root->Tick();
+
     ASSERT_EQ(BT::RUNNING, state);
     ASSERT_EQ(BT::RUNNING, action->get_status());
-    root->Halt();
-
-}
-
-
-
+
+    root->Halt();
+}

 TEST_F(ComplexSequenceWithMemoryTest, ConditionsTrue)
 {
-
     BT::ReturnStatus state = root->Tick();

     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
-
-}
-
-
+
+    root->Halt();
+}

 TEST_F(ComplexSequenceWithMemoryTest, Conditions1ToFalse)
 {
-
     BT::ReturnStatus state = root->Tick();

     condition_1->set_boolean_value(false);
@@ -626,13 +582,10 @@
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
     root->Halt();
-
-
 }

 TEST_F(ComplexSequenceWithMemoryTest, Conditions2ToFalse)
 {
-
     BT::ReturnStatus state = root->Tick();

     condition_2->set_boolean_value(false);
@@ -642,13 +595,12 @@
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(ComplexSequenceWithMemoryTest, Action1Done)
 {
-
     BT::ReturnStatus state = root->Tick();

     condition_2->set_boolean_value(false);
@@ -657,20 +609,13 @@
     std::this_thread::sleep_for(std::chrono::seconds(10));
     state = root->Tick();

-    //ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::RUNNING, action_2->get_status());
-    // ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
-
-}
-
-
-
+
+    root->Halt();
+}

 TEST_F(SimpleFallbackWithMemoryTest, ConditionFalse)
 {
-
     std::cout << "Ticking the root node !" << std::endl << std::endl;
     // Ticking the root node
     condition->set_boolean_value(false);
@@ -679,62 +624,54 @@

     ASSERT_EQ(BT::RUNNING, action->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(SimpleFallbackWithMemoryTest, ConditionTurnToTrue)
 {
-
     condition->set_boolean_value(false);

     BT::ReturnStatus state = root->Tick();
-
-
     condition->set_boolean_value(true);

     state = root->Tick();
+
     ASSERT_EQ(BT::RUNNING, state);
     ASSERT_EQ(BT::RUNNING, action->get_status());
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(ComplexFallbackWithMemoryTest, ConditionsTrue)
 {
-
-
     BT::ReturnStatus state = root->Tick();

     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::SUCCESS, state);
-    root->Halt();
-
-
+
+    root->Halt();
 }

 TEST_F(ComplexFallbackWithMemoryTest, Condition1False)
 {
-
     condition_1->set_boolean_value(false);
     BT::ReturnStatus state = root->Tick();

     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::SUCCESS, state);
-    root->Halt();
-
-
+
+    root->Halt();
 }

 TEST_F(ComplexFallbackWithMemoryTest, ConditionsFalse)
 {
-
     condition_1->set_boolean_value(false);
     condition_2->set_boolean_value(false);
     BT::ReturnStatus state = root->Tick();
@@ -742,9 +679,8 @@
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
-
+
+    root->Halt();
 }

@@ -752,21 +688,18 @@

 TEST_F(ComplexFallbackWithMemoryTest, Conditions1ToTrue)
 {
-
     condition_1->set_boolean_value(false);
     condition_2->set_boolean_value(false);
     BT::ReturnStatus state = root->Tick();
     condition_1->set_boolean_value(true);

-
     state = root->Tick();

     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
-
+
+    root->Halt();
 }

 TEST_F(ComplexFallbackWithMemoryTest, Conditions2ToTrue)
@@ -784,8 +717,8 @@
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(ComplexFallbackWithMemoryTest, Action1Failed)
@@ -796,21 +729,20 @@

     BT::ReturnStatus state = root->Tick();

-
     state = root->Tick();
     std::this_thread::sleep_for(std::chrono::seconds(5));
     state = root->Tick();
+
     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::RUNNING, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(SimpleParallelTest, ConditionsTrue)
 {
-
     BT::ReturnStatus state = root->Tick();

     ASSERT_EQ(BT::IDLE, condition_1->get_status());
@@ -818,47 +750,45 @@
     ASSERT_EQ(BT::RUNNING, action_1->get_status());
     ASSERT_EQ(BT::RUNNING, action_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(SimpleParallelTest, Threshold_3)
 {
-
     root->set_threshold_M(3);
     action_2->set_time(200);
     root->Tick();
     std::this_thread::sleep_for(std::chrono::seconds(5));
     BT::ReturnStatus state = root->Tick();
+
     ASSERT_EQ(BT::IDLE, condition_1->get_status());
     ASSERT_EQ(BT::IDLE, condition_2->get_status());
     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::HALTED, action_2->get_status());
     ASSERT_EQ(BT::SUCCESS, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(SimpleParallelTest, Threshold_1)
 {
-
     root->set_threshold_M(1);
     BT::ReturnStatus state = root->Tick();
+
     ASSERT_EQ(BT::IDLE, condition_1->get_status());
     ASSERT_EQ(BT::IDLE, condition_2->get_status());
     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::IDLE, action_2->get_status());
     ASSERT_EQ(BT::SUCCESS, state);
-    root->Halt();
-
+
+    root->Halt();
 }
 TEST_F(ComplexParallelTest, ConditionsTrue)
 {
-
-    BT::ReturnStatus state = root->Tick();
-
+    BT::ReturnStatus state = root->Tick();

     ASSERT_EQ(BT::IDLE, condition_1->get_status());
     ASSERT_EQ(BT::IDLE, condition_2->get_status());
@@ -869,21 +799,16 @@
     ASSERT_EQ(BT::RUNNING, parallel_1->get_status());
     ASSERT_EQ(BT::IDLE, parallel_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

 TEST_F(ComplexParallelTest, Condition3False)
 {
-
     condition_3->set_boolean_value(false);
     BT::ReturnStatus state = root->Tick();
-
-
-
-

     ASSERT_EQ(BT::IDLE, condition_1->get_status());
     ASSERT_EQ(BT::IDLE, condition_2->get_status());
@@ -894,8 +819,8 @@
     ASSERT_EQ(BT::RUNNING, parallel_1->get_status());
     ASSERT_EQ(BT::RUNNING, parallel_2->get_status());
     ASSERT_EQ(BT::RUNNING, state);
-    root->Halt();
-
+
+    root->Halt();
 }

@@ -912,8 +837,8 @@
     ASSERT_EQ(BT::IDLE, condition_1->get_status());
     ASSERT_EQ(BT::IDLE, condition_2->get_status());
     ASSERT_EQ(BT::IDLE, condition_3->get_status());
-    ASSERT_EQ(BT::SUCCESS, action_1->get_status()); //success not read yet by the node parallel_1
-    ASSERT_EQ(BT::RUNNING, parallel_1->get_status());// parallel_1 hasn't realize (yet) that action_1 has succeeded
+    ASSERT_EQ(BT::SUCCESS, action_1->get_status());  // success not read yet by the node parallel_1
+    ASSERT_EQ(BT::RUNNING, parallel_1->get_status());  // parallel_1 hasn't realize (yet) that action_1 has succeeded

     state = root->Tick();

@@ -930,16 +855,13 @@
     state = root->Tick();

     ASSERT_EQ(BT::IDLE, parallel_2->get_status());
-
     ASSERT_EQ(BT::IDLE, action_1->get_status());
     ASSERT_EQ(BT::IDLE, parallel_1->get_status());
-    //  ASSERT_EQ(BT::HALTED, action_2->get_status());
     ASSERT_EQ(BT::IDLE, action_3->get_status());
     ASSERT_EQ(BT::IDLE, parallel_2->get_status());
     ASSERT_EQ(BT::SUCCESS, state);

     root->Halt();
-
 }

 int main(int argc, char **argv)


QmlDesigner: Remove unused function in ObjectNodeInstance

Change-Id: I4286439082f25fa1eeaf4b90ae3d00aedd80cd51
Reviewed-by: Christian Kandeler <3aa99dcdd3f0cac61fb81c2a11771c0cc2497607@digia.com>
Reviewed-by: Thomas Hartmann <588ee739c05aab7547907becfd1420d2b7316069@digia.com>

--- share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
+++ share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
@@ -153,16 +153,6 @@
     m_nodeInstanceServer = server;
 }

-static bool hasPropertiesWitoutNotifications(const QMetaObject *metaObject)
-{
-    for (int propertyIndex = QObject::staticMetaObject.propertyCount(); propertyIndex < metaObject->propertyCount(); propertyIndex++) {
-        if (!metaObject->property(propertyIndex).hasNotifySignal())
-            return true;
-    }
-
-    return false;
-}
-
 void ObjectNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance)
 {
     m_metaObject = NodeInstanceMetaObject::createNodeInstanceMetaObject(objectNodeInstance, nodeInstanceServer()->engine());


QmlPuppet: Fix build failure for Qt with versions >=5.0 and <=5.2

QQmlType::isComposite and QQmlType::sourceUrl are both unavailable
when used in objectnodeinstance.cpp

Change-Id: I21f66b00348c0535b4779206bd63e363f4b2c225
Reviewed-by: Thomas Hartmann <588ee739c05aab7547907becfd1420d2b7316069@digia.com>

--- share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
+++ share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
@@ -1050,14 +1050,20 @@
     QObject *object = 0;
     QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);

-    if (type && !type->isComposite())  {
+    if (type
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
+            && !type->isComposite()
+#endif
+        )  {
         if (type->typeName() == "QQmlComponent") {
             object = new QQmlComponent(context->engine(), 0);
         } else  {
             object = type->create();
         }
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
     } else if (type->isComposite()) {
         object = createComponent(type->sourceUrl(), context);
+#endif
     } else {
         qWarning() << "QuickDesigner: Cannot create an object of type"
                    << QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber)


+ add using mapnik::color

+ add using mapnik::color

--- bindings/python/mapnik_raster_colorizer.cpp
+++ bindings/python/mapnik_raster_colorizer.cpp
@@ -29,6 +29,7 @@
 using mapnik::raster_colorizer_ptr;
 using mapnik::color_band;
 using mapnik::color_bands;
+using mapnik::color;

 namespace {
    void append_band1(raster_colorizer_ptr & rc, color_band b)


INTEGRATION: CWS changefileheader (1.13.216); FILE MERGED 2008/04/01 15:08:50 thb 1.13.216.3: #i85898# Stripping all external header guards 2008/04/01 10:53:04 thb 1.13.216.2: #i85898# Stripping all external header guards 2008/03/28 15:23:41 rt 1.13.216.1: #i87441# Change license header to LPGL v3.

--- connectivity/source/drivers/jdbc/Class.cxx
+++ connectivity/source/drivers/jdbc/Class.cxx
@@ -1,49 +1,38 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: Class.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.13 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 02:44:59 $
+ * $RCSfile: Class.cxx,v $
+ * $Revision: 1.14 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_connectivity.hxx"
-#ifndef _CONNECTIVITY_JAVA_LANG_CLASS_HXX_
 #include "java/lang/Class.hxx"
-#endif
-#ifndef _CONNECTIVITY_JAVA_TOOLS_HXX_
 #include "java/tools.hxx"
-#endif
-#ifndef _RTL_USTRING_HXX_
 #include <rtl/ustring.hxx>
-#endif

 using namespace connectivity;
 //**************************************************************


bugfix in Plot.cpp for asymmetry plotting

--- src/doofit/plotting/Plot/Plot.cpp
+++ src/doofit/plotting/Plot/Plot.cpp
@@ -196,16 +196,6 @@
   if (plot_args_data_.size() > 6) arg_data7 = plot_args_data_[6];

   RooPlot* plot_frame = dimension_.frame(range_arg);
-
-  // I feel so stupid doing this but apparently RooFit leaves me no other way...
-    RooCmdArg arg1, arg2, arg3, arg4, arg5, arg6, arg7;
-    if (plot_args_.size() > 0) arg1 = plot_args_[0];
-    if (plot_args_.size() > 1) arg2 = plot_args_[1];
-    if (plot_args_.size() > 2) arg3 = plot_args_[2];
-    if (plot_args_.size() > 3) arg4 = plot_args_[3];
-    if (plot_args_.size() > 4) arg5 = plot_args_[4];
-    if (plot_args_.size() > 5) arg6 = plot_args_[5];
-    if (plot_args_.size() > 6) arg7 = plot_args_[6];

   RooCmdArg weight_arg;
   RooAbsData* dataset_normalisation = NULL;


remove potential for deadlock scenarios

remove potential for deadlock scenarios

Former-commit-id: a3a5077f765938be8cb53a6ac12df2ee6386b9b3

--- src/masternode-payments.cpp
+++ src/masternode-payments.cpp
@@ -238,8 +238,6 @@
     CScript payee;
 	int nStartHeightBlock = 0;
     if(!GetBlockPayee(nBlockHeight, payee, nStartHeightBlock)) {
-        // make sure to run masternode checks before trying to get next masternode in queue
-        mnodeman.Check(true);
         // no masternode detected...
         int nCount = 0;
         masternode_info_t mnInfo;
@@ -620,12 +618,6 @@
 		nTotalRewardWithMasternodes  -= fee;
 		return true;
 	}
-    if(!retry){
-        // do check and try again incase of inconsistencies
-        mnodeman.Check(true);
-        if(IsTransactionValid(txNew, nHeight, fee, nTotalRewardWithMasternodes, true))
-            return true;
-    }
     LogPrint(BCLog::MNPAYMENT, "CMasternodeBlockPayees::IsTransactionValid -- ERROR: Missing required payment, possible payees: '%s', amount: %f SYS\n", strPayeesPossible, (float)nMasternodePayment/COIN);
     return false;
 }
@@ -789,12 +781,8 @@
     masternode_info_t mnInfo;

     if (!mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount, mnInfo)) {
-        // run masternode check and check again incase of inconsistencies
-        mnodeman.Check(true);
-        if (!mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount, mnInfo)) {
-            LogPrint(BCLog::MNPAYMENT, "CMasternodePayments::ProcessBlock -- ERROR: Failed to find masternode to pay\n");
-            return false;
-        }
+        LogPrint(BCLog::MNPAYMENT, "CMasternodePayments::ProcessBlock -- ERROR: Failed to find masternode to pay\n");
+        return false;
     }

     LogPrint(BCLog::MNPAYMENT, "CMasternodePayments::ProcessBlock -- Masternode found by GetNextMasternodeInQueueForPayment(): %s\n", mnInfo.outpoint.ToStringShort());


compile

compile

Former-commit-id: ad0c80d75e60ae37730a30534e75ef915b8e7183

--- src/masternode-payments.cpp
+++ src/masternode-payments.cpp
@@ -252,7 +252,7 @@

 	// miner takes 25% of the reward and half fees
 	txNew.vout[0].nValue = (blockReward*0.25);
-	if (nHeight >= Params().GetConsensus().nShareFeeBlock)
+	if (nBlockHeight >= Params().GetConsensus().nShareFeeBlock)
 		txNew.vout[0].nValue += nHalfFee;
 	// masternode takes 75% of reward, add/remove some reward depending on seniority and half fees.
 	CAmount nTotalReward;
@@ -260,7 +260,7 @@

     // ... and masternode
     txoutMasternodeRet = CTxOut(blockReward, payee);
-	if (nHeight >= Params().GetConsensus().nShareFeeBlock)
+	if (nBlockHeight >= Params().GetConsensus().nShareFeeBlock)
 		txoutMasternodeRet.nValue += nHalfFee;

     txNew.vout.push_back(txoutMasternodeRet);


Fixed a bug which meant that vertex s,t primvars would add invalid data to the gl mesh. They are now converted to facevarying and added.

--- contrib/IECoreGL/src/ToGLMeshConverter.cpp
+++ contrib/IECoreGL/src/ToGLMeshConverter.cpp
@@ -47,6 +47,7 @@

 using namespace IECoreGL;

+/// \todo This should be in a standalone Op, and should cope with more than just Vertex interpolated input.
 class ToGLMeshConverter::ToFaceVaryingConverter
 {
 	public:
@@ -151,9 +152,12 @@
 		{
 			if ( pIt->second.interpolation==IECore::PrimitiveVariable::Vertex || pIt->second.interpolation==IECore::PrimitiveVariable::Varying )
 			{
+				// convert to facevarying
 				IECore::DataPtr newData = IECore::despatchTypedData< ToFaceVaryingConverter, IECore::TypeTraits::IsVectorTypedData >( pIt->second.data, primVarConverter );
+				glMesh->addVertexAttribute( pIt->first, newData );
+				// modify the primvar we converted in case it is "s" or "t", then we don't have to do another conversion below.
 				pIt->second.interpolation = IECore::PrimitiveVariable::FaceVarying;
-				glMesh->addVertexAttribute( pIt->first, newData );
+				pIt->second.data = newData;
 			}
 			else if ( pIt->second.interpolation==IECore::PrimitiveVariable::FaceVarying )
 			{


no message

no message

--- src/masternode-payments.cpp
+++ src/masternode-payments.cpp
@@ -471,21 +471,18 @@
     for (CMasternodePayee& payee : vecPayees) {
         if (payee.GetVoteCount() >= MNPAYMENTS_SIGNATURES_REQUIRED) {
             for (CTxOut txout : txNew->vout) {
-                LogPrintf("IsTransactionValid\n");
-                LogPrintf("%s\n", nMasternodePayment);
-                LogPrintf("%s\n", txout.nValue);
-                LogPrintf("%s\n", EncodeDestination(CScriptID(payee.GetPayee())));
-                LogPrintf("%s\n", EncodeDestination(CScriptID(txout.scriptPubKey)));
-                if (CScriptID(payee.GetPayee()) == CScriptID(txout.scriptPubKey) && nMasternodePayment == txout.nValue) {
+                CTxDestination dest;
+                ExtractDestination(txout.scriptPubKey, dest);
+                if (EncodeDestination(payee.GetPayee() == EncodeDestination(dest)) && nMasternodePayment == txout.nValue) {
                     LogPrint(MCLog::MN, "CMasternodeBlockPayees::IsTransactionValid -- Found required payment\n");
                     return true;
                 }
             }

             if(strPayeesPossible == "") {
-                strPayeesPossible = EncodeDestination(CScriptID(payee.GetPayee()));
+                strPayeesPossible = EncodeDestination(payee.GetPayee());
             } else {
-                strPayeesPossible += "," + EncodeDestination(CScriptID(payee.GetPayee()));
+                strPayeesPossible += "," + EncodeDestination(payee.GetPayee());
             }
         }
     }


dirty_memory_manager: flush_permit: make _sstable_write_permit optional

So we can safely test whether it was released or not
by release_sstable_write_permit in a following patch.

Signed-off-by: Benny Halevy <23c997c90eb8537635e9392d48e7af1bf1b2ca22@scylladb.com>

--- dirty_memory_manager.hh
+++ dirty_memory_manager.hh
@@ -428,7 +428,7 @@
 class flush_permit {
     friend class dirty_memory_manager;
     dirty_memory_manager* _manager;
-    sstable_write_permit _sstable_write_permit;
+    std::optional<sstable_write_permit> _sstable_write_permit;
     semaphore_units<> _background_permit;

     flush_permit(dirty_memory_manager* manager, sstable_write_permit&& sstable_write_permit, semaphore_units<>&& background_permit)
@@ -441,7 +441,7 @@
     flush_permit& operator=(flush_permit&&) noexcept = default;

     sstable_write_permit release_sstable_write_permit() {
-        return std::move(_sstable_write_permit);
+        return std::exchange(_sstable_write_permit, std::nullopt).value();
     }

     future<flush_permit> reacquire_sstable_write_permit() &&;


cleanup the debugs

cleanup the debugs

git-svn-id: c0942edff5350604e2827ab28bdfcfa5200fadee@12387 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/mediafile/MediaFile.cxx
+++ src/mediafile/MediaFile.cxx
@@ -118,7 +118,7 @@

 unsigned char* MediaFile::readImage(std::string filename, int* w, int* h)
 {
-  DEBUG3("SDL_image::trying %s\n", filename.c_str());
+  DEBUG3("SDL_image: trying %s\n", filename.c_str());

   // get the absolute filename for cache textures
   if (CACHEMGR.isCacheFileType(filename)) {
@@ -150,7 +150,7 @@
     return NULL;
   }

-  DEBUG3("SDL_image::found %s\n", name.c_str());
+  DEBUG3("SDL_image: found %s\n", name.c_str());

   SDL_Surface* surface;
   surface = IMG_Load(name.c_str());
@@ -159,8 +159,7 @@
   }

   DEBUG3("SDL_Image: loaded %s: %dx%d %dbpp\n",
-         filename.c_str(),
-         surface->w, surface->h, surface->format->BitsPerPixel);
+         name.c_str(), surface->w, surface->h, surface->format->BitsPerPixel);

   // convert the format
   SDL_PixelFormat fmt;


Poprawione engine

Poprawione engine

--- src/ee/execution/VoltDBEngine.cpp
+++ src/ee/execution/VoltDBEngine.cpp
@@ -389,7 +389,7 @@
 			   		continue;
 			   }
 			   TableTuple tempTuple = TableTuple(realtbl->schema());
-			   TableIterator iterator = dupa->iterator();
+			   TableIterator iterator = realtbl->iterator();
         	   while (iterator.next(tempTuple)) {
                			std::cout << "> Odczytane CSI dla wiersza : " << tempTuple.getCSI() << ". Inkrementujemy!\n";
                			tempTuple.incrementCSI();


Unreviewed. Fixing the Windows build, due to a non definition of M_PI.

--- src/effects/SkBlurImageFilter.cpp
+++ src/effects/SkBlurImageFilter.cpp
@@ -120,7 +120,8 @@

 static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lowOffset, int *highOffset)
 {
-    int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * M_PI) / 4.0f + 0.5f));
+    float pi = SkScalarToFloat(SK_ScalarPI);
+    int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi) / 4.0f + 0.5f));
     *kernelSize = d;
     if (d % 2 == 1) {
         *lowOffset = *highOffset = (d - 1) / 2;


Changed "Profile" to "Cube" in ColorCube

A few references to "profile" still existed in SkColorCubeFilter, so I removed them.

BUG=skia:

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

--- src/effects/SkColorCubeFilter.cpp
+++ src/effects/SkColorCubeFilter.cpp
@@ -24,12 +24,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 namespace {

-int32_t SkNextColorProfileUniqueID() {
-    static int32_t gColorProfileUniqueID;
+int32_t SkNextColorCubeUniqueID() {
+    static int32_t gColorCubeUniqueID;
     // do a loop in case our global wraps around, as we never want to return a 0
     int32_t genID;
     do {
-        genID = sk_atomic_inc(&gColorProfileUniqueID) + 1;
+        genID = sk_atomic_inc(&gColorCubeUniqueID) + 1;
     } while (0 == genID);
     return genID;
 }
@@ -55,7 +55,7 @@

 SkColorCubeFilter::SkColorCubeFilter(SkData* cubeData, int cubeDimension)
   : fCubeData(SkRef(cubeData))
-  , fUniqueID(SkNextColorProfileUniqueID())
+  , fUniqueID(SkNextColorCubeUniqueID())
   , fCache(cubeDimension) {
 }

@@ -165,7 +165,7 @@
   : fCache(buffer.readInt()) {
     fCubeData.reset(buffer.readByteArrayAsData());
     buffer.validate(is_valid_3D_lut(fCubeData, fCache.cubeDimension()));
-    fUniqueID = SkNextColorProfileUniqueID();
+    fUniqueID = SkNextColorCubeUniqueID();
 }
 #endif

@@ -192,18 +192,18 @@

 ///////////////////////////////////////////////////////////////////////////////
 #if SK_SUPPORT_GPU
-class GrColorProfileEffect : public GrFragmentProcessor {
+class GrColorCubeEffect : public GrFragmentProcessor {
 public:
     static GrFragmentProcessor* Create(GrTexture* colorCube) {
-        return (NULL != colorCube) ? SkNEW_ARGS(GrColorProfileEffect, (colorCube)) : NULL;
-    }
-
-    virtual ~GrColorProfileEffect();
+        return (NULL != colorCube) ? SkNEW_ARGS(GrColorCubeEffect, (colorCube)) : NULL;
+    }
+
+    virtual ~GrColorCubeEffect();

     virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERRIDE;
     int colorCubeSize() const { return fColorCubeAccess.getTexture()->width(); }

-    static const char* Name() { return "ColorProfile"; }
+    static const char* Name() { return "ColorCube"; }

     virtual void onComputeInvariantOutput(GrProcessor::InvariantOutput*) const SK_OVERRIDE;

@@ -234,7 +234,7 @@
 private:
     virtual bool onIsEqual(const GrProcessor&) const SK_OVERRIDE;

-    GrColorProfileEffect(GrTexture* colorCube);
+    GrColorCubeEffect(GrTexture* colorCube);

     GrCoordTransform    fColorCubeTransform;
     GrTextureAccess     fColorCubeAccess;
@@ -244,46 +244,46 @@

 ///////////////////////////////////////////////////////////////////////////////

-GrColorProfileEffect::GrColorProfileEffect(GrTexture* colorCube)
+GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube)
     : fColorCubeTransform(kLocal_GrCoordSet, colorCube)
     , fColorCubeAccess(colorCube, "bgra", GrTextureParams::kBilerp_FilterMode) {
     this->addCoordTransform(&fColorCubeTransform);
     this->addTextureAccess(&fColorCubeAccess);
 }

-GrColorProfileEffect::~GrColorProfileEffect() {
-}
-
-bool GrColorProfileEffect::onIsEqual(const GrProcessor& sBase) const {
-    const GrColorProfileEffect& s = sBase.cast<GrColorProfileEffect>();
+GrColorCubeEffect::~GrColorCubeEffect() {
+}
+
+bool GrColorCubeEffect::onIsEqual(const GrProcessor& sBase) const {
+    const GrColorCubeEffect& s = sBase.cast<GrColorCubeEffect>();
     return fColorCubeAccess.getTexture() == s.fColorCubeAccess.getTexture();
 }

-const GrBackendFragmentProcessorFactory& GrColorProfileEffect::getFactory() const {
-    return GrTBackendFragmentProcessorFactory<GrColorProfileEffect>::getInstance();
-}
-
-void GrColorProfileEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
+const GrBackendFragmentProcessorFactory& GrColorCubeEffect::getFactory() const {
+    return GrTBackendFragmentProcessorFactory<GrColorCubeEffect>::getInstance();
+}
+
+void GrColorCubeEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
     inout->setToUnknown();
 }

 ///////////////////////////////////////////////////////////////////////////////

-GrColorProfileEffect::GLProcessor::GLProcessor(const GrBackendProcessorFactory& factory,
-                                               const GrProcessor&)
+GrColorCubeEffect::GLProcessor::GLProcessor(const GrBackendProcessorFactory& factory,
+                                            const GrProcessor&)
     : INHERITED(factory) {
 }

-GrColorProfileEffect::GLProcessor::~GLProcessor() {
-}
-
-void GrColorProfileEffect::GLProcessor::emitCode(GrGLFPBuilder* builder,
-                                                 const GrFragmentProcessor&,
-                                                 const GrProcessorKey&,
-                                                 const char* outputColor,
-                                                 const char* inputColor,
-                                                 const TransformedCoordsArray& coords,
-                                                 const TextureSamplerArray& samplers) {
+GrColorCubeEffect::GLProcessor::~GLProcessor() {
+}
+
+void GrColorCubeEffect::GLProcessor::emitCode(GrGLFPBuilder* builder,
+                                              const GrFragmentProcessor&,
+                                              const GrProcessorKey&,
+                                              const char* outputColor,
+                                              const char* inputColor,
+                                              const TransformedCoordsArray& coords,
+                                              const TextureSamplerArray& samplers) {
     if (NULL == inputColor) {
         inputColor = "vec4(1)";
     }
@@ -334,16 +334,16 @@
                            cubeIdx, nonZeroAlpha, inputColor);
 }

-void GrColorProfileEffect::GLProcessor::setData(const GrGLProgramDataManager& pdman,
-                                                const GrProcessor& proc) {
-    const GrColorProfileEffect& colorProfile = proc.cast<GrColorProfileEffect>();
-    SkScalar size = SkIntToScalar(colorProfile.colorCubeSize());
+void GrColorCubeEffect::GLProcessor::setData(const GrGLProgramDataManager& pdman,
+                                             const GrProcessor& proc) {
+    const GrColorCubeEffect& colorCube = proc.cast<GrColorCubeEffect>();
+    SkScalar size = SkIntToScalar(colorCube.colorCubeSize());
     pdman.set1f(fColorCubeSizeUni, SkScalarToFloat(size));
     pdman.set1f(fColorCubeInvSizeUni, SkScalarToFloat(SkScalarInvert(size)));
 }

-void GrColorProfileEffect::GLProcessor::GenKey(const GrProcessor& proc,
-                                               const GrGLCaps&, GrProcessorKeyBuilder* b) {
+void GrColorCubeEffect::GLProcessor::GenKey(const GrProcessor& proc,
+                                            const GrGLCaps&, GrProcessorKeyBuilder* b) {
     b->add32(1); // Always same shader for now
 }

@@ -369,6 +369,6 @@
         textureCube.reset(context->createTexture(NULL, desc, cacheID, fCubeData->data(), 0));
     }

-    return textureCube ? GrColorProfileEffect::Create(textureCube) : NULL;
+    return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL;
 }
 #endif


Fix invalid assertion

Fix invalid assertion

--- src/elysium/test/wallet_tests.cpp
+++ src/elysium/test/wallet_tests.cpp
@@ -234,7 +234,7 @@

     SigmaMintId other(1, 1, otherPub);

-    BOOST_CHECK_THROW(wallet->GetSigmaMint(other), std::runtime_error);
+    BOOST_CHECK_THROW(wallet->GetSigmaMint(other), std::invalid_argument);
 }

 BOOST_AUTO_TEST_CASE(sigma_mint_set_used)
@@ -304,7 +304,7 @@
     // Other mint should not added to our wallet.
     BOOST_CHECK_THROW(
         wallet->GetSigmaMint(SigmaMintId(1, 0, otherPub)),
-        std::runtime_error
+        std::invalid_argument
     );

     // Remove other mint and our chain state should not updated.


interp/oword: cleanup in progress

interp/oword: cleanup in progress

--- src/emc/rs274ngc/interp_o_word.cc
+++ src/emc/rs274ngc/interp_o_word.cc
@@ -532,11 +532,11 @@
 	    if (settings->call_level >= INTERP_SUB_ROUTINE_LEVELS) {
 		ERS(NCE_TOO_MANY_SUBROUTINE_LEVELS);
 	    }
-	    for(i=0; i<INTERP_SUB_PARAMS; i++)	{
+	    for(i = 0; i < INTERP_SUB_PARAMS; i++)	{
 		current_frame->saved_params[i] =
-		    settings->parameters[i+INTERP_FIRST_SUBROUTINE_PARAM];
-
-		settings->parameters[i+INTERP_FIRST_SUBROUTINE_PARAM] =
+		    settings->parameters[i + INTERP_FIRST_SUBROUTINE_PARAM];
+
+		settings->parameters[i + INTERP_FIRST_SUBROUTINE_PARAM] =
 		    block->params[i];
 	    }

@@ -573,28 +573,6 @@
 		}
 	    }
 #endif
-
-	    // // this is the place to call a prolog function.
-	    // if (HAS_BUILTIN_PROLOG(r_block->executing_remap)) {
-
-	    // 	logRemap("O_call: calling builtin prolog\n");
-	    // 	status = (*this.*r_block->executing_remap->builtin_prolog)(settings, r_block);
-
-	    // 	// prolog is exepected to set an appropriate
-	    // 	// error string on failure
-	    // 	if (status > INTERP_MIN_ERROR) {
-	    // 	    // we're terminating the call in progress as we were setting it up.
-	    // 	    // need to unwind setup so far.
-	    // 	    logRemap("O_call: prologue failed, unwinding\n");
-	    // 	    new_frame->subName = NULL;
-	    // 	    settings->call_level--;
-
-	    // 	    // FIXME mah dubious - think this through; better to unwind by return status only
-	    // 	    settings->remap_level = 0;
-	    // 	    return status;
-	    // 	}
-	    // }
-
 	    if (HAS_PYTHON_PROLOG(r_block->executing_remap)) {
 		logRemap("O_call: py prologue %s for NGC remap %s ",
 			 r_block->executing_remap->prolog_func,
@@ -603,7 +581,6 @@
 				r_block->executing_remap->prolog_func);
 	    }

-
 	    if (control_back_to(block,settings) == INTERP_ERROR) {
 		settings->call_level--;
 		ERS(NCE_UNABLE_TO_OPEN_FILE,block->o_name);
@@ -617,12 +594,11 @@
 	    // pass that frame to Python to handle.
 	    settings->call_level++;

+	    new_frame->subName = block->o_name;
+
 	    // aquire the remap_frame
-	    r_block = &_setup.blocks[_setup.remap_level];// &CONTROLLING_BLOCK(_setup);
-
-	    new_frame->subName = block->o_name;
-	    // new_frame->remap_info =  EXECUTING_BLOCK(*settings).current_remap;
-	    // EXECUTING_BLOCK(*settings).current_remap = NULL; // strike off
+	    r_block = &CONTROLLING_BLOCK(_setup);
+

 	    // The 'O word sub' is actually a python callable function.
 	    // call a prolog function if applicable
@@ -637,26 +613,6 @@
 	    // for now, the only builtin prolog we have is the kwargs-dict
 	    // generator add_parameters()

-
-	    // if (HAS_BUILTIN_PROLOG(r_block->executing_remap)) {
-	    // 	logRemap("O_call: calling builtin prolog for py remap %s",
-	    // 		 r_block->executing_remap->name);
-	    // 	// now done in add_parameters
-	    // 	// // always create a dict as well in case a py prolog is called
-	    // 	// new_frame->kwargs = boost::python::dict();
-	    // 	status = (*this.*r_block->executing_remap->builtin_prolog)(settings, r_block);
-
-	    // 	// prolog is exepected to set an appropriate error string
-	    // 	if (status > INTERP_MIN_ERROR) {
-	    // 	    logRemap("O_call: builtin prologue for %s failed, unwinding\n",
-	    // 		     r_block->executing_remap->name);
-	    // 	    settings->call_level--;
-
-	    // 	    // end any remappings in progress
-	    // 	    settings->remap_level = 0;  // FIXME mah better unwind just by return code
-	    // 	    return status;
-	    // 	}
-	    // }
 	    if (HAS_PYTHON_PROLOG(r_block->executing_remap)) {
 		logRemap("O_call: py prologue %s for py remap %s - useless.. but doing it",
 			 r_block->executing_remap->prolog_func,
@@ -667,11 +623,6 @@

 	    status =  pycall(settings, r_block,
 			     r_block->executing_remap->remap_py);
-
-	    // this breaks T,M6,M61 - rely on posargs !! fix this with a Python prolog for T/M6/M61
-	    // predef named params to the rescue?
-	    //status =  pycall(settings, block->o_name, new_frame->remap_info ? NULL : block->params);
-

 	    if (status >  INTERP_MIN_ERROR) {
 		// end any remappings in progress


MIPS: Becuase of cross-context calls, hydrogen-based Array constructor needs to ensure the array constructor pointer passed in matches that of the current context.

Port r14581 (32067c11)

BUG=

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

git-svn-id: b158db1e4b4ab85d4c9e510fdef4b1e8c614b15b@14583 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- src/mips/code-stubs-mips.cc
+++ src/mips/code-stubs-mips.cc
@@ -139,9 +139,10 @@
     int constant_stack_parameter_count) {
   // register state
   // a0 -- number of arguments
+  // a1 -- function
   // a2 -- type info cell with elements kind
-  static Register registers[] = { a2 };
-  descriptor->register_param_count_ = 1;
+  static Register registers[] = { a1, a2 };
+  descriptor->register_param_count_ = 2;
   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
     descriptor->stack_parameter_count_ = &a0;
@@ -7752,13 +7753,8 @@
     Label no_info, switch_ready;
     // Get the elements kind and case on that.
     __ Branch(&no_info, eq, a2, Operand(undefined_sentinel));
-    __ lw(a3, FieldMemOperand(a2, kPointerSize));
-
-    // There is no info if the call site went megamorphic either
-    // TODO(mvstanton): Really? I thought if it was the array function that
-    // the cell wouldn't get stamped as megamorphic.
-    __ Branch(&no_info, eq, a3,
-        Operand(TypeFeedbackCells::MegamorphicSentinel(masm->isolate())));
+    __ lw(a3, FieldMemOperand(a2, JSGlobalPropertyCell::kValueOffset));
+    __ JumpIfNotSmi(a3, &no_info);
     __ SmiUntag(a3);
     __ jmp(&switch_ready);
     __ bind(&no_info);


Update automatic login to only proceed once the alert url is rendered, when present.  This should fix issue #10.

--- dll/InitializeHooks.cpp
+++ dll/InitializeHooks.cpp
@@ -48,7 +48,8 @@
 {
     CVar__Set = 0,
     RealmListCVar,
-    Initialize,
+    Idle,
+    CGlueMgr__m_pendingServerAlert,
     Login,
     FoV,
     Total
@@ -62,7 +63,8 @@
         {
             0x23DF50,
             0x82812C,
-            0x2AD0,
+            0x6B930,
+            0x741E28,
             0x6AFB0,
             0x4089B4
         },
@@ -70,7 +72,8 @@
         {
             0x23F6C0,
             0x943330,
-            0x77AC0,
+            0x70160,
+            0x807DB8,
             0x6E560,
             0x4B5A04
         },
@@ -78,7 +81,8 @@
         {
             0x3668C0,
             0x879D00,
-            0xE5940,
+            0xDAB40,
+            0x76AF88,
             0xD8A30,
             0x5E8D88
         },
@@ -86,17 +90,19 @@
         {
             0x2553B0,
             0x9BE800,
-            0x40F8F0,
+            0x405310,
+            0xABBF04,
             0x400240,
-            0x00, // not supported.  let me know if anyone actually wants this
+            0x00,   // not supported.  let me know if anyone actually wants this
         },
         // Cata64
         {
             0x2F61D0,
             0xCA4328,
-            0x51C0F0,
+            0x51A7C0,
+            0xDACCA8,
             0x514100,
-            0x00, // not supported.  let me know if anyone actually wants this
+            0x00,   // not supported.  let me know if anyone actually wants this
         }
     };

@@ -111,41 +117,50 @@
 class CVar {};

 using SetT = bool(__thiscall CVar::*)(const char *, char, char, char, char);
-using InitializeT = void (__cdecl *)();
+using IdleT = int(__cdecl *)();
 using LoginT = void(__fastcall *)(char *, char *);

-void InitializeHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
-{
-    auto const initialize = detour->GetTrampolineT<InitializeT>();
-    initialize();
-
-    auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Classic, Offset::RealmListCVar));
-    auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Classic, Offset::CVar__Set));
-
-    (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
-
-    detour->Remove();
-
-    if (settings->CredentialsSet)
-    {
-        auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Classic, Offset::Login));
-        login(settings->Username, settings->Password);
-    }
-
-    settings->LoadComplete = true;
+int IdleHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
+{
+    auto const idle = detour->GetTrampolineT<IdleT>();
+    auto const ret = idle();
+
+    // if we are no longer waiting for the server alert, proceed with configuration
+    if (!*reinterpret_cast<std::uint32_t *>(GetAddress(Version::Classic, Offset::CGlueMgr__m_pendingServerAlert)))
+    {
+        auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Classic, Offset::RealmListCVar));
+        auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Classic, Offset::CVar__Set));
+
+        (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
+
+        detour->Remove();
+
+        if (settings->CredentialsSet)
+        {
+            auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Classic, Offset::Login));
+            login(settings->Username, settings->Password);
+        }
+
+        settings->LoadComplete = true;
+    }
+
+    return ret;
 }

 void ApplyClientInitHook(GameSettings *settings)
 {
+    // just to make sure the value is initialized
+    *reinterpret_cast<std::uint32_t *>(GetAddress(Version::Classic, Offset::CGlueMgr__m_pendingServerAlert)) = 1;
+
     auto const proc = hadesmem::Process(::GetCurrentProcessId());
-    auto const initializeOrig = hadesmem::detail::AliasCast<InitializeT>(GetAddress(Version::Classic, Offset::Initialize));
-    auto initializeDetour = new hadesmem::PatchDetour<InitializeT>(proc, initializeOrig,
+    auto const idleOrig = hadesmem::detail::AliasCast<IdleT>(GetAddress(Version::Classic, Offset::Idle));
+    auto idleDetour = new hadesmem::PatchDetour<IdleT>(proc, idleOrig,
         [settings] (hadesmem::PatchDetourBase *detour)
         {
-            InitializeHook(detour, settings);
+            return IdleHook(detour, settings);
         });

-    initializeDetour->Apply();
+    idleDetour->Apply();

     if (settings->FoVSet)
     {
@@ -163,41 +178,50 @@
 class CVar {};

 using SetT = bool(__thiscall CVar::*)(const char *, char, char, char, char);
-using InitializeT = void(__cdecl*)();
+using IdleT = int (__cdecl*)();
 using LoginT = void(__cdecl *)(char *, char *);

-void InitializeHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
-{
-    auto const initialize = detour->GetTrampolineT<InitializeT>();
-    initialize();
-
-    auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::TBC, Offset::RealmListCVar));
-    auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::TBC, Offset::CVar__Set));
-
-    (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
-
-    detour->Remove();
-
-    if (settings->CredentialsSet)
-    {
-        auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::TBC, Offset::Login));
-        login(settings->Username, settings->Password);
-    }
-
-    settings->LoadComplete = true;
+int IdleHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
+{
+    auto const idle = detour->GetTrampolineT<IdleT>();
+    auto const ret = idle();
+
+    // if we are no longer waiting for the server alert, proceed with configuration
+    if (!*reinterpret_cast<std::uint32_t *>(GetAddress(Version::TBC, Offset::CGlueMgr__m_pendingServerAlert)))
+    {
+        auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::TBC, Offset::RealmListCVar));
+        auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::TBC, Offset::CVar__Set));
+
+        (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
+
+        detour->Remove();
+
+        if (settings->CredentialsSet)
+        {
+            auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::TBC, Offset::Login));
+            login(settings->Username, settings->Password);
+        }
+
+        settings->LoadComplete = true;
+    }
+
+    return ret;
 }

 void ApplyClientInitHook(GameSettings *settings)
 {
+    // just to make sure the value is initialized
+    *reinterpret_cast<std::uint32_t *>(GetAddress(Version::TBC, Offset::CGlueMgr__m_pendingServerAlert)) = 1;
+
     auto const proc = hadesmem::Process(::GetCurrentProcessId());
-    auto const initializeOrig = hadesmem::detail::AliasCast<InitializeT>(GetAddress(Version::TBC, Offset::Initialize));
-    auto initializeDetour = new hadesmem::PatchDetour<InitializeT>(proc, initializeOrig,
+    auto const idleOrig = hadesmem::detail::AliasCast<IdleT>(GetAddress(Version::TBC, Offset::Idle));
+    auto idleDetour = new hadesmem::PatchDetour<IdleT>(proc, idleOrig,
         [settings] (hadesmem::PatchDetourBase *detour)
         {
-            InitializeHook(detour, settings);
+            return IdleHook(detour, settings);
         });

-    initializeDetour->Apply();
+    idleDetour->Apply();

     if (settings->FoVSet)
     {
@@ -215,41 +239,50 @@
 class CVar {};

 using SetT = bool(__thiscall CVar::*)(const char *, char, char, char, char);
-using InitializeT = void (*)();
+using IdleT = int (__cdecl *)();
 using LoginT = void(__cdecl *)(char *, char *);

-void InitializeHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
-{
-    auto const initialize = detour->GetTrampolineT<InitializeT>();
-    initialize();
-
-    auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::WotLK, Offset::RealmListCVar));
-    auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::WotLK, Offset::CVar__Set));
-
-    (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
-
-    detour->Remove();
-
-    if (settings->CredentialsSet)
-    {
-        auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::WotLK, Offset::Login));
-        login(settings->Username, settings->Password);
-    }
-
-    settings->LoadComplete = true;
+int IdleHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
+{
+    auto const idle = detour->GetTrampolineT<IdleT>();
+    auto const ret = idle();
+
+    // if we are no longer waiting for the server alert, proceed with configuration
+    if (!*reinterpret_cast<std::uint32_t *>(GetAddress(Version::WotLK, Offset::CGlueMgr__m_pendingServerAlert)))
+    {
+        auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::WotLK, Offset::RealmListCVar));
+        auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::WotLK, Offset::CVar__Set));
+
+        (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
+
+        detour->Remove();
+
+        if (settings->CredentialsSet)
+        {
+            auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::WotLK, Offset::Login));
+            login(settings->Username, settings->Password);
+        }
+
+        settings->LoadComplete = true;
+    }
+
+    return ret;
 }

 void ApplyClientInitHook(GameSettings *settings)
 {
+    // just to make sure the value is initialized
+    *reinterpret_cast<std::uint32_t *>(GetAddress(Version::WotLK, Offset::CGlueMgr__m_pendingServerAlert)) = 1;
+
     auto const proc = hadesmem::Process(::GetCurrentProcessId());
-    auto const initializeOrig = hadesmem::detail::AliasCast<InitializeT>(GetAddress(Version::WotLK, Offset::Initialize));
-    auto initializeDetour = new hadesmem::PatchDetour<InitializeT>(proc, initializeOrig,
+    auto const idleOrig = hadesmem::detail::AliasCast<IdleT>(GetAddress(Version::WotLK, Offset::Idle));
+    auto idleDetour = new hadesmem::PatchDetour<IdleT>(proc, idleOrig,
         [settings] (hadesmem::PatchDetourBase *detour)
         {
-            InitializeHook(detour, settings);
+            return IdleHook(detour, settings);
         });

-    initializeDetour->Apply();
+    idleDetour->Apply();

     if (settings->FoVSet)
     {
@@ -267,41 +300,50 @@
 class CVar {};

 using SetT = bool(__thiscall CVar::*)(const char *, char, char, char, char);
-using InitializeT = void(__cdecl *)();
+using IdleT = int(__cdecl *)();
 using LoginT = void(__cdecl *)(char *, char *);

-void InitializeHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
-{
-    auto const initialize = detour->GetTrampolineT<InitializeT>();
-    initialize();
-
-    auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Cata32, Offset::RealmListCVar));
-    auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Cata32, Offset::CVar__Set));
-
-    (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
-
-    detour->Remove();
-
-    if (settings->CredentialsSet)
-    {
-        auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Cata32, Offset::Login));
-        login(settings->Username, settings->Password);
-    }
-
-    settings->LoadComplete = true;
+int IdleHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
+{
+    auto const idle = detour->GetTrampolineT<IdleT>();
+    auto const ret = idle();
+
+    // if we are no longer waiting for the server alert, proceed with configuration
+    if (!*reinterpret_cast<std::uint32_t *>(GetAddress(Version::Cata32, Offset::CGlueMgr__m_pendingServerAlert)))
+    {
+        auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Cata32, Offset::RealmListCVar));
+        auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Cata32, Offset::CVar__Set));
+
+        (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
+
+        detour->Remove();
+
+        if (settings->CredentialsSet)
+        {
+            auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Cata32, Offset::Login));
+            login(settings->Username, settings->Password);
+        }
+
+        settings->LoadComplete = true;
+    }
+
+    return ret;
 }

 void ApplyClientInitHook(GameSettings *settings)
 {
+    // just to make sure the value is initialized
+    *reinterpret_cast<std::uint32_t *>(GetAddress(Version::Cata32, Offset::CGlueMgr__m_pendingServerAlert)) = 1;
+
     auto const proc = hadesmem::Process(::GetCurrentProcessId());
-    auto const initializeOrig = hadesmem::detail::AliasCast<InitializeT>(GetAddress(Version::Cata32, Offset::Initialize));
-    auto initializeDetour = new hadesmem::PatchDetour<InitializeT>(proc, initializeOrig,
+    auto const idleOrig = hadesmem::detail::AliasCast<IdleT>(GetAddress(Version::Cata32, Offset::Idle));
+    auto idleDetour = new hadesmem::PatchDetour<IdleT>(proc, idleOrig,
         [settings](hadesmem::PatchDetourBase *detour)
         {
-            InitializeHook(detour, settings);
+            return IdleHook(detour, settings);
         });

-    initializeDetour->Apply();
+    idleDetour->Apply();
 }
 }

@@ -310,42 +352,49 @@
 class CVar {};

 using SetT = bool(__fastcall CVar::*)(const char *, char, char, char, char);
-using InitializeT = int (__stdcall *)();
+using IdleT = int (__stdcall *)();
 using LoginT = void(__fastcall *)(char *, char *);

-int InitializeHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
-{
-    auto const initialize = detour->GetTrampolineT<InitializeT>();
-    auto const ret = initialize();
-
-    auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Cata64, Offset::RealmListCVar));
-    auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Cata64, Offset::CVar__Set));
-
-    (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
-
-    detour->Remove();
-
-    if (settings->CredentialsSet)
-    {
-        auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Cata64, Offset::Login));
-        login(settings->Username, settings->Password);
-    }
-
-    settings->LoadComplete = true;
+int IdleHook(hadesmem::PatchDetourBase *detour, GameSettings *settings)
+{
+    auto const idle = detour->GetTrampolineT<IdleT>();
+    auto const ret = idle();
+
+    // if we are no longer waiting for the server alert, proceed with configuration
+    if (!*reinterpret_cast<std::uint32_t *>(GetAddress(Version::Cata64, Offset::CGlueMgr__m_pendingServerAlert)))
+    {
+        auto const cvar = *reinterpret_cast<CVar **>(GetAddress(Version::Cata64, Offset::RealmListCVar));
+        auto const set = hadesmem::detail::AliasCast<SetT>(GetAddress(Version::Cata64, Offset::CVar__Set));
+
+        (cvar->*set)(settings->AuthServer, 1, 0, 1, 0);
+
+        detour->Remove();
+
+        if (settings->CredentialsSet)
+        {
+            auto const login = hadesmem::detail::AliasCast<LoginT>(GetAddress(Version::Cata64, Offset::Login));
+            login(settings->Username, settings->Password);
+        }
+
+        settings->LoadComplete = true;
+    }

     return ret;
 }

 void ApplyClientInitHook(GameSettings *settings)
 {
+    // just to make sure the value is initialized
+    *reinterpret_cast<std::uint32_t *>(GetAddress(Version::Cata64, Offset::CGlueMgr__m_pendingServerAlert)) = 1;
+
     auto const proc = hadesmem::Process(::GetCurrentProcessId());
-    auto const initializeOrig = hadesmem::detail::AliasCast<InitializeT>(GetAddress(Version::Cata64, Offset::Initialize));
-    auto initializeDetour = new hadesmem::PatchDetour<InitializeT>(proc, initializeOrig,
+    auto const idleOrig = hadesmem::detail::AliasCast<IdleT>(GetAddress(Version::Cata64, Offset::Idle));
+    auto idleDetour = new hadesmem::PatchDetour<IdleT>(proc, idleOrig,
         [settings] (hadesmem::PatchDetourBase *detour)
         {
-            return InitializeHook(detour, settings);
+            return IdleHook(detour, settings);
         });

-    initializeDetour->Apply();
+    idleDetour->Apply();
 }
 }


Goss: removing deprecated overdrive

Goss: removing deprecated overdrive

--- src/engines/synths/goss/audio.hpp
+++ src/engines/synths/goss/audio.hpp
@@ -107,8 +107,6 @@
     gam::Biquad<> lpf;
     gam::Biquad<> hpf;

-    util::dsp::HammondPreamp overdrive;
-
     voices::VoiceManager<Voice, 6> voice_mgr_ = {*this};
   };
 } // namespace otto::engines::goss


fixed include order in gui.cpp

fixed include order in gui.cpp

--- src/mirrage/gui/src/gui.cpp
+++ src/mirrage/gui/src/gui.cpp
@@ -1,5 +1,6 @@
+#include <sf2/sf2.hpp>
+
 #include <mirrage/gui/gui.hpp>
-#include <sf2/sf2.hpp>

 #include <mirrage/asset/asset_manager.hpp>
 #include <mirrage/input/events.hpp>


Reduce debug rate.

Reduce debug rate.

--- src/estimator/world_estimator.cpp
+++ src/estimator/world_estimator.cpp
@@ -11,7 +11,7 @@
     Communicator& communicator)
   : locEstimator(locEstimator),
     attEstimator(attEstimator),
-    worldMessageStream(communicator, 10) {
+    worldMessageStream(communicator, 1) {
 }

 WorldEstimate WorldEstimator::update(const SensorMeasurements& meas) {
@@ -22,9 +22,9 @@
     .att = attEstimator.update(meas)
   };

-  if(worldMessageStream.ready()) {
+  if(worldMessageStream.ready() && meas.gps) {
     // protocol::message::log_message_t m;
-    // sprintf(m.data, "world estimate test");
+    // sprintf(m.data, "gps: %d %d", (int) (*meas.gps).lat * 1000, (int) (*meas.gps).lon * 1000);
     //
     // worldMessageStream.publish(m);
   }


Add first working version of sprites

Add first working version of sprites

--- GPU/GPU.cpp
+++ GPU/GPU.cpp
@@ -251,7 +251,7 @@
         uint8_t yOffset;

         // In below comparison, x and alteredWX are both promoted to 'int'
-        if (windowEnabled && (x >= alteredWX) && (x <= alteredWX)) {
+        if (windowEnabled && (x >= alteredWX) /*&& (x <= (alteredWX + WIDTH))*/) {
             // Use window
             mapOffset = windowMapOffset;

@@ -260,7 +260,7 @@

             // Handle case where window is interrupted and resumed at a later line
             // This value is updated to WY upon exiting VBLANK
-            yOffset = lastWindowYPosition++;
+            yOffset = lastWindowYPosition;
         } else if (bgEnabled) {
             // Use background
             mapOffset = backgroundMapOffset;
@@ -308,6 +308,10 @@
         frameBuffer[gpuReg[OffLY] * WIDTH + x] = colors[colorIndexValue];
     }

+    if (windowEnabled) {
+        ++lastWindowYPosition;
+    }
+
     if (isSpriteDisplayOn()) {

         /*uint8_t spritesAdded = 0;
@@ -325,7 +329,7 @@

             // Check whether it is part of this scan-line
             const int16_t spriteY1 = static_cast<int16_t>(spriteRam.readExt((sprite << 2)) - 16);
-            const int16_t spriteY2 = spriteY1 + spriteHeight;
+            const int16_t spriteY2 = spriteY1 + spriteHeight - 1;
             if (gpuReg[OffLY] >= spriteY1 && gpuReg[OffLY] <= spriteY2) {

                 // Get the x-coordinates
@@ -357,9 +361,45 @@
                 }
                  */

-            }
-        }
-    }
-}
-
-
+                // For the time being, assume no hardware limit and no priority checks
+                // and just draw
+                // Get tile number from tile map - multiply yTileOffset by 32 as there are 32 tiles within one row
+                const uint8_t patternNumber = spriteRam.readExt((sprite << 2) + 2) & (spriteHeight == 16 ? 0xFE : 0xFF);
+                const uint8_t options = spriteRam.readExt((sprite << 2) + 3);
+                const bool hasPriority = (options & (1 << 7)) == 0;
+                const bool yFlip = (options & (1 << 6)) != 0;
+                const bool xFlip = (options & (1 << 5)) != 0;
+                const uint8_t palette = (options & (1 << 4)) != 0 ? gpuReg[OffOBP1] : gpuReg[OffOBP0];
+
+                // Select correct y-row depending on y-flip
+                const uint8_t lineNumber = static_cast<uint8_t>(yFlip ? spriteY1 - gpuReg[OffLY] : spriteY2 - gpuReg[OffLY]);
+
+                // Read the whole line
+                // Get 2-bit value - multiply tileLineIndex by two as each line is composed of 2-bytes
+                const uint16_t finalAddress = (patternNumber << 4) + (lineNumber << 1);
+
+                // render
+                for (int8_t i = 0; i < 8; ++i) {
+                    int8_t x = xFlip ? 7 - i : i;
+                    uint8_t pixelValue = static_cast<uint8_t>((videoRam.readExt(finalAddress + 1) &
+                                                               (1 << (7 - x))) ? 2 : 0);
+                    pixelValue |= (videoRam.readExt(finalAddress) >> (7 - x)) & 1;
+
+                    // Get palette colour value
+                    const uint8_t color = static_cast<uint8_t>((palette >> (pixelValue << 1)) & 0x03);
+
+                    //
+                    int16_t spriteXPixel = spriteX1 + i;
+                    if (spriteXPixel >= 0 && spriteXPixel < WIDTH
+                        && (color != colors[COLOUR0])
+                        && (hasPriority || frameBuffer[gpuReg[OffLY] * WIDTH + spriteXPixel] == colors[COLOUR0])) {
+                        frameBuffer[gpuReg[OffLY] * WIDTH + spriteXPixel] = colors[color];
+                    }
+                }
+
+            }
+        }
+    }
+}
+
+


コンパイル通ります

コンパイル通ります

--- Helper2.cpp
+++ Helper2.cpp
@@ -5,9 +5,6 @@

 #include "Helper2_protected.h"
 #include "LED.h"
-
-Accel accel;
-

 // val の値を min と max の値に収まるようにする
 // val < min         :=> min


[ntuple] Clarify constness of local variable

Co-authored-by: Javier Lopez-Gomez <e93e62598cea284a6e63613b3a81ef9d4b8991a5@cern.ch>

--- tree/ntuple/v7/src/RNTuple.cxx
+++ tree/ntuple/v7/src/RNTuple.cxx
@@ -339,7 +339,7 @@
    }
    const float nbytes = fSink->CommitCluster(fNEntries);
    // Cap the compression factor at 1000 to prevent overflow of fMinUnzippedClusterSizeEst
-   float compressionFactor = std::min(1000.f, static_cast<float>(fUnzippedClusterSize) / nbytes);
+   const float compressionFactor = std::min(1000.f, static_cast<float>(fUnzippedClusterSize) / nbytes);
    fUnzippedClusterSizeEst =
       compressionFactor * static_cast<float>(fSink->GetWriteOptions().GetApproxZippedClusterSize());


Test TTreeReaderArray reading vector (not reproducing ROOT-8747).

--- tree/treeplayer/test/array.cxx
+++ tree/treeplayer/test/array.cxx
@@ -6,6 +6,24 @@
 #include "gtest/gtest.h"

 #include <fstream>
+
+TEST(TTreeReaderArray, Vector) {
+   TTree* tree = new TTree("TTreeReaderArrayTree", "In-memory test tree");
+   std::vector<float> vecf{17.f, 18.f, 19.f, 20.f, 21.f};
+   tree->Branch("vec", &vecf);
+
+   tree->Fill();
+   tree->Fill();
+   tree->Fill();
+
+   TTreeReader tr(tree);
+   TTreeReaderArray<double> vec(tr, "vec");
+
+   EXPECT_EQ(5u, vec.GetSize());
+   EXPECT_DOUBLE_EQ(19., vec[2]);
+   EXPECT_DOUBLE_EQ(17., vec[0]);
+}
+

 TEST(TTreeReaderArray, MultiReaders) {
    // See https://root.cern.ch/phpBB3/viewtopic.php?f=3&t=22790


From Jan:
Fixed several typos in comments.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@21755 27541ba8-7e3a-0410-8455-c3a389f83636

--- treeplayer/src/TTreePlayer.cxx
+++ treeplayer/src/TTreePlayer.cxx
@@ -388,7 +388,7 @@
    nentries = GetEntriesToProcess(firstentry, nentries);

    // Compile selection expression if there is one
-   TTreeFormula *select = 0; // no need to interfer with fSelect since we
+   TTreeFormula *select = 0; // no need to interfere with fSelect since we
                              // handle the loop explicitly below and can call
                              // UpdateFormulaLeaves ourselves.
    if (strlen(selection)) {
@@ -458,7 +458,7 @@
    // If the branch name can not be used a proper C++ symbol name,
    // it will be modified as follow:
    //    - white spaces are removed
-   //    - if the leadind character is not a letter, an underscore is inserted
+   //    - if the leading character is not a letter, an underscore is inserted
    //    - < and > are replace by underscores
    //    - * is replaced by st
    //    - & is replaced by rf
@@ -556,7 +556,7 @@
 //  Examples:
 //      selection1 = "x<y && sqrt(z)>3.2"
 //      selection2 = "(x+y)*(sqrt(z)>3.2"
-//  selection1 returns a weigth = 0 or 1
+//  selection1 returns a weight = 0 or 1
 //  selection2 returns a weight = x+y if sqrt(z)>3.2
 //             returns a weight = 0 otherwise.
 //
@@ -771,7 +771,7 @@
 //  Length$(formula): return the total number of element of the formula given as a
 //                    parameter.
 //  Sum$(formula): return the sum of the value of the elements of the formula given
-//                    as a parameter.  For eaxmple the mean for all the elements in
+//                    as a parameter.  For example the mean for all the elements in
 //                    one entry can be calculated with:
 //                Sum$(formula)/Length$(formula)
 //
@@ -787,7 +787,7 @@
 //    tree->Draw("arr3[0]+arr3[1]+arr3[2]");
 //                 will draw the sum arr3 for the index 0 to 2 only if the
 //                 actual_size_of_arr3 is greater or equal to 3.
-//                 Note that the array in 'primary' is flatened/linearilized thus using
+//                 Note that the array in 'primary' is flattened/linearized thus using
 //                 Alt$ with multi-dimensional arrays of different dimensions in unlikely
 //                 to yield the expected results.  To visualize a bit more what elements
 //                 would be matched by TTree::Draw, TTree::Scan can be used:
@@ -833,14 +833,14 @@
 //     Making a Profile histogram
 //     ==========================
 //  In case of a 2-Dim expression, one can generate a TProfile histogram
-//  instead of a TH2F histogram by specyfying option=prof or option=profs.
+//  instead of a TH2F histogram by specifying option=prof or option=profs.
 //  The option=prof is automatically selected in case of y:x>>pf
 //  where pf is an existing TProfile histogram.
 //
 //     Making a 2D Profile histogram
 //     ==========================
 //  In case of a 3-Dim expression, one can generate a TProfile2D histogram
-//  instead of a TH3F histogram by specyfying option=prof or option=profs.
+//  instead of a TH3F histogram by specifying option=prof or option=profs.
 //  The option=prof is automatically selected in case of z:y:x>>pf
 //  where pf is an existing TProfile2D histogram.
 //
@@ -1140,7 +1140,7 @@
 //   =============
 // The function returns the status of the histogram fit (see TH1::Fit)
 // If no entries were selected, the function returns -1;
-//   (ie fitResult is null is the fit is OK)
+//   (i.e. fitResult is null if the fit is OK)

    Int_t nch = strlen(option) + 10;
    char *opt = new char[nch];
@@ -2077,7 +2077,7 @@
 // and anal.C the name of the file created by this function.
 //
 // NOTE: Since the implementation of this function, a new and better
-//       function TTree::MakeClass() has been developped.
+//       function TTree::MakeClass() has been developed.

 // Connect output file
    TString tfile;
@@ -2315,7 +2315,7 @@
    //    nohist : indicates that the generated ProcessFill should not
    //             fill the histogram.
    //
-   // 'maxUnrolling' controls how deep in the class hierachy does the
+   // 'maxUnrolling' controls how deep in the class hierarchy does the
    // system 'unroll' class that are not split.  'unrolling' a class
    // will allow direct access to its data members a class (this
    // emulates the behavior of TTreeFormula).
@@ -2330,7 +2330,7 @@
    // For example with Event.root, if
    //    Double_t somepx = fTracks.fPx[2];
    // is executed by one of the method of the skeleton,
-   // somepx will updated with the current value of fPx of the 3rd track.
+   // somepx will be updated with the current value of fPx of the 3rd track.
    //
    // Both macrofilename and the optional cutfilename are expected to be
    // the name of source files which contain at least a free standing
@@ -2442,7 +2442,7 @@
 //   If option "p" and "d" print results of analysis
 //   If option "p" and "h" generate standard histograms
 //   If option "p" and "c" generate code of conversion functions
-//   return a pointer to the TPrincipal object. It is the user responsability
+//   return a pointer to the TPrincipal object. It is the user responsibility
 //   to delete this object.
 //   The option default value is "np"
 //
@@ -2587,7 +2587,7 @@
    // filename must contain a valid class implementation derived from TSelector,
    // where TSelector has the following member functions:
    //
-   //    Begin():        called everytime a loop on the tree starts,
+   //    Begin():        called every time a loop on the tree starts,
    //                    a convenient place to create your histograms.
    //    SlaveBegin():   called after Begin(), when on PROOF called only on the
    //                    slave servers.
@@ -2664,7 +2664,7 @@
    //
    //   The TSelector class has the following member functions:
    //
-   //    Begin():        called everytime a loop on the tree starts,
+   //    Begin():        called every time a loop on the tree starts,
    //                    a convenient place to create your histograms.
    //    SlaveBegin():   called after Begin(), when on PROOF called only on the
    //                    slave servers.
@@ -2687,8 +2687,8 @@

    selector->SetOption(option);

-   selector->Begin(fTree);       //<===call user initialisation function
-   selector->SlaveBegin(fTree);  //<===call user initialisation function
+   selector->Begin(fTree);       //<===call user initialization function
+   selector->SlaveBegin(fTree);  //<===call user initialization function
    if (selector->Version() >= 2)
       selector->Init(fTree);
    selector->Notify();
@@ -2821,8 +2821,8 @@
    // *        x *        6 * arr1[3][0]*           *
    // *        x *        7 * arr1[3][1]*           *
    //
-   // However, if there is a selection criterium which is an array, then
-   // all the formulas will be synchronized with the selection criterium
+   // However, if there is a selection criterion which is an array, then
+   // all the formulas will be synchronized with the selection criterion
    // (see TTreePlayer::DrawSelect for more information).
    //
    // The options string can contains the following parameters:
@@ -3464,7 +3464,7 @@
    if (npar <=0) { Error("UnbinnedFit", "Illegal number of parameters = %d",npar); return 0; }

    // Spin through the data to select out the events of interest
-   // Make sure that the arrays V1,etc are created large enough to accomodate
+   // Make sure that the arrays V1,etc are created large enough to accommodate
    // all entries
    Long64_t oldEstimate = fTree->GetEstimate();
    Long64_t nent = fTree->GetEntriesFriend();
@@ -3498,7 +3498,7 @@

    TString opt = option;
    opt.ToLower();
-   // Some initialisations
+   // Some initializations
    if (!opt.Contains("v")) {
       arglist[0] = -1;
       tFitter->ExecuteCommand("SET PRINT", arglist,1);


Cut and paste error corrected

Cut and paste error corrected

--- ZDC/AliZDCPedestals.cxx
+++ ZDC/AliZDCPedestals.cxx
@@ -173,7 +173,7 @@
   if(PedCorrCoeff0 && PedCorrCoeff1){
     for(int t=0; t<48; t++){
        fPedCorrCoeff[0][t] = PedCorrCoeff0[t];
-       fPedCorrCoeff[0][t] = PedCorrCoeff1[t];
+       fPedCorrCoeff[1][t] = PedCorrCoeff1[t];
     }
   }
   else{


Fix a problem in TTreePlayer::UnbinnedFit in case the initial value of a parameter is negative.
In this case, the step size was set negative, forcing Minuit in RESET mode.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@7778 27541ba8-7e3a-0410-8455-c3a389f83636

--- treeplayer/src/TTreePlayer.cxx
+++ treeplayer/src/TTreePlayer.cxx
@@ -1,4 +1,4 @@
-// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.149 2003/12/16 21:58:58 brun Exp $
+// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.150 2003/12/16 22:42:29 brun Exp $
 // Author: Rene Brun   12/01/96

 /*************************************************************************
@@ -2754,14 +2754,17 @@
   Double_t min, max;
   for(i = 0; i < npar; i++) {
     fitfunc->GetParLimits(i, min, max);
+    Double_t we = 0.1*TMath::Abs(max-min);
+    if (we == 0) we = 0.3*TMath::Abs(fitfunc->GetParameter(i));
+    if (we == 0) we = 1;
     if(min < max) {
       tFitter->SetParameter(i, fitfunc->GetParName(i),
                                fitfunc->GetParameter(i),
-                               fitfunc->GetParameter(i)/100.0, min, max);
+                               we, min, max);
     } else {
       tFitter->SetParameter(i, fitfunc->GetParName(i),
                                fitfunc->GetParameter(i),
-                               fitfunc->GetParameter(i)/100.0, 0, 0);
+                               we, 0, 0);
     }


don't start TTreeViewer when in batch mode.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@1190 27541ba8-7e3a-0410-8455-c3a389f83636

--- treeplayer/src/TTreePlayer.cxx
+++ treeplayer/src/TTreePlayer.cxx
@@ -1,4 +1,4 @@
-// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.27 2000/12/10 17:17:01 brun Exp $
+// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.28 2000/12/11 12:05:31 brun Exp $
 // Author: Rene Brun   12/01/96

 /*************************************************************************
@@ -1728,7 +1728,7 @@
    if (!opt.Contains("selector")) {
       fprintf(fp,"   Notify();\n");
    }
-
+
    fprintf(fp,"}\n");
    fprintf(fp,"\n");

@@ -2613,6 +2613,11 @@
 //  ww is the width of the canvas in pixels
 //  wh is the height of the canvas in pixels

+   if (gROOT->IsBatch()) {
+      Warning("StartViewer", "viewer cannot run in batch mode");
+      return;
+   }
+
    gROOT->LoadClass("TTreeViewer","TreeViewer");
 #ifdef R__WIN32
    gROOT->ProcessLine(Form("new TTreeViewer(\"%s\",\"TreeViewer\",%d,%d);",fTree->GetName(),ww,wh));


no need to test for null config

no need to test for null config

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@2031 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/lexers.cpp
+++ trunk/extension/src/lexers.cpp
@@ -436,20 +436,14 @@
     child = child->GetNext();
   }

-  // Initialize the config if it is constructed.
-  wxConfigBase* config = wxConfigBase::Get(false);
-
-  if (config != NULL)
-  {
-    if (!wxConfigBase::Get()->Exists(_("In files")))
-    {
-      wxConfigBase::Get()->Write(_("In files"), GetLexerAssociations());
-    }
-
-    if (!wxConfigBase::Get()->Exists(_("Add what")))
-    {
-      wxConfigBase::Get()->Write(_("Add what"), GetLexerAssociations());
-    }
+  if (!wxConfigBase::Get()->Exists(_("In files")))
+  {
+    wxConfigBase::Get()->Write(_("In files"), GetLexerAssociations());
+  }
+
+  if (!wxConfigBase::Get()->Exists(_("Add what")))
+  {
+    wxConfigBase::Get()->Write(_("Add what"), GetLexerAssociations());
   }
 }


a small fix

a small fix

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@1927 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/lexers.cpp
+++ trunk/extension/src/lexers.cpp
@@ -356,15 +356,16 @@

 bool wxExLexers::Read()
 {
-  wxXmlDocument doc;
-
   // This test is to prevent showing an error if the lexers files does not exist,
   // as this is not required.
   if (!m_FileName.FileExists())
   {
     return false;
   }
-  else if (!doc.Load(m_FileName.GetFullPath()))
+
+  wxXmlDocument doc;
+
+  if (!doc.Load(m_FileName.GetFullPath()))
   {
     return false;
   }


Allocator Performance: Exited early to avoid needless computation.

Review: https://reviews.apache.org/r/43668/

--- src/master/allocator/mesos/hierarchical.cpp
+++ src/master/allocator/mesos/hierarchical.cpp
@@ -1281,11 +1281,16 @@
         Resources resources =
           (available.unreserved() + available.reserved(role)).nonRevocable();

+        // It is safe to break here, because all frameworks under a role would
+        // consider the same resources, so in case we don't have allocatable
+        // resources, we don't have to check for other frameworks under the
+        // same role. We only break out of the innermost loop, so the next step
+        // will use the same slaveId, but a different role.
         // NOTE: The resources may not be allocatable here, but they can be
         // accepted by one of the frameworks during the second allocation
         // stage.
         if (!allocatable(resources)) {
-          continue;
+          break;
         }

         // If the framework filters these resources, ignore. The unallocated
@@ -1409,6 +1414,19 @@
           resources += available.unreserved();
         }

+        // It is safe to break here, because all frameworks under a role would
+        // consider the same resources, so in case we don't have allocatable
+        // resources, we don't have to check for other frameworks under the
+        // same role. We only break out of the innermost loop, so the next step
+        // will use the same slaveId, but a different role.
+        // The difference to the second `allocatable` check is that here we also
+        // check for revocable resources, which can be disabled on a per frame-
+        // work basis, which requires us to go through all frameworks in case we
+        // have allocatable revocable resources.
+        if (!allocatable(resources)) {
+          break;
+        }
+
         // Remove revocable resources if the framework has not opted
         // for them.
         if (!frameworks[frameworkId].revocable) {
@@ -1416,6 +1434,9 @@
         }

         // If the resources are not allocatable, ignore.
+        // We can not break here, because another framework under the same role
+        // could accept revocable resources and breaking would skip all other
+        // frameworks.
         if (!allocatable(resources)) {
           continue;
         }


simulator: typo in initial output message

--- src/modules/simulator/simulator_mavlink.cpp
+++ src/modules/simulator/simulator_mavlink.cpp
@@ -715,7 +715,7 @@
 						handle_message(&msg, publish);

 						if (msg.msgid != 0 && (hrt_system_time() - pstart_time > 1000000)) {
-							PX4_INFO("Got initial simuation data, running sim..");
+							PX4_INFO("Got initial simulation data, running sim..");
 							no_sim_data = false;
 						}
 					}


Implement Sys::GenRandomBytes for NaCl

Implement Sys::GenRandomBytes for NaCl

--- src/common/System.cpp
+++ src/common/System.cpp
@@ -36,6 +36,7 @@
 #include <signal.h>
 #ifdef __native_client__
 #include <nacl/nacl_exception.h>
+#include <nacl/nacl_random.h>
 #else
 #include <dlfcn.h>
 #endif
@@ -336,6 +337,10 @@
 		Sys::Error("CryptGenRandom failed: %s", Win32StrError(GetLastError()));

 	CryptReleaseContext(prov, 0);
+#elif defined(__native_client__)
+	size_t bytes_written;
+	if (nacl_secure_random(dest, size, &bytes_written) != 0 || bytes_written != size)
+		Sys::Error("nacl_secure_random failed");
 #else
 	try {
 		FS::RawPath::OpenRead("/dev/urandom").Read(dest, size);


Add missing point.

Add missing point.

--- src/common/source.cpp
+++ src/common/source.cpp
@@ -615,7 +615,7 @@

 Source load_source(const ptree &p)
 {
-#define TRY_TO_LOAD_SOURCE(x) x x##_; if (x##_.load(p.get_child("source" + x::getString()))) return x##_
+#define TRY_TO_LOAD_SOURCE(x) x x##_; if (x##_.load(p.get_child("source." + x::getString()))) return x##_
     SOURCE_TYPES(TRY_TO_LOAD_SOURCE, DELIM_SEMICOLON);
     throw std::runtime_error("Bad source");
 }


Minor update to info printed as code is running

--- stf/src/search.cxx
+++ stf/src/search.cxx
@@ -120,27 +120,27 @@
         delete[] numingroup;
         numingroup=NULL;
     }
+    time2=MyGetTime();
+
+    //Also must ensure that group ids do not overlap between mpi threads so adjust group ids
+    MPI_Allgather(&numgroups, 1, MPI_Int_t, mpi_ngroups, 1, MPI_Int_t, MPI_COMM_WORLD);
+    MPIAdjustLocalGroupIDs(nbodies, pfof);
+
+    //then determine export particles, declare arrays used to export data
+#ifdef MPIREDUCEMEM
+    MPIGetExportNum(nbodies, Part, sqrt(param[1]));
+#endif
+    //allocate memory to store info
     cout<<ThisTask<<": Finished local search, nexport/nimport = "<<NExport<<" "<<NImport<<" in "<<MyGetTime()-time2<<endl;
-    time2=MyGetTime();
-
+    PartDataIn = new Particle[NExport];
+    PartDataGet = new Particle[NImport];
+    FoFDataIn = new fofdata_in[NExport];
+    FoFDataGet = new fofdata_in[NImport];
     //if using MPI must determine which local particles need to be exported to other threads and used to search
     //that threads particles. This is done by seeing if the any particles have a search radius that overlaps with
     //the boundaries of another threads domain. Then once have exported particles must search local particles
     //relative to these exported particles. Iterate over search till no new links are found.

-    //Also must ensure that group ids do not overlap between mpi threads so adjust group ids
-    MPI_Allgather(&numgroups, 1, MPI_Int_t, mpi_ngroups, 1, MPI_Int_t, MPI_COMM_WORLD);
-    MPIAdjustLocalGroupIDs(nbodies, pfof);
-
-    //then determine export particles, declare arrays used to export data
-#ifdef MPIREDUCEMEM
-    MPIGetExportNum(nbodies, Part, sqrt(param[1]));
-#endif
-
-    PartDataIn = new Particle[NExport];
-    PartDataGet = new Particle[NImport];
-    FoFDataIn = new fofdata_in[NExport];
-    FoFDataGet = new fofdata_in[NImport];
     //I have adjusted FOF data structure to have local group length and also seperated the export particles from export fof data
     //the reason is that will have to update fof data in iterative section but don't need to update particle information.
     MPIBuildParticleExportList(nbodies, Part, pfof, Len, sqrt(param[1]));


Lower case -t- recommendation

Lower case -t- recommendation

--- precomp.cpp
+++ precomp.cpp
@@ -3382,15 +3382,15 @@
 #else
 #define DISABLE_OR_ENABLE_FOR_COMFORT
 #endif // COMFORT
-  if (((use_pdf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_pdf_count == 0) && (decompressed_pdf_count > 0)))) disable_methods += 'P';
-  if (((use_zip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_zip_count == 0) && (decompressed_zip_count > 0)))) disable_methods += 'Z';
-  if (((use_gzip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gzip_count == 0) && (decompressed_gzip_count > 0)))) disable_methods += 'G';
-  if ((((use_png) && DISABLE_OR_ENABLE_FOR_COMFORT(((recompressed_png_count + recompressed_png_multi_count) == 0) && (decompressed_png_count + decompressed_png_multi_count > 0))))) disable_methods += 'N';
-  if (((use_gif) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gif_count == 0) && (decompressed_gif_count > 0)))) disable_methods += 'F';
-  if (((use_jpg) && DISABLE_OR_ENABLE_FOR_COMFORT(((recompressed_jpg_count + recompressed_jpg_prog_count) == 0) && (decompressed_jpg_count + decompressed_jpg_prog_count > 0)))) disable_methods += 'J';
-  if (((use_swf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_swf_count == 0) && (decompressed_swf_count > 0)))) disable_methods += 'S';
-  if (((use_base64) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_base64_count == 0) && (decompressed_base64_count > 0)))) disable_methods += 'M';
-  if (((use_bzip2) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_bzip2_count == 0) && (decompressed_bzip2_count > 0)))) disable_methods += 'B';
+  if (((use_pdf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_pdf_count == 0) && (decompressed_pdf_count > 0)))) disable_methods += 'p';
+  if (((use_zip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_zip_count == 0) && (decompressed_zip_count > 0)))) disable_methods += 'z';
+  if (((use_gzip) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gzip_count == 0) && (decompressed_gzip_count > 0)))) disable_methods += 'g';
+  if ((((use_png) && DISABLE_OR_ENABLE_FOR_COMFORT(((recompressed_png_count + recompressed_png_multi_count) == 0) && (decompressed_png_count + decompressed_png_multi_count > 0))))) disable_methods += 'n';
+  if (((use_gif) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_gif_count == 0) && (decompressed_gif_count > 0)))) disable_methods += 'f';
+  if (((use_jpg) && DISABLE_OR_ENABLE_FOR_COMFORT(((recompressed_jpg_count + recompressed_jpg_prog_count) == 0) && (decompressed_jpg_count + decompressed_jpg_prog_count > 0)))) disable_methods += 'j';
+  if (((use_swf) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_swf_count == 0) && (decompressed_swf_count > 0)))) disable_methods += 's';
+  if (((use_base64) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_base64_count == 0) && (decompressed_base64_count > 0)))) disable_methods += 'm';
+  if (((use_bzip2) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_bzip2_count == 0) && (decompressed_bzip2_count > 0)))) disable_methods += 'b';
   if (((use_mp3) && DISABLE_OR_ENABLE_FOR_COMFORT((recompressed_mp3_count == 0) && (decompressed_mp3_count > 0)))) disable_methods += '3';
   if ( disable_methods.length() > 0 ) {
     if (DISABLE_OR_ENABLE_FOR_COMFORT(false))


:children_crossing: add autocorrelation to calc help

--- src/mode_calc_help.cpp
+++ src/mode_calc_help.cpp
@@ -8,6 +8,7 @@
 #include "mode_calc_aabb.hpp"
 #include "mode_calc_obb.hpp"
 #include "mode_calc_center.hpp"
+#include "mode_calc_autocorrelation.hpp"

 namespace mill
 {
@@ -30,6 +31,8 @@
            "      : construct OBB using covariances\n"
            "    - center\n"
            "      : calculate geometric center\n"
+           "    - autocorrelation\n"
+           "      : calculate autocorrelation of data\n"
            "    - help\n"
            "      : print detailed explanation of each command\n";
 }
@@ -74,6 +77,10 @@
     {
         return mode_calc_center({"help"sv});
     }
+    else if(command == "autocorrelation")
+    {
+        return mode_calc_autocorrelation({"help"sv});
+    }
     else if(command == "help")
     {
         log::info(mode_calc_help_usage());


Addressed review feedback: incomplete cleanup of empty branch

Signed-off-by: lhlawson <dffab2815f75df92cc8df158c2862035ecca479a@intel.com>

--- service/src/LevelZero.cpp
+++ service/src/LevelZero.cpp
@@ -511,8 +511,6 @@
     int LevelZeroImp::performance_domain_count(int geopm_domain, unsigned int l0_device_idx, int l0_domain) const
     {
         int result = 0;
-        if (geopm_domain == GEOPM_DOMAIN_GPU) {
-        }
         else if (geopm_domain == GEOPM_DOMAIN_GPU_CHIP) {
             result = m_devices.at(l0_device_idx).subdevice.perf_domain.at(l0_domain).size();
         }


Fix for incorrectly restored multi PNGs

Fix for incorrectly restored multi PNGs

- Using a signed int instead of an unsigned solves the issue
- Fixes #50

--- precomp.cpp
+++ precomp.cpp
@@ -4722,10 +4722,10 @@

       frecomp = tryOpen(tempfile2,"rb");

-      unsigned int remaining_bytes = recompressed_data_length;
+      int remaining_bytes = recompressed_data_length;
       unsigned int act_idat_chunk = 0;
       for (;;) {
-        if ((remaining_bytes + 2) > idat_lengths[act_idat_chunk]) {
+        if ((remaining_bytes + 2) > (int)idat_lengths[act_idat_chunk]) {
           fast_copy(frecomp, fout, idat_lengths[act_idat_chunk]);
           remaining_bytes -= idat_lengths[act_idat_chunk];


INTEGRATION: CWS ooo19126 (1.2.504); FILE MERGED 2005/09/05 17:32:29 rt 1.2.504.1: #i54170# Change license header: remove SISSL

--- dbaccess/source/core/inc/core_resource.hxx
+++ dbaccess/source/core/inc/core_resource.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: core_resource.hxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.3 $
  *
- *  last change: $Author: fs $ $Date: 2001-04-26 11:18:22 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 13:36:10 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


Enable APFS normalization for macOS

Enable APFS normalization for macOS

--- src/posix/fs.cpp
+++ src/posix/fs.cpp
@@ -921,7 +921,7 @@

 void PosixFileSystemAccess::path2local(string* path, string* local) const
 {
-#ifdef USE_IOS
+#ifdef __MACH__
     path2localMac(path, local);
 #else
     *local = *path;


sync with unstable (port bugfix)

sync with unstable (port bugfix)

Signed-off-by: Nuno Lopes <c61bc7502a9d053e92b2bfd97b87138a818cfe20@microsoft.com>

--- src/muz/rel/dl_compiler.cpp
+++ src/muz/rel/dl_compiler.cpp
@@ -590,7 +590,7 @@
         }

         // enforce interpreted tail predicates
-        unsigned ut_len=r->get_uninterpreted_tail_size();
+        unsigned ut_len = r->get_uninterpreted_tail_size();
         unsigned ft_len = r->get_tail_size(); // full tail
         ptr_vector<expr> tail;
         for (unsigned tail_index = ut_len; tail_index < ft_len; ++tail_index) {


adapt multicast_throughput for libfabric too.

--- src/applications/archive/multicast_throughput.cpp
+++ src/applications/archive/multicast_throughput.cpp
@@ -55,7 +55,7 @@
 #ifdef USE_VERBS_API
     verbs_initialize(ip_addrs_and_ports, ip_addrs_and_ports, node_id);
 #else
-    lf_initialize(ip_addrs_and_ports, node_id);
+    lf_initialize(ip_addrs_and_ports, ip_addrs_and_ports, node_id);
 #endif

     std::vector<uint32_t> members;


thcrap: handle exception in RepoWrire

thcrap: handle exception in RepoWrire

Originally I added this code to try and fix a crash as a result
of an unhandled exception in RepoWrite but when I added this code
the bug seemed to have disappeared

--- thcrap/src/repo.cpp
+++ thcrap/src/repo.cpp
@@ -97,7 +97,13 @@
 	repo_dir.remove_filename();
 	free(repo_fn_local);

-	std::filesystem::create_directories(repo_dir);
+	try {
+		std::filesystem::create_directories(repo_dir);
+	}
+	catch (std::filesystem::filesystem_error e) {
+		log_printf("Failed to create repo folder %s.\nError %d: %s\n", repo_dir.u8string(), e.code().value(), e.what());
+		return false;
+	}
 	int ret = json_dump_file(repo_js, repo_path.u8string().c_str(), JSON_INDENT(4)) == 0;
 	json_decref(repo_js);
 	return ret;