Speculative fix of Windows build breakage am: 0f3d962283 am: 456a82d668

Original change: https://android-review.googlesource.com/c/platform/external/perfetto/+/1914629

Change-Id: I45d4edf4f03b767623f49ea57e9b55926467a1a6

--- src/base/file_utils.cc
+++ src/base/file_utils.cc
@@ -238,7 +238,9 @@
       return base::ErrStatus("Directory path %s is too long", dir_path.c_str());
     WIN32_FIND_DATAA ffd;

-    base::ScopedResource<HANDLE, FindClose, nullptr, false,
+    // Wrap FindClose to: (1) make the return unix-style; (2) deal w/ stdcall.
+    static auto find_close = [](HANDLE h) { return FindClose(h) ? 0 : -1; };
+    base::ScopedResource<HANDLE, find_close, nullptr, false,
                          base::PlatformHandleChecker>
         hFind(FindFirstFileA(glob_path.c_str(), &ffd));
     if (!hFind) {


Generic Binary Search Tree!

Generic Binary Search Tree!

--- C++/bst.cpp
+++ C++/bst.cpp
@@ -4,78 +4,84 @@
 #include <iostream>

-struct node {
-    struct node *pr;
-    struct node *lf;
-    struct node *rg;
-    int value;
-} typedef Node;
+template <class T>
+class Node
+{
+    public:
+        Node<T> *pr;
+        Node<T> *lf;
+        Node<T> *rg;
+        T value;

+        Node(T value) {
+            pr = NULL;
+            lf = NULL;
+            rg = NULL;
+            this->value = value;
+        }
+};
+
+template <class T>
 class BST
 {
     public:

-        void insert_node(int value);
-        void delete_node(int value);
+        void insert_node(T value);
+        void delete_node(T value);
         void print_nodes(void);

         BST();

     private:

-        Node *root;
+        Node<T> *root;

-        void insert_node(Node *node, int value);
-        void delete_node(Node *node, int value);
-        void transplant(Node *x, Node *y);
-        void print_nodes(Node *node);
-        Node *create_node(Node *pr, int value);
-        Node *min_node(Node *node);
+        void insert_node(Node<T> *node, T value);
+        void delete_node(Node<T> *node, T value);
+        void transplant(Node<T> *x, Node<T> *y);
+        void print_nodes(Node<T> *node);
+        Node<T> *create_node(Node<T> *pr, T value);
+        Node<T> *min_node(Node<T> *node);
 };

-BST::BST(void)
+template <class T>
+BST<T>::BST(void)
 {
     root = NULL;
 }

-Node *BST::create_node(Node *pr, int value)
-{
-    Node *new_node = new Node();
-    new_node->value = value;
-    new_node->lf = NULL;
-    new_node->rg = NULL;
-    new_node->pr = pr;
-
-    return new_node;
-}
-
-void BST::insert_node(Node *node, int value)
+template <class T>
+void BST<T>::insert_node(Node<T> *node, T value)
 {
     if (node == NULL)
-        root = create_node(NULL, value);
+        root = new Node<T>(value);
     else if (node->value > value) {
         if (node->lf)
             insert_node(node->lf, value);
         else {
-            Node *new_node = create_node(node, value);
+            Node<T> *new_node = new Node<T>(value);
             node->lf = new_node;
+            new_node->pr = node;
         }
     } else {
         if (node->rg)
             insert_node(node->rg, value);
         else {
-            Node *new_node = create_node(node, value);
+            Node<T> *new_node = new Node<T>(value);
             node->rg = new_node;
+            new_node->pr = node;
         }
     }
 }

-void BST::insert_node(int value)
+template <class T>
+void BST<T>::insert_node(T value)
 {
     insert_node(root, value);
 }

-void BST::transplant(Node *x, Node *y)
+template <class T>
+void BST<T>::transplant(Node<T> *x, Node<T> *y)
 {
     if (x == root)
         root = y;
@@ -87,14 +93,16 @@
         y->pr = x->pr;
 }

-Node *BST::min_node(Node *node)
+template <class T>
+Node<T> *BST<T>::min_node(Node<T> *node)
 {
     if (!node->lf)
         return node;
     return min_node(node->lf);
 }

-void BST::delete_node(Node *node, int value)
+template <class T>
+void BST<T>::delete_node(Node<T> *node, T value)
 {
     if (node == NULL)
         return;
@@ -103,12 +111,12 @@
     else if (node->value < value)
         delete_node(node->rg, value);
     else {
-        if (node->rg and !node->lf)
+        if (!node->lf)
             transplant(node, node->rg);
-        else if (node->lf and !node->rg)
+        else if (!node->rg)
             transplant(node, node->lf);
         else {
-            Node *s = min_node(node->rg);
+            Node<T> *s = min_node(node->rg);
             if (s->pr != node) {
                 transplant(s, s->rg);
                 s->rg = node->rg;
@@ -122,12 +130,14 @@
     }
 }

-void BST::delete_node(int value)
+template <class T>
+void BST<T>::delete_node(T value)
 {
     delete_node(root, value);
 }

-void BST::print_nodes(Node *node)
+template <class T>
+void BST<T>::print_nodes(Node<T> *node)
 {
     if (!node)
         return;
@@ -137,7 +147,8 @@
     print_nodes(node->rg);
 }

-void BST::print_nodes(void)
+template <class T>
+void BST<T>::print_nodes(void)
 {
     print_nodes(root);
 }
@@ -147,21 +158,26 @@
     std::cout << "Binary Search Tree!" << std::endl;

     int number_of_test_values = 10;
-    BST tree = BST();
+    BST<int> tree = BST<int>();

     std::cout << "Inserting <" << number_of_test_values;
     std::cout << "> random values...." << std::endl;

     srand(time(NULL));

-
+    int del_value;
     for (int i=0; i < number_of_test_values; i++) {
         int value = rand() % 100;
+        if (i == 5)
+            del_value = value;
         std::cout << "Inserting " << value << std::endl;
         tree.insert_node(value);
     }

     tree.print_nodes();
+    std::cout << "Deleting " << del_value << std::endl;
+    tree.delete_node(del_value);
+    tree.print_nodes();

     return 0;
 }


stats: ensure that stat names are valid

stats: ensure that stat names are valid

--- src/base/statistics.cc
+++ src/base/statistics.cc
@@ -138,9 +138,43 @@
 {
 }

+bool
+validateStatName(const string &name)
+{
+    if (name.empty())
+        return false;
+
+    vector<string> vec;
+    tokenize(vec, name, '.');
+    vector<string>::const_iterator item = vec.begin();
+    while (item != vec.end()) {
+        if (item->empty())
+            return false;
+
+        string::const_iterator c = item->begin();
+
+        // The first character is different
+        if (!isalpha(*c) && *c != '_')
+            return false;
+
+        // The rest of the characters have different rules.
+        while (++c != item->end()) {
+            if (!isalnum(*c) && *c != '_')
+                return false;
+        }
+
+        ++item;
+    }
+
+    return true;
+}
+
 void
 Info::setName(const string &name)
 {
+    if (!validateStatName(name))
+        panic("invalid stat name '%s'", name);
+
     pair<NameMapType::iterator, bool> p =
         nameMap().insert(make_pair(name, this));


pull out calculation of SDF ops parameters

Change-Id: Ifc3909a93ae036fc8f851cf0a8ea9cc65b688b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375064
Commit-Queue: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>
Reviewed-by: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>

--- src/gpu/text/GrTextBlob.cpp
+++ src/gpu/text/GrTextBlob.cpp
@@ -1210,6 +1210,34 @@
             has_some_antialiasing(runFont));
 }

+static std::tuple<GrAtlasTextOp::MaskType, uint32_t, bool> calculate_sdf_parameters(
+        const GrSurfaceDrawContext& rtc,
+        const SkMatrix& drawMatrix,
+        bool useLCDText,
+        bool isAntiAliased) {
+    const GrColorInfo& colorInfo = rtc.colorInfo();
+    const SkSurfaceProps& props = rtc.surfaceProps();
+    bool isBGR = SkPixelGeometryIsBGR(props.pixelGeometry());
+    bool isLCD = useLCDText && SkPixelGeometryIsH(props.pixelGeometry());
+    using MT = GrAtlasTextOp::MaskType;
+    MT maskType = !isAntiAliased ? MT::kAliasedDistanceField
+                                 : isLCD ? (isBGR ? MT::kLCDBGRDistanceField
+                                                  : MT::kLCDDistanceField)
+                                         : MT::kGrayscaleDistanceField;
+
+    bool useGammaCorrectDistanceTable = colorInfo.isLinearlyBlended();
+    uint32_t DFGPFlags = drawMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0;
+    DFGPFlags |= drawMatrix.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0;
+    DFGPFlags |= useGammaCorrectDistanceTable ? kGammaCorrect_DistanceFieldEffectFlag : 0;
+    DFGPFlags |= MT::kAliasedDistanceField == maskType ? kAliased_DistanceFieldEffectFlag : 0;
+
+    if (isLCD) {
+        DFGPFlags |= kUseLCD_DistanceFieldEffectFlag;
+        DFGPFlags |= MT::kLCDBGRDistanceField == maskType ? kBGR_DistanceFieldEffectFlag : 0;
+    }
+    return {maskType, DFGPFlags, useGammaCorrectDistanceTable};
+}
+
 std::tuple<const GrClip*, GrOp::Owner >
 SDFTSubRun::makeAtlasTextOp(const GrClip* clip,
                             const SkMatrixProvider& viewMatrix,
@@ -1225,26 +1253,8 @@
     GrPaint grPaint;
     SkPMColor4f drawingColor = calculate_colors(rtc, drawPaint, viewMatrix, fMaskFormat, &grPaint);

-    const GrColorInfo& colorInfo = rtc->colorInfo();
-    const SkSurfaceProps& props = rtc->surfaceProps();
-    bool isBGR = SkPixelGeometryIsBGR(props.pixelGeometry());
-    bool isLCD = fUseLCDText && SkPixelGeometryIsH(props.pixelGeometry());
-    using MT = GrAtlasTextOp::MaskType;
-    MT maskType = !fAntiAliased ? MT::kAliasedDistanceField
-                                : isLCD ? (isBGR ? MT::kLCDBGRDistanceField
-                                                 : MT::kLCDDistanceField)
-                                        : MT::kGrayscaleDistanceField;
-
-    bool useGammaCorrectDistanceTable = colorInfo.isLinearlyBlended();
-    uint32_t DFGPFlags = drawMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0;
-    DFGPFlags |= drawMatrix.isScaleTranslate() ? kScaleOnly_DistanceFieldEffectFlag : 0;
-    DFGPFlags |= useGammaCorrectDistanceTable ? kGammaCorrect_DistanceFieldEffectFlag : 0;
-    DFGPFlags |= MT::kAliasedDistanceField == maskType ? kAliased_DistanceFieldEffectFlag : 0;
-
-    if (isLCD) {
-        DFGPFlags |= kUseLCD_DistanceFieldEffectFlag;
-        DFGPFlags |= MT::kLCDBGRDistanceField == maskType ? kBGR_DistanceFieldEffectFlag : 0;
-    }
+    auto [maskType, DFGPFlags, useGammaCorrectDistanceTable] =
+        calculate_sdf_parameters(*rtc, drawMatrix, fUseLCDText, fAntiAliased);

     GrRecordingContext* const context = rtc->recordingContext();
     GrAtlasTextOp::Geometry* geometry = GrAtlasTextOp::Geometry::Make(


UDP detector module fix.

UDP detector module fix.

--- prototype2/udp/udp.cpp
+++ prototype2/udp/udp.cpp
@@ -46,7 +46,7 @@
                          EFUSettings.DetectorPort);
   UDPServer raw(local);
   raw.setbuffers(4000000, 4000000);
-  // raw.settimeout(0, 100000);
+  raw.settimeout(0, 100000);
   raw.printbuffers();

   Timer rate_timer;
@@ -56,9 +56,9 @@
   uint32_t dropped = 0;
   uint32_t timeseq = 0;
   uint32_t first_dropped = 0;
-  for (;;) {
+  while (runThreads) {
     char buffer[10000];
-    auto tmprx = raw.receive(buffer, EFUSettings.DetectorRxBufferSize);
+    auto tmprx = raw.receive(buffer, EFUSettings.DetectorRxBufferSize); //Fix this, its blocking
     auto tmpseq = *((uint32_t *)buffer);

     if (seqno == tmpseq) {
@@ -98,6 +98,10 @@

 /** ----------------------------------------------------- */

+void SetCLIArguments(CLI::App __attribute__((unused)) & parser) {}
+
+PopulateCLIParser PopulateParser{SetCLIArguments};
+
 class UDPRawFactory : public DetectorFactory {
 public:
   std::shared_ptr<Detector> create(BaseSettings settings) {


doc: Fixed a qdoc command that was meant to add emphasis

It was creating another list item.

--- src/gui/painting/qcolor.cpp
+++ src/gui/painting/qcolor.cpp
@@ -514,7 +514,7 @@
     \i #RRRRGGGGBBBB
     \i A name from the list of colors defined in the list of \l{SVG color keyword names}
        provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
-       These color names work on all platforms. Note that these color names are \i not the
+       These color names work on all platforms. Note that these color names are \e not the
        same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not
        refer to the same color.
     \i \c transparent - representing the absence of a color.


Fixed minor typo "poins" in documentation page

--- modules/calib3d/include/opencv2/calib3d.hpp
+++ modules/calib3d/include/opencv2/calib3d.hpp
@@ -91,7 +91,7 @@

 The joint rotation-translation matrix \f$[R|t]\f$ is the matrix product of a projective
 transformation and a homogeneous transformation. The 3-by-4 projective transformation maps 3D points
-represented in camera coordinates to 2D poins in the image plane and represented in normalized
+represented in camera coordinates to 2D points in the image plane and represented in normalized
 camera coordinates \f$x' = X_c / Z_c\f$ and \f$y' = Y_c / Z_c\f$:

 \f[Z_c \begin{bmatrix}


TSDBServlet stub

TSDBServlet stub

--- src/cm-chunkserver.cc
+++ src/cm-chunkserver.cc
@@ -43,6 +43,7 @@
 #include "fnord-mdb/MDB.h"
 #include "fnord-mdb/MDBUtil.h"
 #include "fnord-tsdb/TSDBNode.h"
+#include "fnord-tsdb/TSDBServlet.h"
 #include "common.h"
 #include "schemas.h"
 #include "ModelReplication.h"
@@ -247,6 +248,8 @@
   http_router.addRouteByPrefixMatch("/logtable", &logtable_servlet, &tpool);

   tsdb::TSDBNode tsdb_node("xxx", "/tmp/tsdb");
+  tsdb::TSDBServlet tsdb_servlet(&tsdb_node);
+  http_router.addRouteByPrefixMatch("/tsdb", &tsdb_servlet, &tpool);

   ev.run();


announcement of what team is joined when the team is not what we was requested (including automatic).  fulfills sf feature request 874440 too

git-svn-id: 67bf12f30ddf2081c31403e0b02b2123541f1680@5255 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -3758,10 +3758,9 @@
       const char *oldcolor = NULL;
       if (dstTeam == RogueTeam || srcPlayer->getTeam() == NoTeam)
 	oldcolor = ColorStrings[RogueTeam];
-      else if (srcPlayer->getTeam() == ObserverTeam)
-        oldcolor = ColorStrings[CyanColor];
       else
 	oldcolor = ColorStrings[srcPlayer->getTeam()];
+
       addMessage(srcPlayer,"[Sent versioninfo per request]", false, oldcolor);
       break;
     } else if (fromServer) {
@@ -3864,12 +3863,10 @@
 	fullMsg += text;
       }
       const char *oldcolor = NULL;
-      if (!srcPlayer || srcPlayer->getTeam() == NoTeam)
+      if (srcPlayer && srcPlayer->getTeam() != NoTeam)
+	oldcolor = ColorStrings[srcPlayer->getTeam()];
+      else
 	oldcolor = ColorStrings[RogueTeam];
-      else if (srcPlayer->getTeam() == ObserverTeam)
-	oldcolor = ColorStrings[CyanColor];
-      else
-	oldcolor = ColorStrings[srcPlayer->getTeam()];
       addMessage(NULL, fullMsg, false, oldcolor);

       if (!srcPlayer || srcPlayer!=myTank)
@@ -5313,12 +5310,36 @@
       if (id == myTank->getId()) {
 	// it's me!  end of updates

-	// the server may dictate a team different than we asked for
+	// the server sends back the team the player was joined to
 	void *tmpbuf = buf;
 	uint16_t team, type;
 	tmpbuf = nboUnpackUShort(tmpbuf, type);
 	tmpbuf = nboUnpackUShort(tmpbuf, team);
-	myTank->setTeam((TeamColor)team);
+
+	// if server assigns us a different team, display a message
+	std::string teamMsg;
+	if (myTank->getTeam() != AutomaticTeam) {
+	  teamMsg = string_util::format("%s team was unavailable, you were joined to ",
+					Team::getName(myTank->getTeam()));
+	  if ((TeamColor)team == ObserverTeam) {
+	    teamMsg += "as an Observer";
+	  } else {
+	    teamMsg += string_util::format("the %s",
+					   Team::getName((TeamColor)team));
+	  }
+	} else {
+	  if ((TeamColor)team == ObserverTeam) {
+	    teamMsg = "You were joined as an observer";
+	  } else {
+	    teamMsg = string_util::format("You were joined to the %s",
+					  Team::getName((TeamColor)team));
+	  }
+	}
+	if (myTank->getTeam() != (TeamColor)team) {
+	  myTank->setTeam((TeamColor)team);
+	  hud->setAlert(1, teamMsg.c_str(), 8.0f, (TeamColor)team==ObserverTeam?true:false);
+	  addMessage(NULL, teamMsg.c_str(), true);
+	}
 	controlPanel->setControlColor(Team::getRadarColor(myTank->getTeam()));
 	radar->setControlColor(Team::getRadarColor(myTank->getTeam()));
 	roaming = (myTank->getTeam() == ObserverTeam);
@@ -5854,8 +5875,11 @@
       pauseCountdown -= dt;
       if (pauseCountdown <= 0.0f) {

-	/* make sure it is really safe to pause..  make sure the player is
-	 * still on the ground and not in a building
+	/* make sure it is really safe to pause..  since the server
+	 * might make us drop our flag, make sure the player is on the
+	 * ground and not in a building.  prevents getting kicked
+	 * later for being in places we shouldn't without holding the
+	 * right flags.
 	 */
 	if (myTank->getLocation() == LocalPlayer::InBuilding) {
 	  // custom message when trying to pause while in a building


cleaning up

cleaning up

--- src/cm-jqcolumnize.cc
+++ src/cm-jqcolumnize.cc
@@ -275,11 +275,8 @@
   //cstable::BitPackedIntColumnWriter jqi_position_col(2, 2, 64);
   //cstable::BooleanColumnWriter jqi_clicked_col(2, 2);

-  //uint64_t r = 0;
-  //uint64_t n = 0;

   auto add_session = [&] (const cm::JoinedSession& sess) {
-    msg::MessageBuilder msg;
     msg::MessageObject obj;

     for (const auto& q : sess.queries) {
@@ -377,7 +374,7 @@
       }
     }

-    table.addRecord(msg);
+    table.addRecord(obj);
   };

   /* read input tables */


Fix call

Fix call

--- src/ir/builders/CallIRBuilder.cpp
+++ src/ir/builders/CallIRBuilder.cpp
@@ -42,14 +42,50 @@

 void CallIRBuilder::reg(AnalysisProcessor &ap, Inst &inst) const {
-  std::cout << "TODO" << std::endl;
-  //OneOperandTemplate::stop(this->disas);
+  SymbolicElement   *se;
+  std::stringstream expr1, expr2;
+  uint64_t          reg       = std::get<1>(this->operands[0]);
+  uint32_t          regSize   = std::get<2>(this->operands[0]);
+  uint64_t          memDst    = std::get<1>(this->operands[1]); // The dst memory write
+  uint32_t          writeSize = std::get<2>(this->operands[1]);
+  uint64_t          symReg    = ap.getRegSymbolicID(reg);
+
+  /* Create the SMT semantic side effect */
+  inst.addElement(alignStack(ap, writeSize));
+
+  /* Create the SMT semantic */
+  /* *RSP =  Next_RIP */
+  expr1 << smt2lib::bv(this->nextAddress, writeSize * REG_SIZE);
+
+  /* Create the symbolic element */
+  se = ap.createMemSE(expr1, memDst, "Saved RIP");
+
+  /* Apply the taint */
+  ap.assignmentSpreadTaintMemImm(se, memDst, writeSize);
+
+  /* Add the symbolic element to the current inst */
+  inst.addElement(se);
+
+  /* Create the SMT semantic */
+  /* RIP = imm */
+  if (symReg != UNSET)
+    expr2 << "#" << std::dec << symReg;
+  else
+    expr2 << smt2lib::bv(ap.getRegisterValue(reg), regSize * REG_SIZE);
+
+  /* Create the symbolic element */
+  se = ap.createRegSE(expr2, ID_RIP, "RIP");
+
+  /* Apply the taint */
+  ap.assignmentSpreadTaintRegImm(se, ID_RIP);
+
+  /* Add the symbolic element to the current inst */
+  inst.addElement(se);
 }

 void CallIRBuilder::imm(AnalysisProcessor &ap, Inst &inst) const {
-  std::cout << "TODO" << std::endl;
-  //OneOperandTemplate::stop(this->disas);
+  OneOperandTemplate::stop(this->disas);
 }

@@ -76,7 +112,7 @@
   /* Add the symbolic element to the current inst */
   inst.addElement(se);

-// TODO: How really works XED_CALL ??
+// TODO: How really works XED_CALL ?? Where is the immediate operand ?
 //
 //  /* Create the SMT semantic */
 //  /* RIP = imm */


remove strange code artifact which tokenized input string and printed it to cout

git-svn-id: 67bf12f30ddf2081c31403e0b02b2123541f1680@4034 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -530,11 +530,6 @@

   if (sendIt) {
     std::string message = hud->getComposeString();
-    std::vector<std::string> v = string_util::tokenize(message," \t");
-    for (std::vector<std::string>::iterator it = v.begin(); it != v.end(); ++it) {
-	    std::string s = *it;
-	    cout << s << std::endl;
-    }

     if (message.length() > 0) {
       const char* silence = message.c_str();


HMI: fix recorder bug

HMI: fix recorder bug


KnobGui: fix spacing/alignment on a few Knob types

--- Gui/KnobGuiTypes.cpp
+++ Gui/KnobGuiTypes.cpp
@@ -107,9 +107,10 @@
         boxContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
         boxContainer->setLayout(boxContainerLayout);
         boxContainerLayout->setContentsMargins(0, 0, 0, 0);
+        boxContainerLayout->setSpacing(1);
         QLabel *subDesc = 0;
         if (dim != 1) {
-            subDesc = new QLabel(getKnob()->getDimensionName(i).c_str(), boxContainer);
+            subDesc = new QLabel(QString(getKnob()->getDimensionName(i).c_str())+':', boxContainer);
             boxContainerLayout->addWidget(subDesc);
         }
         SpinBox *box = new SpinBox(layout->parentWidget(), SpinBox::INT_SPINBOX);
@@ -385,9 +386,10 @@
         boxContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
         boxContainer->setLayout(boxContainerLayout);
         boxContainerLayout->setContentsMargins(0, 0, 0, 0);
+        boxContainerLayout->setSpacing(1);
         QLabel *subDesc = 0;
         if (dim != 1) {
-            subDesc = new QLabel(getKnob()->getDimensionName(i).c_str(), boxContainer);
+            subDesc = new QLabel(QString(getKnob()->getDimensionName(i).c_str())+':', boxContainer);
             boxContainerLayout->addWidget(subDesc);
         }
         SpinBox *box = new SpinBox(layout->parentWidget(), SpinBox::DOUBLE_SPINBOX);
@@ -986,7 +988,7 @@
     boxLayout = new QHBoxLayout(boxContainers);
     boxContainers->setLayout(boxLayout);
     boxLayout->setContentsMargins(0, 0, 0, 0);
-    boxLayout->setSpacing(0);
+    boxLayout->setSpacing(1);

     _rBox = new SpinBox(boxContainers, SpinBox::DOUBLE_SPINBOX);
@@ -1420,7 +1422,7 @@
         if(hasToolTip()) {
             _textEdit->setToolTip(toolTip());
         }
-        layout->addWidget(_textEdit, row, 1, Qt::AlignLeft);
+        layout->addWidget(_textEdit, row, 1);
         QObject::connect(_textEdit, SIGNAL(textChanged()), this, SLOT(onTextChanged()));
         if(strKnob->isCustomKnob()) {
             _textEdit->setReadOnly(true);


* compile fix and temp disabled the GetWorldState as theres no hellfire pvp script been created yet so would make this impossible to get the tokens

--- src/arcemu-world/HonorHandler.cpp
+++ src/arcemu-world/HonorHandler.cpp
@@ -248,12 +248,13 @@
 				if(pAffectedPlayer->GetZoneId() == 3483)
 				{
 					// Hellfire Horde Controlled Towers
-					if(pAffectedPlayer->GetMapMgr()->GetWorldState(2478) != 3 && pAffectedPlayer->GetTeam() == 1)
+					// Commented out until someone works on the hellfire world pvp :)
+					/*if(pAffectedPlayer->GetMapMgr()->GetWorldState(2478) != 3 && pAffectedPlayer->GetTeam() == 1)
 						return;

 					// Hellfire Alliance Controlled Towers
 					if(pAffectedPlayer->GetMapMgr()->GetWorldState(2476) != 3 && pAffectedPlayer->GetTeam() == 0)
-						return;
+						return;*/

 					// Add Mark of Thrallmar/Honor Hold
 					SpellEntry * pvp_token_spell = dbcSpell.LookupEntry(pAffectedPlayer->GetTeam()? 32158 : 32155);


* moved the speed/rotation clamps so that they clamp all methods   (this also fixes a (forcedSpeed < -0.5f) bug)

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -484,11 +484,6 @@
   if (enabled) {
     forcedSpeed  = speed;
     forcedAngVel = angVel;
-    // clamps
-    if (forcedSpeed  < -1.0f) { forcedSpeed  = -1.0f; }
-    if (forcedSpeed  > +1.0f) { forcedSpeed  = +1.0f; }
-    if (forcedAngVel < -1.0f) { forcedAngVel = -1.0f; }
-    if (forcedAngVel > +1.0f) { forcedAngVel = +1.0f; }
   }
 }

@@ -883,12 +878,11 @@

 static void doMotion()
 {
-  float rotation = 0.0f, speed = 0.0f;
-  int noMotionSize = hud->getNoMotionSize();
-  int maxMotionSize = hud->getMaxMotionSize();
-
+  float speed = 0.0f;
+  float rotation = 0.0f;
+
+  int keyboardSpeed    = myTank->getSpeed();
   int keyboardRotation = myTank->getRotation();
-  int keyboardSpeed    = myTank->getSpeed();

   // mouse is default steering method; query mouse pos always, not doing so
   // can lead to stuttering movement with X and software rendering (uncertain why)
@@ -918,7 +912,7 @@
 #endif

   if (forcedControls) {
-    speed = forcedSpeed;
+    speed    = forcedSpeed;
     rotation = forcedAngVel;
   }
   else if (myTank->isAutoPilot()) {
@@ -932,6 +926,8 @@
     }
   }
   else { // both mouse and joystick
+    int noMotionSize  = hud->getNoMotionSize();
+    int maxMotionSize = hud->getMaxMotionSize();

     if (myTank->getInputMethod() == LocalPlayer::Joystick) {
       noMotionSize = 0; // joystick deadzone is specified at platform level
@@ -943,12 +939,8 @@
       rotation = float(keyboardRotation);
     } else if (mx < -noMotionSize) {
       rotation = float(-mx - noMotionSize) / float(maxMotionSize - noMotionSize);
-      if (rotation > 1.0f)
-	rotation = 1.0f;
     } else if (mx > noMotionSize) {
       rotation = -float(mx - noMotionSize) / float(maxMotionSize - noMotionSize);
-      if (rotation < -1.0f)
-	rotation = -1.0f;
     }

     // calculate desired speed
@@ -959,15 +951,24 @@
       }
     } else if (my < -noMotionSize) {
       speed = float(-my - noMotionSize) / float(maxMotionSize - noMotionSize);
-      if (speed > 1.0f)
-	speed = 1.0f;
     } else if (my > noMotionSize) {
       speed = -float(my - noMotionSize) / float(maxMotionSize - noMotionSize);
-      if (speed < -0.5f)
-	speed = -0.5f;
     } else {
       speed = 0.0f;
     }
+  }
+
+  // speed clamp
+  if (speed < -0.5f) {
+    speed = -0.5f;
+  } else if (speed > +1.0f) {
+    speed = +1.0f;
+  }
+  // rotation clamp
+  if (rotation < -1.0f) {
+    rotation = -1.0f;
+  } else if (rotation > +1.0f) {
+    rotation = +1.0f;
   }

   // slow motion modifier
@@ -988,8 +989,8 @@
     speed = -speed;
   }

+  myTank->setDesiredSpeed(speed);
   myTank->setDesiredAngVel(rotation);
-  myTank->setDesiredSpeed(speed);
 }


Check for empty asset name when creating the asset

So that undoing a deletion wouldn't trigger error if asset name is
empty.

Also delete the asset if the asset name is empty, so that it's the same
behavior as an invalid asset name.

--- AssetNode.C
+++ AssetNode.C
@@ -1844,16 +1844,7 @@

         // Create the Asset object as early as possible. We may need it before
         // the first compute. For example, Maya may call internalArrayCount.
-
-        // When the AssetNode is first created, setInternalValueInContext()
-        // will be called with default values. But we don't want to try to
-        // create the Asset at that time, since it'll result in errors that's
-        // not caused by the user. So make sure the asset name is at least set
-        // to avoid getting false errors.
-        if(myAssetName.length())
-        {
-            rebuildAsset();
-        }
+        rebuildAsset();

         return true;
     }
@@ -1932,6 +1923,11 @@
         return;
     }

+    // Make sure the asset name is set before trying to create the asset.
+    if(!myAssetName.length())
+    {
+        return;
+    }

     myAsset = new Asset(myOTLFilePath, myAssetName, thisMObject());


probably fixed build problems on Android

--- modules/imgproc/src/connectedcomponents.cpp
+++ modules/imgproc/src/connectedcomponents.cpp
@@ -378,32 +378,32 @@

 }

-int cv::connectedComponents(InputArray _I, OutputArray _L, int connectivity, int ltype){
-    const cv::Mat I = _I.getMat();
-    _L.create(I.size(), ltype);
-    cv::Mat L = _L.getMat();
+int cv::connectedComponents(InputArray _img, OutputArray _labels, int connectivity, int ltype){
+    const cv::Mat img = _img.getMat();
+    _labels.create(img.size(), CV_MAT_DEPTH(ltype));
+    cv::Mat labels = _labels.getMat();
     connectedcomponents::NoOp sop;
     if(ltype == CV_16U){
-        return connectedComponents_sub1(I, L, connectivity, sop);
+        return connectedComponents_sub1(img, labels, connectivity, sop);
     }else if(ltype == CV_32S){
-        return connectedComponents_sub1(I, L, connectivity, sop);
+        return connectedComponents_sub1(img, labels, connectivity, sop);
     }else{
         CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
         return 0;
     }
 }

-int cv::connectedComponentsWithStats(InputArray _I, OutputArray _L, OutputArray statsv,
+int cv::connectedComponentsWithStats(InputArray _img, OutputArray _labels, OutputArray statsv,
                                      OutputArray centroids, int connectivity, int ltype)
 {
-    const cv::Mat I = _I.getMat();
-    _L.create(I.size(), ltype);
-    cv::Mat L = _L.getMat();
+    const cv::Mat img = _img.getMat();
+    _labels.create(img.size(), CV_MAT_DEPTH(ltype));
+    cv::Mat labels = _labels.getMat();
     connectedcomponents::CCStatsOp sop(statsv, centroids);
     if(ltype == CV_16U){
-        return connectedComponents_sub1(I, L, connectivity, sop);
+        return connectedComponents_sub1(img, labels, connectivity, sop);
     }else if(ltype == CV_32S){
-        return connectedComponents_sub1(I, L, connectivity, sop);
+        return connectedComponents_sub1(img, labels, connectivity, sop);
     }else{
         CV_Error(CV_StsUnsupportedFormat, "the type of labels must be 16u or 32s");
         return 0;


Removed `std::getchar()` in case of failing to open file.

All tests pass.

	modified:   code/ylikuutio/ontology/texture_loader.cpp

--- code/ylikuutio/ontology/texture_loader.cpp
+++ code/ylikuutio/ontology/texture_loader.cpp
@@ -174,7 +174,6 @@
         if (fp == nullptr)
         {
             std::printf("%s could not be opened. Are you in the right directory ? Don't forget to read the FAQ !\n", imagepath);
-            std::getchar();
             return 0;
         }


INTEGRATION: CWS warnings01 (1.19.32); FILE MERGED 2005/11/16 15:20:30 pl 1.19.32.2: #i55991# removed warnings 2005/10/28 14:48:38 cd 1.19.32.1: #i55991# Warning free code changes for gcc

--- framework/source/services/backingcomp.cxx
+++ framework/source/services/backingcomp.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: backingcomp.cxx,v $
  *
- *  $Revision: 1.19 $
+ *  $Revision: 1.20 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-09 01:40:37 $
+ *  last change: $Author: hr $ $Date: 2006-06-19 11:25:48 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -613,7 +613,7 @@
     // create a listener for automatic updates of the window background color
     // It hold itself alive and listen for window disposing() so it can die automaticly
     // if we release our component window.
-    ColorListener* pColorListener = new ColorListener(m_xWindow);
+    new ColorListener(m_xWindow);

     // sett he right title at the title bar of the parent window
     css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
@@ -668,7 +668,7 @@
     return  <FALSE/> everytime.
  */

-sal_Bool SAL_CALL BackingComp::attachModel( /*IN*/ const css::uno::Reference< css::frame::XModel >& xModel )
+sal_Bool SAL_CALL BackingComp::attachModel( /*IN*/ const css::uno::Reference< css::frame::XModel >& )
     throw (css::uno::RuntimeException)
 {
     return sal_False;
@@ -711,7 +711,7 @@
                 not used.
  */

-void SAL_CALL BackingComp::restoreViewData( /*IN*/ const css::uno::Any& aData )
+void SAL_CALL BackingComp::restoreViewData( /*IN*/ const css::uno::Any& )
     throw (css::uno::RuntimeException)
 {
 }
@@ -750,7 +750,7 @@
     @return TRUE if the request could be finished successfully; FALSE otherwise.
  */

-sal_Bool SAL_CALL BackingComp::suspend( /*IN*/ sal_Bool bSuspend )
+sal_Bool SAL_CALL BackingComp::suspend( /*IN*/ sal_Bool )
     throw (css::uno::RuntimeException)
 {
     /* FIXME ... implemented by using default :-( */
@@ -875,7 +875,7 @@
                 We must inform it about this unsupported feature.
  */

-void SAL_CALL BackingComp::addEventListener( /*IN*/ const css::uno::Reference< css::lang::XEventListener >& xListener )
+void SAL_CALL BackingComp::addEventListener( /*IN*/ const css::uno::Reference< css::lang::XEventListener >& )
     throw(css::uno::RuntimeException)
 {
     throw css::uno::RuntimeException(
@@ -893,7 +893,7 @@
                 not used.
  */

-void SAL_CALL BackingComp::removeEventListener( /*IN*/ const css::uno::Reference< css::lang::XEventListener >& xListener )
+void SAL_CALL BackingComp::removeEventListener( /*IN*/ const css::uno::Reference< css::lang::XEventListener >& )
     throw(css::uno::RuntimeException)
 {
 }
@@ -1000,7 +1000,7 @@
 /**
  */

-void SAL_CALL BackingComp::keyReleased( /*IN*/ const css::awt::KeyEvent& aEvent )
+void SAL_CALL BackingComp::keyReleased( /*IN*/ const css::awt::KeyEvent& )
     throw(css::uno::RuntimeException)
 {
     /* Attention


Remove library name fetching for unknown and error frames (#599)

--- src/flightRecorder.cpp
+++ src/flightRecorder.cpp
@@ -130,8 +130,7 @@
     Dictionary _symbols;

   private:
-    void fillNativeMethodInfo(MethodInfo* mi, const char* name) {
-        const char* lib_name = name == NULL ? NULL : Profiler::instance()->getLibraryName(name);
+    void fillNativeMethodInfo(MethodInfo* mi, const char* name, const char* lib_name) {
         if (lib_name == NULL) {
             mi->_class = _classes->lookup("");
         } else if (lib_name[0] == '[' && lib_name[1] != 0) {
@@ -223,9 +222,13 @@
         if (!mi->_mark) {
             mi->_mark = true;
             if (method == NULL) {
-                fillNativeMethodInfo(mi, "unknown");
-            } else if (frame.bci == BCI_NATIVE_FRAME || frame.bci == BCI_ERROR) {
-                fillNativeMethodInfo(mi, (const char*)method);
+                fillNativeMethodInfo(mi, "unknown", NULL);
+            } else if (frame.bci == BCI_ERROR) {
+                fillNativeMethodInfo(mi, (const char*)method, NULL);
+            } else if (frame.bci == BCI_NATIVE_FRAME) {
+                const char* name = (const char*)method;
+                const char* lib_name = name == NULL ? NULL : Profiler::instance()->getLibraryName(name);
+                fillNativeMethodInfo(mi, name, lib_name);
             } else {
                 fillJavaMethodInfo(mi, method, first_time);
             }


added vote, poll, and veto options

added vote, poll, and veto options

git-svn-id: 67bf12f30ddf2081c31403e0b02b2123541f1680@3261 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -902,6 +902,9 @@
       Setpass,
       Grouplist,
       Groupperms,
+      Vote,
+      Poll,
+      Veto,
       Password, // leave this as the last item
     };

@@ -1036,8 +1039,9 @@
     case Setpass: hud->setComposing("Set your password [enter pass]:", true); break;
     case Grouplist :  hud->setComposing("List Groups", false); break;
     case Groupperms :  hud->setComposing("List Permissions", false); break;
-
-
+    case Vote : hud->setComposing("Vote", false); break;
+    case Poll : hud->setComposing("Call a Poll", false); break;
+    case Veto : hud->setComposing("Cancel a Poll", false); break;

     default: /* shouldn't happen */ break;
     }
@@ -1195,7 +1199,9 @@
 	case Setpass: sendMsg = "/setpass "+ message; break;
 	case Grouplist: sendMsg = "/grouplist"; break;
 	case Groupperms: sendMsg = "/groupperms"; break;
-
+        case Vote: sendMsg = "/vote "+ message; break;
+        case Poll: sendMsg = "/poll "+ message; break;
+        case Veto: sendMsg = "/veto "+ message; break;
 	default: /* shouldn't happen */ break;
       }


Supplementary test for the AMTI BSF format.

--- modules/io/test/c++/trial/bsfreaderTest.cpp
+++ modules/io/test/c++/trial/bsfreaderTest.cpp
@@ -3,6 +3,7 @@
 #include <openma/io.h>
 #include <openma/base/node.h>
 #include <openma/base/timesequence.h>
+#include <openma/instrument/forceplate.h>

 #include "test_file_path.h"

@@ -145,6 +146,91 @@
     data = analogs[5]->data();
     TS_ASSERT_DELTA(data[0], -0.032, 5e-4);
     TS_ASSERT_DELTA(data[399], -0.446, 5e-4);
+    auto forplates = root.findChildren<ma::instrument::ForcePlate*>();
+    TS_ASSERT_EQUALS(forplates.size(), 1u);
+    TS_ASSERT_EQUALS(forplates[0]->channels()->children().size(), 6u);
+    TS_ASSERT_EQUALS(forplates[0]->type(), 2);
+    const double fpDims[3] = {0.49784, 0.49784, 0.0}; // Dimensions in meters
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[0], fpDims[0]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[1], -fpDims[1]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[2], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[3], -fpDims[0]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[4], -fpDims[1]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[5], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[6], -fpDims[0]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[7], fpDims[1]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[8], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[9], fpDims[0]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[10], fpDims[1]/2., 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->surfaceCorners()[11], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->relativeSurfaceOrigin()[0], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->relativeSurfaceOrigin()[1], 0.0f, 1e-5);
+    TS_ASSERT_DELTA(forplates[0]->relativeSurfaceOrigin()[2], -fpDims[2]/2., 1e-5);
+  };
+
+  CXXTEST_TEST(fileTrial03361)
+  {
+    ma::io::File file;
+    file.open(OPENMA_TDD_PATH_IN("bsf/Trial03361.bsf"), ma::io::Mode::In);
+    ma::io::HandlerReader reader(&file, "amti.bsf");
+    ma::Node root("root");
+    TS_ASSERT_EQUALS(reader.read(&root), true);
+    TS_ASSERT_EQUALS(root.children().size(), 1u);
+    auto analogs = root.findChildren<ma::TimeSequence*>();
+    TS_ASSERT_EQUALS(analogs.size(), 6u);
+    for (auto analog : analogs)
+    {
+      TS_ASSERT_EQUALS(analog->startTime(), 0.0);
+      TS_ASSERT_EQUALS(analog->sampleRate(), 200.0);
+      TS_ASSERT_EQUALS(analog->components(), 1u);
+      TS_ASSERT_EQUALS(analog->samples(), 400u);
+    }
+    TS_ASSERT_EQUALS(analogs[0]->name(), "Fx");
+    TS_ASSERT_EQUALS(analogs[0]->unit(), "N");
+    TS_ASSERT_EQUALS(analogs[1]->name(), "Fy");
+    TS_ASSERT_EQUALS(analogs[1]->unit(), "N");
+    TS_ASSERT_EQUALS(analogs[2]->name(), "Fz");
+    TS_ASSERT_EQUALS(analogs[2]->unit(), "N");
+    TS_ASSERT_EQUALS(analogs[3]->name(), "Mx");
+    TS_ASSERT_EQUALS(analogs[3]->unit(), "Nm");
+    TS_ASSERT_EQUALS(analogs[4]->name(), "My");
+    TS_ASSERT_EQUALS(analogs[4]->unit(), "Nm");
+    TS_ASSERT_EQUALS(analogs[5]->name(), "Mz");
+    TS_ASSERT_EQUALS(analogs[5]->unit(), "Nm");
+    double* data = 0;
+    data = analogs[0]->data();
+    TS_ASSERT_DELTA(data[0], 0.9818, 5e-4);
+    TS_ASSERT_DELTA(data[1], 1.35, 5e-4);
+    TS_ASSERT_DELTA(data[2], 0.3682, 5e-4);
+    TS_ASSERT_DELTA(data[399], 0.1227, 5e-4);
+    data = analogs[1]->data();
+    TS_ASSERT_DELTA(data[0],0.3907, 5e-4);
+    data = analogs[2]->data();
+    TS_ASSERT_DELTA(data[0], -0.5397, 5e-4);
+    data = analogs[3]->data();
+    TS_ASSERT_DELTA(data[0], 0.0, 5e-4);
+    data = analogs[4]->data();
+    TS_ASSERT_DELTA(data[0], 0.0, 5e-4);
+    data = analogs[5]->data();
+    TS_ASSERT_DELTA(data[0], 0.0319, 5e-4);
+    TS_ASSERT_DELTA(data[399], -0.0319, 5e-4);
+    auto forplates = root.findChildren<ma::instrument::ForcePlate*>();
+    TS_ASSERT_EQUALS(forplates.size(), 1u);
+    TS_ASSERT_EQUALS(forplates[0]->channels()->children().size(), 6u);
+    TS_ASSERT_EQUALS(forplates[0]->type(), 2);
+    auto wrench = forplates[0]->wrench(ma::instrument::Location::PointOfApplication, true, 0.0);
+    double fref[1200] = {
+      0.981825677735640, 1.35001030688651, 0.368184629150865, 0.490912838867820, -0.490912838867820, 0., 0., 0.245456419433910, -1.10455388745260, 0.245456419433910, -0.245456419433910, 1.10455388745260, 0.613641048584775, -0.368184629150865, -0.122728209716955, 0., 0.490912838867820, 0., -1.10455388745260, -7.97733363160208, -15.8319390534872, -26.6320215085792, -22.3365341684858, -10.3091696162242, 4.66367196924429, 19.6365135547128, 29.0865857029183, 35.1002679790491, 35.1002679790491, 34.1184423013135, 33.8729858818796, 34.2411705110305, 35.7139090276339, 35.8366372373509, 35.5911808179170, 37.6775603831052, 39.5184835288595, 41.1139502551799, 40.8684938357460, 40.8684938357460, 39.7639399482934, 38.2912014316900, 37.0639193345204, 35.4684526082000, 35.7139090276339, 32.4002473652761, 32.0320627361253, 30.4365960098049, 29.5774985417862, 29.9456831709370, 29.3320421223523, 28.2274882348997, 29.3320421223523, 30.0684113806540, 31.5411498972574, 33.3820730430118, 34.2411705110305, 36.5730064956526, 37.0639193345204, 39.5184835288595, 40.5003092065952, 42.5866887717834, 44.6730683369716, 44.6730683369716, 46.2685350632921, 47.8640017896125, 48.1094582090464, 49.5821967256498, 50.8094788228194, 51.6685762908381, 52.2822173394229, 53.0185865977246, 54.2458686948941, 54.4913251143280, 56.2095200503654, 56.9458893086671, 57.1913457281011, 56.7004328892332, 57.5595303572519, 57.6822585669689, 57.0686175183841, 56.0867918406485, 55.4731507920637, 54.7367815337620, 52.7731301782907, 52.6504019685737, 51.4231198714042, 49.2140120964990, 48.4776428381972, 47.2503607410277, 44.4276119175377, 45.0412529661225, 43.8139708689530, 41.7275913037647, 39.8866681580104, 38.6593860608408, 37.0639193345204, 36.4502782859356, 34.1184423013135, 31.4184216875405, 30.8047806389557, 31.4184216875405, 28.4729446543336, 28.7184010737675, 27.7365753960318, 26.2638368794284, 25.8956522502775, 24.7910983628249, 22.9501752170706, 21.9683495393350, 22.9501752170706, 21.8456213296180, 20.2501546032976, 20.0046981838637, 18.0410468283924, 18.1637750381093, 17.3046775700907, 15.9546672632042, 14.2364723271668, 13.1319184397142, 12.0273645522616, 11.0455388745260, 8.95915930933772, 7.60914900245121, 5.76822585669689, 5.03185659839516, 2.45456419433910, 1.22728209716955, 0., -2.08637956518824, -3.80457450122561, -6.75005153443253, -7.48642079273426, -9.08188751905467, -10.8000824550920, -13.6228312785820, -15.4637544243363, -16.8137647312228, -19.0228725061280, -20.7410674421654, -22.8274470073536, -24.5456419433910, -26.6320215085792, -29.2093139126353, -30.6820524292388, -32.7684319944270, -35.3457243984831, -37.6775603831052, -39.7639399482934, -42.2185041426325, -42.9548734009343, -47.0049043215938, -49.0912838867820, -51.4231198714042, -53.3867712268754, -57.0686175183841, -59.6459099224402, -60.6277356001758, -63.6959408430997, -65.4141357791370, -69.2187102803626, -70.2005359580983, -72.1641873135696, -74.7414797176256, -76.8278592828139, -77.4415003313986, -77.5642285411156, -78.6687824285682, -80.1415209451717, -79.6506081063038, -79.8960645257377, -81.7369876714921, -79.1596952674360, -79.2824234771530, -77.9324131702665, -78.3005977994173, -76.9505874925308, -77.3187721216817, -74.7414797176256, -74.1278386690408, -71.9187308941357, -69.8323513289474, -69.3414384900796, -67.2550589248914, -66.8868742957405, -64.6777665208353, -63.0822997945149, -62.4686587459301, -59.6459099224402, -59.0322688738554, -56.9458893086671, -55.2276943726298, -54.3685969046111, -51.4231198714042, -49.3367403062159, -46.6367196924429, -41.9730477231986, -35.9593654470678, -30.0684113806540, -25.1592829919758, -19.7592417644298, -15.2182980049024, -10.9228106648090, -8.83643109962076, -5.40004122754602, -1.35001030688651, 0.981825677735640, 3.19093345264083, 4.78640017896125, 7.11823616358339, 6.01368227613080, 4.66367196924429, 2.20910777490519, 0.122728209716955, -0.368184629150865, -1.22728209716955, -0.368184629150865, 0.122728209716955, 0.859097468018685, 0., -0.122728209716955, 0.122728209716955, 0.368184629150865, -0.122728209716955, -0.736369258301730, -0.122728209716955, -0.122728209716955, -0.981825677735640, 0.613641048584775, -0.613641048584775, -0.981825677735640, -0.122728209716955, -0.736369258301730, -0.368184629150865, -0.245456419433910, -0.245456419433910, 1.22728209716955, -0.736369258301730, -0.490912838867820, 0., 0., 0., -0.122728209716955, 0.368184629150865, 0., 0.736369258301730, 0.613641048584775, 0., -0.122728209716955, 0.613641048584775, 0., -0.613641048584775, 0.122728209716955, 0., 0., 0.736369258301730, 0., -0.122728209716955, 0., 0., 0., -0.368184629150865, 0.245456419433910, 0., 0.122728209716955, 0.245456419433910, 0.245456419433910, 0.368184629150865, -0.122728209716955, 0.368184629150865, 0.245456419433910, 0., 0.245456419433910, 1.47273851660346, -0.490912838867820, 0.245456419433910, -0.490912838867820, -0.245456419433910, -0.490912838867820, -0.490912838867820, -0.368184629150865, 0.368184629150865, -0.245456419433910, 0.490912838867820, 0.122728209716955, 1.10455388745260, 0.613641048584775, -0.368184629150865, -0.368184629150865, -0.613641048584775, -0.245456419433910, -1.22728209716955, -0.613641048584775, -0.490912838867820, -0.859097468018685, -0.859097468018685, -0.122728209716955, 0.490912838867820, 0.368184629150865, -0.368184629150865, 0.368184629150865, 0., -0.245456419433910, -0.736369258301730, 0.122728209716955, -0.245456419433910, -0.245456419433910, -0.981825677735640, 0.245456419433910, 0.368184629150865, 0.122728209716955, -0.368184629150865, -0.490912838867820, -0.245456419433910, 0.613641048584775, 0.736369258301730, -0.122728209716955, -0.490912838867820, -0.122728209716955, 0.736369258301730, 0.245456419433910, -0.859097468018685, 0., 0.859097468018685, 0.490912838867820, 0.736369258301730, -0.245456419433910, 0.859097468018685, -0.490912838867820, 0.613641048584775, 0.736369258301730, -0.368184629150865, 0.613641048584775, 0., 0.736369258301730, 0.490912838867820, -0.736369258301730, 0.736369258301730, -0.859097468018685, 0., -0.490912838867820, -0.122728209716955, 0.368184629150865, 0.736369258301730, -0.490912838867820, -0.245456419433910, 0.245456419433910, -0.859097468018685, -0.613641048584775, 0.368184629150865, 0., -1.22728209716955, 0.245456419433910, -0.122728209716955, 0., -0.490912838867820, 0.368184629150865, 0.368184629150865, 0., 0.490912838867820, 0.368184629150865, 0.368184629150865, 0., 0.613641048584775, 0.859097468018685, 0., 0.368184629150865, 0.490912838867820, -0.981825677735640, -0.245456419433910, 0., 1.47273851660346, -0.490912838867820, 0.245456419433910, 0.122728209716955, -0.245456419433910, 0.613641048584775, 0.981825677735640, 0.981825677735640, 0.981825677735640, 0.245456419433910, 0.368184629150865, -0.859097468018685, -0.122728209716955, 0.981825677735640, 0.981825677735640, 0.122728209716955, 0.613641048584775, 1.22728209716955, 0.245456419433910, -0.122728209716955, 0., 1.47273851660346, 0., 0.368184629150865, 0.613641048584775, 0.245456419433910, 0.859097468018685, -0.368184629150865, 0.122728209716955,
+      -0.390694419044956, 0.520925892059941, -0.781388838089912, 0.260462946029971, -0.260462946029971, 0.781388838089912, 0.651157365074927, 0.781388838089912, 0.260462946029971, -0.130231473014985, 0.911620311104898, 0., 1.04185178411988, -0.130231473014985, 0.260462946029971, -0.781388838089912, -0.260462946029971, -0.130231473014985, -1.43254620316484, -3.12555535235965, -7.16273101582420, -13.9347676126034, -20.9672671554126, -26.0462946029971, -25.6556001839521, -20.9672671554126, -16.0184711808432, -11.9812955173787, -7.16273101582420, 0., 0.651157365074927, 3.12555535235965, 4.81856450155446, 9.76736047612390, 12.3719899364236, 16.7998600189331, 21.3579615744576, 24.8742113458622, 26.9579149141020, 28.5206925902818, 28.6509240632968, 29.3020814283717, 29.6927758474167, 29.0416184823417, 27.4788408061619, 26.6974519680720, 25.7858316569671, 25.6556001839521, 25.2649057649072, 24.4835169268173, 22.5300448315925, 23.3114336696824, 23.7021280887273, 23.4416651426974, 25.3951372379221, 25.2649057649072, 27.7393037521919, 28.5206925902818, 30.4741646855066, 31.7764794156564, 33.2090256188213, 36.2043494981659, 36.3345809711809, 37.5066642283158, 38.4182845394207, 39.1996733775106, 39.8508307425855, 39.8508307425855, 41.5438398917803, 42.5856916759002, 44.4089322981100, 43.2368490409751, 45.0600896631849, 44.6693952441400, 47.2740247044397, 46.8833302853947, 47.6647191234846, 48.3158764885596, 48.4461079615746, 48.9670338536345, 48.4461079615746, 48.1856450155446, 48.4461079615746, 47.4042561774547, 46.2321729203198, 45.0600896631849, 44.6693952441400, 43.3670805139901, 42.0647657838403, 41.2833769457504, 41.2833769457504, 40.2415251616305, 38.5485160124357, 38.5485160124357, 39.3299048505256, 38.8089789584656, 38.0275901203757, 37.3764327553008, 36.0741180251509, 35.2927291870610, 35.4229606600760, 35.0322662410311, 33.9904144569112, 33.0787941458063, 32.6880997267613, 32.8183311997763, 32.0369423616864, 32.0369423616864, 30.7346276315365, 29.8230073204316, 29.0416184823417, 29.0416184823417, 28.9113870093268, 27.4788408061619, 27.6090722791769, 27.3486093331469, 27.0881463871170, 25.7858316569671, 26.5672204950570, 26.9579149141020, 27.3486093331469, 28.6509240632968, 27.9997666982219, 29.3020814283717, 29.9532387934466, 29.5625443744017, 31.1253220505815, 30.6043961585216, 32.1671738347014, 34.2508774029412, 33.9904144569112, 33.7299515108812, 35.4229606600760, 36.2043494981659, 36.8555068632409, 37.6368957013308, 37.8973586473607, 38.9392104314806, 38.6787474854507, 39.1996733775106, 39.4601363235406, 39.9810622156005, 39.8508307425855, 41.0229139997204, 41.5438398917803, 40.7624510536904, 42.0647657838403, 41.5438398917803, 40.8926825267054, 41.8043028378103, 42.5856916759002, 42.7159231489152, 42.4554602028852, 43.4973119870051, 43.1066175679602, 44.5391637711250, 42.8461546219302, 43.7577749330351, 41.6740713647953, 41.6740713647953, 40.6322195806754, 40.7624510536904, 40.5019881076604, 38.5485160124357, 38.8089789584656, 36.2043494981659, 34.5113403489711, 32.8183311997763, 30.4741646855066, 28.7811555363118, 27.6090722791769, 26.9579149141020, 25.0044428188772, 23.8323595617423, 22.2695818855625, 23.1812021966674, 22.3998133585775, 21.3579615744576, 21.6184245204876, 19.6649524252628, 19.1440265332028, 18.6231006411429, 19.2742580062178, 18.1021747490830, 16.9300914919481, 16.5393970729031, 15.3673138157683, 13.2836102475285, 11.1999066792887, 11.9812955173787, 10.2882863681838, 9.89759194913889, 8.85574016501900, 6.51157365074927, 5.86041628567434, 3.77671271743458, 2.08370356823977, 1.82324062220980, 0.390694419044956, -1.30231473014985, -0.390694419044956, -2.34416651426974, -2.21393504125475, -1.56277767617982, -2.21393504125475, -1.69300914919481, -1.17208325713487, 0.130231473014985, 2.08370356823977, 2.99532387934466, 2.99532387934466, 3.25578682537463, 2.60462946029971, 0.911620311104898, -0.260462946029971, -0.260462946029971, 0.130231473014985, 0., 0.260462946029971, -0.520925892059941, 0.520925892059941, -0.520925892059941, 0., -1.04185178411988, -0.520925892059941, -0.651157365074927, 0.781388838089912, 0.260462946029971, 0.390694419044956, -0.130231473014985, 0., -0.130231473014985, 0., 0.130231473014985, 0.781388838089912, 0., -0.130231473014985, -0.260462946029971, 1.04185178411988, 0., 0.130231473014985, 0.260462946029971, -0.911620311104898, -0.130231473014985, 0.260462946029971, 0., 0., -0.130231473014985, 0.260462946029971, 0., -1.04185178411988, 0., 0.130231473014985, -0.651157365074927, -0.260462946029971, -0.390694419044956, -0.260462946029971, -0.781388838089912, -0.390694419044956, 0.651157365074927, 0., 0., 0.130231473014985, -0.130231473014985, 0., -0.130231473014985, 0., 0., -1.17208325713487, 0., 0.390694419044956, -0.260462946029971, -0.260462946029971, -0.651157365074927, -0.651157365074927, -0.130231473014985, 0., 0., 0., -0.130231473014985, -1.04185178411988, -0.130231473014985, 0.260462946029971, -0.260462946029971, 0.651157365074927, -0.651157365074927, -0.651157365074927, -0.260462946029971, -0.781388838089912, -0.651157365074927, -0.781388838089912, -0.390694419044956, -0.390694419044956, -0.390694419044956, 0.390694419044956, -0.260462946029971, 0., 0.781388838089912, 0., 0.390694419044956, 0., 0., -1.30231473014985, 0., 1.04185178411988, 1.17208325713487, 0., 0.130231473014985, 0.260462946029971, 0., 1.43254620316484, 0.911620311104898, 0.651157365074927, 0., 0., 0.390694419044956, 0.651157365074927, 1.30231473014985, 0.260462946029971, -0.651157365074927, 0.260462946029971, 0.911620311104898, -0.260462946029971, 0., 0., 0.390694419044956, 0.260462946029971, -0.260462946029971, -0.130231473014985, 0.390694419044956, 0.520925892059941, 0.651157365074927, -0.390694419044956, -0.260462946029971, -1.04185178411988, 0.781388838089912, 0.651157365074927, 0., 0.520925892059941, 0., 0.130231473014985, 0., 0.911620311104898, 0.781388838089912, 0.390694419044956, 0.390694419044956, 0.130231473014985, 0.651157365074927, 0., 0.130231473014985, -0.520925892059941, 0.520925892059941, 0.520925892059941, 1.43254620316484, 0.260462946029971, 0.911620311104898, 1.17208325713487, 0.781388838089912, 0., -0.260462946029971, 0.520925892059941, 0.651157365074927, 0.390694419044956, 1.04185178411988, 0.911620311104898, 1.17208325713487, 0.520925892059941, -0.390694419044956, -0.520925892059941, 0.260462946029971, 0.390694419044956, 0.390694419044956, 0.260462946029971, 0., -0.130231473014985, 0., 1.17208325713487, 0.390694419044956, 0.390694419044956, 0.520925892059941, 0.260462946029971, 0.260462946029971, 0., 0.911620311104898, 0., 0.651157365074927, 0.130231473014985, -0.260462946029971, -0.781388838089912, 0.651157365074927, 0.911620311104898, 1.04185178411988, -0.130231473014985, 0.130231473014985, -0.260462946029971, -0.260462946029971, 0.520925892059941, 0.130231473014985, 0.130231473014985, 0.,
+      0.539706275763973, 1.61911882729192, 0.539706275763973, 0.539706275763973, 0.539706275763973, 1.07941255152795, 0., 0., 0.539706275763973, 2.15882510305589, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.07941255152795, 0., 0.539706275763973, 1.07941255152795, 3.77794393034781, 10.2544192395155, 30.7632577185465, 83.1147664676519, 174.325127071763, 227.216342096633, 229.375167199689, 252.582537057539, 280.107557121502, 295.759039118657, 314.648758770396, 330.300240767552, 350.809079246582, 359.444379658806, 361.063498486098, 362.682617313390, 365.381148692210, 370.238505174086, 376.175274207489, 383.191455792421, 391.826756204644, 401.001762892632, 411.256182132147, 422.050307647427, 433.923845714234, 446.876796332570, 459.290040675141, 470.084166190421, 480.878291705700, 492.751829772507, 504.625367839315, 517.578318457650, 531.070975351749, 542.404807142793, 555.897464036892, 569.929827206756, 584.501896652383, 599.613672373774, 617.423979473985, 634.154874022668, 650.885768571352, 667.616663120035, 683.268145117190, 697.840214562817, 714.571109111500, 730.762297384419, 749.112310760395, 765.303499033314, 784.193218685053, 801.463819509500, 816.575595230891, 832.766783503810, 848.418265500966, 862.450628670829, 875.403579289164, 888.896236183264, 901.849186801599, 912.643312316878, 923.437437832158, 931.533031968617, 940.168332380841, 947.724220241537, 953.660989274940, 960.677170859872, 966.613939893276, 972.011002650915, 976.328652857027, 979.027184235847, 983.884540717723, 984.963953269251, 985.503659545015, 985.503659545015, 985.503659545015, 983.884540717723, 981.725715614667, 979.566890511611, 975.788946581263, 973.090415202443, 969.312471272096, 964.455114790220, 960.677170859872, 955.819814377996, 950.962457896120, 946.105101414245, 940.168332380841, 933.691857071673, 929.374206865562, 921.278612729102, 915.881549971462, 909.405074662295, 903.468305628891, 898.071242871251, 893.213886389375, 888.356529907500, 884.578585977152, 880.260935771040, 877.022698116456, 874.324166737636, 871.625635358817, 867.847691428469, 866.228572601177, 862.990334946593, 862.450628670829, 860.831509843537, 860.291803567773, 859.212391016245, 859.752097292009, 859.752097292009, 860.291803567773, 862.450628670829, 864.069747498121, 866.228572601177, 869.466810255761, 873.244754186108, 875.943285564928, 879.721229495276, 884.578585977152, 888.896236183264, 893.753592665139, 898.071242871251, 903.468305628891, 907.246249559239, 911.563899765350, 915.341843695698, 919.119787626046, 922.897731556394, 926.135969210978, 928.294794314034, 933.152150795909, 935.310975898965, 939.088919829313, 941.247744932369, 943.406570035425, 946.644807690009, 949.343339068829, 950.962457896120, 953.660989274940, 955.280108102232, 956.359520653760, 957.438933205288, 957.438933205288, 954.740401826468, 952.581576723412, 950.422751620357, 951.502164171884, 940.168332380841, 932.612444520145, 922.358025280630, 909.405074662295, 897.531536595487, 882.959467149860, 868.927103979997, 851.116796879785, 835.465314882630, 816.035888955127, 795.527050476096, 777.177037100121, 755.049079793798, 734.540241314767, 710.253458905389, 689.204914150594, 665.997544292743, 642.790174434892, 619.582804577041, 596.915140994954, 573.168064861339, 549.960695003489, 526.753325145638, 504.625367839315, 480.878291705700, 457.670921847849, 436.082670817290, 412.875300959439, 390.207637377353, 368.079680071030, 344.872310213179, 322.204646631092, 300.076689324769, 275.789906915390, 252.582537057539, 229.375167199689, 205.088384790310, 180.261896105167, 154.895701144260, 131.688331286409, 111.719199083142, 94.9883045344593, 80.4162350888320, 67.4632844704966, 57.2088652309811, 47.4941522672296, 39.3985581307700, 32.3823765458384, 24.8264886851428, 18.3500133759751, 10.2544192395155, 4.85735648187576, 1.07941255152795, 2.15882510305589, 2.69853137881987, 3.23823765458384, 1.61911882729192, 1.07941255152795, 2.15882510305589, 2.69853137881987, 2.15882510305589, 2.69853137881987, 2.69853137881987, 2.15882510305589, 2.69853137881987, 2.69853137881987, 2.15882510305589, 2.69853137881987, 2.15882510305589, 2.69853137881987, 2.15882510305589, 2.15882510305589, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.15882510305589, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.61911882729192, 2.69853137881987, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.07941255152795, 2.15882510305589, 2.15882510305589, 1.07941255152795, 2.69853137881987, 1.61911882729192, 1.61911882729192, 2.69853137881987, 2.15882510305589, 1.07941255152795, 2.15882510305589, 2.15882510305589, 1.61911882729192, 1.07941255152795, 2.15882510305589, 1.07941255152795, 2.15882510305589, 1.07941255152795, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.07941255152795, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.61911882729192, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.07941255152795, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.07941255152795, 1.61911882729192, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.15882510305589, 1.61911882729192, 1.61911882729192, 1.61911882729192, 2.69853137881987, 1.61911882729192, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.61911882729192, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.69853137881987, 2.15882510305589, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.15882510305589, 2.15882510305589, 1.07941255152795, 1.61911882729192, 1.07941255152795, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.07941255152795, 2.69853137881987, 2.15882510305589, 1.61911882729192, 1.61911882729192, 1.07941255152795, 1.07941255152795, 1.61911882729192, 1.07941255152795, 1.07941255152795, 1.61911882729192, 1.07941255152795, 0.539706275763973, 1.07941255152795, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.15882510305589, 2.15882510305589, 2.69853137881987, 2.15882510305589, 2.69853137881987, 1.07941255152795, 1.61911882729192, 1.61911882729192, 2.15882510305589, 1.07941255152795, 2.69853137881987, 1.61911882729192, 1.61911882729192, 2.15882510305589, 2.15882510305589, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.07941255152795, 2.69853137881987, 2.15882510305589, 1.61911882729192, 1.07941255152795, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.07941255152795, 2.69853137881987, 1.07941255152795, 2.15882510305589, 0.539706275763973, 1.61911882729192, 1.07941255152795, 1.07941255152795, 1.07941255152795, 2.69853137881987, 0.539706275763973, 2.15882510305589, 1.61911882729192, 1.61911882729192, 0.539706275763973, 2.15882510305589, 1.61911882729192, 2.15882510305589, 1.61911882729192, 1.61911882729192, 1.07941255152795, 1.61911882729192, 1.61911882729192, 1.07941255152795, 0.539706275763973, 1.07941255152795, 1.61911882729192, 1.61911882729192,
+    };
+    for (unsigned i = 0 ; i < 400u ; ++i)
+    {
+      auto msg = std::to_string(i);
+      TSM_ASSERT_DELTA(msg, wrench->data()[i],       fref[i],      1e-10);
+      TSM_ASSERT_DELTA(msg, wrench->data()[i+400u ], fref[i+400u], 1e-10);
+      TSM_ASSERT_DELTA(msg, wrench->data()[i+800u ], fref[i+800u], 1e-10);
+    };
   };
 };

@@ -160,3 +246,4 @@
 CXXTEST_TEST_REGISTRATION(BSFReaderTest, queryOkTwo)
 CXXTEST_TEST_REGISTRATION(BSFReaderTest, queryOkThree)
 CXXTEST_TEST_REGISTRATION(BSFReaderTest, fileTrial01868)
+CXXTEST_TEST_REGISTRATION(BSFReaderTest, fileTrial03361)


[llvm-objdump] Use `auto` declaration in typecasting

Summary:
According to `MaskRay`, use `auto` for type inference, according to coding standards.
Delete some comments, because these comments can be easily inferred from codes.

Reviewers: jhenderson, MaskRay

Reviewed By: jhenderson

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D54573

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

--- tools/llvm-objdump/ELFDump.cpp
+++ tools/llvm-objdump/ELFDump.cpp
@@ -158,31 +158,23 @@
 }

 void llvm::printELFFileHeader(const object::ObjectFile *Obj) {
-  // Little-endian 32-bit
-  if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
+  if (const auto *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
     printProgramHeaders(ELFObj->getELFFile());
-  // Big-endian 32-bit
-  else if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
     printProgramHeaders(ELFObj->getELFFile());
-  // Little-endian 64-bit
-  else if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
     printProgramHeaders(ELFObj->getELFFile());
-  // Big-endian 64-bit
-  else if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
     printProgramHeaders(ELFObj->getELFFile());
 }

 void llvm::printELFDynamicSection(const object::ObjectFile *Obj) {
-  // Little-endian 32-bit
-  if (const ELF32LEObjectFile *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
+  if (const auto *ELFObj = dyn_cast<ELF32LEObjectFile>(Obj))
     printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
-  // Big-endian 32-bit
-  else if (const ELF32BEObjectFile *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF32BEObjectFile>(Obj))
     printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
-  // Little-endian 64-bit
-  else if (const ELF64LEObjectFile *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF64LEObjectFile>(Obj))
     printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
-  // Big-endian 64-bit
-  else if (const ELF64BEObjectFile *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
+  else if (const auto *ELFObj = dyn_cast<ELF64BEObjectFile>(Obj))
     printDynamicSection(ELFObj->getELFFile(), Obj->getFileName());
 }


navi: fixed the heading issue in navi lane.

--- modules/map/relative_map/navigation_lane.cc
+++ modules/map/relative_map/navigation_lane.cc
@@ -170,7 +170,9 @@

     point->set_x(flu_x);
     point->set_y(flu_y);
-    point->set_theta(point->theta() - original_pose_.heading());
+    point->set_theta(common::math::NormalizeAngle(
+        common::math::NormalizeAngle(point->theta())
+            - original_pose_.heading()));
     const double accumulated_s = navigation_path.path_point(i).s() - ref_s;
     point->set_s(accumulated_s);


navi: updated lane marker only ref line generation method.

--- modules/map/relative_map/navigation_lane.cc
+++ modules/map/relative_map/navigation_lane.cc
@@ -230,70 +230,49 @@
   const auto& left_lane = lane_marker.left_lane_marker();
   const auto& right_lane = lane_marker.right_lane_marker();

+  double path_c0 = (left_lane.c0_position() + right_lane.c0_position()) / 2.0;
+
+  double quality_divider = left_lane.quality() + right_lane.quality();
+
+  double path_c1 = (left_lane.c1_heading_angle() * left_lane.quality() +
+      right_lane.c1_heading_angle() * left_lane.quality()) / quality_divider;
+
+  double path_c2 = (left_lane.c2_curvature() * left_lane.quality() +
+      right_lane.c2_curvature() * left_lane.quality()) / quality_divider;
+
+  double path_c3 = (left_lane.c3_curvature_derivative() * left_lane.quality() +
+      right_lane.c3_curvature_derivative() * left_lane.quality()) /
+      quality_divider;
+
+  double path_range = std::fmax(left_lane.view_range(),
+                                right_lane.view_range());
+
   const double unit_z = 1.0;
-  if (left_lane.view_range() > right_lane.view_range()) {
-    const double x_l_0 = EvaluateCubicPolynomial(
-        left_lane.c0_position(), left_lane.c1_heading_angle(),
-        left_lane.c2_curvature(), left_lane.c3_curvature_derivative(), 0.0);
-
-    double accumulated_s = 0.0;
-    for (double z = 0; z <= left_lane.view_range(); z += unit_z) {
-      const double x_l = EvaluateCubicPolynomial(
-          left_lane.c0_position(), left_lane.c1_heading_angle(),
-          left_lane.c2_curvature(), left_lane.c3_curvature_derivative(), z);
-
-      if (left_width_ < 0.0) {
-        left_width_ = std::fabs(x_l);
-      }
-      if (right_width_ < 0.0) {
-        right_width_ = left_width_;
-      }
-
-      double x1 = z;
-      // TODO(All): use more precise method to shift y
-      double y1 = std::fabs(x_l) - std::fabs(x_l_0);
-
-      auto* point = path->add_path_point();
-      point->set_x(x1);
-      point->set_y(y1);
-      point->set_s(accumulated_s);
-
-      if (path->path_point_size() > 1) {
-        auto& pre_point = path->path_point(path->path_point_size() - 2);
-        accumulated_s += std::hypot(x1 - pre_point.x(), y1 - pre_point.y());
-      }
-    }
-  } else {
-    const double x_r_0 = EvaluateCubicPolynomial(
-        right_lane.c0_position(), right_lane.c1_heading_angle(),
-        right_lane.c2_curvature(), right_lane.c3_curvature_derivative(), 0.0);
-    double accumulated_s = 0.0;
-    for (double z = 0; z <= right_lane.view_range(); z += unit_z) {
-      const double x_r = EvaluateCubicPolynomial(
-          right_lane.c0_position(), right_lane.c1_heading_angle(),
-          right_lane.c2_curvature(), right_lane.c3_curvature_derivative(), z);
-
-      if (right_width_ < 0.0) {
-        right_width_ = left_width_;
-      }
-      if (left_width_ < 0.0) {
-        left_width_ = right_width_;
-      }
-
-      double x1 = z;
-      // TODO(All): use more precise method to shift y
-      double y1 = -std::fabs(x_r) + std::fabs(x_r_0);
-
-      auto* point = path->add_path_point();
-      point->set_x(x1);
-      point->set_y(y1);
-      point->set_s(accumulated_s);
-
-      if (path->path_point_size() > 1) {
-        auto& pre_point = path->path_point(path->path_point_size() - 2);
-        accumulated_s += std::hypot(x1 - pre_point.x(), y1 - pre_point.y());
-      }
-    }
+  double accumulated_s = 0.0;
+  for (double z = 0; z <= path_range; z += unit_z) {
+    const double x_l = EvaluateCubicPolynomial(path_c0, path_c1,
+                                               path_c2, path_c3, z);
+
+    if (left_width_ < 0.0) {
+      left_width_ = (std::fabs(left_lane.c0_position()) +
+          std::fabs(right_lane.c0_position())) / 2.0;
+    }
+    if (right_width_ < 0.0) {
+      right_width_ = left_width_;
+    }
+
+    double x1 = z;
+    double y1 = x_l;
+
+    auto* point = path->add_path_point();
+    point->set_x(x1);
+    point->set_y(y1);
+
+    if (path->path_point_size() > 1) {
+      auto& pre_point = path->path_point(path->path_point_size() - 2);
+      accumulated_s += std::hypot(x1 - pre_point.x(), y1 - pre_point.y());
+    }
+    point->set_s(accumulated_s);
   }
 }


style + add test cases

style + add test cases

--- test/blockchain.cpp
+++ test/blockchain.cpp
@@ -32,7 +32,7 @@
 namespace dev {  namespace test {

 bytes createBlockRLPFromFields(mObject& _tObj);
-void overwriteBlockHeader(BlockInfo& current_BlockHeader, mObject& blObj);
+void overwriteBlockHeader(BlockInfo& _current_BlockHeader, mObject& _blObj);
 BlockInfo constructBlock(mObject& _o);
 void updatePoW(BlockInfo& _bi);
 void writeBlockHeaderToJson(mObject& _o, const BlockInfo& _bi);
@@ -106,8 +106,8 @@
 					BlockInfo uncleBlockFromFields = constructBlock(uncleHeaderObj);

 					// make uncle header valid
+					uncleBlockFromFields.timestamp = (u256)time(0);
 					uncleBlockFromFields.populateFromParent(vBiBlocks[vBiBlocks.size()-2]);
-					uncleBlockFromFields.timestamp = (u256)time(0);

 					updatePoW(uncleBlockFromFields);
 					writeBlockHeaderToJson(uncleHeaderObj, uncleBlockFromFields);
@@ -462,79 +462,79 @@
 	return rlpStream.out();
 }

-void overwriteBlockHeader(BlockInfo& current_BlockHeader, mObject& blObj)
-{
-	if (blObj["blockHeader"].get_obj().size() != 14)
-	{
-
-		BlockInfo tmp = current_BlockHeader;
-
-		if (blObj["blockHeader"].get_obj().count("parentHash"))
-			tmp.parentHash = h256(blObj["blockHeader"].get_obj()["parentHash"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("uncleHash"))
-			tmp.sha3Uncles = h256(blObj["blockHeader"].get_obj()["uncleHash"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("coinbase"))
-			tmp.coinbaseAddress = Address(blObj["blockHeader"].get_obj()["coinbase"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("stateRoot"))
-			tmp.stateRoot = h256(blObj["blockHeader"].get_obj()["stateRoot"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("transactionsTrie"))
-			tmp.transactionsRoot = h256(blObj["blockHeader"].get_obj()["transactionsTrie"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("receiptTrie"))
-			tmp.receiptsRoot = h256(blObj["blockHeader"].get_obj()["receiptTrie"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("bloom"))
-			tmp.logBloom = LogBloom(blObj["blockHeader"].get_obj()["bloom"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("difficulty"))
-			tmp.difficulty = toInt(blObj["blockHeader"].get_obj()["difficulty"]);
-
-		if (blObj["blockHeader"].get_obj().count("number"))
-			tmp.number = toInt(blObj["blockHeader"].get_obj()["number"]);
-
-		if (blObj["blockHeader"].get_obj().count("gasLimit"))
-			tmp.gasLimit = toInt(blObj["blockHeader"].get_obj()["gasLimit"]);
-
-		if (blObj["blockHeader"].get_obj().count("gasUsed"))
-			tmp.gasUsed = toInt(blObj["blockHeader"].get_obj()["gasUsed"]);
-
-		if (blObj["blockHeader"].get_obj().count("timestamp"))
-			tmp.timestamp = toInt(blObj["blockHeader"].get_obj()["timestamp"]);
-
-		if (blObj["blockHeader"].get_obj().count("extraData"))
-			tmp.extraData = importByteArray(blObj["blockHeader"].get_obj()["extraData"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("mixHash"))
-			tmp.mixHash = h256(blObj["blockHeader"].get_obj()["mixHash"].get_str());
-
-		if (blObj["blockHeader"].get_obj().count("seedHash"))
-			tmp.seedHash = h256(blObj["blockHeader"].get_obj()["seedHash"].get_str());
+void overwriteBlockHeader(BlockInfo& _current_BlockHeader, mObject& _blObj)
+{
+	if (_blObj["blockHeader"].get_obj().size() != 14)
+	{
+
+		BlockInfo tmp = _current_BlockHeader;
+
+		if (_blObj["blockHeader"].get_obj().count("parentHash"))
+			tmp.parentHash = h256(_blObj["blockHeader"].get_obj()["parentHash"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("uncleHash"))
+			tmp.sha3Uncles = h256(_blObj["blockHeader"].get_obj()["uncleHash"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("coinbase"))
+			tmp.coinbaseAddress = Address(_blObj["blockHeader"].get_obj()["coinbase"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("stateRoot"))
+			tmp.stateRoot = h256(_blObj["blockHeader"].get_obj()["stateRoot"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("transactionsTrie"))
+			tmp.transactionsRoot = h256(_blObj["blockHeader"].get_obj()["transactionsTrie"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("receiptTrie"))
+			tmp.receiptsRoot = h256(_blObj["blockHeader"].get_obj()["receiptTrie"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("bloom"))
+			tmp.logBloom = LogBloom(_blObj["blockHeader"].get_obj()["bloom"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("difficulty"))
+			tmp.difficulty = toInt(_blObj["blockHeader"].get_obj()["difficulty"]);
+
+		if (_blObj["blockHeader"].get_obj().count("number"))
+			tmp.number = toInt(_blObj["blockHeader"].get_obj()["number"]);
+
+		if (_blObj["blockHeader"].get_obj().count("gasLimit"))
+			tmp.gasLimit = toInt(_blObj["blockHeader"].get_obj()["gasLimit"]);
+
+		if (_blObj["blockHeader"].get_obj().count("gasUsed"))
+			tmp.gasUsed = toInt(_blObj["blockHeader"].get_obj()["gasUsed"]);
+
+		if (_blObj["blockHeader"].get_obj().count("timestamp"))
+			tmp.timestamp = toInt(_blObj["blockHeader"].get_obj()["timestamp"]);
+
+		if (_blObj["blockHeader"].get_obj().count("extraData"))
+			tmp.extraData = importByteArray(_blObj["blockHeader"].get_obj()["extraData"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("mixHash"))
+			tmp.mixHash = h256(_blObj["blockHeader"].get_obj()["mixHash"].get_str());
+
+		if (_blObj["blockHeader"].get_obj().count("seedHash"))
+			tmp.seedHash = h256(_blObj["blockHeader"].get_obj()["seedHash"].get_str());

 		// find new valid nonce

-		if (tmp != current_BlockHeader)
+		if (tmp != _current_BlockHeader)
 		{
-			current_BlockHeader = tmp;
+			_current_BlockHeader = tmp;

 			ProofOfWork pow;
 			std::pair<MineInfo, Ethash::Proof> ret;
-			while (!ProofOfWork::verify(current_BlockHeader))
+			while (!ProofOfWork::verify(_current_BlockHeader))
 			{
-				ret = pow.mine(current_BlockHeader, 1000, true, true); // tie(ret, blockFromFields.nonce)
-				Ethash::assignResult(ret.second, current_BlockHeader);
+				ret = pow.mine(_current_BlockHeader, 1000, true, true); // tie(ret, blockFromFields.nonce)
+				Ethash::assignResult(ret.second, _current_BlockHeader);
 			}
 		}
 	}
 	else
 	{
 		// take the blockheader as is
-		const bytes c_blockRLP = createBlockRLPFromFields(blObj["blockHeader"].get_obj());
+		const bytes c_blockRLP = createBlockRLPFromFields(_blObj["blockHeader"].get_obj());
 		const RLP c_bRLP(c_blockRLP);
-		current_BlockHeader.populateFromHeader(c_bRLP, false);
+		_current_BlockHeader.populateFromHeader(c_bRLP, false);
 	}
 }

@@ -614,20 +614,20 @@

 BOOST_AUTO_TEST_SUITE(BlockChainTests)

-//BOOST_AUTO_TEST_CASE(bcBlockChainTest)
-//{
-//	dev::test::executeTests("bcBlockChainTest", "/BlockTests", dev::test::doBlockchainTests);
-//}
-
-//BOOST_AUTO_TEST_CASE(bcValidBlockTest)
-//{
-//	dev::test::executeTests("bcValidBlockTest", "/BlockTests", dev::test::doBlockchainTests);
-//}
-
-//BOOST_AUTO_TEST_CASE(bcInvalidHeaderTest)
-//{
-//	dev::test::executeTests("bcInvalidHeaderTest", "/BlockTests", dev::test::doBlockchainTests);
-//}
+BOOST_AUTO_TEST_CASE(bcBlockChainTest)
+{
+	dev::test::executeTests("bcBlockChainTest", "/BlockTests", dev::test::doBlockchainTests);
+}
+
+BOOST_AUTO_TEST_CASE(bcValidBlockTest)
+{
+	dev::test::executeTests("bcValidBlockTest", "/BlockTests", dev::test::doBlockchainTests);
+}
+
+BOOST_AUTO_TEST_CASE(bcInvalidHeaderTest)
+{
+	dev::test::executeTests("bcInvalidHeaderTest", "/BlockTests", dev::test::doBlockchainTests);
+}

 BOOST_AUTO_TEST_CASE(bcUncleTest)
 {


passing actionMapper to drawing function and avoiding a memory leak

--- tools/mapeditor/map_editor.cpp
+++ tools/mapeditor/map_editor.cpp
@@ -73,7 +73,7 @@

 struct actions_t {
     std::vector<BITMAP *> tile_img;
-    point_t * coords;
+    std::vector<point_t> coords;
 };
 static actions_t g_actions;

@@ -194,6 +194,7 @@

 // Desenha painel das actions
 static void draw_actionsbar(BITMAP *bmp,
+                            const gamelib::allegro::bmp::CActionMapper & actionMapper,
                             const unsigned act_num,
                             const unsigned x) {
     rectfill(bmp, x, 0, x + 200, SCREEN_H, makecol(255, 255, 255));
@@ -351,7 +352,7 @@
 static void load_actions(const int num_actions,
                          const std::string & path) {
     g_actions.tile_img = std::vector<BITMAP *>(num_actions, nullptr);
-    g_actions.coords = new point_t[num_actions];
+    g_actions.coords.resize(num_actions, {0,0});
     int x = 20, y = 10;

     char img_name[16];
@@ -543,7 +544,7 @@
                     draw_grid(buffer);
             }
             draw_tilesbar(buffer, tileMapper, tiles_num, UTIL_H);
-            draw_actionsbar(buffer, act_num, UTIL_W);
+            draw_actionsbar(buffer, actionMapper, act_num, UTIL_W);

             if (key[KEY_I]) {
                 int xpos, ypos;


remove unnecessary acknowledge_interrupt_on_exit

--- HyperPlatform/vm.cpp
+++ HyperPlatform/vm.cpp
@@ -567,7 +567,6 @@

   VmxVmExitControls vm_exitctl_requested = {};
   vm_exitctl_requested.fields.host_address_space_size = IsX64();
-  vm_exitctl_requested.fields.acknowledge_interrupt_on_exit = true;
   VmxVmExitControls vm_exitctl = {VmpAdjustControlValue(
       (use_true_msrs) ? Msr::kIa32VmxTrueExitCtls : Msr::kIa32VmxExitCtls,
       vm_exitctl_requested.all)};


Fix check for valid tiff files

Fix check for valid tiff files

--- IO/vtkTIFFReader.cxx
+++ IO/vtkTIFFReader.cxx
@@ -126,11 +126,16 @@
 {
   if ( this->Image )
     {
-    TIFFGetField(this->Image, TIFFTAG_IMAGEWIDTH, &this->Width);
-    TIFFGetField(this->Image, TIFFTAG_IMAGELENGTH, &this->Height);
-    TIFFGetField(this->Image, TIFFTAG_SAMPLESPERPIXEL, &this->SamplesPerPixel);
+    if ( !TIFFGetField(this->Image, TIFFTAG_IMAGEWIDTH, &this->Width) &&
+         TIFFGetField(this->Image, TIFFTAG_IMAGELENGTH, &this->Height) )
+      {
+      return 0;
+      }
+    TIFFGetField(this->Image, TIFFTAG_SAMPLESPERPIXEL,
+                 &this->SamplesPerPixel);
     TIFFGetField(this->Image, TIFFTAG_COMPRESSION, &this->Compression);
-    TIFFGetField(this->Image, TIFFTAG_BITSPERSAMPLE, &this->BitsPerSample);
+    TIFFGetField(this->Image, TIFFTAG_BITSPERSAMPLE,
+                 &this->BitsPerSample);
     TIFFGetField(this->Image, TIFFTAG_PHOTOMETRIC, &this->Photometrics);
     TIFFGetField(this->Image, TIFFTAG_PLANARCONFIG, &this->PlanarConfig);
     if ( !TIFFGetField(this->Image, TIFFTAG_TILEDEPTH, &this->TileDepth) )


Make STM32 SPIv2 SpiPeripheral::getSpi() private

--- source/chip/STM32/peripherals/SPIv2/include/distortos/chip/STM32-SPIv2-SpiPeripheral.hpp
+++ source/chip/STM32/peripherals/SPIv2/include/distortos/chip/STM32-SPIv2-SpiPeripheral.hpp
@@ -45,15 +45,6 @@
 	uint32_t getPeripheralFrequency() const
 	{
 		return peripheralFrequency_;
-	}
-
-	/**
-	 * \return reference to SPI_TypeDef object
-	 */
-
-	SPI_TypeDef& getSpi() const
-	{
-		return *reinterpret_cast<SPI_TypeDef*>(spiBase_);
 	}

 	/**
@@ -148,6 +139,15 @@

 private:

+	/**
+	 * \return reference to SPI_TypeDef object
+	 */
+
+	SPI_TypeDef& getSpi() const
+	{
+		return *reinterpret_cast<SPI_TypeDef*>(spiBase_);
+	}
+
 	/// base address of SPI peripheral
 	uintptr_t spiBase_;


r1369/sofa-dev : BUGFIX: MechanicalObject vector operation (vOp) v=a+b*f was incorrect when b was the same as v.

--- modules/sofa/component/MechanicalObject.inl
+++ modules/sofa/component/MechanicalObject.inl
@@ -815,6 +815,71 @@
                     }
                 }
             }
+            else if (v == b)
+            {
+                if (f==1.0)
+                {
+                    // v += a
+                    if (v.type == VecId::V_COORD)
+                    {
+                        VecCoord* vv = getVecCoord(v.index);
+                        if (a.type == VecId::V_COORD)
+                        {
+                            VecCoord* va = getVecCoord(a.index);
+                            vv->resize(va->size());
+                            for (unsigned int i=0; i<vv->size(); i++)
+                                (*vv)[i] += (*va)[i];
+                        }
+                        else
+                        {
+                            VecDeriv* va = getVecDeriv(a.index);
+                            vv->resize(va->size());
+                            for (unsigned int i=0; i<vv->size(); i++)
+                                (*vv)[i] += (*va)[i];
+                        }
+                    }
+                    else if (a.type == VecId::V_DERIV)
+                    {
+                        VecDeriv* vv = getVecDeriv(v.index);
+                        VecDeriv* va = getVecDeriv(a.index);
+                        vv->resize(va->size());
+                        for (unsigned int i=0; i<vv->size(); i++)
+                            (*vv)[i] += (*va)[i];
+                    }
+                    else
+                    {
+                        // ERROR
+                        std::cerr << "Invalid vOp operation ("<<v<<','<<a<<','<<b<<','<<f<<")\n";
+                        return;
+                    }
+                }
+                else
+                {
+                    // v = a+v*f
+                    if (v.type == VecId::V_COORD)
+                    {
+                        VecCoord* vv = getVecCoord(v.index);
+                        VecCoord* va = getVecCoord(a.index);
+                        vv->resize(va->size());
+                        for (unsigned int i=0; i<vv->size(); i++)
+                        {
+                            (*vv)[i] *= (Real)f;
+                            (*vv)[i] += (*va)[i];
+                        }
+                    }
+                    else
+                    {
+                        VecDeriv* vv = getVecDeriv(v.index);
+                        VecDeriv* va = getVecDeriv(a.index);
+                        vv->resize(va->size());
+                        for (unsigned int i=0; i<vv->size(); i++)
+                        {
+                            (*vv)[i] *= (Real)f;
+                            (*vv)[i] += (*va)[i];
+                        }
+                    }
+                }
+            }
             else
             {
                 if (f==1.0)


ask note

ask note

--- nta/algorithms/unittests/SpatialPoolerTest.cpp
+++ nta/algorithms/unittests/SpatialPoolerTest.cpp
@@ -629,8 +629,7 @@
     colDim.push_back(10);
     sp.initialize(inputDim, colDim);

-    UInt trueAvgConnectedSpan1[7] =
-      {3, 3, 4.5, 3, 2.5, 2, 0};
+    UInt trueAvgConnectedSpan1[7] = {3, 3, 4.5, 3, 2.5, 2, 0};

     for (UInt i = 0; i < numColumns; i++) {
       sp.setPermanence(i, permArr1[i]);


INTEGRATION: CWS warnings01 (1.4.184); FILE MERGED 2005/09/23 03:13:48 sb 1.4.184.2: RESYNC: (1.4-1.5); FILE MERGED 2005/09/01 13:59:56 sb 1.4.184.1: #i53898# Made code warning-free.

--- comphelper/source/container/enumhelper.cxx
+++ comphelper/source/container/enumhelper.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: enumhelper.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-08 02:45:10 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: hr $ $Date: 2006-06-19 22:46:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -166,8 +166,8 @@
 //==================================================================
 //------------------------------------------------------------------------------
 OEnumerationByIndex::OEnumerationByIndex(const staruno::Reference< starcontainer::XIndexAccess >& _rxAccess)
-    :m_xAccess(_rxAccess)
-    ,m_nPos(0)
+    :m_nPos(0)
+    ,m_xAccess(_rxAccess)
     ,m_bListening(sal_False)
 {
     impl_startDisposeListening();


Fixed a bug in which a cast on the returned expression would not be
inserted unless the returned expression were a simple symbol access
(SymExpr).

This fixes the following --baseline --no-local regressions:

  classes/deitz/infer/infer_field2
  classes/deitz/infer/infer_field2a
  classes/deitz/infer/infer_field2b
  classes/deitz/infer/infer_field2c
  types/tuple/dinan/pining_for_lisp_ver2

git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@14441 3a8e244f-b0f2-452b-bcba-4c88e055c3ca

--- compiler/resolution/functionResolution.cpp
+++ compiler/resolution/functionResolution.cpp
@@ -3126,14 +3126,23 @@
       if (call->isPrimitive(PRIMITIVE_MOVE)) {
         if (SymExpr* lhs = toSymExpr(call->get(1))) {
           if (lhs->var == ret) {
-            if (SymExpr* rhs = toSymExpr(call->get(2))) {
-              if (rhs->var->type != lhs->var->type) {
-                CallExpr* cast = new CallExpr("_cast", lhs->var->type->symbol, rhs->remove());
-                lhs->insertAfter(cast);
-                resolveCall(cast);
-                if (cast->isResolved())
-                  resolveFns(cast->isResolved());
+            Expr* rhs = call->get(2);
+            if (rhs->typeInfo() != lhs->var->type) {
+              rhs->remove();
+              Symbol* tmp = NULL;
+              if (SymExpr* se = toSymExpr(rhs)) {
+                tmp = se->var;
+              } else {
+                tmp = new VarSymbol("_tmp", rhs->typeInfo());
+                tmp->isCompilerTemp = true;
+                call->insertBefore(new DefExpr(tmp));
+                call->insertBefore(new CallExpr(PRIMITIVE_MOVE, tmp, rhs));
               }
+              CallExpr* cast = new CallExpr("_cast", lhs->var->type->symbol, tmp);
+              call->insertAtTail(cast);
+              resolveCall(cast);
+              if (cast->isResolved())
+                resolveFns(cast->isResolved());
             }
           }
         }


fix unit test program return

fix unit test program return

--- test/catch_main.cpp
+++ test/catch_main.cpp
@@ -17,7 +17,7 @@
     if (ret)
         return ret;

-    session.run();
+    ret = session.run();

-    return 0;
+    return ret;
 }


INTEGRATION: CWS pdf01 (1.15.72); FILE MERGED 2004/08/06 21:41:08 pl 1.15.72.2: RESYNC: (1.15-1.16); FILE MERGED 2004/05/27 11:12:29 pl 1.15.72.1: #i29581# fix a memory leak

--- tools/source/stream/stream.cxx
+++ tools/source/stream/stream.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: stream.cxx,v $
  *
- *  $Revision: 1.16 $
+ *  $Revision: 1.17 $
  *
- *  last change: $Author: rt $ $Date: 2004-06-17 13:12:34 $
+ *  last change: $Author: hr $ $Date: 2004-09-08 16:01:59 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -2735,6 +2735,7 @@
     else
     {
         bRetVal = TRUE;
+        FreeMemory();
         pBuf = 0;
         nSize = 0;
         nEndOfData = 0;


Fix building views_unittests.

Fix building views_unittests.

TBR=sky@chromium.org

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

--- views/view_unittest.cc
+++ views/view_unittest.cc
@@ -2252,6 +2252,7 @@
   virtual void NotifyStart() OVERRIDE {}
   virtual void NotifyEnd() OVERRIDE {}
   virtual void Blur(const gfx::Rect& bounds) OVERRIDE {}
+  virtual void SchedulePaint() OVERRIDE {}

  private:
   DISALLOW_COPY_AND_ASSIGN(TestCompositor);


INTEGRATION: CWS fwk55 (1.24.22); FILE MERGED 2006/10/23 12:56:08 mav 1.24.22.1: #i68655# handle the signed offset correctly

--- tools/source/stream/stream.cxx
+++ tools/source/stream/stream.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: stream.cxx,v $
  *
- *  $Revision: 1.24 $
+ *  $Revision: 1.25 $
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 01:01:33 $
+ *  last change: $Author: kz $ $Date: 2006-11-07 14:44:28 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1159,7 +1159,19 @@
 sal_Size SvStream::SeekRel( sal_sSize nPos )
 {
     sal_Size nActualPos = Tell();
-    nActualPos += nPos;
+
+    if ( nPos >= 0 )
+    {
+        if ( SAL_MAX_SIZE - nActualPos > (sal_Size)nPos )
+            nActualPos += nPos;
+    }
+    else
+    {
+        sal_Size nAbsPos = (sal_Size)-nPos;
+        if ( nActualPos >= nAbsPos )
+            nActualPos -= nAbsPos;
+    }
+
     pBufPos = pRWBuf + nActualPos;
     return Seek( nActualPos );
 }


Fix valgrind memory leak complain in ViewTest

BUG=42199
TEST=Verify valgrind issue in 42199 is fixed.

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

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

--- views/view_unittest.cc
+++ views/view_unittest.cc
@@ -50,6 +50,12 @@
 #if defined(OS_WIN)
     OleUninitialize();
 #endif
+  }
+
+  virtual void TearDown() {
+    // Flush the message loop because we have pending release tasks
+    // and these tasks if un-executed would upset Valgrind.
+    RunPendingMessages();
   }

   Widget* CreateWidget() {