INTEGRATION: CWS aw054 (1.7.374); FILE MERGED 2007/10/17 13:22:12 af 1.7.374.1: #i82710# Using overlay support of drawing layer for painting overlays.

--- sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx
+++ sd/source/ui/slidesorter/inc/view/SlsViewOverlay.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SlsViewOverlay.hxx,v $
  *
- *  $Revision: 1.7 $
- *
- *  last change: $Author: vg $ $Date: 2006-04-06 16:25:38 $
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: vg $ $Date: 2008-02-12 16:28:38 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -38,10 +38,13 @@

 #include "model/SlsSharedPageDescriptor.hxx"

+#include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <osl/mutex.hxx>
+#include <svx/sdr/overlay/overlayobject.hxx>
 #include <tools/gen.hxx>
 #include <vector>
 #include <boost/weak_ptr.hpp>
+#include <boost/noncopyable.hpp>

 class OutputDevice;
 class Region;
@@ -58,20 +61,25 @@
 class SlideSorterController;
 } } }

+namespace sdr { namespace overlay {
+class OverlayManager;
+} }
+
 namespace sd { namespace slidesorter { namespace view {

+class InsertionIndicatorOverlay;
+class PageObjectViewObjectContact;
+class SelectionRectangleOverlay;
+class SubstitutionOverlay;
 class ViewOverlay;
-class SelectionRectangleOverlay;
-class InsertionIndicatorOverlay;
-class SubstitutionOverlay;
-
-/** This base class of overlay graphics keeps track of the visibility of
-    graphical objects that possibly are drawn in XOR paint mode.  This makes
-    it possibly to switch such an overlay on or off without knowing whether
-    it is visible.
+
+/** This base class of slide sorter overlays uses the drawing layer overlay
+    support for the display.
 */
 class OverlayBase
+    : private ::boost::noncopyable,
+      public sdr::overlay::OverlayObject
 {
 public:
     OverlayBase (ViewOverlay& rViewOverlay);
@@ -90,15 +98,19 @@

     ViewOverlay& mrViewOverlay;

-    bool mbIsShowing;
-};
-
-
-
-
-/** This class manages the substitution display of the page objects.  This
-    subsitution is used to visualize the selected page objects during a
-    mouse drag operation.
+    virtual void transform (const basegfx::B2DHomMatrix& rMatrix);
+
+    /** Make sure that the overlay object is registered at the
+        OverlayManager.  This registration is done on demand.
+    */
+    void EnsureRegistration (void);
+};
+
+
+
+
+/** During internal drag and drop the outlines of the selected slides are
+    painted at the mouse position in dashed lines.
 */
 class SubstitutionOverlay
     : public OverlayBase
@@ -106,8 +118,6 @@
 public:
     SubstitutionOverlay (ViewOverlay& rViewOverlay);
     virtual ~SubstitutionOverlay (void);
-
-    virtual void Paint (void);

     /** Setup the substitution display of the given set of selected pages.
         The given mouse position is remembered so that it later can be
@@ -126,34 +136,40 @@
     */
     void Move (const Point& rOffset);
     void SetPosition (const Point& rPosition);
-    const Point& GetPosition (void) const;
-
-private:
-    /// List of page object substitution displays.
-    typedef ::std::vector<Rectangle> SubstitutionShapeList;
-    SubstitutionShapeList maShapes;
+    Point GetPosition (void) const;
+
+protected:
+    virtual void drawGeometry (OutputDevice& rOutputDevice);
+    virtual void createBaseRange (OutputDevice& rOutputDevice);
+
+private:
     Point maPosition;
-};
-
-
-
-
+    basegfx::B2DRange maBoundingBox;
+    basegfx::B2DPolyPolygon maShapes;
+};
+
+
+
+
+/** Slides can be selected by drawing a selection rectangle in the slide
+    sorter.  When the left mouse button is released all slides that are at
+    least partially in the rectangle are selected.
+*/
 class SelectionRectangleOverlay
     : public OverlayBase
 {
 public:
     SelectionRectangleOverlay (ViewOverlay& rViewOverlay);
-
-    virtual void Paint (void);
-
-    virtual void Show (void);
-    virtual void Hide (void);

     void Start (const Point& rAnchor);
     void Update (const Point& rSecondCorner);

     Rectangle GetSelectionRectangle (void);

+protected:
+    virtual void drawGeometry (OutputDevice& rOutputDevice);
+    virtual void createBaseRange (OutputDevice& rOutputDevice);
+
 private:
     Point maAnchor;
     Point maSecondCorner;
@@ -169,11 +185,9 @@
     : public OverlayBase
 {
 public:
-    InsertionIndicatorOverlay (ViewOverlay& rViewOverlay);
-
-    void SetPositionAndSize (const Rectangle& rBoundingBox);
-
-    virtual void Paint (void);
+    InsertionIndicatorOverlay (
+        ViewOverlay& rViewOverlay,
+        SlideSorterViewShell& mrViewShell);

     /** Given a position in model coordinates this method calculates the
         insertion marker both as an index in the document and as a rectangle
@@ -183,9 +197,16 @@

     sal_Int32 GetInsertionPageIndex (void) const;

-private:
+protected:
+    virtual void drawGeometry (OutputDevice& rOutputDevice);
+    virtual void createBaseRange (OutputDevice& rOutputDevice);
+
+private:
+    SlideSorterViewShell& mrViewShell;
+    sal_Int32 mnInsertionIndex;
     Rectangle maBoundingBox;
-    sal_Int32 mnInsertionIndex;
+
+    void SetPositionAndSize (const Rectangle& rBoundingBox);
 };

@@ -193,14 +214,15 @@

 /** Paint a frame around the slide preview under the mouse.  The actual
     painting is done by the PageObjectViewObjectContact of the slidesorter.
-    This class is responsible for the coordination of the right time for the
-    painting.
 */
 class MouseOverIndicatorOverlay
     : public OverlayBase
 {
 public:
-    MouseOverIndicatorOverlay (ViewOverlay& rViewOverlay);
+    MouseOverIndicatorOverlay (
+        ViewOverlay& rViewOverlay,
+        SlideSorterViewShell& mrViewShell);
+    virtual ~MouseOverIndicatorOverlay (void);

     /** Set the page object for which to paint a mouse over indicator.
         @param pContact
@@ -208,14 +230,22 @@
     */
     void SetSlideUnderMouse (const model::SharedPageDescriptor& rpDescriptor);

-    virtual void Paint (void);
-
-private:
+protected:
+    virtual void drawGeometry (OutputDevice& rOutputDevice);
+    virtual void createBaseRange (OutputDevice& rOutputDevice);
+
+private:
+    class MouseOverIndicator;
+
+    SlideSorterViewShell& mrViewShell;
+
     /** The page under the mouse is stored as weak shared pointer so that
         model changes can be handled without having the SlideSorterModel
         inform this class explicitly.
     */
     ::boost::weak_ptr<model::PageDescriptor> mpPageUnderMouse;
+
+    view::PageObjectViewObjectContact* GetViewObjectContact (void) const;
 };

@@ -224,11 +254,12 @@
 /** The view overlay manages and paints some indicators that are painted on
     top of the regular view content (the page objects).  It is separated
     from the view to allow the indicators to be altered in position and size
-    without to repaint the whole view content (inside that the bounding box
-    of the indicator).  One technique to achive this is to use XOR-painting.
-
-    The view overlay itself simply provides the more specialized classes
-    that handle individual indicators.
+    without repainting the whole view content (inside that the bounding box
+    of the indicator).  This is achieved by using the drawing layer overlay
+    support.
+
+    The view overlay itself simply gives access to the more specialized
+    classes that handle individual indicators.

 */
 class ViewOverlay
@@ -242,29 +273,7 @@
     InsertionIndicatorOverlay& GetInsertionIndicatorOverlay (void);
     SubstitutionOverlay& GetSubstitutionOverlay (void);

-    void Paint (void);
-
-    /** The overlay paint type describes how an overlay is painted.  That can be
-        either by using XOR operation or by doing a regular paint.
-    */
-    enum OverlayPaintType { OPT_ALL, OPT_XOR, OPT_PAINT };
-
-    /** As a preparation for draw operations that are not caused by the
-        overlays this method saves the current state of all overlays so that
-        the next call to Restore() can restore them.  After that it hides
-        the overlays so they do not interfere with the drawing operations.
-        @param eType
-            This parameter specifies what overlays to hide.
-    */
-    void HideAndSave (OverlayPaintType eType = OPT_ALL);
-
-    /** Restore the state of the overlays that has been saved in an earlier
-        call of HideAndSave().
-    */
-    void Restore (void);
-
-    controller::SlideSorterController& GetController (void);
-    SlideSorterViewShell& GetViewShell (void);
+    sdr::overlay::OverlayManager* GetOverlayManager (void) const;

 private:
     SlideSorterViewShell& mrViewShell;
@@ -272,18 +281,6 @@
     MouseOverIndicatorOverlay maMouseOverIndicatorOverlay;
     InsertionIndicatorOverlay maInsertionIndicatorOverlay;
     SubstitutionOverlay maSubstitutionOverlay;
-
-    OverlayPaintType meSavedStateType;
-
-    bool mbSelectionRectangleWasVisible;
-    bool mbMouseOverIndicatorWasVisible;
-    bool mbInsertionIndicatorWasVisible;
-    bool mbSubstitutionDisplayWasVisible;
-
-    /** The number HideAndSave() has been called more than Restore(). Only
-        when the value is 1 does Restore() really restore the overlays.
-    */
-    int mnHideAndSaveLevel;
 };


fix parameters shadowing member var in subgrid list

--- dune/multiscale/tools/solver/MsFEM/msfem_localproblems/subgrid-list.hh
+++ dune/multiscale/tools/solver/MsFEM/msfem_localproblems/subgrid-list.hh
@@ -1,21 +1,22 @@
 #ifndef SUBGRIDLIST_HH
 #define SUBGRIDLIST_HH
+
+#include <boost/noncopyable.hpp>

 #include <dune/common/fmatrix.hh>
 #include <dune/common/exceptions.hh>
 #include <dune/subgrid/subgrid.hh>
-
 #include <dune/fem/quadrature/cachingquadrature.hh>
 #include <dune/fem/operator/common/operator.hh>
+#include <dune/fem/operator/2order/lagrangematrixsetup.hh>
 #include <dune/multiscale/tools/solver/MsFEM/msfem_localproblems/localproblemsolver.hh>

-#include <dune/fem/operator/2order/lagrangematrixsetup.hh>

 // / done

 namespace Dune {
 template< class HostDiscreteFunctionImp, class SubGridImp, class MacroMicroGridSpecifierImp >
-class SubGridList
+class SubGridList : boost::noncopyable
 {
 public:
   // ! ---------------- typedefs for the HostDiscreteFunctionSpace -----------------------
@@ -45,18 +46,6 @@

   typedef typename HostEntityType::EntityPointer HostEntityPointerType;

-  // old:
-  #if 0
-  typedef typename HostGridType::template Codim< 0 >::template Partition< All_Partition >::LevelIterator
-  HostgridLevelEntityIteratorType;
-  typedef typename HostGridType::Traits::LevelIndexSet
-  HostGridLevelIndexSet;
-
-  // usage:
-  // const HostGridLevelIndexSet& hostGridLevelIndexSet = hostGrid.levelIndexSet(computational_level_);
-  // int father_index = hostGridLevelIndexSet.index( *level_it );
-  #endif // if 0
-
   typedef typename HostEntityType::template Codim< 2 >::EntityPointer HostNodePointer;

   typedef typename HostGridPartType::IntersectionIteratorType HostIntersectionIterator;
@@ -73,7 +62,7 @@
   template< typename EntityPointerCollectionType >
   bool entity_patch_in_subgrid(HostEntityPointerType& hit,
                                const HostGridPartType& hostGridPart,
-                               SubGridType& subGrid,
+                               const SubGridType& subGrid,
                                EntityPointerCollectionType& entities_sharing_same_node) {
     bool patch_in_subgrid_ = true;

@@ -215,7 +204,7 @@

     std::cout << "number_of_coarse_grid_entities = " << number_of_coarse_grid_entities << std::endl;

-    subGrid = new SubGridType *[number_of_coarse_grid_entities];
+    subGridList_ = new SubGridType *[number_of_coarse_grid_entities];

     // ! ----------- create subgrids --------------------

@@ -225,8 +214,8 @@
     {
       int coarse_index = coarseGridLeafIndexSet.index(*coarse_it);

-      subGrid[coarse_index] = new SubGridType(hostGrid);
-      subGrid[coarse_index]->createBegin();
+      subGridList_[coarse_index] = new SubGridType(hostGrid);
+      subGridList_[coarse_index]->createBegin();
     }

     for (HostGridEntityIteratorType it = hostSpace_.begin(); it != hostSpace_.end(); ++it)
@@ -293,8 +282,8 @@

       int father_index = coarseGridLeafIndexSet.index(*level_father_entity);

-      if ( !( subGrid[father_index]->template contains< 0 >(host_entity) ) )
-      { subGrid[father_index]->insertPartial(host_entity); }
+      if ( !( subGridList_[father_index]->template contains< 0 >(host_entity) ) )
+      { subGridList_[father_index]->insertPartial(host_entity); }

       // check the neighbor entities and look if they belong to the same father
       // if yes, continue
@@ -343,20 +332,20 @@
       {
         HostEntityPointerType hep(*host_it);
         enrichment(hep, level_father_entity, specifier, father_index,
-                   hostGridPart, *subGrid[father_index], entities_sharing_same_node, layers, enriched);
+                   hostGridPart, *subGridList_[father_index], entities_sharing_same_node, layers, enriched);
       }
     }

     for (int i = 0; i < number_of_coarse_grid_entities; ++i)
     {
-      subGrid[i]->createEnd();
+      subGridList_[i]->createEnd();
       if (!silent_)
       {
         std::cout << "Subgrid " << i << ":" << std::endl;
-        subGrid[i]->report();
-      }
-
-      if (subGrid[i]->size(2) == 0)
+        subGridList_[i]->report();
+      }
+
+      if (subGridList_[i]->size(2) == 0)
       {
         std::cout << "Error." << std::endl;
         std::cout << "Error. Created Subgrid with 0 nodes." << std::endl;
@@ -388,17 +377,16 @@
     {
       DUNE_THROW(Dune::RangeError, "Error. Subgrid-Index too large.");
     }
-    return *(subGrid[i]);
+    return *(subGridList_[i]);
   } // getSubGrid

 private:
-  SubGridList(const SubGridList& list);
   const HostDiscreteFunctionSpaceType& hostSpace_;
   MacroMicroGridSpecifierType& specifier_;

   bool silent_;

-  SubGridType** subGrid;
+  SubGridType** subGridList_;

 public:
   // Destruktor (Dynamisch angeforderter Speicher wird wieder freigegeben)
@@ -406,8 +394,8 @@
     const int size = specifier_.getNumOfCoarseEntities();

     for (int i = 0; i < size; ++i)
-      delete subGrid[i];
-    delete[] subGrid;
+      delete subGridList_[i];
+    delete[] subGridList_;
   }
 };
 }


Restore FitSlices() call back to original parameters.

Shows again same results as in the tutorials/dataframe/df101_h1Analysis.C
script.

--- tutorials/tree/h1analysis.C
+++ tutorials/tree/h1analysis.C
@@ -366,9 +366,7 @@
       delete gROOT->GetFunction("f2");
    TF1 *f2 = new TF1("f2",fdm2,0.139,0.17,2);
    f2->SetParameters(10000, 10);
-   // Restrict to three bins in this example
-   Info("Fit Slices","Restricting fit to two bins only in this example...");
-   h2->FitSlicesX(f2,10,20,10,"g5 l");
+   h2->FitSlicesX(f2,0,-1,1,"qln");
    TH1D *h2_1 = (TH1D*)gDirectory->Get("h2_1");
    h2_1->GetXaxis()->SetTitle("#tau[ps]");
    h2_1->SetMarkerStyle(21);


INTEGRATION: CWS sab004 (1.27.70); FILE MERGED 2003/07/15 12:57:40 sab 1.27.70.1: #110797#; dipose AccessibleShape before releasing

--- sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: AccessibleDocumentPagePreview.cxx,v $
  *
- *  $Revision: 1.27 $
+ *  $Revision: 1.28 $
  *
- *  last change: $Author: vg $ $Date: 2003-04-24 17:11:25 $
+ *  last change: $Author: hr $ $Date: 2003-07-17 11:30:42 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -750,7 +750,10 @@
 ScShapeChild::~ScShapeChild()
 {
     if (mpAccShape)
+    {
+        mpAccShape->dispose();
         mpAccShape->release();
+    }
 }

 struct ScShapeChildLess
@@ -1753,7 +1756,7 @@

 void SAL_CALL ScAccessibleDocumentPagePreview::grabFocus() throw (uno::RuntimeException)
 {
-    ScUnoGuard aGuard();
+    ScUnoGuard aGuard;
     IsObjectValid();
     if (getAccessibleParent().is())
     {


make_unique only supported by C++14 compilers

--- scanner/evaluators/caffe/default/default_input_evaluator.cpp
+++ scanner/evaluators/caffe/default/default_input_evaluator.cpp
@@ -16,6 +16,10 @@
 #include "scanner/evaluators/caffe/default/default_input_evaluator.h"
 #include "scanner/util/memory.h"

+#ifdef HAVE_CUDA
+#include <opencv2/cudaimgproc.hpp>
+#endif
+
 namespace scanner {

 DefaultInputEvaluator::DefaultInputEvaluator(DeviceType device_type,
@@ -49,8 +53,7 @@
     for (i32 i = 0; i < mean_colors.size(); i++) {
       param.add_mean_value(mean_colors[i]);
     }
-    transformer_ =
-        std::make_unique<caffe::DataTransformer<f32>>(param, caffe::TEST);
+    transformer_.reset(new caffe::DataTransformer<f32>(param, caffe::TEST));
   }
 }

@@ -73,6 +76,7 @@

     mean_mat_g_ = cv::cuda::GpuMat(
         net_input_height_, net_input_width_, CV_32FC3,
+
         cv::Scalar(descriptor_.mean_colors[0], descriptor_.mean_colors[1],
                    descriptor_.mean_colors[2]));


マンハッタン距離2乗、かつ焼きなましLike手法でちょっと移動手数が下がりました

--- clammbon/src/algorithm.cpp
+++ clammbon/src/algorithm.cpp
@@ -258,10 +258,28 @@

     //std::cout << "select piece position = " << start.position << std::endl;
     //std::cout << "select piece content = " << start.content << std::endl;
+
+    auto P = [](auto e, auto ne, double T) {
+        if( ne < e ) {
+            return 1.0;
+        } else {
+            return std::exp((e - ne)/T);
+        }
+    };
+    double T = 1000.0;
+
+    std::random_device sec_rng;
+    std::mt19937 mt(sec_rng());
+    std::uniform_real_distribution<double> prob_dist(0.0, 1.0);
+    auto prob = [&]{return prob_dist(mt);};
+
+    auto is_transition = [&](auto s, auto ns) {
+        return prob() < P(s, ns, T);
+    };

     while (que.size() > 0 && depth++ < 100)
     {
-        //std::cout << "depth = " << depth++ << " score = " << best.score << " que size = " << que.size() << std::endl;
+        std::cout << "depth = " << depth++ << " score = " << best.score << " que size = " << que.size() << std::endl;
         while (que.size() > 0)
         {
             auto const node = que.front();
@@ -272,7 +290,8 @@
             if (node.position.y != 0 && node.direct.back() != 'D')
             {
                 auto child = try_u(node);
-                if (child.score <= node.score)
+                //if (child.score <= node.score)
+                if (is_transition(node.score, child.score))
                 {
                     children.push_back(std::move(child));
                 }
@@ -280,7 +299,8 @@
             if (node.position.x != width - 1 && node.direct.back() != 'L')
             {
                 auto child = try_r(node);
-                if (child.score <= node.score)
+                //if (child.score <= node.score)
+                if (is_transition(node.score, child.score))
                 {
                     children.push_back(std::move(child));
                 }
@@ -288,7 +308,8 @@
             if (node.position.y != height - 1 && node.direct.back() != 'U')
             {
                 auto child = try_d(node);
-                if (child.score <= node.score)
+                //if (child.score <= node.score)
+                if (is_transition(node.score, child.score))
                 {
                     children.push_back(std::move(child));
                 }
@@ -296,7 +317,8 @@
             if (node.position.x != 0 && node.direct.back() != 'R')
             {
                 auto child = try_l(node);
-                if (child.score <= node.score)
+                //if (child.score <= node.score)
+                if (is_transition(node.score, child.score))
                 {
                     children.push_back(std::move(child));
                 }


Added shard matrix to HTTP output.

Added shard matrix to HTTP output.

--- src/Application/Controller/HTTPControllerSession.cpp
+++ src/Application/Controller/HTTPControllerSession.cpp
@@ -103,6 +103,8 @@
     PrintQuorumMatrix(configState);
     session.Print("\n");
     PrintDatabases(configState);
+    session.Print("\n");
+    PrintShardMatrix(configState);

     session.Flush();
 }
@@ -148,11 +150,19 @@
     session.Print("Quorum matrix:\n\n");
     ConfigState::ShardServerList& shardServers = configState->shardServers;
     ConfigState::QuorumList& quorums = configState->quorums;
+
     buffer.Writef("       ");
     for (itShardServer = shardServers.First(); itShardServer != NULL; itShardServer = shardServers.Next(itShardServer))
     {
-        buffer.Appendf(" n");
-        buffer.Appendf("%U", itShardServer->nodeID);
+        if (itShardServer->nodeID < 10)
+            buffer.Appendf("   ");
+        else if (itShardServer->nodeID < 100)
+            buffer.Appendf("  ");
+        else if (itShardServer->nodeID < 1000)
+            buffer.Appendf(" ");
+        else
+            buffer.Appendf("");
+        buffer.Appendf("ss%U", itShardServer->nodeID - CONFIG_MIN_SHARD_NODE_ID);
     }
     buffer.Appendf("\n");
     session.Print(buffer);
@@ -173,7 +183,7 @@
             buffer.Writef("  ");
         else if (itQuorum->quorumID < 1000)
             buffer.Writef(" ");
-        else if (itQuorum->quorumID < 10000)
+        else
             buffer.Writef("");
         buffer.Appendf("q%U |", itQuorum->quorumID);
         ConfigQuorum::NodeList& activeNodes = itQuorum->activeNodes;
@@ -247,7 +257,89 @@

 void HTTPControllerSession::PrintShardMatrix(ConfigState* configState)
 {
-    // TODO: xxx
+    bool                    found;
+    ConfigShardServer*      itShardServer;
+    ConfigShard*            itShard;
+    ConfigQuorum*           quorum;
+    uint64_t*               itNodeID;
+    Buffer                  buffer;
+
+    if (configState->shardServers.GetLength() == 0 ||
+     configState->quorums.GetLength() == 0 ||
+     configState->shards.GetLength() == 0)
+        return;
+
+    session.Print("Shard matrix:\n\n");
+    ConfigState::ShardServerList& shardServers = configState->shardServers;
+    ConfigState::ShardList& shards = configState->shards;
+
+    buffer.Writef("       ");
+    for (itShardServer = shardServers.First(); itShardServer != NULL; itShardServer = shardServers.Next(itShardServer))
+    {
+        if (itShardServer->nodeID < 10)
+            buffer.Appendf("   ");
+        else if (itShardServer->nodeID < 100)
+            buffer.Appendf("  ");
+        else if (itShardServer->nodeID < 1000)
+            buffer.Appendf(" ");
+        else if (itShardServer->nodeID < 10000)
+            buffer.Appendf("");
+        buffer.Appendf("ss%U", itShardServer->nodeID - CONFIG_MIN_SHARD_NODE_ID);
+    }
+    buffer.Appendf("\n");
+    session.Print(buffer);
+
+    buffer.Writef("      +");
+    for (itShardServer = shardServers.First(); itShardServer != NULL; itShardServer = shardServers.Next(itShardServer))
+    {
+        buffer.Appendf("------");
+    }
+    buffer.Appendf("\n");
+    session.Print(buffer);
+
+    for (itShard = shards.First(); itShard != NULL; itShard = shards.Next(itShard))
+    {
+        if (itShard->shardID < 10)
+            buffer.Writef("   ");
+        else if (itShard->shardID < 100)
+            buffer.Writef("  ");
+        else if (itShard->shardID < 1000)
+            buffer.Writef(" ");
+        else
+            buffer.Writef("");
+        buffer.Appendf("s%U |", itShard->shardID);
+        quorum = configState->GetQuorum(itShard->quorumID);
+        ConfigQuorum::NodeList& activeNodes = quorum->activeNodes;
+        for (itShardServer = shardServers.First(); itShardServer != NULL; itShardServer = shardServers.Next(itShardServer))
+        {
+            found = false;
+            for (itNodeID = activeNodes.First(); itNodeID != NULL; itNodeID = activeNodes.Next(itNodeID))
+            {
+                if (itShardServer->nodeID == *itNodeID)
+                {
+                    found = true;
+                    if (quorum->hasPrimary && quorum->primaryID == *itNodeID)
+                        if (CONTEXT_TRANSPORT->IsConnected(*itNodeID))
+                            buffer.Appendf("     P");
+                        else
+                            buffer.Appendf("     p");
+                    else
+                    {
+                        if (CONTEXT_TRANSPORT->IsConnected(*itNodeID))
+                            buffer.Appendf("     +");
+                        else
+                            buffer.Appendf("     -");
+                    }
+                    break;
+                }
+            }
+            if (!found)
+                buffer.Appendf("     .");
+
+        }
+        buffer.Appendf("\n");
+        session.Print(buffer);
+    }
 }

 bool HTTPControllerSession::ProcessCommand(ReadBuffer& cmd, UrlParam& params)


[clangd] Use Dex for dynamic index by default.

Summary:
Memory usage for a sample TU:
  Without Dex: 17.9M
  With    Dex: 24.4M

The memory increase is considerable but seems tolerable.

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@353413 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/tool/ClangdMain.cpp
+++ clangd/tool/ClangdMain.cpp
@@ -31,7 +31,7 @@
 static llvm::cl::opt<bool>
     UseDex("use-dex-index",
            llvm::cl::desc("Use experimental Dex dynamic index."),
-           llvm::cl::init(false), llvm::cl::Hidden);
+           llvm::cl::init(true), llvm::cl::Hidden);

 static llvm::cl::opt<Path> CompileCommandsDir(
     "compile-commands-dir",


MpInputOutputFrameworkTest updated to support new native flowgraph ticker.

git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@9450 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXmediaLib/src/test/mp/MpInputOutputFrameworkTest.cpp
+++ sipXmediaLib/src/test/mp/MpInputOutputFrameworkTest.cpp
@@ -18,6 +18,7 @@
 #include "mp/MprToOutputDevice.h"
 #include "mp/MpFlowGraphBase.h"
 #include "mp/MpMisc.h"
+#include "mp/MpMediaTask.h"
 #include "os/OsTask.h"
 #ifdef RTL_ENABLED
 #  include <rtl_macro.h>
@@ -99,6 +100,9 @@
       mpFlowGraph = new MpFlowGraphBase( TEST_SAMPLES_PER_FRAME
                                        , TEST_SAMPLES_PER_SECOND);
       CPPUNIT_ASSERT(mpFlowGraph != NULL);
+
+      // Call getMediaTask() which causes the task to get instantiated
+      CPPUNIT_ASSERT(MpMediaTask::getMediaTask(10) != NULL);
    }

    void tearDown()
@@ -127,9 +131,14 @@

    void testShortCircuit()
    {
+      enableConsoleOutput(1);
+
 #ifdef RTL_ENABLED
       RTL_START(1000000);
 #endif
+
+      // Get media processing task.
+      MpMediaTask *pMediaTask = MpMediaTask::getMediaTask(10);

       // Create input and output device managers
       MpInputDeviceManager inputDeviceManager(TEST_SAMPLES_PER_FRAME,
@@ -175,22 +184,39 @@
                            inputDeviceManager.enableDevice(sourceDeviceId));
       CPPUNIT_ASSERT_EQUAL(OS_SUCCESS,
                            outputDeviceManager.enableDevice(sinkDeviceId));
+
+      // Set flowgraph ticker
+      CPPUNIT_ASSERT_EQUAL(OS_SUCCESS,
+                           outputDeviceManager.setFlowgraphTickerSource(sinkDeviceId));

       // Enable resources
       CPPUNIT_ASSERT(pSource.enable());
       CPPUNIT_ASSERT(pSink.enable());

-      mpFlowGraph->start();
+      // Manage flowgraph with media task.
+      CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, pMediaTask->manageFlowGraph(*mpFlowGraph));
+
+      // Start flowgraph
+      CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, pMediaTask->startFlowGraph(*mpFlowGraph));

       // Run test!
-      for (int i=0; i<TEST_TIME_MS*(TEST_SAMPLES_PER_SECOND/TEST_SAMPLES_PER_FRAME)/1000; i++)
+      OsTask::delay(TEST_TIME_MS);
+/*      for (int i=0; i<TEST_TIME_MS*(TEST_SAMPLES_PER_SECOND/TEST_SAMPLES_PER_FRAME)/1000; i++)
       {
          RTL_BLOCK("test loop body");
          printf("==> i=%d\n",i);
          OsTask::delay(TEST_SAMPLES_PER_FRAME*1000/TEST_SAMPLES_PER_SECOND-2);
          RTL_EVENT("test loop body", 2);
-         mpFlowGraph->processNextFrame();
+         MpMediaTask::signalFrameStart();
       }
+*/
+
+      // Stop flowgraph
+      CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, pMediaTask->stopFlowGraph(*mpFlowGraph));
+      OsTask::delay(20);
+
+      // Unmanage flowgraph with media task.
+      CPPUNIT_ASSERT_EQUAL(OS_SUCCESS, pMediaTask->unmanageFlowGraph(*mpFlowGraph));

       // Disable resources
       CPPUNIT_ASSERT(pSource.disable());


copy_and_blit.blit_image: fix threshold computation

Threshold should not be ceiled, affecting all blit tests with
floating point format as destination :

dEQP-VK.api.copy_and_blit.blit_image.all_formats.*sfloat*

Also use the source texture to get the source format.

Fixes #516

Change-Id: I4c49007070306d597e36f7b79ee969ef5081d19e

--- external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
+++ external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp
@@ -1722,7 +1722,7 @@
 	{
 		const int	clampedBits	= de::clamp<int>(srcBits, 0, 32);
 		const float	srcMaxValue	= de::max((float)(1ULL<<clampedBits) - 1.0f, 1.0f);
-		const float	error		= deFloatCeil(1.0f / srcMaxValue);
+		const float	error		= 1.0f / srcMaxValue;

 		return de::clamp<float>(error, 0.0f, 1.0f);
 	}
@@ -1746,7 +1746,7 @@
 {
 	tcu::TestLog&				log			(m_context.getTestContext().getLog());
 	const bool					isLinear	= m_params.filter == VK_FILTER_LINEAR;
-	const tcu::TextureFormat	srcFormat	= clampedExpected.getFormat();
+	const tcu::TextureFormat	srcFormat	= m_sourceTextureLevel->getFormat();
 	const tcu::TextureFormat	dstFormat	= result.getFormat();
 	bool						isOk		= false;


INTEGRATION: CWS changefileheader (1.34.20); FILE MERGED 2008/04/01 15:35:54 thb 1.34.20.3: #i85898# Stripping all external header guards 2008/04/01 12:39:17 thb 1.34.20.2: #i85898# Stripping all external header guards 2008/03/31 13:58:47 rt 1.34.20.1: #i87441# Change license header to LPGL v3.

--- sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: SlsSelectionFunction.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.35 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: kz $ $Date: 2008-04-03 14:29:18 $
+ * $RCSfile: SlsSelectionFunction.cxx,v $
+ * $Revision: 1.36 $
  *
- *  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.
  *
  ************************************************************************/


make new code

make new code

--- class_double_list/main.cpp
+++ class_double_list/main.cpp
@@ -1,34 +1,26 @@
-#include "iostream"
-#include "class_double_list.h"
+#include "stdafx.h"
+#include "double_linked_list.h"

-int main(){
-    List*head, *cur;
-    int num;
-    cout << "a=  ";
-    cin >> num;
-    head = createlist(num);
-    cur = head;
-    for (int i = 0; i < 9; i++) {
-        cout << "a = ";
-        cin >> num;
-        cur = addToend(cur, num);
-    }
-    printlist(head);
-    cout << endl;
-    // Удаляем элемент со значением 3
-    deleteElem(&head, 3);
-    printlist(head);
-    cout << endl;
-    //Добавление элемента co значением 4 после элемента со значением 6
-    addTomiddle(&head, 4, 6);
-    printlist(head);
-    cout << endl;
-    // Сортировка элементов по возрастанию
-    sort(&head);
-    printlist(head);
-
-
+int main()
+{
+	int num;
+	double_linked_list list;
+	for (int i = 1; i < 10; i++){
+		cout << "a= ";
+		cin >> num;
+		list.append(num);
+	}
+	list.printlist();
+	//Удаляем элемент со значением 4;
+	list.deleteElem(4);
+	list.printlist();
+	//Добавление элемента со значением 9 после 5;
+	list.insert(9, 5);
+	list.printlist();
+	//Сортировка списка по возрастанию
+	list.sort();
+	list.printlist();
+	system("pause");
     return 0;
 }
-


Increase texcoord offset used by pipeline.sampler conformance tests from 0.001 to 0.002

--- external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
+++ external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerTests.cpp
@@ -301,7 +301,7 @@
 	// TODO: Would be nice to base this on number of texels and subtexel precision. But this
 	// seems to work.
 	for (unsigned int i = 0; i < vertices.size(); ++i) {
-		vertices[i].texCoord += tcu::Vec4(0.001f, 0.001f, 0.001f, 0.0f);
+		vertices[i].texCoord += tcu::Vec4(0.002f, 0.002f, 0.002f, 0.0f);
 	}
 	return vertices;
 }


Fix compiler warning about unused variable

Contributes to issue CURA-7282.

--- tests/utils/PolygonTest.cpp
+++ tests/utils/PolygonTest.cpp
@@ -330,7 +330,7 @@

     coord_t max_height = segment_length * std::sqrt(2.0); // the diameter of the circle along the diagonal

-    for (auto it : spiral_before)
+    for (size_t i = 0; i < spiral_before.size(); ++i)
     {
         // apply simplify iteratively for each point until nothing is simplifiable any more
         spiral_polygons.simplify(10000, max_height);


Update Go OS Plugin for newer runtimes.

Update Go OS Plugin for newer runtimes.

Differential Revision: http://reviews.llvm.org/D19273

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

--- source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
+++ source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -249,8 +249,19 @@
     TargetSP target_sp = m_process->CalculateTarget();
     if (!target_sp)
         return false;
-    m_allg_sp = FindGlobal(target_sp, "runtime.allg");
-    m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    // Go 1.6 stores goroutines in a slice called runtime.allgs
+    ValueObjectSP allgs_sp = FindGlobal(target_sp, "runtime.allgs");
+    if (allgs_sp)
+    {
+        m_allg_sp = allgs_sp->GetChildMemberWithName(ConstString("array"), true);
+        m_allglen_sp = allgs_sp->GetChildMemberWithName(ConstString("len"), true);
+    }
+    else
+    {
+        // Go 1.4 stores goroutines in the variable runtime.allg.
+        m_allg_sp = FindGlobal(target_sp, "runtime.allg");
+        m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    }

     if (m_allg_sp && !m_allglen_sp)
     {


When PlatformDarwinKernel::ExamineKextForMatchingUUID is given
a FileSpec, UUID, and ArchSpec, and it's opening all the kexts
with the same bundle id to see if they're a match, don't set
the Arch in the ModuleSpec.  If Module::GetObjectFile() sees
that the architecture of the kext is a mismatch for the arch
we're looking for, it'll spew a warning message to the dev (r217251).

Rely on the UUID match to get the correct file if we have
a UUID -- we'll get no warning if it's a mismatch.

<rdar://problem/18641477>

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

--- source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -658,12 +658,15 @@
     {
         ModuleSpec exe_spec (exe_file);
         exe_spec.GetUUID() = uuid;
-        exe_spec.GetArchitecture() = arch;
+        if (!uuid.IsValid())
+        {
+            exe_spec.GetArchitecture() = arch;
+        }

         // First try to create a ModuleSP with the file / arch and see if the UUID matches.
         // If that fails (this exec file doesn't have the correct uuid), don't call GetSharedModule
         // (which may call in to the DebugSymbols framework and therefore can be slow.)
-        ModuleSP module_sp (new Module (exe_file, arch));
+        ModuleSP module_sp (new Module (exe_spec));
         if (module_sp && module_sp->GetObjectFile() && module_sp->MatchesModuleSpec (exe_spec))
         {
             error = ModuleList::GetSharedModule (exe_spec, exe_module_sp, NULL, NULL, NULL);


layers: Fixup OT error messages

layers: Fixup OT error messages

Print object type explicitly; also fixup a couple of format
specifiers.

Change-Id: I6f5036f70cae05bd5f7ee9320e24b2e16bdc811b

--- layers/object_tracker.cpp
+++ layers/object_tracker.cpp
@@ -152,10 +152,10 @@
                                  reinterpret_cast<uint64_t &>(command_pool));
         }
     } else {
-        skip_call |=
-            log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, __LINE__,
-                    OBJTRACK_NONE, LayerName,
-                    "Unable to remove obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?", object_handle);
+        skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle,
+                             __LINE__, OBJTRACK_NONE, LayerName, "Unable to remove command buffer obj 0x%" PRIxLEAST64
+                                                                 ". Was it created? Has it already been destroyed?",
+                             object_handle);
     }
     return skip_call;
 }
@@ -197,10 +197,10 @@
                                  reinterpret_cast<uint64_t &>(descriptor_pool));
         }
     } else {
-        skip_call |=
-            log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, __LINE__,
-                    OBJTRACK_NONE, LayerName,
-                    "Unable to remove obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?", object_handle);
+        skip_call |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle,
+                             __LINE__, OBJTRACK_NONE, LayerName, "Unable to remove descriptor set obj 0x%" PRIxLEAST64
+                                                                 ". Was it created? Has it already been destroyed?",
+                             object_handle);
     }
     return skip_call;
 }
@@ -302,7 +302,8 @@
     } else {
         log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, __LINE__,
                 OBJTRACK_UNKNOWN_OBJECT, LayerName,
-                "Unable to remove obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?", object_handle);
+                "Unable to remove %s obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?",
+                object_name[object_type], object_handle);
     }
 }

@@ -332,7 +333,8 @@
     } else {
         log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, object_handle, __LINE__,
                 OBJTRACK_UNKNOWN_OBJECT, LayerName,
-                "Unable to remove obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?", object_handle);
+                "Unable to remove %s obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?",
+                object_name[object_type], object_handle);
     }
 }

@@ -347,7 +349,7 @@
     if (instance_data->object_map[object_type].find(reinterpret_cast<uint64_t>(object)) ==
         instance_data->object_map[object_type].end()) {
         return log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type, reinterpret_cast<uint64_t>(object),
-                       __LINE__, OBJTRACK_INVALID_OBJECT, LayerName, "Invalid %s Object 0x%" PRIx64, object_name[object_type],
+                       __LINE__, OBJTRACK_INVALID_OBJECT, LayerName, "Invalid %s Object 0x%" PRIxLEAST64, object_name[object_type],
                        reinterpret_cast<uint64_t>(object));
     }
     return false;
@@ -367,7 +369,7 @@
             (device_data->swapchainImageMap.find(reinterpret_cast<uint64_t &>(object)) == device_data->swapchainImageMap.end())) {
             return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, object_type,
                            reinterpret_cast<uint64_t &>(object), __LINE__, OBJTRACK_INVALID_OBJECT, LayerName,
-                           "Invalid %s Object 0x%" PRIx64, object_name[object_type], reinterpret_cast<uint64_t &>(object));
+                           "Invalid %s Object 0x%" PRIxLEAST64, object_name[object_type], reinterpret_cast<uint64_t &>(object));
         }
     }
     return false;


shader_checker: validate vertex attribs against vs inputs

--- layers/shader_checker.cpp
+++ layers/shader_checker.cpp
@@ -295,12 +295,56 @@
 }

+static void
+validate_vi_against_vs_inputs(VkPipelineVertexInputCreateInfo const *vi, shader_source const *vs)
+{
+    std::map<uint32_t, interface_var> inputs;
+    /* we collect builtin inputs, but they will never appear in the VI state --
+     * the vs builtin inputs are generated in the pipeline, not sourced from buffers (VertexID, etc)
+     */
+    std::map<uint32_t, interface_var> builtin_inputs;
+
+    printf("Begin validate_vi_against_vs_inputs\n");
+
+    collect_interface_by_location(vs, spv::StorageInput, inputs, builtin_inputs);
+
+    /* Build index by location */
+    std::map<uint32_t, VkVertexInputAttributeDescription const *> attribs;
+    for (int i = 0; i < vi->attributeCount; i++)
+        attribs[vi->pVertexAttributeDescriptions[i].location] = &vi->pVertexAttributeDescriptions[i];
+
+    auto it_a = attribs.begin();
+    auto it_b = inputs.begin();
+
+    while (it_a != attribs.end() || it_b != inputs.end()) {
+        if (it_b == inputs.end() || it_a->first < it_b->first) {
+            printf("  WARN: attribute at location %d not consumed by the vertex shader\n",
+                   it_a->first);
+            it_a++;
+        }
+        else if (it_a == attribs.end() || it_b->first < it_a->first) {
+            printf("  ERR: vertex shader consumes input at location %d but not provided\n",
+                   it_b->first);
+            it_b++;
+        }
+        else {
+            /* TODO: type check */
+            printf("  OK: match on attribute location %d\n",
+                   it_a->first);
+            it_a++;
+            it_b++;
+        }
+    }
+
+    printf("End validate_vi_against_vs_inputs\n");
+}
+
+
 VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipeline(VkDevice device,
                                                              const VkGraphicsPipelineCreateInfo *pCreateInfo,
                                                              VkPipeline *pPipeline)
 {
     /* TODO: run cross-stage validation */
-    /* - Validate vertex fetch -> VS interface */
     /* - Validate FS output -> CB */
     /* - Support GS, TCS, TES stages */

@@ -333,6 +377,10 @@

     printf("Pipeline: vi=%p vs=%p fs=%p cb=%p\n", vi, vs_source, fs_source, cb);

+    if (vi && vs_source) {
+        validate_vi_against_vs_inputs(vi, vs_source);
+    }
+
     if (vs_source && fs_source) {
         validate_interface_between_stages(vs_source, "vertex shader",
                                           fs_source, "fragment shader");


Fix compilationation error with C++ namespace using g++ on Solaris

git-svn-id: 3ec853389310512053d525963cab269c063bb453@174574 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/util/Platforms/Solaris/SolarisPlatformUtils.cpp
+++ src/xercesc/util/Platforms/Solaris/SolarisPlatformUtils.cpp
@@ -109,6 +109,11 @@
     #include <xercesc/util/NetAccessors/Socket/SocketNetAccessor.hpp>
 #endif

+
+#if defined (SOLARIS)
+extern "C" int ftime(struct timeb *); // Solaris headers missing this decl
+#endif
+
 XERCES_CPP_NAMESPACE_BEGIN

 // ---------------------------------------------------------------------------
@@ -501,11 +506,6 @@
 // ---------------------------------------------------------------------------
 //  XMLPlatformUtils: Timing Methods
 // ---------------------------------------------------------------------------
-
-#if defined (SOLARIS)
-extern "C" int ftime(struct timeb *); // Solaris headers missing this decl
-#endif
-
 unsigned long XMLPlatformUtils::getCurrentMillis()
 {
     timeb aTime;


Tetgen build fix

Tetgen build fix

--- src/Modules/Legacy/Fields/InterfaceWithTetGenImpl.cc
+++ src/Modules/Legacy/Fields/InterfaceWithTetGenImpl.cc
@@ -338,7 +338,7 @@
     }

     module_->getUpdaterFunc()(.9);
-    FieldInformation fi(TETVOLMESH_E,CONSTANTDATA_E,DOUBLE_E);
+    FieldInformation fi(mesh_info_type::TETVOLMESH_E, databasis_info_type::CONSTANTDATA_E, data_info_type::DOUBLE_E);
     FieldHandle tetvol_out = CreateField(fi);
     // Convert to a SCIRun TetVol.


changed robot vel control simulation to give just brake/throttle targets

--- stacks/reinforcement_learning/rl_env/src/Env/RobotCarVel.cc
+++ stacks/reinforcement_learning/rl_env/src/Env/RobotCarVel.cc
@@ -13,14 +13,14 @@
 // normal: true values of each
 RobotCarVel::RobotCarVel(Random &rand, bool randomVel, bool upVel, bool tenToSix, bool lag):
   rng(rand),
-  s(6),
-  junk(0),
+  s(4),
+  junk(2),
   targetVel(s[0]),
   currVel(s[1]),
-  trueThrottle(s[2]),
-  trueBrake(s[3]),
-  throttleTarget(s[4]),
-  brakeTarget(s[5]),
+  trueThrottle(junk[0]),
+  trueBrake(junk[1]),
+  throttleTarget(s[2]),
+  brakeTarget(s[3]),
   randomVel(randomVel),
   upVel(upVel),
   tenToSix(tenToSix),
@@ -288,8 +288,6 @@

   (*maxFeat)[2] = 0.4;
   (*maxFeat)[3] = 1.0;
-  (*maxFeat)[4] = 0.4;
-  (*maxFeat)[5] = 1.0;

 }


INTEGRATION: CWS ooo19126 (1.5.22); FILE MERGED 2005/09/05 17:41:31 rt 1.5.22.1: #i54170# Change license header: remove SISSL

--- slideshow/source/engine/transitions/transitionfactorytab.cxx
+++ slideshow/source/engine/transitions/transitionfactorytab.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: transitionfactorytab.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: rt $ $Date: 2005-03-30 08:08:55 $
+ *  last change: $Author: rt $ $Date: 2005-09-07 21:00:32 $
  *
- *  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
  *
  ************************************************************************/


Verify chain_id even though there is no way for it to be different

--- libraries/chain/include/eosio/chain/transaction_metadata.hpp
+++ libraries/chain/include/eosio/chain/transaction_metadata.hpp
@@ -21,7 +21,7 @@
       signed_transaction                                         trx;
       packed_transaction                                         packed_trx;
       optional<pair<chain_id_type, flat_set<public_key_type>>>   signing_keys;
-      std::future<flat_set<public_key_type>>                     signing_keys_future;
+      std::future<pair<chain_id_type,flat_set<public_key_type>>> signing_keys_future;
       bool                                                       accepted = false;
       bool                                                       implicit = false;
       bool                                                       scheduled = false;
@@ -41,12 +41,15 @@
       }

       const flat_set<public_key_type>& recover_keys( const chain_id_type& chain_id ) {
-         if( !signing_keys || signing_keys->first != chain_id ) {// Unlikely for more than one chain_id to be used in one nodeos instance
+         // Unlikely for more than one chain_id to be used in one nodeos instance
+         if( !signing_keys || signing_keys->first != chain_id ) {
             if( signing_keys_future.valid() ) {
-               signing_keys = std::make_pair( chain_id, signing_keys_future.get());
-            } else {
-               signing_keys = std::make_pair( chain_id, trx.get_signature_keys( chain_id ));
+               signing_keys = signing_keys_future.get();
+               if( signing_keys->first == chain_id ) {
+                  return signing_keys->second;
+               }
             }
+            signing_keys = std::make_pair( chain_id, trx.get_signature_keys( chain_id ));
          }
          return signing_keys->second;
       }


updated a timeout flag for fall notification

git-svn-id: 767549f2a3626ae39d79f5348867a3ebb5082aca@4664 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/motion_estimate/twolegged_estimate/src/test_imu.cpp
+++ software/motion_estimate/twolegged_estimate/src/test_imu.cpp
@@ -117,9 +117,14 @@
 		E = q2e_new(q);

 		// fall detector
-		if ((E(1) > 20*PI/180. || E(0) > 20*PI/180.) && (msg->utime - fall_utime) > 30000000) {
-			fall_utime = msg->utime;
-			system("notify-send ROBOT_FELL_OVER");
+
+		if (E(1) > 20*PI/180. || E(0) > 20*PI/180.) {
+			//std::cout << "Falling\n";
+			if ((msg->utime - fall_utime) > 1200000) {
+				std::cout << "Timeout.\n";
+				fall_utime = msg->utime;
+				system("notify-send ROBOT_FELL_OVER");
+			}
 		}

 		check_conv(0) = __q.w() - q.w();


[DISC][MLIR] 1. replace dyn_cast to cast 2. refine code

--- tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/hlo_ops.cc
+++ tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/hlo_ops.cc
@@ -1554,14 +1554,12 @@
 static LogicalResult Verify(RealDynamicSliceOp op) {
   auto input_type = op.operand().getType().dyn_cast<RankedTensorType>();
   // If operand is unranked, there is very little to verify statically.
-  if (!input_type) {
-    return success();
-  }
+  if (!input_type) return success();
   int input_rank = input_type.getRank();

-  auto start_type = op.start_indices().getType().dyn_cast<RankedTensorType>();
-  auto limit_type = op.limit_indices().getType().dyn_cast<RankedTensorType>();
-  auto strides_type = op.strides().getType().dyn_cast<RankedTensorType>();
+  auto start_type = op.start_indices().getType().cast<RankedTensorType>();
+  auto limit_type = op.limit_indices().getType().cast<RankedTensorType>();
+  auto strides_type = op.strides().getType().cast<RankedTensorType>();

   if (input_rank != start_type.getNumElements()) {
     return op.emitOpError() << "has mismatched number of operand rank ("
@@ -2302,18 +2300,16 @@
 static LogicalResult Verify(DynamicPadOp op) {
   auto input_type = op.operand().getType().dyn_cast<RankedTensorType>();
   // If operand is unranked, there is very little to verify statically.
-  if (!input_type) {
-    return success();
-  }
+  if (!input_type) return success();
   int input_rank = input_type.getRank();

-  auto pad_type = op.padding_value().getType().dyn_cast<RankedTensorType>();
-  if (!pad_type || pad_type.getRank() != 0) {
+  auto pad_type = op.padding_value().getType().cast<RankedTensorType>();
+  if (pad_type.getRank() != 0) {
     return op.emitOpError() << "padding value type should be a rank-0";
   }

   auto padding_low_type =
-      op.edge_padding_low().getType().dyn_cast<RankedTensorType>();
+      op.edge_padding_low().getType().cast<RankedTensorType>();
   if (padding_low_type.getNumElements() != input_rank) {
     return op.emitOpError()
            << "edge_padding_low length(" << padding_low_type.getNumElements()
@@ -2321,7 +2317,7 @@
   }

   auto padding_high_type =
-      op.edge_padding_high().getType().dyn_cast<RankedTensorType>();
+      op.edge_padding_high().getType().cast<RankedTensorType>();
   if (padding_high_type.getNumElements() != input_rank) {
     return op.emitOpError()
            << "edge_padding_high length(" << padding_high_type.getNumElements()
@@ -2329,7 +2325,7 @@
   }

   auto interior_padding_type =
-      op.interior_padding().getType().dyn_cast<RankedTensorType>();
+      op.interior_padding().getType().cast<RankedTensorType>();
   if (interior_padding_type.getNumElements() != input_rank) {
     return op.emitOpError()
            << "edge_padding_interior length("
@@ -2339,9 +2335,7 @@

   auto output_type = op.getResult().getType().dyn_cast<RankedTensorType>();
   // If result is unranked, there is very little to verify statically.
-  if (!output_type) {
-    return success();
-  }
+  if (!output_type) return success();
   int output_rank = output_type.getRank();
   if (input_rank != output_rank) {
     return op.emitOpError() << "operand rank(" << input_rank


Fix #95: Fix rotation in WorldInHandNavigation

--- source/gloperate/source/navigation/WorldInHandNavigation.cpp
+++ source/gloperate/source/navigation/WorldInHandNavigation.cpp
@@ -229,7 +229,7 @@
 {
     m_rotationHappened = true;

-    const glm::vec3 ray(glm::normalize(m_cameraCapability.center() - m_eye));
+    const glm::vec3 ray(glm::normalize(m_center - m_eye));
     const glm::vec3 rotAxis(glm::cross(ray, m_cameraCapability.up()));

     hAngle *= ROTATION_HOR_DOF;
@@ -237,7 +237,7 @@

     enforceRotationConstraints(hAngle, vAngle);

-    glm::vec3 t = m_refPositionValid ? m_referencePosition : m_center;;
+    glm::vec3 t = m_refPositionValid ? m_referencePosition : m_center;

     glm::mat4x4 transform = glm::mat4x4();
     transform = glm::translate(transform, t);
@@ -245,8 +245,8 @@
     transform = glm::rotate(transform, vAngle, rotAxis);
     transform = glm::translate(transform, -t);

-    glm::vec4 newEye = transform * glm::vec4(m_eye, 0.0f);
-    glm::vec4 newCenter = transform * glm::vec4(m_center, 0.0f);
+    glm::vec4 newEye = transform * glm::vec4(m_eye, 1.f);
+    glm::vec4 newCenter = transform * glm::vec4(m_center, 1.f);

     m_cameraCapability.setEye(glm::vec3(newEye));
     m_cameraCapability.setCenter(glm::vec3(newCenter));


Add top level VLOG(1) for PJRT methods.

Add top level VLOG(1) for PJRT methods.

PiperOrigin-RevId: 368079729
Change-Id: I2c59ad1fc90414f536347bf56c67c640a54f44b8

--- tensorflow/compiler/xla/pjrt/pjrt_stream_executor_client.cc
+++ tensorflow/compiler/xla/pjrt/pjrt_stream_executor_client.cc
@@ -682,7 +682,7 @@
     std::function<void()> on_done_with_host_buffer, PjRtDevice* device) {
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorClient::BufferFromHostBuffer");
-  VLOG(2) << "PjRtStreamExecutorClient::BufferFromHostBuffer: shape: "
+  VLOG(1) << "PjRtStreamExecutorClient::BufferFromHostBuffer: shape: "
           << shape.ToString() << " device: " << device->DebugString();
   if (shape.IsTuple()) {
     return InvalidArgument("Use BufferFromHostLiteral to transfer a tuple");
@@ -866,7 +866,7 @@
     std::shared_ptr<BufferSequencingEvent> definition_event) {
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorClient::CreateUninitializedBuffer");
-  VLOG(2) << "PjRtStreamExecutorClient::CreateUninitializedBuffer: shape: "
+  VLOG(1) << "PjRtStreamExecutorClient::CreateUninitializedBuffer: shape: "
           << shape.ToString() << " device: " << device->DebugString();
   TF_ASSIGN_OR_RETURN(LocalDeviceState * local_device,
                       tensorflow::down_cast<PjRtStreamExecutorDevice*>(device)
@@ -890,7 +890,7 @@
                                                 PjRtDevice* device) {
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorClient::BufferFromHostLiteral");
-  VLOG(2) << "PjRtStreamExecutorClient::BufferFromHostLiteral: shape: "
+  VLOG(1) << "PjRtStreamExecutorClient::BufferFromHostLiteral: shape: "
           << literal.shape().ToString() << " device: " << device->DebugString();
   TF_ASSIGN_OR_RETURN(LocalDeviceState * local_device,
                       tensorflow::down_cast<PjRtStreamExecutorDevice*>(device)
@@ -1008,6 +1008,7 @@

 Status PjRtStreamExecutorDevice::TransferFromOutfeed(
     MutableBorrowingLiteral literal) {
+  VLOG(1) << "PjRtStreamExecutorDevice::TransferFromOutfeed";
   TF_ASSIGN_OR_RETURN(LocalDeviceState * local_device, GetLocalDeviceState());
   return local_device->client()->TransferFromOutfeedLocal(
       local_device->device_ordinal(), literal);
@@ -1141,6 +1142,7 @@
 }

 void PjRtStreamExecutorBuffer::Delete() {
+  VLOG(1) << "PjRtStreamExecutorBuffer::Delete";
   // When wait_for_reads_to_complete is false, Release should never fail.
   TF_CHECK_OK(Release(/*wait_for_operations_to_complete=*/false).status());
 }
@@ -1230,6 +1232,7 @@

 void PjRtStreamExecutorBuffer::ToLiteral(MutableLiteralBase* literal,
                                          std::function<void(Status)> on_ready) {
+  VLOG(1) << "PjRtStreamExecutorBuffer::ToLiteral";
   if (IsEmptyTuple()) {
     on_ready(InvalidArgument("ToLiteral called on empty tuple"));
     return;
@@ -1362,6 +1365,7 @@
     PjRtDevice* dst_device) {
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorBuffer::CopyToDevice");
+  VLOG(1) << "PjRtStreamExecutorBuffer::CopyToDevice";
   if (dst_device == device_) {
     return InvalidArgument(
         "CopyToDevice cannot accept the same source and destination devices");
@@ -1431,12 +1435,14 @@

 Status PjRtStreamExecutorBuffer::CopyToRemoteDevice(
     absl::string_view serialized_descriptor) {
+  VLOG(1) << "PjRtStreamExecutorBuffer::CopyToRemoteDevice";
   return client_->CopyToRemoteDevice(this, serialized_descriptor);
 }

 Status PjRtStreamExecutorBuffer::BlockHostUntilReady() {
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorBuffer::BlockHostUntilReady");
+  VLOG(1) << "PjRtStreamExecutorBuffer::BlockHostUntilReady";
   std::shared_ptr<TrackedDeviceBuffer> device_buffer;
   {
     absl::MutexLock lock(&mu_);
@@ -1625,12 +1631,12 @@
   int num_partitions;
   if (device_assignment_ == nullptr) {
     // This must go after `executables_` is initialized.
-    VLOG(1) << "PjRtStreamExecutorExecutable portable single-core";
+    VLOG(3) << "PjRtStreamExecutorExecutable portable single-core";
     num_partitions = 1;
     CHECK(addressable_devices_.empty());
   } else {
     // This must go after `executables_` is initialized.
-    VLOG(1) << "PjRtStreamExecutorExecutable device_assignment:\n"
+    VLOG(3) << "PjRtStreamExecutorExecutable device_assignment:\n"
             << device_assignment_->ToString();
     CHECK_GE(addressable_devices_.size(), 1) << device_assignment_->ToString();
     CHECK_LE(addressable_devices_.size(), client_->addressable_device_count())
@@ -1812,7 +1818,7 @@
   run_options.set_gpu_executable_run_options(client_->gpu_run_options());
   run_options.set_launch_id(options.launch_id);
   if (run_options.launch_id() != 0) {
-    VLOG(1) << "launch id for " << name() << ": " << run_options.launch_id();
+    VLOG(3) << "launch id for " << name() << ": " << run_options.launch_id();
   }

   // The choice of where we wait is arbitrary; the reason for the wait is
@@ -1938,7 +1944,7 @@
                            ->device_ordinal();
   tensorflow::profiler::TraceMe traceme(
       "PjRtStreamExecutorExecutable::ExecuteHelper");
-  VLOG(3) << "Replica " << replica << ", partition " << partition
+  VLOG(1) << "Replica " << replica << ", partition " << partition
           << " mapped to device ordinal for execution: " << device_ordinal;

   // SPMD sharding produces a single executable for multiple partitions.
@@ -2188,7 +2194,7 @@
 StatusOr<std::unique_ptr<PjRtExecutable>> PjRtStreamExecutorClient::Compile(
     const XlaComputation& computation, CompileOptions options) {
   tensorflow::profiler::TraceMe traceme("PjRtStreamExecutorClient::Compile");
-
+  VLOG(1) << "PjRtStreamExecutorClient::Compile";
   ExecutableBuildOptions& build_options = options.executable_build_options;
   if (!build_options.compile_thread_pool()) {
     build_options.set_compile_thread_pool(thread_pool());


FIX: Add softmax to MLP multi-class output

Previously the softmax function was only applied MLP multi-class
output when evaluating, not during training.


Replace error with VLOG

Replace error with VLOG

--- tensorflow/compiler/xla/service/gpu/cublas_pad_for_gemms.cc
+++ tensorflow/compiler/xla/service/gpu/cublas_pad_for_gemms.cc
@@ -126,8 +126,10 @@
           dot->operand(0)->shape().rank() ||
       dimension_numbers.rhs_batch_dimensions_size() + 2 !=
           dot->operand(1)->shape().rank()) {
-    LOG(ERROR) << "Dot is not canonical: Expected all dimensions but 2 to be "
-                  "batch_dimensions.";
+    VLOG(2)
+        << dot->ToString()
+        << " is not canonical: Expected all dimensions but 2 to be "
+           "batch_dimensions. Hence, this dot is not a candidate for padding.";
     return false;
   }

@@ -138,8 +140,11 @@
                      canonical_batch_dims) ||
       !absl::c_equal(dimension_numbers.rhs_batch_dimensions(),
                      canonical_batch_dims)) {
-    LOG(ERROR) << "Dot is not canonical: Expected batch dimensions to be all "
-                  "dimensions except for the last 2 ones.";
+    VLOG(2)
+        dot->ToString()
+        << " is not canonical: Expected batch dimensions to be all "
+           "dimensions except for the last 2 ones. Hence, this dot is not a "
+           "candidate for padding.";
     return false;
   }


[tensorflow/compiler/xla/service/space_to_batch_converter.cc] Use `const auto&` instead of `const auto`

--- tensorflow/compiler/xla/service/space_to_batch_converter.cc
+++ tensorflow/compiler/xla/service/space_to_batch_converter.cc
@@ -1329,7 +1329,7 @@
   }

   std::vector<int64_t> broadcast_dims;
-  const auto dimensions = consumer->dimensions();
+  const auto& dimensions = consumer->dimensions();
   broadcast_dims.reserve(dimensions.size());
   for (auto j : dimensions) {
     broadcast_dims.push_back(DimLookUp(permute_dims, j));


Use context instance to disconnect signal

--- tomviz/PipelineExecutor.cxx
+++ tomviz/PipelineExecutor.cxx
@@ -364,11 +364,9 @@
           &DockerPipelineExecutor::reset);

   // We need to hook up the transformCanceled signal to each of the operators,
-  // so
-  // we can stop the container if the user cancels any of them.
+  // so we can stop the container if the user cancels any of them.
   for (Operator* op : operators) {
-    connect(op, &Operator::transformCanceled,
-            [this]() { this->cancel(nullptr); });
+    connect(op, &Operator::transformCanceled, future, [this]() { this->cancel(nullptr); });
   }

   // We are now ready to run the pipeline


Appease MSAN buildbots.

Appease MSAN buildbots.

This is just a compile time test, but we have MSAN buildbots that will
fail since `exp` was uninitialized.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@225286 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/atomics/atomics.general/replace_failure_order.pass.cpp
+++ test/atomics/atomics.general/replace_failure_order.pass.cpp
@@ -25,7 +25,7 @@
 int main() {
     std::atomic<int> i;
     volatile std::atomic<int> v;
-    int exp;
+    int exp = 0;

     i.compare_exchange_weak(exp, 0, std::memory_order_acq_rel);
     i.compare_exchange_weak(exp, 0, std::memory_order_release);


Simplify.

Simplify.

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

--- tools/clang-cc/clang-cc.cpp
+++ tools/clang-cc/clang-cc.cpp
@@ -397,18 +397,11 @@
 PThread("pthread", llvm::cl::desc("Support POSIX threads in generated code"),
          llvm::cl::init(false));

-static LangKind GetLanguage(const std::string &Filename) {
+static LangKind GetLanguage(llvm::StringRef Filename) {
   if (BaseLang != langkind_unspecified)
     return BaseLang;

-  std::string::size_type DotPos = Filename.rfind('.');
-
-  if (DotPos == std::string::npos) {
-    BaseLang = langkind_c;  // Default to C if no extension.
-    return langkind_c;
-  }
-
-  std::string Ext = std::string(Filename.begin()+DotPos+1, Filename.end());
+  llvm::StringRef Ext = Filename.rsplit('.').second;
   if (Ext == "c")
     return langkind_c;
   else if (Ext == "S" || Ext == "s")


Fix a trivial typo, add a FIXME to have more test coverage for VTableBuilder

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

--- lib/AST/VTableBuilder.cpp
+++ lib/AST/VTableBuilder.cpp
@@ -1914,6 +1914,8 @@

 /// dumpLayout - Dump the vtable layout.
 void VTableBuilder::dumpLayout(raw_ostream& Out) {
+  // FIXME: write more tests that actually use the dumpLayout output to prevent
+  // VTableBuilder regressions.

   if (isBuildingConstructorVTable()) {
     Out << "Construction vtable for ('";
@@ -2166,7 +2168,7 @@

         // If this function pointer has a return pointer adjustment, dump it.
         if (!Thunk.Return.isEmpty()) {
-          Out << "return adjustment: " << Thunk.This.NonVirtual;
+          Out << "return adjustment: " << Thunk.Return.NonVirtual;
           Out << " non-virtual";
           if (Thunk.Return.VBaseOffsetOffset) {
             Out << ", " << Thunk.Return.VBaseOffsetOffset;


My testing shows that function stat has no problem with trailing separators. (tested on Windows and Darwin).

This fixes a bug on Windows:
clang c:\test.cpp

Here the call stat("c:") is not recognized as a directory (must be "c:\").

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

--- lib/Basic/FileManager.cpp
+++ lib/Basic/FileManager.cpp
@@ -264,10 +264,6 @@
 /// exist.
 ///
 const DirectoryEntry *FileManager::getDirectory(llvm::StringRef DirName) {
-  // stat doesn't like trailing separators (at least on Windows).
-  if (DirName.size() > 1 && llvm::sys::path::is_separator(DirName.back()))
-    DirName = DirName.substr(0, DirName.size()-1);
-
   ++NumDirLookups;
   llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
     SeenDirEntries.GetOrCreateValue(DirName);


Lint.

Lint.

--- integrators/embedded_explicit_runge_kutta_nyström_integrator_body.hpp
+++ integrators/embedded_explicit_runge_kutta_nyström_integrator_body.hpp
@@ -333,7 +333,8 @@
     EmbeddedExplicitRungeKuttaNyströmIntegrator<Method, Position> const&
 EmbeddedExplicitRungeKuttaNyströmIntegrator() {
   static_assert(
-      std::is_base_of<methods::EmbeddedExplicitRungeKuttaNyström, Method>::value,
+      std::is_base_of<methods::EmbeddedExplicitRungeKuttaNyström,
+                      Method>::value,
       "Method must be derived from EmbeddedExplicitRungeKuttaNyström");
   static internal_embedded_explicit_runge_kutta_nyström_integrator::
       EmbeddedExplicitRungeKuttaNyströmIntegrator<Method, Position> const


Fixed platform_window.cpp's Window::SizeMove().

--- src/adobe/future/widgets/sources/platform_window.cpp
+++ src/adobe/future/widgets/sources/platform_window.cpp
@@ -86,6 +86,8 @@

     virtual void SizeMove(const GG::Pt& ul, const GG::Pt& lr)
         {
+            GG::Wnd::SizeMove(ul, lr);
+
             GG::Pt client_size = ClientSize();

             if (!m_imp.debounce_m && !m_imp.resize_proc_m.empty()) {
@@ -101,8 +103,6 @@

                 m_imp.debounce_m = false;
             }
-
-            GG::Wnd::SizeMove(ul, lr);

             GG::Pt new_title_size((LowerRight() - UpperLeft()).x - BEVEL_OFFSET.x * 2, m_title->Height());
             m_title->Resize(new_title_size);


Add a separate rightShift flag instead of reusing the existing "poly" variable
to distinguish vsri/vsli.

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

--- lib/CodeGen/CGBuiltin.cpp
+++ lib/CodeGen/CGBuiltin.cpp
@@ -1172,6 +1172,7 @@
   bool quad = type & 0x10;
   bool poly = (type & 0x7) == 5 || (type & 0x7) == 6;
   bool splat = false;
+  bool rightShift = false;

   const llvm::VectorType *VTy = GetNeonType(VMContext, type & 0x7, quad);
   const llvm::Type *Ty = VTy;
@@ -1737,10 +1738,10 @@
       return Builder.CreateAShr(Ops[0], Ops[1], "vshr_n");
   case ARM::BI__builtin_neon_vsri_n_v:
   case ARM::BI__builtin_neon_vsriq_n_v:
-    poly = true;
+    rightShift = true;
   case ARM::BI__builtin_neon_vsli_n_v:
   case ARM::BI__builtin_neon_vsliq_n_v:
-    Ops[2] = EmitNeonShiftVector(Ops[2], Ty, poly);
+    Ops[2] = EmitNeonShiftVector(Ops[2], Ty, rightShift);
     return EmitNeonCall(CGM.getIntrinsic(Intrinsic::arm_neon_vshiftins, &Ty, 1),
                         Ops, "vsli_n");
   case ARM::BI__builtin_neon_vsra_n_v:


Macro out TODO unit tests for @ajwaller.

--- src/Core/Algorithms/Math/Tests/ParallelLinearAlgebraTests.cc
+++ src/Core/Algorithms/Math/Tests/ParallelLinearAlgebraTests.cc
@@ -242,17 +242,7 @@
   EXPECT_NE(v1.data_[7], v2.data_[7]);
 }

-//TODO: by intern
-TEST(ParallelArithmeticTests, CanTakeAbsoluteValueOfDiagonal)
-{
-  EXPECT_TRUE(false);
-}
-
-//TODO: by intern
-TEST(ParallelArithmeticTests, CanTakeAbsoluteValueOfDiagonalMulti)
-{
-  EXPECT_TRUE(false);
-}
+

 TEST(ParallelArithmeticTests, CanComputeMaxOfVector)
 {
@@ -272,6 +262,20 @@
   EXPECT_EQ(1, max2);
 }

+//TODO FIX_UNIT_TESTS
+#if 0
+//TODO: by intern
+TEST(ParallelArithmeticTests, CanTakeAbsoluteValueOfDiagonal)
+{
+  EXPECT_TRUE(false);
+}
+
+//TODO: by intern
+TEST(ParallelArithmeticTests, CanTakeAbsoluteValueOfDiagonalMulti)
+{
+  EXPECT_TRUE(false);
+}
+
 //TODO: by intern
 TEST(ParallelArithmeticTests, CanComputeMaxOfVectorMulti)
 {
@@ -361,3 +365,4 @@
 {
   EXPECT_TRUE(false);
 }
+#endif


When ProcessMachCore::DoLoadCore() finds *BOTH* a user process dyld and a mach kernel
binary, change to prefer the mach kernel binary by default.

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

--- source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -306,16 +306,28 @@
         }
     }

-    // If we find both a user process dyld and a mach kernel, prefer the
-    // user process dyld.  We may be looking at an lldb debug session were they were debugging
-    // a mach kernel when lldb coredumped.
-    if (m_dyld_addr != LLDB_INVALID_ADDRESS)
+    // If we find both a user process dyld and a mach kernel, we need to pick which one to use.
+    // We're looking at one or two scenarios:
+    //
+    // 1 This is a core of a crashed user process (e.g. a debugger) which has a copy of
+    //   a kernel in its memory.  lldb crashed while doing kernel debugging, leaving this
+    //   core file behind.
+    //
+    // 2 This is a kernel core file that happens to have a user-land dyld macho image in
+    //   one of its vm pages.
+    //
+    // #2 is rare, but has happened.  #1 only happens to people debugging the debugger, so
+    // for now, they will be inconvenienced.  FIXME - we should have a ProcessMachCore
+    // default setting to specify which dynamic loader to use so it can over-ridden without
+    // rebuilding the debugger for those rare occasions where it's needed.
+
+    if (m_mach_kernel_addr != LLDB_INVALID_ADDRESS)
+    {
+        m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
+    }
+    else if (m_dyld_addr != LLDB_INVALID_ADDRESS)
     {
         m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
-    }
-    else if (m_mach_kernel_addr != LLDB_INVALID_ADDRESS)
-    {
-        m_dyld_plugin_name = DynamicLoaderDarwinKernel::GetPluginNameStatic();
     }

     // Even if the architecture is set in the target, we need to override


Bug fixing involving method-list in protocol meta-data
(objc2 nonfragile-abi).

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

--- lib/CodeGen/CGObjCMac.cpp
+++ lib/CodeGen/CGObjCMac.cpp
@@ -571,6 +571,8 @@
                                             llvm::Constant *ClassRoGV);

   llvm::Constant *GetMethodConstant(const ObjCMethodDecl *MD);
+
+  llvm::Constant *GetMethodDescriptionConstant(const ObjCMethodDecl *MD);

   /// EmitMethodList - Emit the method list for the given
   /// implementation. The return value has type MethodListnfABITy.
@@ -3789,7 +3791,7 @@
   for (ObjCProtocolDecl::instmeth_iterator i = PD->instmeth_begin(),
        e = PD->instmeth_end(); i != e; ++i) {
     ObjCMethodDecl *MD = *i;
-    llvm::Constant *C = GetMethodConstant(MD);
+    llvm::Constant *C = GetMethodDescriptionConstant(MD);
     if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
       OptInstanceMethods.push_back(C);
     } else {
@@ -3800,7 +3802,7 @@
   for (ObjCProtocolDecl::classmeth_iterator i = PD->classmeth_begin(),
        e = PD->classmeth_end(); i != e; ++i) {
     ObjCMethodDecl *MD = *i;
-    llvm::Constant *C = GetMethodConstant(MD);
+    llvm::Constant *C = GetMethodDescriptionConstant(MD);
     if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
       OptClassMethods.push_back(C);
     } else {
@@ -3817,19 +3819,19 @@
                           PD->protocol_begin(),
                           PD->protocol_end());

-  Values[3] = EmitMethodList("\01l_OBJC_$_INSTANCE_METHODS_"
+  Values[3] = EmitMethodList("\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_"
                              + PD->getNameAsString(),
                              "__DATA, __objc_const",
                              InstanceMethods);
-  Values[4] = EmitMethodList("\01l_OBJC_$_CLASS_METHODS_"
+  Values[4] = EmitMethodList("\01l_OBJC_$_PROTOCOL_CLASS_METHODS_"
                              + PD->getNameAsString(),
                              "__DATA, __objc_const",
                              ClassMethods);
-  Values[5] = EmitMethodList("\01l_OBJC_$_INSTANCE_METHODS_OPT_"
+  Values[5] = EmitMethodList("\01l_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT_"
                              + PD->getNameAsString(),
                              "__DATA, __objc_const",
                              OptInstanceMethods);
-  Values[6] = EmitMethodList("\01l_OBJC_$_CLASS_METHODS_OPT_"
+  Values[6] = EmitMethodList("\01l_OBJC_$_PROTOCOL_CLASS_METHODS_OPT_"
                              + PD->getNameAsString(),
                              "__DATA, __objc_const",
                              OptClassMethods);
@@ -3921,6 +3923,23 @@
   return llvm::ConstantExpr::getBitCast(GV, ObjCTypes.ProtocolListnfABIPtrTy);
 }

+/// GetMethodDescriptionConstant - This routine build following meta-data:
+/// struct _objc_method {
+///   SEL _cmd;
+///   char *method_type;
+///   char *_imp;
+/// }
+
+llvm::Constant *
+CGObjCNonFragileABIMac::GetMethodDescriptionConstant(const ObjCMethodDecl *MD) {
+  std::vector<llvm::Constant*> Desc(3);
+  Desc[0] = llvm::ConstantExpr::getBitCast(GetMethodVarName(MD->getSelector()),
+                                           ObjCTypes.SelectorPtrTy);
+  Desc[1] = GetMethodVarType(MD);
+  // FIXME. This is really always NULL?
+  Desc[2] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
+  return llvm::ConstantStruct::get(ObjCTypes.MethodTy, Desc);
+}
 /* *** */

 CodeGen::CGObjCRuntime *


Disable code patch with substrated at iOS 14.5 temporarily

--- source/UserMode/ExecMemory/code-patch-tool-darwin.cc
+++ source/UserMode/ExecMemory/code-patch-tool-darwin.cc
@@ -21,6 +21,7 @@
 #include "logging/check_logging.h"

 #include "platform_macro.h"
+
 #if defined(CODE_PATCH_WITH_SUBSTRATED) && defined(TARGET_ARCH_ARM64)
 #include <mach/mach.h>
 #include "bootstrap.h"
@@ -35,12 +36,14 @@

 static mach_port_t substrated_server_port = MACH_PORT_NULL;

-mach_port_t connect_mach_service(const char *name) {
+static mach_port_t connect_mach_service(const char *name) {
   mach_port_t port = MACH_PORT_NULL;
   kern_return_t kr;

+#if 0
   kr = task_get_special_port(mach_task_self(), TASK_BOOTSTRAP_PORT, &bootstrap_port);
   KERN_ERROR_RETURN(kr, MACH_PORT_NULL)
+#endif

   kr = bootstrap_look_up(bootstrap_port, (char *)name, &port);
   KERN_ERROR_RETURN(kr, MACH_PORT_NULL);
@@ -76,24 +79,6 @@

   static mach_port_t self_port = mach_task_self();
 #ifdef __APPLE__
-
-#if 0 // REMOVE
-  vm_prot_t prot;
-  vm_inherit_t inherit;
-  mach_port_t task_self = mach_task_self();
-  vm_address_t region   = (vm_address_t)page_aligned_address;
-  vm_size_t region_size = 0;
-  struct vm_region_submap_short_info_64 info;
-  mach_msg_type_number_t info_count = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64;
-  natural_t max_depth               = -1;
-  kr = vm_region_recurse_64(task_self, &region, &region_size, &max_depth, (vm_region_recurse_info_t)&info, &info_count);
-  if (kr != KERN_SUCCESS) {
-    return kMemoryOperationError;
-  }
-  prot    = info.protection;
-  inherit = info.inheritance;
-#endif
-
   // try modify with substrated (steal from frida-gum)
   addr_t remap_dummy_page =
       (addr_t)mmap(0, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, VM_MAKE_TAG(255), 0);
@@ -110,7 +95,7 @@
   mprotect((void *)remap_dummy_page, page_size, PROT_READ | PROT_WRITE);

   int ret = RT_FAILED;
-#if defined(CODE_PATCH_WITH_SUBSTRATED) && defined(TARGET_ARCH_ARM64)
+#if 0 && defined(CODE_PATCH_WITH_SUBSTRATED) && defined(TARGET_ARCH_ARM64)
   ret = code_remap_with_substrated((uint8_t *)remap_dummy_page, (uint32_t)page_size, (addr_t)page_aligned_address);
   if (0 && ret == RT_FAILED)
     DLOG(0, "substrated failed, use vm_remap");


Fix an inconsistance in objc2's meta-data related to
the symbol for the root meta-data.

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

--- lib/CodeGen/CGObjCMac.cpp
+++ lib/CodeGen/CGObjCMac.cpp
@@ -3683,9 +3683,23 @@
     }
   } else {
     // Has a root. Current class is not a root.
-    std::string RootClassName =
-      ID->getClassInterface()->getSuperClass()->getNameAsString();
-    std::string SuperClassName = ObjCMetaClassName + RootClassName;
+    const ObjCInterfaceDecl *Root = ID->getClassInterface();
+    while (const ObjCInterfaceDecl *Super = Root->getSuperClass())
+      Root = Super;
+    std::string RootClassName = ObjCMetaClassName + Root->getNameAsString();
+    IsAGV = CGM.getModule().getGlobalVariable(RootClassName);
+    if (!IsAGV) {
+      IsAGV =
+        new llvm::GlobalVariable(ObjCTypes.ClassnfABITy, false,
+                                 llvm::GlobalValue::ExternalLinkage,
+                                 0,
+                                 RootClassName,
+                                 &CGM.getModule());
+      UsedGlobals.push_back(IsAGV);
+    }
+    // work on super class metadata symbol.
+    std::string SuperClassName =
+      ObjCMetaClassName + ID->getClassInterface()->getSuperClass()->getNameAsString();
     SuperClassGV = CGM.getModule().getGlobalVariable(SuperClassName);
     if (!SuperClassGV) {
       SuperClassGV =
@@ -3696,7 +3710,6 @@
                                  &CGM.getModule());
       UsedGlobals.push_back(SuperClassGV);
     }
-    IsAGV = SuperClassGV;
   }
   llvm::GlobalVariable *CLASS_RO_GV = BuildClassRoTInitializer(flags,
                                                                InstanceStart,
@@ -3716,7 +3729,7 @@
   }
   else {
     // Has a root. Current class is not a root.
-    std::string RootClassName =
+    std::string RootClassName =
       ID->getClassInterface()->getSuperClass()->getNameAsString();
     std::string SuperClassName = ObjCClassName + RootClassName;
     SuperClassGV = CGM.getModule().getGlobalVariable(SuperClassName);


Formatting changes

Formatting changes

--- source/common/templating/TemplateContainerParser.cpp
+++ source/common/templating/TemplateContainerParser.cpp
@@ -59,13 +59,11 @@
                 QZ_ERROR("Qz:Cmn:Tmpl")
                         << "Could not find 'template' tags inside 'templates'";
             }
-        }
-        else {
+        } else {
             QZ_ERROR("Qz:Cmn:Tmpl")
                     << "Could not find root 'templates' tag";
         }
-    }
-    else {
+    } else {
         QZ_ERROR("Qz:Cmn:Tmpl")
                 << "Failed to read config XML content at " << errorLine
                 << " Msg: " << errorMsg;


Random bug fix related to protocl metadata in categories in
non-fragile abi.

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

--- lib/CodeGen/CGObjCMac.cpp
+++ lib/CodeGen/CGObjCMac.cpp
@@ -3519,13 +3519,14 @@
   Values[3] = EmitMethodList(MethodListName,
                              "__DATA, __objc_const",
                              Methods);
-  Values[4] = EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_"
-                               + Interface->getNameAsString(),
-                                Interface->protocol_begin(),
-                                Interface->protocol_end());
-
   const ObjCCategoryDecl *Category =
     Interface->FindCategoryDeclaration(OCD->getIdentifier());
+  Values[4] = EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_"
+                               + Interface->getNameAsString() + "_$_"
+                               + Category->getNameAsString(),
+                                Category->protocol_begin(),
+                                Category->protocol_end());
+
   std::string ExtName(Interface->getNameAsString() + "_$_" +
                       OCD->getNameAsString());
   Values[5] =


Added conctruction exception for Function_element_xi.  Added USE_Function_derivatnew_finite_element option

--- source/computed_variable/function_finite_element.hpp
+++ source/computed_variable/function_finite_element.hpp
@@ -1,7 +1,7 @@
 //******************************************************************************
 // FILE : function_finite_element.hpp
 //
-// LAST MODIFIED : 13 January 2005
+// LAST MODIFIED : 8 March 2005
 //
 // DESCRIPTION :
 //==============================================================================
@@ -18,6 +18,12 @@
 }
 #include "computed_variable/function.hpp"
 #include "computed_variable/function_variable.hpp"
+
+//???DB.  Testing.
+//???DB.  Function_derivatnew_finite_element doesn't currently handle
+//  composite independent variables.  Would have to fall back to
+//  Function_derivatnew.  End up slower?
+//#define USE_Function_derivatnew_finite_element

 class Function_element : public Function
 //******************************************************************************
@@ -75,7 +81,7 @@

 class Function_element_xi : public Function
 //******************************************************************************
-// LAST MODIFIED : 13 January 2005
+// LAST MODIFIED : 8 March 2005
 //
 // DESCRIPTION :
 // An identity function whose input/output is element/xi.
@@ -86,6 +92,8 @@
 		friend bool equivalent(boost::intrusive_ptr<Value_type_1> const &,
 		boost::intrusive_ptr<Value_type_2> const &);
 	public:
+		// for construction exception
+		class Invalid_element_xi {};
 		// constructor
 		Function_element_xi(struct FE_element *element,const Vector& xi);
 		// destructor
@@ -143,7 +151,7 @@

 class Function_finite_element : public Function
 //******************************************************************************
-// LAST MODIFIED : 13 January 2005
+// LAST MODIFIED : 17 February 2005
 //
 // DESCRIPTION :
 // A function for a finite element interpolation field.
@@ -154,6 +162,10 @@
 {
 	friend class Function_variable_matrix_components;
 	friend class Function_variable_matrix_nodal_values;
+#if defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
+#else // defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
+	friend class Function_derivatnew_finite_element;
+#endif // defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
 	public:
 		// constructor
 		Function_finite_element(struct FE_field *field);
@@ -249,6 +261,14 @@
 		bool evaluate_derivative(Scalar& derivative,
 			Function_variable_handle atomic_variable,
 			std::list<Function_variable_handle>& atomic_independent_variables);
+#if defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
+#else // defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
+#if defined (USE_Function_derivatnew_finite_element)
+		bool evaluate_derivative_matrix(Function_size_type component_number,
+			std::list<Function_variable_handle>& independent_variables,
+			Matrix& matrix);
+#endif // defined (USE_Function_derivatnew_finite_element)
+#endif // defined (USE_FUNCTION_VARIABLE__EVALUATE_DERIVATIVE)
 		bool set_value(Function_variable_handle atomic_variable,
 			Function_variable_handle atomic_value);
 		Function_handle get_value(Function_variable_handle atomic_variable);


Fix format string for int64_t (#6963)

Fix format string for int64_t (#6963)

--- tests/gold_tests/continuations/plugins/session_id_verify.cc
+++ tests/gold_tests/continuations/plugins/session_id_verify.cc
@@ -20,9 +20,9 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 */
-#include <ts/ts.h>    // for debug
-#include <cstdlib>    // for abort
-#include <inttypes.h> // for PRIu64
+#include <ts/ts.h>   // for debug
+#include <cstdlib>   // for abort
+#include <cinttypes> // for PRId64
 #include <unordered_set>

 // plugin registration info
@@ -43,11 +43,11 @@

     static std::unordered_set<int64_t> seen_ids;
     if (seen_ids.find(id) != seen_ids.end()) {
-      TSError("[%s] Plugin encountered a duplicate session id: %ld", PLUGIN_NAME, id);
+      TSError("[%s] Plugin encountered a duplicate session id: %" PRId64, PLUGIN_NAME, id);
     } else {
       seen_ids.insert(id);
     }
-    TSDebug(PLUGIN_NAME, "session id: %ld", id);
+    TSDebug(PLUGIN_NAME, "session id: %" PRId64, id);
   } break;

   default:


Fix typo

Fix typo

--- src/bindings/python/namespaces/initSmtAstNodeEnv.cpp
+++ src/bindings/python/namespaces/initSmtAstNodeEnv.cpp
@@ -49,6 +49,6 @@
   PyDict_SetItemString(idSmtAstNodeClassDict, "STRING", PyInt_FromLong(smt2lib::STRING_NODE));
   PyDict_SetItemString(idSmtAstNodeClassDict, "SX", PyInt_FromLong(smt2lib::SX_NODE));
   PyDict_SetItemString(idSmtAstNodeClassDict, "UNDEFINED", PyInt_FromLong(smt2lib::UNDEFINED_NODE));
-  PyDict_SetItemString(idSmtAstNodeClassDict, "ZX_NODE", PyInt_FromLong(smt2lib::ZX_NODE));
+  PyDict_SetItemString(idSmtAstNodeClassDict, "ZX", PyInt_FromLong(smt2lib::ZX_NODE));
 }