Added swap to the sample.

Added swap to the sample.

--- soa_example.cc
+++ soa_example.cc
@@ -3,7 +3,7 @@

 #include "soa.h"

-void print_soa_iis(const SoA<int, std::string, int>& soa_iis) {
+void print_soa_iis(const SoA<int, std::string, int> &soa_iis) {
   for (int i = 0; i < soa_iis.size(); ++i) {
     std::cout << "(" << i << "): " << soa_iis.get<int, 0>(i) << ", "
               << soa_iis.get<std::string, 1>(i) << ", "
@@ -16,8 +16,8 @@
   std::cout << "size: " << soa_iis.size() << std::endl;
   std::cout << "empty: " << soa_iis.empty() << std::endl;

+  soa_iis.push_back(22, "Kitty", 4);
   soa_iis.push_back(0, "Hi", 2);
-  soa_iis.push_back(22, "Kitty", 4);

   std::cout << "size: " << soa_iis.size() << std::endl;
   std::cout << "empty: " << soa_iis.empty() << std::endl;
@@ -25,6 +25,12 @@

   // Iterate the arrays and print out the elements.
   std::cout << "Arrays now contain:\n";
+  print_soa_iis(soa_iis);
+  std::cout << std::endl;
+
+  // Swap the elements.
+  soa_iis.swap(0, 1);
+  std::cout << "Swapped first two elements. Arrays now contain:\n";
   print_soa_iis(soa_iis);
   std::cout << std::endl;

@@ -75,17 +81,17 @@
   soa_iis.push_back(100, "I'm new!.", 20);
   std::cout
       << "Modified the 4th element and added a new one. Arrays now contain:\n";
-      print_soa_iis(soa_iis);
+  print_soa_iis(soa_iis);
   std::cout << "size: " << soa_iis.size() << std::endl;
   std::cout << "empty: " << soa_iis.empty() << std::endl;
   std::cout << std::endl;

   // Get arrays and print them.
   std::cout << "Printing arrays individually:\n";
-  int* ints0 = soa_iis.array<int, 0>();
-  std::string* strings = soa_iis.array<std::string, 1>();
-  int* ints1 = soa_iis.array<int, 2>();
-  for (int i = 0; i < soa_iis.size(); ++ i) {
+  int *ints0 = soa_iis.array<int, 0>();
+  std::string *strings = soa_iis.array<std::string, 1>();
+  int *ints1 = soa_iis.array<int, 2>();
+  for (int i = 0; i < soa_iis.size(); ++i) {
     std::cout << "Index: " << i << ": ";
     std::cout << ints0[i] << ", ";
     std::cout << strings[i] << ", ";


document arrayvector

document arrayvector

--- time_steward_under_construction/bounded_int_calculus.hpp
+++ time_steward_under_construction/bounded_int_calculus.hpp
@@ -55,7 +55,14 @@
   int val;
 };

-
+// arrayvector<std::vector<float>, 3> is a sequence container
+// that stores 3 floats directly in the arrayvector object
+// and any floats after the third in a conditionally-present
+// std::vector<float> object.  If size() is always <= ArraySize
+// then arrayvector never allocates.
+//
+// value_type must be DefaultConstructible and Assignable (this is
+// a conceptual bug).
 template<typename VectorType, size_t ArraySize> class arrayvector {
 public:
   typedef typename VectorType::value_type value_type;


+ show expr string in styles control

+ show expr string in styles control

--- demo/viewer/styles_model.cpp
+++ demo/viewer/styles_model.cpp
@@ -19,7 +19,7 @@
 //$Id$

 #include "styles_model.hpp"
-
+#include <mapnik/expression_string.hpp>
 // boost
 #include <boost/concept_check.hpp>
 #include <boost/scoped_ptr.hpp>
@@ -32,304 +32,304 @@

 class node : private boost::noncopyable
 {
-      struct node_base
-      {
-            virtual QString name() const=0;
-            virtual QIcon   icon() const=0;
-            virtual ~node_base() {}
-      };
-
-      template <typename T>
-      struct wrap : public node_base
-      {
-            wrap(T const& obj)
-               : obj_(obj) {}
+    struct node_base
+    {
+	virtual QString name() const=0;
+	virtual QIcon   icon() const=0;
+	virtual ~node_base() {}
+    };
+
+    template <typename T>
+    struct wrap : public node_base
+    {
+	wrap(T const& obj)
+	    : obj_(obj) {}

-            ~wrap() {}
+	~wrap() {}

-            QString name () const
-            {
-               return obj_.name();
-            }
+	QString name () const
+	{
+	    return obj_.name();
+	}

-            QIcon icon() const
-            {
-               return obj_.icon();
-            }
+	QIcon icon() const
+	{
+	    return obj_.icon();
+	}

-            T obj_;
-      };
-
-   public:
-      template <typename T>
-      node ( T const& obj, node * parent=0)
-         : impl_(new wrap<T>(obj)),
-           parent_(parent)
-      {}
-
-      QString name() const
-      {
-         return impl_->name();
-      }
-
-      QIcon icon() const
-      {
-         return impl_->icon();
-      }
-
-      unsigned num_children() const
-      {
-         return children_.count();
-      }
-
-      node * child(unsigned row) const
-      {
-         return children_.value(row);
-      }
-
-      node * parent() const
-      {
-         return parent_;
-      }
-
-      node * add_child(node * child)
-      {
-         children_.push_back(child);
-         return child;
-      }
-      int row () const
-      {
-         if (parent_)
+	T obj_;
+    };
+
+public:
+    template <typename T>
+    node ( T const& obj, node * parent=0)
+	: impl_(new wrap<T>(obj)),
+	  parent_(parent)
+    {}
+
+    QString name() const
+    {
+	return impl_->name();
+    }
+
+    QIcon icon() const
+    {
+	return impl_->icon();
+    }
+
+    unsigned num_children() const
+    {
+	return children_.count();
+    }
+
+    node * child(unsigned row) const
+    {
+	return children_.value(row);
+    }
+
+    node * parent() const
+    {
+	return parent_;
+    }
+
+    node * add_child(node * child)
+    {
+	children_.push_back(child);
+	return child;
+    }
+    int row () const
+    {
+	if (parent_)
             return parent_->children_.indexOf(const_cast<node*>(this));
-         else
+	else
             return 0;
-      }
-
-      ~node()
-      {
-         qDeleteAll(children_);
-      }
-
-   private:
-      boost::scoped_ptr<node_base> impl_;
-      QList<node*> children_;
-      node * parent_;
+    }
+
+    ~node()
+    {
+	qDeleteAll(children_);
+    }
+
+private:
+    boost::scoped_ptr<node_base> impl_;
+    QList<node*> children_;
+    node * parent_;
 };

 struct symbolizer_info : public boost::static_visitor<QString>
 {
-      QString operator() (mapnik::point_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("PointSymbolizer");
-      }
-
-      QString operator() (mapnik::line_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("LineSymbolizer");
-      }
-
-      QString operator() (mapnik::line_pattern_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("LinePatternSymbolizer");
-      }
-
-      QString operator() (mapnik::polygon_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("PolygonSymbolizer");
-      }
-
-      QString operator() (mapnik::polygon_pattern_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("PolygonSymbolizer");
-      }
+    QString operator() (mapnik::point_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("PointSymbolizer");
+    }
+
+    QString operator() (mapnik::line_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("LineSymbolizer");
+    }
+
+    QString operator() (mapnik::line_pattern_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("LinePatternSymbolizer");
+    }
+
+    QString operator() (mapnik::polygon_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("PolygonSymbolizer");
+    }
+
+    QString operator() (mapnik::polygon_pattern_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("PolygonSymbolizer");
+    }

-      QString operator() (mapnik::text_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("TextSymbolizer");
-      }
-
-      QString operator() (mapnik::shield_symbolizer const& sym) const
-      {
-         boost::ignore_unused_variable_warning(sym);
-         return QString("ShieldSymbolizer");
-      }
-
-      template <typename T>
-      QString operator() (T const& ) const
-      {
-         return QString ("FIXME");
-      }
+    QString operator() (mapnik::text_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("TextSymbolizer");
+    }
+
+    QString operator() (mapnik::shield_symbolizer const& sym) const
+    {
+	boost::ignore_unused_variable_warning(sym);
+	return QString("ShieldSymbolizer");
+    }
+
+    template <typename T>
+    QString operator() (T const& ) const
+    {
+	return QString ("FIXME");
+    }
 };

 struct symbolizer_icon : public boost::static_visitor<QIcon>
 {
-      QIcon operator() (mapnik::polygon_symbolizer const& sym) const
-      {
-         QPixmap pix(16,16);
-         QPainter painter(&pix);
-         mapnik::color const& fill = sym.get_fill();
-         QBrush brush(QColor(fill.red(),fill.green(),fill.blue(),fill.alpha()));
-         painter.fillRect(0, 0, 16, 16, brush);
-         return QIcon(pix);
-      }
-
-      QIcon operator() (mapnik::point_symbolizer const& sym) const
-      {
-	  // FIXME!
-	  /*
-	    boost::shared_ptr<mapnik::image_data_32> symbol = sym.get_image();
-	    if (symbol)
+    QIcon operator() (mapnik::polygon_symbolizer const& sym) const
+    {
+	QPixmap pix(16,16);
+	QPainter painter(&pix);
+	mapnik::color const& fill = sym.get_fill();
+	QBrush brush(QColor(fill.red(),fill.green(),fill.blue(),fill.alpha()));
+	painter.fillRect(0, 0, 16, 16, brush);
+	return QIcon(pix);
+    }
+
+    QIcon operator() (mapnik::point_symbolizer const& sym) const
+    {
+	// FIXME!
+	/*
+	  boost::shared_ptr<mapnik::image_data_32> symbol = sym.get_image();
+	  if (symbol)
+	  {
+	  QImage image(symbol->getBytes(),
+	  symbol->width(),symbol->height(),QImage::Format_ARGB32);
+	  QPixmap pix = QPixmap::fromImage(image.rgbSwapped());
+	  return QIcon(pix);
+	  }
+	*/
+	return QIcon();
+    }
+    QIcon operator() (mapnik::line_symbolizer const& sym) const
+    {
+	QPixmap pix(48,16);
+	pix.fill();
+	QPainter painter(&pix);
+	mapnik::stroke const&  strk = sym.get_stroke();
+	mapnik::color const& col = strk.get_color();
+	QPen pen(QColor(col.red(),col.green(),col.blue(),col.alpha()));
+	pen.setWidth(strk.get_width());
+	painter.setPen(pen);
+	painter.drawLine(0,7,47,7);
+	//painter.drawLine(7,15,12,0);
+	//painter.drawLine(12,0,8,15);
+	return QIcon(pix);
+    }
+
+    template <typename T>
+    QIcon operator() (T const& ) const
+    {
+	return QIcon (":/images/filter.png");
+    }
+};
+
+class symbolizer_node
+{
+public:
+    symbolizer_node(mapnik::symbolizer const & sym)
+	: sym_(sym) {}
+    ~symbolizer_node(){}
+
+    QString name() const
+    {
+	//return QString("Symbolizer:fixme");
+	return boost::apply_visitor(symbolizer_info(),sym_);
+    }
+
+    QIcon icon() const
+    {
+	return boost::apply_visitor(symbolizer_icon(),sym_);//QIcon(":/images/filter.png");
+    }
+    mapnik::symbolizer const& sym_;
+};
+
+class rule_node
+{
+public:
+    rule_node(QString name,mapnik::rule_type const & r)
+	: name_(name),
+	  rule_(r) {}
+    ~rule_node() {}
+    QString name() const
+    {
+	mapnik::expression_ptr filter = rule_.get_filter();
+
+	return QString(mapnik::to_expression_string(*filter).c_str());
+    }
+
+    QIcon icon() const
+    {
+	return QIcon(":/images/filter.png");
+    }
+
+private:
+    QString name_;
+    mapnik::rule_type const& rule_;
+};
+
+class style_node
+{
+public:
+    style_node(QString name, mapnik::feature_type_style const& style)
+	: name_(name),
+	  style_(style) {}
+
+    ~style_node() {}
+
+    QString name() const
+    {
+	return name_;
+    }
+
+    QIcon icon() const
+    {
+	return QIcon(":/images/style.png");
+    }
+
+private:
+    QString name_;
+    mapnik::feature_type_style const& style_;
+};
+
+class map_node
+{
+public:
+    explicit map_node(boost::shared_ptr<mapnik::Map> map)
+	: map_(map)  {}
+    ~map_node() {}
+
+    QString name() const
+    {
+	return QString("Map");
+    }
+
+    QIcon icon() const
+    {
+	return QIcon(":/images/map.png");
+    }
+
+private:
+    boost::shared_ptr<mapnik::Map> map_;
+};
+
+StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
+    : QAbstractItemModel(parent),
+      root_(new node(map_node(map)))
+{
+    typedef std::map<std::string,mapnik::feature_type_style> style_type;
+    style_type const & styles = map->styles();
+    style_type::const_iterator itr = styles.begin();
+    style_type::const_iterator end = styles.end();
+    for (; itr != end; ++itr)
+    {
+	node * style_n = root_->add_child(new node(style_node(QString(itr->first.c_str()),itr->second),root_.get()));
+	mapnik::rules const& rules = itr->second.get_rules();
+	mapnik::rules::const_iterator itr2 = rules.begin();
+	for ( ; itr2 != rules.end();++itr2)
+	{
+	    node* rule_n = style_n->add_child(new node(rule_node(QString("Rule"),*itr2),style_n));
+	    mapnik::rule_type::symbolizers::const_iterator itr3 = (*itr2).begin();
+	    for ( ; itr3 !=itr2->end();++itr3)
 	    {
-            QImage image(symbol->getBytes(),
-	    symbol->width(),symbol->height(),QImage::Format_ARGB32);
-            QPixmap pix = QPixmap::fromImage(image.rgbSwapped());
-            return QIcon(pix);
-         }
-	  */
-         return QIcon();
-      }
-      QIcon operator() (mapnik::line_symbolizer const& sym) const
-      {
-         QPixmap pix(48,16);
-         pix.fill();
-         QPainter painter(&pix);
-         mapnik::stroke const&  strk = sym.get_stroke();
-         mapnik::color const& col = strk.get_color();
-         QPen pen(QColor(col.red(),col.green(),col.blue(),col.alpha()));
-         pen.setWidth(strk.get_width());
-         painter.setPen(pen);
-         painter.drawLine(0,7,47,7);
-         //painter.drawLine(7,15,12,0);
-         //painter.drawLine(12,0,8,15);
-         return QIcon(pix);
-      }
-
-      template <typename T>
-      QIcon operator() (T const& ) const
-      {
-         return QIcon (":/images/filter.png");
-      }
-};
-
-class symbolizer_node
-{
-   public:
-      symbolizer_node(mapnik::symbolizer const & sym)
-         : sym_(sym) {}
-      ~symbolizer_node(){}
-
-      QString name() const
-      {
-         //return QString("Symbolizer:fixme");
-         return boost::apply_visitor(symbolizer_info(),sym_);
-      }
-
-      QIcon icon() const
-      {
-         return boost::apply_visitor(symbolizer_icon(),sym_);//QIcon(":/images/filter.png");
-      }
-      mapnik::symbolizer const& sym_;
-};
-
-class rule_node
-{
-   public:
-      rule_node(QString name,mapnik::rule_type const & r)
-         : name_(name),
-           rule_(r) {}
-      ~rule_node() {}
-      QString name() const
-      {
-         mapnik::expression_ptr filter = rule_.get_filter();
-
-         return QString("TODO!");//filter->to_string().c_str());
-      }
-
-      QIcon icon() const
-      {
-         return QIcon(":/images/filter.png");
-      }
-
-   private:
-      QString name_;
-      mapnik::rule_type const& rule_;
-};
-
-class style_node
-{
-   public:
-      style_node(QString name, mapnik::feature_type_style const& style)
-         : name_(name),
-           style_(style) {}
-
-      ~style_node() {}
-
-      QString name() const
-      {
-         return name_;
-      }
-
-      QIcon icon() const
-      {
-         return QIcon(":/images/style.png");
-      }
-
-   private:
-      QString name_;
-      mapnik::feature_type_style const& style_;
-};
-
-class map_node
-{
-   public:
-      explicit map_node(boost::shared_ptr<mapnik::Map> map)
-         : map_(map)  {}
-      ~map_node() {}
-
-      QString name() const
-      {
-         return QString("Map");
-      }
-
-      QIcon icon() const
-      {
-         return QIcon(":/images/map.png");
-      }
-
-   private:
-      boost::shared_ptr<mapnik::Map> map_;
-};
-
-StyleModel::StyleModel(boost::shared_ptr<mapnik::Map> map, QObject * parent)
-   : QAbstractItemModel(parent),
-     root_(new node(map_node(map)))
-{
-   typedef std::map<std::string,mapnik::feature_type_style> style_type;
-   style_type const & styles = map->styles();
-   style_type::const_iterator itr = styles.begin();
-   style_type::const_iterator end = styles.end();
-   for (; itr != end; ++itr)
-   {
-      node * style_n = root_->add_child(new node(style_node(QString(itr->first.c_str()),itr->second),root_.get()));
-      mapnik::rules const& rules = itr->second.get_rules();
-      mapnik::rules::const_iterator itr2 = rules.begin();
-      for ( ; itr2 != rules.end();++itr2)
-      {
-         node* rule_n = style_n->add_child(new node(rule_node(QString("Rule"),*itr2),style_n));
-         mapnik::rule_type::symbolizers::const_iterator itr3 = (*itr2).begin();
-         for ( ; itr3 !=itr2->end();++itr3)
-         {
-            rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
-         }
-      }
-   }
+		rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
+	    }
+	}
+    }
 }

 StyleModel::~StyleModel() {}
@@ -338,64 +338,64 @@
 QModelIndex StyleModel::index (int row, int col, QModelIndex const& parent) const
 {
 //   qDebug("index() row=%d col=%d parent::internalId() = %lld", row,col,parent.internalId());
-   node * parent_node;
+    node * parent_node;

-   if (!parent.isValid())
-      parent_node = root_.get();
-   else
-      parent_node = static_cast<node*>(parent.internalPointer());
+    if (!parent.isValid())
+	parent_node = root_.get();
+    else
+	parent_node = static_cast<node*>(parent.internalPointer());

-   node * child_node = parent_node->child(row);
-   if (child_node)
-      return createIndex(row,col,child_node);
-   else
-      return QModelIndex();
+    node * child_node = parent_node->child(row);
+    if (child_node)
+	return createIndex(row,col,child_node);
+    else
+	return QModelIndex();
 }

 QModelIndex StyleModel::parent (QModelIndex const& index) const
 {
-   node * child_node = static_cast<node*>(index.internalPointer());
-   node * parent_node = child_node->parent();
-   if (parent_node == root_.get())
-      return QModelIndex();
+    node * child_node = static_cast<node*>(index.internalPointer());
+    node * parent_node = child_node->parent();
+    if (parent_node == root_.get())
+	return QModelIndex();

-   return createIndex(parent_node->row(),0,parent_node);
+    return createIndex(parent_node->row(),0,parent_node);
 }

 int StyleModel::rowCount(QModelIndex const& parent) const
 {
-   //qDebug("rowCount");
-   node * parent_node;
-   if (parent.column() > 0) return 0;
-   if (!parent.isValid())
-      parent_node = root_.get();
-   else
-      parent_node = static_cast<node*>(parent.internalPointer());
-   return parent_node->num_children();
+    //qDebug("rowCount");
+    node * parent_node;
+    if (parent.column() > 0) return 0;
+    if (!parent.isValid())
+	parent_node = root_.get();
+    else
+	parent_node = static_cast<node*>(parent.internalPointer());
+    return parent_node->num_children();
 }

 int StyleModel::columnCount( QModelIndex const&) const
 {
-   return 1;
+    return 1;
 }

 QVariant StyleModel::data(const QModelIndex & index, int role) const
 {
-   //qDebug("data index::internalId() = %lld", index.internalId());
-   if (!index.isValid())
-      return QVariant();
-   node * cur_node = static_cast<node*>(index.internalPointer());
-   if (cur_node)
-   {
-      if (role == Qt::DisplayRole)
-      {
+    //qDebug("data index::internalId() = %lld", index.internalId());
+    if (!index.isValid())
+	return QVariant();
+    node * cur_node = static_cast<node*>(index.internalPointer());
+    if (cur_node)
+    {
+	if (role == Qt::DisplayRole)
+	{

-         return QVariant(cur_node->name());
-      }
-      else if ( role == Qt::DecorationRole)
-      {
-         return cur_node->icon();
-      }
-   }
-   return QVariant();
-}
+	    return QVariant(cur_node->name());
+	}
+	else if ( role == Qt::DecorationRole)
+	{
+	    return cur_node->icon();
+	}
+    }
+    return QVariant();
+}


Bug [#1420]. CoffeeScript: Drop code that doesn't apply to CoffeeScript

Drop obsolete code that was copied from LexCPP but that is not relevant
or even valid for CoffeeScript.

Closes #1420.

--- lexers/LexCoffeeScript.cxx
+++ lexers/LexCoffeeScript.cxx
@@ -31,11 +31,8 @@
 #endif

 static bool IsSpaceEquiv(int state) {
-	return (state <= SCE_COFFEESCRIPT_COMMENTDOC
-	    // including SCE_COFFEESCRIPT_DEFAULT, SCE_COFFEESCRIPT_COMMENT, SCE_COFFEESCRIPT_COMMENTLINE
-	    || state == SCE_COFFEESCRIPT_COMMENTLINEDOC
-	    || state == SCE_COFFEESCRIPT_COMMENTDOCKEYWORD
-	    || state == SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR
+	return (state == SCE_COFFEESCRIPT_DEFAULT
+	    || state == SCE_COFFEESCRIPT_COMMENTLINE
 	    || state == SCE_COFFEESCRIPT_COMMENTBLOCK
 	    || state == SCE_COFFEESCRIPT_VERBOSE_REGEX
 	    || state == SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT
@@ -88,51 +85,16 @@

 	WordList &keywords = *keywordlists[0];
 	WordList &keywords2 = *keywordlists[1];
-	WordList &keywords3 = *keywordlists[2];
 	WordList &keywords4 = *keywordlists[3];
-
-	// property styling.within.preprocessor
-	//	For C++ code, determines whether all preprocessor code is styled in the preprocessor style (0, the default)
-	//	or only from the initial # to the end of the command word(1).
-	bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0;

 	CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-");
 	CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-");

-	CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]");
-
-	CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true);
-	CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true);
-
-	// property lexer.cpp.allow.dollars
-	//	Set to 0 to disallow the '$' character in identifiers with the cpp lexer.
-	if (styler.GetPropertyInt("lexer.cpp.allow.dollars", 1) != 0) {
-		setWordStart.Add('$');
-		setWord.Add('$');
-	}
+	CharacterSet setWordStart(CharacterSet::setAlpha, "_$@", 0x80, true);
+	CharacterSet setWord(CharacterSet::setAlphaNum, "._$", 0x80, true);

 	int chPrevNonWhite = ' ';
 	int visibleChars = 0;
-	bool lastWordWasUUID = false;
-	int styleBeforeDCKeyword = SCE_COFFEESCRIPT_DEFAULT;
-	bool continuationLine = false;
-	bool isIncludePreprocessor = false;
-
-	if (initStyle == SCE_COFFEESCRIPT_PREPROCESSOR) {
-		// Set continuationLine if last character of previous line is '\'
-		int lineCurrent = styler.GetLine(startPos);
-		if (lineCurrent > 0) {
-			int chBack = styler.SafeGetCharAt(startPos-1, 0);
-			int chBack2 = styler.SafeGetCharAt(startPos-2, 0);
-			int lineEndChar = '!';
-			if (chBack2 == '\r' && chBack == '\n') {
-				lineEndChar = styler.SafeGetCharAt(startPos-3, 0);
-			} else if (chBack == '\n' || chBack == '\r') {
-				lineEndChar = chBack2;
-			}
-			continuationLine = lineEndChar == '\\';
-		}
-	}

 	// look back to set chPrevNonWhite properly for better regex colouring
 	int endPos = startPos + length;
@@ -161,20 +123,6 @@
 			// Reset states to beginning of colourise so no surprises
 			// if different sets of lines lexed.
 			visibleChars = 0;
-			lastWordWasUUID = false;
-			isIncludePreprocessor = false;
-		}
-
-		// Handle line continuation generically.
-		if (sc.ch == '\\') {
-			if (sc.chNext == '\n' || sc.chNext == '\r') {
-				sc.Forward();
-				if (sc.ch == '\r' && sc.chNext == '\n') {
-					sc.Forward();
-				}
-				continuationLine = true;
-				continue;
-			}
 		}

 		// Determine if the current state should terminate.
@@ -193,7 +141,6 @@
 					char s[1000];
 					sc.GetCurrent(s, sizeof(s));
 					if (keywords.InList(s)) {
-						lastWordWasUUID = strcmp(s, "uuid") == 0;
 						sc.ChangeState(SCE_COFFEESCRIPT_WORD);
 					} else if (keywords2.InList(s)) {
 						sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
@@ -210,74 +157,13 @@
 					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
 				}
 				break;
-			case SCE_COFFEESCRIPT_PREPROCESSOR:
-				if (sc.atLineStart && !continuationLine) {
-					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
-				} else if (stylingWithinPreprocessor) {
-					if (IsASpace(sc.ch)) {
-						sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
-					}
-				} else {
-					if (sc.Match('/', '*') || sc.Match('/', '/')) {
-						sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
-					}
-				}
-				break;
-			case SCE_COFFEESCRIPT_COMMENT:
-				if (sc.Match('*', '/')) {
-					sc.Forward();
-					sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
-				}
-				break;
-			case SCE_COFFEESCRIPT_COMMENTDOC:
-				if (sc.Match('*', '/')) {
-					sc.Forward();
-					sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
-				} else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
-					// Verify that we have the conditions to mark a comment-doc-keyword
-					if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) {
-						styleBeforeDCKeyword = SCE_COFFEESCRIPT_COMMENTDOC;
-						sc.SetState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORD);
-					}
-				}
-				break;
 			case SCE_COFFEESCRIPT_COMMENTLINE:
 				if (sc.atLineStart) {
 					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
 				}
 				break;
-			case SCE_COFFEESCRIPT_COMMENTLINEDOC:
-				if (sc.atLineStart) {
-					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
-				} else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support
-					// Verify that we have the conditions to mark a comment-doc-keyword
-					if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) {
-						styleBeforeDCKeyword = SCE_COFFEESCRIPT_COMMENTLINEDOC;
-						sc.SetState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORD);
-					}
-				}
-				break;
-			case SCE_COFFEESCRIPT_COMMENTDOCKEYWORD:
-				if ((styleBeforeDCKeyword == SCE_COFFEESCRIPT_COMMENTDOC) && sc.Match('*', '/')) {
-					sc.ChangeState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR);
-					sc.Forward();
-					sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
-				} else if (!setDoxygen.Contains(sc.ch)) {
-					char s[100];
-					sc.GetCurrent(s, sizeof(s));
-					if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) {
-						sc.ChangeState(SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR);
-					}
-					sc.SetState(styleBeforeDCKeyword);
-				}
-				break;
 			case SCE_COFFEESCRIPT_STRING:
-				if (isIncludePreprocessor) {
-					if (sc.ch == '>') {
-						sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
-						isIncludePreprocessor = false;
-					}
-				} else if (sc.ch == '\\') {
+				if (sc.ch == '\\') {
 					if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
 						sc.Forward();
 					}
@@ -314,20 +200,6 @@
 					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
 				}
 				break;
-			case SCE_COFFEESCRIPT_VERBATIM:
-				if (sc.ch == '\"') {
-					if (sc.chNext == '\"') {
-						sc.Forward();
-					} else {
-						sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT);
-					}
-				}
-				break;
-			case SCE_COFFEESCRIPT_UUID:
-				if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') {
-					sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
-				}
-				break;
 			case SCE_COFFEESCRIPT_COMMENTBLOCK:
 				if (sc.Match("###")) {
 					sc.Forward();
@@ -357,30 +229,10 @@

 		// Determine if a new state should be entered.
 		if (sc.state == SCE_COFFEESCRIPT_DEFAULT) {
-			if (sc.Match('@', '\"')) {
-				sc.SetState(SCE_COFFEESCRIPT_VERBATIM);
-				sc.Forward();
-			} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
-				if (lastWordWasUUID) {
-					sc.SetState(SCE_COFFEESCRIPT_UUID);
-					lastWordWasUUID = false;
-				} else {
-					sc.SetState(SCE_COFFEESCRIPT_NUMBER);
-				}
-			} else if (setWordStart.Contains(sc.ch) || (sc.ch == '@') || (sc.ch == '$')) {
-				if (lastWordWasUUID) {
-					sc.SetState(SCE_COFFEESCRIPT_UUID);
-					lastWordWasUUID = false;
-				} else {
-					sc.SetState(SCE_COFFEESCRIPT_IDENTIFIER);
-				}
-			} else if (sc.Match('/', '*')) {
-				if (sc.Match("/**") || sc.Match("/*!")) {	// Support of Qt/Doxygen doc. style
-					sc.SetState(SCE_COFFEESCRIPT_COMMENTDOC);
-				} else {
-					sc.SetState(SCE_COFFEESCRIPT_COMMENT);
-				}
-				sc.Forward();	// Eat the * so it isn't used for the end of the comment
+			if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
+				sc.SetState(SCE_COFFEESCRIPT_NUMBER);
+			} else if (setWordStart.Contains(sc.ch)) {
+				sc.SetState(SCE_COFFEESCRIPT_IDENTIFIER);
 			} else if (sc.Match("///")) {
 				sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX);
 				sc.Forward();
@@ -393,9 +245,6 @@
 				sc.SetState(SCE_COFFEESCRIPT_REGEX);	// JavaScript's RegEx
 			} else if (sc.ch == '\"') {
 				sc.SetState(SCE_COFFEESCRIPT_STRING);
-				isIncludePreprocessor = false;	// ensure that '>' won't end the string
-			} else if (isIncludePreprocessor && sc.ch == '<') {
-				sc.SetState(SCE_COFFEESCRIPT_STRING);
 			} else if (sc.ch == '\'') {
 				sc.SetState(SCE_COFFEESCRIPT_CHARACTER);
 			} else if (sc.ch == '#') {
@@ -403,7 +252,6 @@
 					sc.SetState(SCE_COFFEESCRIPT_COMMENTBLOCK);
 					sc.Forward();
 					sc.Forward();
-
 				} else {
 					sc.SetState(SCE_COFFEESCRIPT_COMMENTLINE);
 				}
@@ -416,7 +264,6 @@
 			chPrevNonWhite = sc.ch;
 			visibleChars++;
 		}
-		continuationLine = false;
 	}
 	sc.Complete();
 }
@@ -427,10 +274,6 @@
 	for (int i = pos; i < eol_pos; i++) {
 		char ch = styler[i];
 		if (ch == '#')
-			return true;
-        else if (ch == '/'
-                 && i < eol_pos - 1
-                 && styler[i + 1] == '*')
 			return true;
 		else if (ch != ' ' && ch != '\t')
 			return false;


add odometry subscriber

add odometry subscriber

--- tinkerforge_laser_transform/src/laser_transform_node.cpp
+++ tinkerforge_laser_transform/src/laser_transform_node.cpp
@@ -3,6 +3,7 @@
 #include "sensor_msgs/PointCloud2.h"
 #include "sensor_msgs/NavSatFix.h"
 #include "sensor_msgs/Imu.h"
+#include "nav_msgs/Odometry.h"
 #include "laser_transform_core.h"

 using std::string;
@@ -20,6 +21,7 @@
   string pcl_out_topic;
   string imu_topic;
   string gps_topic;
+  //string odo_topic;

   // Create a new LaserTransformer object.
   LaserTransform *node_lt = new LaserTransform();
@@ -38,6 +40,9 @@

   // Create a subscriber
   ros::Subscriber sub_message = n.subscribe(pcl_in_topic.c_str(), 1000, &LaserTransform::messageCallback, node_lt);
+
+  // Create odometry subscriber
+  ros::Subscriber sub_odometry = n.subscribe("/odometry/filtered", 50, &LaserTransform::odometryCallback, node_lt);

   // Create a publisher and name the topic
   ros::Publisher pub_message = n.advertise<sensor_msgs::PointCloud2>(pcl_out_topic.c_str(), 50);


Use std::thread for userevents_multithreaded test (#824)

The genericThread abstraction is not necessary now that C++11 is
required.

--- test_conformance/events/test_userevents_multithreaded.cpp
+++ test_conformance/events/test_userevents_multithreaded.cpp
@@ -16,28 +16,19 @@
 #include "testBase.h"
 #include "action_classes.h"
 #include "harness/conversions.h"
-#include "harness/genericThread.h"
+
+#include <thread>

 #if !defined (_MSC_VER)
     #include <unistd.h>
 #endif // !_MSC_VER

-class releaseEvent_thread : public genericThread
+void trigger_user_event(cl_event *event)
 {
-    public:
-        releaseEvent_thread( cl_event *event ) : mEvent( event ) {}
-
-        cl_event * mEvent;
-
-    protected:
-        virtual void *    IRun( void )
-        {
-            usleep( 1000000 );
-            log_info( "\tTriggering gate from separate thread...\n" );
-            clSetUserEventStatus( *mEvent, CL_COMPLETE );
-            return NULL;
-        }
-};
+    usleep(1000000);
+    log_info("\tTriggering gate from separate thread...\n");
+    clSetUserEventStatus(*event, CL_COMPLETE);
+}

 int test_userevents_multithreaded( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
 {
@@ -66,14 +57,14 @@
     }

     // Now, instead of releasing the gate, we spawn a separate thread to do so
-    releaseEvent_thread thread( &gateEvent );
     log_info( "\tStarting trigger thread...\n" );
-    thread.Start();
+    std::thread thread(trigger_user_event, &gateEvent);

     log_info( "\tWaiting for actions...\n" );
     error = clWaitForEvents( 3, &actionEvents[ 0 ] );
     test_error( error, "Unable to wait for action events" );

+    thread.join();
     log_info( "\tActions completed.\n" );

     // If we got here without error, we're good


utilities: Minor

utilities: Minor

--- poseidon/src/utilities.hpp
+++ poseidon/src/utilities.hpp
@@ -96,6 +96,7 @@
       {
         typename ::std::decay<FuncT>::type m_func;

+        explicit
         Concrete_Timer(int64_t next, int64_t period, FuncT&& func)
           : Abstract_Timer(next, period),
             m_func(::std::forward<FuncT>(func))
@@ -109,7 +110,7 @@

     // Allocate an abstract timer and insert it.
     auto timer = ::rocket::make_unique<Concrete_Timer>(next, period,
-                                                       ::std::forward<FuncT>(func));
+                                           ::std::forward<FuncT>(func));
     return Timer_Driver::insert(::std::move(timer));
   }


Fix compilation err for x86-64

Fix compilation err for x86-64

--- cpu/init.cc
+++ cpu/init.cc
@@ -419,7 +419,7 @@
   BXRS_PARAM_SIMPLE(R12);
   BXRS_PARAM_SIMPLE(R13);
   BXRS_PARAM_SIMPLE(R14);
-  BXRS_PARAM_SIMPLE(R15;
+  BXRS_PARAM_SIMPLE(R15);
   BXRS_PARAM_SIMPLE(RIP);
 #else
   BXRS_PARAM_SIMPLE(EAX);


[assembler.multiscale.coupling]

[assembler.multiscale.coupling]

--- dune/detailed/discretizations/assembler/multiscale/coupling.hh
+++ dune/detailed/discretizations/assembler/multiscale/coupling.hh
@@ -216,7 +216,6 @@
         const IntersectionType& intersection = *interectionIt;
         assert(intersection.neighbor() && !intersection.boundary());
         // call the local assembler
-        // assemble local matrices
         for (unsigned int ii = 0; ii < localMatrixAssemblers_.size(); ++ii)
           localMatrixAssemblers_[ii]->apply(intersection,
                                             innerAnsatzSpace_,


Comments

Comments

--- earth_enterprise/src/fusion/autoingest/sysman/StateUpdater.cpp
+++ earth_enterprise/src/fusion/autoingest/sysman/StateUpdater.cpp
@@ -114,6 +114,8 @@
     VertexMap & vertices,
     size_t & index,
     list<TreeType::vertex_descriptor> & toFillIn) {
+  // TODO: see if there's a way to do this that doesn't require
+  // making the asset mutable.
   MutableAssetVersionD version(tree[myVertex].name);
   tree[myVertex].state = version->state;
   vector<SharedString> dependents;


Leave grid size to default (50x50)

Leave grid size to default (50x50)

--- game_of_life_main/main.cpp
+++ game_of_life_main/main.cpp
@@ -4,7 +4,7 @@

 int main()
 {
-	auto model = std::make_shared<Model>(58,58);
+	auto model = std::make_shared<Model>();
 	auto view = std::make_unique<View>(model);
 	auto controller = Controller::Create(model, std::move(view));


fixed counting hidden controls when calculating total scrollable width and height

--- gameplay/src/Container.cpp
+++ gameplay/src/Container.cpp
@@ -1097,6 +1097,9 @@
     {
         Control* control = _controls[i];

+        if (!control->isVisible())
+            continue;
+
         const Rectangle& bounds = control->getBounds();
         const Theme::Margin& margin = control->getMargin();


Handle another case exposed on X86.

Handle another case exposed on X86.

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

--- lib/CodeGen/VirtRegMap.cpp
+++ lib/CodeGen/VirtRegMap.cpp
@@ -274,6 +274,10 @@
   /// specified physreg.  If CanClobber is true, the physreg can be modified at
   /// any time without changing the semantics of the program.
   void addAvailable(int Slot, unsigned Reg, bool CanClobber = true) {
+    // If this stack slot is thought to be available in some other physreg,
+    // remove its record.
+    ModifyStackSlot(Slot);
+
     PhysRegsAvailable.insert(std::make_pair(Reg, Slot));
     SpillSlotsAvailable[Slot] = (Reg << 1) | CanClobber;


Add one more histogram to SDCH decoder

Add one more histogram to SDCH decoder

r=mbelshe
Review URL: http://codereview.chromium.org/19542

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

Former-commit-id: c7b04d8040be85aa3ca4a9865ebfc9bda174bc52

--- net/base/sdch_filter.cc
+++ net/base/sdch_filter.cc
@@ -61,11 +61,16 @@
                                     read_times_.back() - read_times_[0],
                                     base::TimeDelta::FromMilliseconds(20),
                                     base::TimeDelta::FromMinutes(10), 100);
-        if (read_times_.size() > 3)
+        if (read_times_.size() > 3) {
           UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_3rd_To_4th",
                                       read_times_[3] - read_times_[2],
                                       base::TimeDelta::FromMilliseconds(10),
                                       base::TimeDelta::FromSeconds(3), 100);
+          UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_2nd_To_3rd",
+                                      read_times_[2] - read_times_[1],
+                                      base::TimeDelta::FromMilliseconds(10),
+                                      base::TimeDelta::FromSeconds(3), 100);
+        }
         UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Decode_Reads",
                                  read_times_.size());
         UMA_HISTOGRAM_COUNTS(L"Sdch.Network_Decode_Bytes_Read", output_bytes_);
@@ -78,11 +83,16 @@
                                     read_times_.back() - read_times_[0],
                                     base::TimeDelta::FromMilliseconds(20),
                                     base::TimeDelta::FromMinutes(10), 100);
-        if (read_times_.size() > 3)
+        if (read_times_.size() > 3) {
           UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_3rd_To_4th",
                                       read_times_[3] - read_times_[2],
                                       base::TimeDelta::FromMilliseconds(10),
                                       base::TimeDelta::FromSeconds(3), 100);
+          UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_2nd_To_3rd",
+                                      read_times_[2] - read_times_[1],
+                                      base::TimeDelta::FromMilliseconds(10),
+                                      base::TimeDelta::FromSeconds(3), 100);
+        }
         UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Pass-through_Reads",
                                  read_times_.size());
       }


Shorten configuration variable to CVMFS_FUSE_NOTIFY_INVALIDATION

--- cvmfs/cvmfs.cc
+++ cvmfs/cvmfs.cc
@@ -1817,7 +1817,7 @@

   bool use_fuse_notify_invalidation = true;
   std::string buf;
-  if (cvmfs::options_mgr_->GetValue("CVMFS_USE_FUSE_NOTIFY_INVALIDATION",
+  if (cvmfs::options_mgr_->GetValue("CVMFS_FUSE_NOTIFY_INVALIDATION",
                                     &buf)) {
     if (buf == "false") {
       use_fuse_notify_invalidation = false;


Enabled UDP broadcasting for POSIX

Enabled UDP broadcasting for POSIX

--- source/UDP.cpp
+++ source/UDP.cpp
@@ -161,12 +161,8 @@
 	int targetLength = ( int )sizeof( target );
 	memset( &target, 0, sizeof( target ) );

-#ifdef __WIN_API__
-	target.sin_family = AF_INET;
-	target.sin_addr.s_addr = INADDR_BROADCAST;
-#elif defined( __POSIX__ )
-    //memcpy( &target.sin_addr.s_addr, &targetInfo.address.protocolV4[0], sizeof( target.sin_addr.s_addr ) );
-#endif
+    target.sin_family = AF_INET;
+    target.sin_addr.s_addr = INADDR_BROADCAST;

 	target.sin_port = ( uint16_t )Endian::HostToNetworkUnsigned( port, sizeof( port ) );


Add a few compile-asserts for new text input types that were added.

Review URL: https://chromiumcodereview.appspot.com/11369160

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

--- content/renderer/render_widget.cc
+++ content/renderer/render_widget.cc
@@ -1829,6 +1829,10 @@
                int(ui::TEXT_INPUT_TYPE_TIME), mismatching_enum);
 COMPILE_ASSERT(int(WebKit::WebTextInputTypeWeek) == \
                int(ui::TEXT_INPUT_TYPE_WEEK), mismatching_enum);
+COMPILE_ASSERT(int(WebKit::WebTextInputTypeTextArea) == \
+               int(ui::TEXT_INPUT_TYPE_TEXT_AREA), mismatching_enums);
+COMPILE_ASSERT(int(WebKit::WebTextInputTypeContentEditable) == \
+               int(ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE), mismatching_enums);

 ui::TextInputType RenderWidget::WebKitToUiTextInputType(
     WebKit::WebTextInputType type) {


[FIXED] translation of seahorn.fail

[FIXED] translation of seahorn.fail

--- lib/CrabLlvm/CfgBuilder.cc
+++ lib/CrabLlvm/CfgBuilder.cc
@@ -457,11 +457,14 @@
             F->getName().equals("__CRAB_assert"));
   }

+
+  static bool isSeaHornFail (const Function* F) {
+    return (F->getName().equals("seahorn.fail"));
+  }
+
   static bool isErrorFn(const Function* F) {
     return (F->getName().equals("seahorn.error") ||
 	    F->getName().equals("verifier.error") ||
-	    F->getName().equals("verifier.fail") ||
-	    F->getName().equals("seahorn.fail") ||
 	    F->getName().equals("__VERIFIER_error") ||
             F->getName().equals("__SEAHORN_error"));
   }
@@ -476,7 +479,8 @@

   static bool isVerifierCall (const Function *F) {
     return (isAssertFn (F) || isErrorFn (F) ||
-	    isAssumeFn(F) || isNotAssumeFn (F));
+	    isAssumeFn(F) || isNotAssumeFn (F) ||
+	    isSeaHornFail (F));
   }

   static bool isZeroInitializer(const Function *F) {
@@ -944,6 +948,7 @@
     basic_block_t& m_bb;
     const bool m_is_inter_proc;
     unsigned int m_object_id;
+    bool m_has_seahorn_fail;

     typedef typename HeapAbstraction::region_t region_t;
     typedef typename HeapAbstraction::region_set_t region_set_t;
@@ -1353,6 +1358,16 @@
         return;
       }

+      if (isSeaHornFail(callee)) {
+	// when seahorn inserts a call to "seahorn.fail" means that
+	// the program is safe iff the function cannot return.  Note
+	// that we cannot add "assert(false)" in the current
+	// block. Instead, we need to check whether the exit block of
+	// the function is reachable or not.
+	m_has_seahorn_fail = true;
+	return;
+      }
+
       if (!isAssertFn(callee) && !isAssumeFn(callee) && !isNotAssumeFn(callee))
 	return;

@@ -1417,7 +1432,12 @@
 	m_dl(dl), m_tli(tli),
 	m_bb(bb),
 	m_is_inter_proc (isInterProc),
-	m_object_id (0) {}
+	m_object_id (0),
+	m_has_seahorn_fail (false) {}
+
+    bool has_seahorn_fail() const { return m_has_seahorn_fail;}
+
+  public:

     /// skip PHI nodes (processed elsewhere)
     void visitPHINode (PHINode &I) {}
@@ -1989,7 +2009,7 @@
     }

     void visitReturnInst (ReturnInst &I) {
-      // translated elsewhere
+      // translated elsewhere
     }

     void visitCallInst (CallInst &I) {
@@ -2354,7 +2374,7 @@
     basic_block_t *ret_block = nullptr;
     boost::optional<typed_variable_t> ret_val;

-
+    bool has_seahorn_fail = false;
     // execBr can add new BasicBlock's in m_func and we do not want to
     // iterate over them.
     for (BasicBlock* B : blocks) {
@@ -2364,7 +2384,9 @@
       // -- build a CFG block ignoring branches, phi-nodes, and return
       CrabInstVisitor v (lfac, m_mem, m_dl, m_tli, *BB, m_is_inter_proc);
       v.visit (*B);
-
+      // hook for seahorn
+      has_seahorn_fail |= (v.has_seahorn_fail() && m_func.getName().equals("main"));
+
       // -- process the exit block of the function and its returned value.
       if (ReturnInst *RI = dyn_cast<ReturnInst> (B->getTerminator ())) {
 	if (ret_block)
@@ -2373,6 +2395,10 @@
         basic_block_t &bb = *BB;
         ret_block = &bb;
 	m_cfg->set_exit(ret_block->label());
+
+	if (has_seahorn_fail) {
+	  ret_block->assertion(CST_FALSE, getDebugLoc(RI));
+	}

 	if (m_is_inter_proc) {
 	  if (Value * RV = RI->getReturnValue()) {


improve: improve swAio_handler_gethostbyname (#3297)

* improve: improve swAio_handler_gethostbyname

* delete: delete useless code

swAio_event::flags is sock_domain

--- src/os/base.cc
+++ src/os/base.cc
@@ -506,21 +506,15 @@

 void swAio_handler_gethostbyname(swAio_event *event)
 {
-    struct in_addr addr_v4;
-    struct in6_addr addr_v6;
+    char addr[SW_IP_MAX_LENGTH];
     int ret;

 #ifndef HAVE_GETHOSTBYNAME2_R
     SwooleG.lock.lock(&SwooleG.lock);
 #endif
-    if (event->flags == AF_INET6)
-    {
-        ret = swoole_gethostbyname(AF_INET6, (char*) event->buf, (char *) &addr_v6);
-    }
-    else
-    {
-        ret = swoole_gethostbyname(AF_INET, (char*) event->buf, (char *) &addr_v4);
-    }
+
+    ret = swoole_gethostbyname(event->flags, (char*) event->buf, addr);
+
     bzero(event->buf, event->nbytes);
 #ifndef HAVE_GETHOSTBYNAME2_R
     SwooleG.lock.unlock(&SwooleG.lock);
@@ -532,8 +526,7 @@
     }
     else
     {
-        if (inet_ntop(event->flags == AF_INET6 ? AF_INET6 : AF_INET,
-                event->flags == AF_INET6 ? (void *) &addr_v6 : (void *) &addr_v4, (char*) event->buf, event->nbytes) == NULL)
+        if (inet_ntop(event->flags, addr, (char *) event->buf, event->nbytes) == NULL)
         {
             ret = -1;
             event->error = SW_ERROR_BAD_IPV6_ADDRESS;


osd: move to boot state if down OR wrong address in map

Saw an OSD that was up in the map, but the address didn't match.  Caused
all kinds of strange behavior.  I'm not sure what I had in mind when the
original test only checked for down AND same address before moving to boot
state, since having the wrong address is clearly bad news.

Signed-off-by: Sage Weil <6dd34506bbd5e58221bbb3e4732d97c91f02277b@newdream.net>

--- src/osd/OSD.cc
+++ src/osd/OSD.cc
@@ -2526,8 +2526,9 @@
   if (osdmap->get_epoch() > 0 &&
       state != STATE_BOOTING &&
       (!osdmap->exists(whoami) ||
-       (!osdmap->is_up(whoami) && osdmap->get_addr(whoami) == client_messenger->get_myaddr()))) {
-    dout(0) << "map says i am down.  switching to boot state." << dendl;
+       !osdmap->is_up(whoami) ||
+       osdmap->get_addr(whoami) != client_messenger->get_myaddr())) {
+    dout(0) << "map says i am down or have a different address.  switching to boot state." << dendl;
     //shutdown();

     stringstream ss;


Qt >= 5.3 has reverted to the 4.x handling of double click events. Undoes change set [6b9cc8].

--- qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -310,17 +310,11 @@
 	emit buttonReleased(event);
 }

-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
 void ScintillaEditBase::mouseDoubleClickEvent(QMouseEvent *event)
 {
 	// Scintilla does its own double-click detection.
 	mousePressEvent(event);
 }
-#else
-void ScintillaEditBase::mouseDoubleClickEvent(QMouseEvent *)
-{
-}
-#endif

 void ScintillaEditBase::mouseMoveEvent(QMouseEvent *event)
 {


material's layer count save/load

material's layer count save/load

--- src/renderer/material.cpp
+++ src/renderer/material.cpp
@@ -120,6 +120,7 @@

 	serializer.beginObject();
 	serializer.serialize("shader", m_shader ? m_shader->getPath() : Path(""));
+	if (m_layer_count != 1)serializer.serialize("layer_count", m_layer_count);
 	for (int i = 0; i < m_texture_count; ++i)
 	{
 		char path[MAX_PATH_LENGTH];
@@ -683,9 +684,13 @@
 				return false;
 			}
 		}
-		else if(compareString(label, "alpha_ref") == 0)
+		else if (compareString(label, "alpha_ref") == 0)
 		{
 			serializer.deserialize(m_alpha_ref, 0.3f);
+		}
+		else if (compareString(label, "layer_count") == 0)
+		{
+			serializer.deserialize(m_layer_count, 1);
 		}
 		else if (compareString(label, "color") == 0)
 		{


osd: fix ms_handle_reset

osd: fix ms_handle_reset

--- src/osd/OSD.cc
+++ src/osd/OSD.cc
@@ -1623,12 +1623,25 @@

   dout(0) << "OSD::ms_handle_reset() s=" << (void *)session << dendl;

+  map<ReplicatedPG::ObjectContext *, ceph_object_layout> obcs;
+
+  watch_lock.Lock();
+
   map<void *, ceph_object_layout>::iterator iter;
   for (iter = session->watches.begin(); iter != session->watches.end(); ++iter) {
     ReplicatedPG::ObjectContext *obc = (ReplicatedPG::ObjectContext *)iter->first;
+    obcs[obc] = iter->second;
+  }
+  watch_lock.Unlock();
+
+
+  map<ReplicatedPG::ObjectContext *, ceph_object_layout>::iterator oiter;
+  for (oiter = obcs.begin(); oiter != obcs.end(); ++oiter) {
+    ReplicatedPG::ObjectContext *obc = (ReplicatedPG::ObjectContext *)oiter->first;
     dout(0) << "obc=" << (void *)obc << dendl;

     obc->lock.Lock();
+    watch_lock.Lock();
     map<entity_name_t, Session *>::iterator witer;
     /* NOTE! fix this one, should be able to just lookup entity name,
        however, we currently only keep EntityName on the session and not
@@ -1643,9 +1656,10 @@
         break;
       ++witer;
     }
+    watch_lock.Unlock();
     obc->lock.Unlock();
     /* now drop a reference to that obc */
-    put_object_context(obc, iter->second);
+    put_object_context(obc, oiter->second);
   }

   return true;


make lock scope narrow

make lock scope narrow

--- src/resman/resman_impl.cc
+++ src/resman/resman_impl.cc
@@ -651,21 +651,24 @@
                              ::baidu::galaxy::proto::RemoveAgentResponse* response,
                              ::google::protobuf::Closure* done) {
     LOG(INFO) << "remove agent:" << request->endpoint();
-    MutexLock lock(&mu_);
-    if (agents_.find(request->endpoint()) == agents_.end()) {
-        response->mutable_error_code()->set_status(proto::kRemoveAgentFail);
-        response->mutable_error_code()->set_reason("agent not exist");
-        done->Run();
-        return;
-    }
-    agents_.erase(request->endpoint());
-    agent_stats_.erase(request->endpoint());
-    scheduler_->RemoveAgent(request->endpoint());
+    {
+        MutexLock lock(&mu_);
+        if (agents_.find(request->endpoint()) == agents_.end()) {
+            response->mutable_error_code()->set_status(proto::kRemoveAgentFail);
+            response->mutable_error_code()->set_reason("agent not exist");
+            done->Run();
+            return;
+        }
+    }
     bool remove_ok = RemoveObject(sAgentPrefix + "/" + request->endpoint());
     if (!remove_ok) {
         response->mutable_error_code()->set_status(proto::kRemoveAgentFail);
         response->mutable_error_code()->set_reason("fail to delete meta from nexus");
     } else {
+        MutexLock lock(&mu_);
+        agents_.erase(request->endpoint());
+        agent_stats_.erase(request->endpoint());
+        scheduler_->RemoveAgent(request->endpoint());
         response->mutable_error_code()->set_status(proto::kOk);
     }
     done->Run();
@@ -741,7 +744,6 @@
                            ::baidu::galaxy::proto::CreateTagResponse* response,
                            ::google::protobuf::Closure* done) {
     LOG(INFO) << "create tag:" << request->tag();
-    MutexLock lock(&mu_);
     const std::string& tag = request->tag();
     proto::TagMeta tag_meta;
     tag_meta.set_tag(tag);
@@ -757,6 +759,7 @@
         err->set_status(proto::kCreateTagFail);
         err->set_reason("fail to save tag to nexus");
     } else {
+        MutexLock lock(&mu_);
         std::set<std::string>& tag_old = tags_[tag];
         std::set<std::string>::iterator it_old = tag_old.begin();
         std::set<std::string>::iterator it_new = tag_new.begin();
@@ -848,12 +851,14 @@
                                 const ::baidu::galaxy::proto::AddAgentToPoolRequest* request,
                                 ::baidu::galaxy::proto::AddAgentToPoolResponse* response,
                                 ::google::protobuf::Closure* done) {
-    MutexLock lock(&mu_);
-    if (agents_.find(request->endpoint()) == agents_.end()) {
-        response->mutable_error_code()->set_status(proto::kAddAgentToPoolFail);
-        response->mutable_error_code()->set_reason("agent not exist");
-        done->Run();
-        return;
+    {
+        MutexLock lock(&mu_);
+        if (agents_.find(request->endpoint()) == agents_.end()) {
+            response->mutable_error_code()->set_status(proto::kAddAgentToPoolFail);
+            response->mutable_error_code()->set_reason("agent not exist");
+            done->Run();
+            return;
+        }
     }
     if (request->pool().empty()) {
         proto::ErrorCode* err = response->mutable_error_code();
@@ -871,6 +876,7 @@
         response->mutable_error_code()->set_status(proto::kAddAgentToPoolFail);
         response->mutable_error_code()->set_reason("fail to save agent meta to nexus");
     } else {
+        MutexLock lock(&mu_);
         agents_[endpoint].set_pool(pool);
         pools_[pool].erase(endpoint);
         scheduler_->SetPool(endpoint, pool);
@@ -927,21 +933,25 @@
                         const ::baidu::galaxy::proto::AddUserRequest* request,
                         ::baidu::galaxy::proto::AddUserResponse* response,
                         ::google::protobuf::Closure* done) {
-    MutexLock lock(&mu_);
     const std::string& user_name = request->user().user();
-    if (users_.find(user_name) != users_.end()) {
-        response->mutable_error_code()->set_status(proto::kAddUserFail);
-        response->mutable_error_code()->set_reason("user already exist");
-        done->Run();
-        return;
+    {
+        MutexLock lock(&mu_);
+        if (users_.find(user_name) != users_.end()) {
+            response->mutable_error_code()->set_status(proto::kAddUserFail);
+            response->mutable_error_code()->set_reason("user already exist");
+            done->Run();
+            return;
+        }
     }
     proto::UserMeta user_meta;
     user_meta.mutable_user()->CopyFrom(request->user());
+    LOG(INFO) << "add user: " << user_meta.DebugString();
     bool ret = SaveObject(sUserPrefix + "/" + user_name, user_meta);
     if (!ret) {
         response->mutable_error_code()->set_status(proto::kAddUserFail);
         response->mutable_error_code()->set_reason("fail to save user meta in nexus");
     } else {
+        MutexLock lock(&mu_);
         users_[user_name] = user_meta;
         response->mutable_error_code()->set_status(proto::kOk);
     }
@@ -952,19 +962,23 @@
                             const ::baidu::galaxy::proto::RemoveUserRequest* request,
                             ::baidu::galaxy::proto::RemoveUserResponse* response,
                             ::google::protobuf::Closure* done) {
-    MutexLock lock(&mu_);
     const std::string& user_name = request->user().user();
-    if (users_.find(user_name) == users_.end()) {
-        response->mutable_error_code()->set_status(proto::kRemoveUserFail);
-        response->mutable_error_code()->set_reason("user not exist");
-        done->Run();
-        return;
+    LOG(INFO) << "remove user: " << user_name;
+    {
+        MutexLock lock(&mu_);
+        if (users_.find(user_name) == users_.end()) {
+            response->mutable_error_code()->set_status(proto::kRemoveUserFail);
+            response->mutable_error_code()->set_reason("user not exist");
+            done->Run();
+            return;
+        }
     }
     bool ret = RemoveObject(sUserPrefix + "/" + user_name);
     if (!ret) {
         response->mutable_error_code()->set_status(proto::kRemoveUserFail);
         response->mutable_error_code()->set_reason("fail to delete user meta from nexus");
     } else {
+        MutexLock lock(&mu_);
         users_.erase(user_name);
         response->mutable_error_code()->set_status(proto::kOk);
     }


Update output.cpp

Update output.cpp

--- src/output.cpp
+++ src/output.cpp
@@ -1,8 +1,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
-#include "comm_struct.h"
-#include "comm_const.h"
+
+#include "common_struct.h"
+#include "common_constant.h"
 #include "version.h"

 extern int press_rate;
@@ -11,53 +12,55 @@
 extern int press_time;

 //如何使用本工具
-void usage(const char* tool_name)
+void usage( const char* tool_name )
 {
 	fprintf( stderr, "usage:  %s\n", tool_name );
 	fprintf( stderr, "        -r [or --rate] N                 [REQUIRED] specify the press rate (unit: query per second).\n" );
 	fprintf( stderr, "        -t [or --time] N                 [REQUIRED] test time (unit: second). \n" );
 	fprintf( stderr, "        -h [or --host] XXX.XXX.XXX.XXX   target host ip. The default host ip is 127.0.0.1 .\n" );
 	fprintf( stderr, "        -p [or --port] N                 port number. The default port number is 80.\n" );
-	fprintf( stderr, "        -u [or --uri ] /index.html       uri of the request.\n");
-	exit(1);
+	fprintf( stderr, "        -u [or --uri ] /index.html       uri of the request.\n" );
+	exit( 1 );
 }

 //打印读取的参数信息
-void print_info(void)
+void print_info( void )
 {
-	fprintf( stdout, "\n");
-	fprintf( stdout, "This is %s (last updated on %s), an HTTP benchmarking tool.\n", VERSION, LAST_UPDATE);
-	fprintf( stdout, "Copyright © 2014 %s. Email: %s\n\n", AUTHOR, CONTACT);
-	fprintf( stdout, "Test Information\n");
+	fprintf( stdout, "\n" );
+	fprintf( stdout, "This is %s (last updated on %s), an HTTP benchmarking tool.\n", VERSION, LAST_UPDATE );
+	fprintf( stdout, "Copyright © 2014 %s. Email: %s\n\n", AUTHOR, CONTACT );
+	fprintf( stdout, "Test Information\n" );
 	fprintf( stdout, "    Host       : %s\n", host.host_ip );
 	fprintf( stdout, "    Port       : %d\n", host.port );
-	fprintf( stdout, "    Uri        : %s\n", host.uri);
-	fprintf( stdout, "    Target QPS : %d\n", press_rate );
-	fprintf( stdout, "    Test Time  : %d\n", press_time);
-	fprintf( stdout, "\n");
+	fprintf( stdout, "    URI        : %s\n", host.uri );
+	fprintf( stdout, "    Target QPS : %-6d%-11s\n", press_rate, "[#/second]" );
+	fprintf( stdout, "    Test Time  : %-6d%-11s\n", press_time, "[second]" );
+	fprintf( stdout, "\n" );
 	return;
 }

-void check_setting(void)
+void check_setting( void )
 {
-	if(press_rate <= 0 || press_rate >= MAX_RATE){
-		fprintf(stderr, "The press rate is illegal. The request rate should be between 1 and %d QPS.\n", MAX_RATE);
-		exit(1);
+	if( press_rate <= 0 || press_rate > MAX_RATE )
+	{
+		fprintf( stderr, "The press rate is illegal. The request rate should be between 1 and %d RPS.\n", MAX_RATE );
+		exit( 1 );
 	}

-	if(press_time <= 0 || press_time > MAX_TIME){
-		fprintf(stderr, "The press time is too long! The test time should be between 1 and %d seconds.\n", MAX_TIME);
-		exit(1);
+	if( press_time <= 0 || press_time > MAX_TIME )
+	{
+		fprintf( stderr, "The press time is too long! The test time should be between 1 and %d seconds.\n", MAX_TIME );
+		exit( 1 );
 	}

 	return ;
 }

-void statistics_calculation(final_statistics *overall_stat, const request_data test_data[], const int press_number)
+void statistics_calculation( final_statistics *overall_stat, const request_data test_data[], const int press_number )
 {
-	unsigned int min_connect_time=UINT_MAX;
-	unsigned int max_connect_time=0;
-	double avg_connect_time=0.0;
+	unsigned int min_connect_time = UINT_MAX;
+	unsigned int max_connect_time = 0;
+	double avg_connect_time = 0.0;

 	unsigned int min_response_time = UINT_MAX;
 	unsigned int max_response_time = 0;
@@ -69,43 +72,52 @@

 	int connect_count = 0; //实时统计请求连接的成功数
 	int response_count = 0; //实时统计成功收到回复的连接数
-	for(int i=0; i<press_number; i++)
+	for( int i = 0; i < press_number; i++ )
 	{
-		if(test_data[i].is_connected){ //如果该请求连接成功
-			connect_count ++;
-			if(test_data[i].connect_time > max_connect_time){
+		if( test_data[i].is_connected == 1 )
+		{ //如果该请求连接成功
+			connect_count++;
+			if( test_data[i].connect_time > max_connect_time )
+			{
 				max_connect_time = test_data[i].connect_time;
 			}
-			if (test_data[i].connect_time < min_connect_time){
+			if ( test_data[i].connect_time < min_connect_time )
+			{
 				min_connect_time = test_data[i].connect_time;
 			}
-			avg_connect_time = 1.0*(connect_count-1)/connect_count*avg_connect_time + 1.0/connect_count*test_data[i].connect_time;
+			avg_connect_time = 1.0 * ( connect_count - 1 ) / connect_count * avg_connect_time + 1.0 / connect_count * test_data[i].connect_time;
 		}

-		if(test_data[i].is_replied && test_data[i].is_connected){ //如果该请求连接成功，发送出去后也成功收到回复
-			response_count ++;
+		if( test_data[i].is_replied == 1 && test_data[i].is_connected == 1 )
+		{ //如果该请求连接成功，发送出去后也成功收到回复
+			response_count++;
 			overall_stat->total_byte += test_data[i].byte_transfered;

 			int response_time_elapsed = test_data[i].recv_finish_time - test_data[i].start_send_time;
-			if(response_time_elapsed > max_response_time){
+			if( response_time_elapsed > max_response_time )
+			{
 				max_response_time = response_time_elapsed;
 			}
-			if(response_time_elapsed < min_response_time){
+			if( response_time_elapsed < min_response_time )
+			{
 				min_response_time = response_time_elapsed;
 			}
-			avg_response_time = 1.0*(response_count -1)/response_count*avg_response_time + 1.0/response_count*response_time_elapsed;
+			avg_response_time = 1.0 * ( response_count - 1 ) / response_count * avg_response_time + 1.0 / response_count * response_time_elapsed;

-			if(test_data[i].recv_finish_time > max_request_time){
+			if( test_data[i].recv_finish_time > max_request_time )
+			{
 				max_request_time = test_data[i].recv_finish_time;
 			}
-			if(test_data[i].recv_finish_time < min_request_time){
+			if( test_data[i].recv_finish_time < min_request_time )
+			{
 				min_request_time = test_data[i].recv_finish_time;
 			}
-			avg_request_time = 1.0*(response_count - 1)/response_count*avg_request_time + 1.0/response_count*test_data[i].recv_finish_time;
+			avg_request_time = 1.0 * ( response_count - 1 ) / response_count * avg_request_time + 1.0 / response_count * test_data[i].recv_finish_time;
 		}

-		if((!test_data[i].is_replied) && test_data[i].is_connected){
-			overall_stat->response_fail_count ++;
+		if( test_data[i].is_replied != 1 && test_data[i].is_connected == 1 )
+		{
+			overall_stat->response_fail_count++;
 		}
 	}

@@ -113,7 +125,7 @@
 	overall_stat->min_connect_time = min_connect_time;
 	overall_stat->max_connect_time = max_connect_time;

-	overall_stat->avg_response_time =(unsigned int)avg_response_time;
+	overall_stat->avg_response_time = (unsigned int)avg_response_time;
 	overall_stat->min_response_time = min_response_time;
 	overall_stat->max_response_time = max_response_time;

@@ -125,28 +137,29 @@

 	overall_stat->total_fail_count = overall_stat->response_fail_count + overall_stat->connect_fail_count;
 	overall_stat->total_request = press_number;
-	overall_stat->fail_percent = 1.0*overall_stat->total_fail_count / overall_stat->total_request;
+	overall_stat->fail_percent = 1.0 * overall_stat->total_fail_count / overall_stat->total_request;
 }

-void print_statistics(final_statistics *overall_stat)
+void print_statistics( final_statistics *overall_stat )
 {
-	fprintf(stdout, "    TCP Connect Fail Count:   %-9d%-8s\n", overall_stat->connect_fail_count, "[#]");
-	fprintf(stdout, "    HTTP Response Fail Count: %-9d%-8s\n", overall_stat->response_fail_count, "[#]");
-	fprintf(stdout, "    Overall Fail Count:       %-9d%-8s\n", overall_stat->total_fail_count, "[#]");
-	fprintf(stdout, "    Total Request Number:     %-9d%-8s\n", overall_stat->total_request, "[#]");
-	fprintf(stdout, "    Fail Percent:             %.3f%%\n", 100*(overall_stat->fail_percent));
-	fprintf(stdout, "    Total Bytes Transferred:  %-9lu%-8s\n", overall_stat->total_byte, "[Bytes]");
-	fprintf(stdout, "\n");
-	fprintf(stdout, "Request Time [unit: us]\n");
-	fprintf(stdout, "                             min         max         avg\n");
-	fprintf(stdout, "    TCP Connect Time:  %9u%12u%12u\n", overall_stat->min_connect_time,
-		overall_stat->max_connect_time, overall_stat->avg_connect_time);
+	fprintf( stdout, "    TCP Connect Fail Count:   %-9d%-8s\n", overall_stat->connect_fail_count, "[#]" );
+	fprintf( stdout, "    HTTP Response Fail Count: %-9d%-8s\n", overall_stat->response_fail_count, "[#]" );
+	fprintf( stdout, "    Overall Fail Count:       %-9d%-8s\n", overall_stat->total_fail_count, "[#]" );
+	fprintf( stdout, "    Total Request Number:     %-9d%-8s\n", overall_stat->total_request, "[#]" );
+	fprintf( stdout, "    Fail Percent:             %.3f%%\n", 100*(overall_stat->fail_percent) );
+	fprintf( stdout, "    Total Bytes Transferred:  %-9lu%-8s\n", overall_stat->total_byte, "[Bytes]" );
+	fprintf( stdout, "\n" );
+	fprintf( stdout, "Request Time [unit: us]\n" );
+	fprintf( stdout, "                             min         max         avg\n" );
+	fprintf( stdout, "    TCP Connect Time:  %9u%12u%12u\n", overall_stat->min_connect_time,
+		overall_stat->max_connect_time, overall_stat->avg_connect_time );

-	fprintf(stdout, "    HTTP Response Time:%9u%12u%12u\n", overall_stat->min_response_time,
-		overall_stat->max_response_time, overall_stat->avg_response_time);
+	fprintf( stdout, "    HTTP Response Time:%9u%12u%12u\n", overall_stat->min_response_time,
+		overall_stat->max_response_time, overall_stat->avg_response_time );

-	fprintf(stdout, "    Total Request Time:%9u%12u%12u\n", overall_stat->min_request_time,
-		overall_stat->max_request_time, overall_stat->avg_request_time);
+	fprintf( stdout, "    Total Request Time:%9u%12u%12u\n", overall_stat->min_request_time,
+		overall_stat->max_request_time, overall_stat->avg_request_time );
+	fprintf( stdout, "\n" );

 	return ;
 }


Fix build

Fix build

--- content_handler/runtime_holder.cc
+++ content_handler/runtime_holder.cc
@@ -218,7 +218,7 @@
     return;
   }
   if (auto response = message->response())
-    response->CompleteWithError();
+    response->CompleteEmpty();
 }

 void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) {
@@ -276,7 +276,7 @@
   if (asset_store_ && asset_store_->GetAsBuffer(asset_name, &asset_data)) {
     response->Complete(std::move(asset_data));
   } else {
-    response->CompleteWithError();
+    response->CompleteEmpty();
   }
 }


move variable declaration

move variable declaration

--- Framework/Platforms/Source/DCM/NaoRobot/AudioRecorder.cpp
+++ Framework/Platforms/Source/DCM/NaoRobot/AudioRecorder.cpp
@@ -57,8 +57,6 @@
     // return;
     while(running)
     {
-      int error = 0;
-
       if(!initialized)
       {
         if(!resetting && capture)
@@ -102,6 +100,8 @@
           running = false;
         }
         //std::cout << "[AudioRecorder] bytesToRead: " << bytesToRead << std::endl;
+
+        int error = 0;
         if (pa_simple_read(paSimple, &audioReadBuffer[0], bytesToRead, &error) < 0)
         {
           std::cerr << "[PulseAudio] pa_simple_read() failed: " << pa_strerror(error) << std::endl;
@@ -172,7 +172,7 @@
     paSampleSpec.channels = (uint8_t)numChannels;

     // Create the recording stream
-    int error;
+    int error = 0;
     if (!(paSimple = pa_simple_new(NULL, "AudioRecorder", PA_STREAM_RECORD, NULL, "AudioRecorder", &paSampleSpec, NULL, NULL, &error)))
     {
       std::cerr << "[PulseAudio] pa_simple_new() failed: " << pa_strerror(error) << "\n" << std::endl;


Use std namespace for sqrt() of cmath

Use std namespace for sqrt() of cmath

--- domains/dubins_traffic/e-agents/wander/src/wander.cpp
+++ domains/dubins_traffic/e-agents/wander/src/wander.cpp
@@ -266,8 +266,8 @@
             while (angle_diff < -M_PI)
                 angle_diff += 2*M_PI;

-            if (sqrt( (waypoints[current_index](0) - current_pose[0])*(waypoints[current_index](0) - current_pose[0])
-                      + (waypoints[current_index](1) - current_pose[1])*(waypoints[current_index](1) - current_pose[1]) ) < min_reach_err) {
+            if (std::sqrt( (waypoints[current_index](0) - current_pose[0])*(waypoints[current_index](0) - current_pose[0])
+                           + (waypoints[current_index](1) - current_pose[1])*(waypoints[current_index](1) - current_pose[1]) ) < min_reach_err) {
                 std::cout << "Reached waypoint " << waypoints[current_index].transpose() << std::endl;
                 // current_index = (current_index+1) % waypoints.size();
                 if (current_index < 1) {


Top-level inlining.

Top-level inlining.

--- numerics/polynomial.hpp
+++ numerics/polynomial.hpp
@@ -85,8 +85,8 @@

   explicit PolynomialInMonomialBasis(Coefficients const& coefficients);

-  Value Evaluate(Argument const& argument) const override;
-  Derivative<Value, Argument> EvaluateDerivative(
+  FORCE_INLINE(inline) Value Evaluate(Argument const& argument) const override;
+  FORCE_INLINE(inline) Derivative<Value, Argument> EvaluateDerivative(
       Argument const& argument) const override;

  private:


reorg preprocessor directives

reorg preprocessor directives

--- numexpr/interpreter.cpp
+++ numexpr/interpreter.cpp
@@ -13,11 +13,43 @@
 #include <string.h>
 #include <assert.h>
 #include <vector>
+#include <syslog.h>

 #include "numexpr_config.hpp"
 #include "complex_functions.hpp"
 #include "interpreter.hpp"
 #include "numexpr_object.hpp"
+
+
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
+#endif
+
+#define RETURN_TYPE char*
+
+// AVAILABLE(Haystack, Haystack_Len, J, Needle_Len)
+//                         A macro that returns nonzero if there are
+//                         at least Needle_Len bytes left starting at Haystack[J].
+//                         Haystack is 'unsigned char *', Haystack_Len, J, and Needle_Len
+//                         are 'size_t'; Haystack_Len is an lvalue.  For
+//                         NUL-terminated searches, Haystack_Len can be
+//                         modified each iteration to avoid having
+//                         to compute the end of Haystack up front.
+
+#define AVAILABLE(Haystack, Haystack_Len, J, Needle_Len)   \
+  ((Haystack_Len) >= (J) + (Needle_Len))
+
+#include "gnulib/str-two-way.h"
+
+#ifdef DEBUG
+#define DEBUG_TEST 1
+#else
+#define DEBUG_TEST 0
+#endif
+
+#define LOGDEBUG(...) do { if (DEBUG_TEST) syslog(LOG_MAKEPRI(LOG_USER, LOG_DEBUG),  __VA_ARGS__); } while (0)
+
+

 using namespace std;

@@ -492,36 +524,6 @@

 // Based on Gnulib/strstr.c

-#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t)-1)
-#endif
-
-#define RETURN_TYPE char*
-
-// AVAILABLE(Haystack, Haystack_Len, J, Needle_Len)
-//                         A macro that returns nonzero if there are
-//                         at least Needle_Len bytes left starting at Haystack[J].
-//                         Haystack is 'unsigned char *', Haystack_Len, J, and Needle_Len
-//                         are 'size_t'; Haystack_Len is an lvalue.  For
-//                         NUL-terminated searches, Haystack_Len can be
-//                         modified each iteration to avoid having
-//                         to compute the end of Haystack up front.
-
-#define AVAILABLE(Haystack, Haystack_Len, J, Needle_Len)   \
-  ((Haystack_Len) >= (J) + (Needle_Len))
-
-#include "gnulib/str-two-way.h"
-#include <syslog.h>
-
-#ifdef DEBUG
-#define DEBUG_TEST 1
-#else
-#define DEBUG_TEST 0
-#endif
-
-#define LOGDEBUG(...) do { if (DEBUG_TEST) syslog(LOG_MAKEPRI(LOG_USER, LOG_DEBUG),  __VA_ARGS__); } while (0)
-
-
 int
 stringcontains(const char *haystack_start, const char *needle_start,  npy_intp max_haystack_len, npy_intp max_needle_len)
 {


[test|diffusion-ipdg] use correct boundary penalty term

--- dune/gdt/test/stationary-eocstudies/diffusion-ipdg.hh
+++ dune/gdt/test/stationary-eocstudies/diffusion-ipdg.hh
@@ -281,7 +281,7 @@
         {},
         XT::Grid::ApplyOn::CustomBoundaryIntersections<GV>(this->boundary_info(), new XT::Grid::DirichletBoundary()));
     lhs_op->append(
-        LocalIntersectionIntegralBilinearForm<I>(LocalIPDGIntegrands::Penalty<I>(
+        LocalIntersectionIntegralBilinearForm<I>(LocalIPDGIntegrands::BoundaryPenalty<I>(
             14, this->diffusion(), [](const auto& intersection) { return intersection.geometry().volume(); })),
         {},
         XT::Grid::ApplyOn::CustomBoundaryIntersections<GV>(this->boundary_info(), new XT::Grid::DirichletBoundary()));


Code completion: speed up by more than 2x
... at the cost of correctness, see test changes

This change was suggested by Argyrios.

But we still take 10 seconds to compute completion results for Cocoa.

Swift SVN r16599

--- lib/IDE/CodeCompletion.cpp
+++ lib/IDE/CodeCompletion.cpp
@@ -1707,7 +1707,7 @@
     SmallVector<ValueDecl *, 1> Decls;
     lookupVisibleDeclsInModule(M, LookupAccessPath, Decls,
                                NLKind::QualifiedLookup,
-                               ResolutionKind::Overloadable,
+                               ResolutionKind::Exact,
                                TypeResolver.get());

     for (auto *VD : Decls) {


Error message text fixed.

Error message text fixed.

--- FitsRequestHandler.cc
+++ FitsRequestHandler.cc
@@ -239,7 +239,7 @@
 		throw BESDapError(e.get_error_message(), false, e.get_error_code(), __FILE__, __LINE__);
 	}
 	catch( ... ) {
-		throw BESDapError("Unknown exception caught building FITS data response", true, unknown_error, __FILE__, __LINE__);
+		throw BESDapError("Unknown exception caught building FITS DMR response", true, unknown_error, __FILE__, __LINE__);
 	}

 	// Make a DMR using the DDS


Fixed perfmon.cc copy constructor.

Fixed perfmon.cc copy constructor.

--- src/perfmon.cc
+++ src/perfmon.cc
@@ -15,7 +15,11 @@
 }

 perfmon_result_t::perfmon_result_t(const perfmon_result_t &copyee)
-    : type(copyee.type), value_(copyee.value_), map_(copyee.map_) { }
+    : type(copyee.type), value_(copyee.value_), map_() {
+    for (internal_map_t::const_iterator it = copyee.map_.begin(); it != copyee.map_.end(); ++it) {
+        map_.insert(std::pair<std::string, perfmon_result_t *>(it->first, new perfmon_result_t(*it->second)));
+    }
+}

 perfmon_result_t::~perfmon_result_t() {
     for (internal_map_t::iterator it = map_.begin(); it != map_.end(); ++it) {


Fix for inproper merging of some components. (M. Ivanov)

--- ANALYSIS/AliFileMerger.cxx
+++ ANALYSIS/AliFileMerger.cxx
@@ -163,7 +163,7 @@
   else {
     StoreResults(mergeArray, outputFileName);
   }
-
+
   delete mergeArray;
 }

@@ -202,6 +202,7 @@
   //
   // Merging procedure
   //
+  if (!array) return;
   static Int_t counter=-1;
   counter++;
   TObjArray *carray = new TObjArray;   //array of the objects inside current file
@@ -228,8 +229,8 @@
     return;
   }
   TMethodCall callEnv;
-
-  for (Int_t i=0; i<carray->GetEntries(); i++){
+  Int_t entries =carray->GetEntriesFast();
+  for (Int_t i=0; i<entries; i++){

     TObjArray *templist = new TObjArray(1);
     templist->SetOwner(kFALSE);
@@ -258,6 +259,7 @@
     AliSysInfo::AddStamp(currentObject->GetName(),2,i,counter);
     delete templist;
   }
+  carray->Delete();
   delete carray;
 }


Fix issues with creating temporary directories on Linux

--- HopsanCore/src/ComponentUtilities/TempDirectoryHandle.cpp
+++ HopsanCore/src/ComponentUtilities/TempDirectoryHandle.cpp
@@ -146,7 +146,8 @@
 #ifdef _WIN32
         return _mkdir(rName.c_str()) == 0;
 #else
-        return mkdir(rName.c_str(), 0777) == 0;
+        int ret = mkdir(rName.c_str(), 0777) == 0;
+        return (ret != 0);
 #endif
 }

@@ -166,7 +167,9 @@
                 return false;
             }
         }
-        currentLevel += "/"; // don't forget to append a slash
+        if(currentLevel.empty() || currentLevel[currentLevel.size()-1] != '/') {
+            currentLevel += "/"; // don't forget to append a slash
+        }
     }
 #endif
     return directoryExists(rPath);
@@ -176,8 +179,13 @@
 bool TempDirectoryHandle::directoryExists(const HString &rName) const
 {
     struct stat st;
-    stat(rName.c_str(), &st);
-    return st.st_mode & S_IFDIR;
+    if(stat(rName.c_str(), &st) != 0) {
+        return false;
+    }
+    else if(st.st_mode & S_IFDIR) {
+        return true;
+    }
+    return false;
 }

 bool TempDirectoryHandle::removeDirectory(const HString &rPath) const


[task_maps] Explicitly set to zero when frac >=0 and topic name update for pub_markers_.

--- exotations/exotica_core_task_maps/src/avoid_look_at_sphere.cpp
+++ exotations/exotica_core_task_maps/src/avoid_look_at_sphere.cpp
@@ -39,7 +39,14 @@
     for (int i = 0; i < n_objects_; ++i)
     {
         const double frac = Eigen::Map<Eigen::Vector2d>(kinematics[0].Phi(i).p.data).squaredNorm() / radii_squared_(i);
-        if (frac < 1.0) phi(i) = 1.0 - 2.0 * frac + frac * frac;
+        if (frac < 1.0)
+        {
+            phi(i) = 1.0 - 2.0 * frac + frac * frac;
+        }
+        else
+        {
+            phi(i) = 0.0;
+        }
     }
 }

@@ -58,6 +65,11 @@
         {
             phi(i) = 1.0 - 2.0 * frac + frac * frac;
             for (int j = 0; j < jacobian.cols(); ++j) jacobian(i, j) = -4.0 * (1.0 - frac) * kinematics[0].jacobian[i].data.topRows<2>().col(j).dot(o) / radii_squared_(i);
+        }
+        else
+        {
+            phi(i) = 0.0;
+            jacobian.row(i).setZero();
         }
     }
 }
@@ -143,7 +155,7 @@

     if (debug_ && Server::IsRos())
     {
-        pub_markers_ = Server::Advertise<visualization_msgs::MarkerArray>("alas_objs", 1, true);
+        pub_markers_ = Server::Advertise<visualization_msgs::MarkerArray>("avoid_look_at_sphere_objects", 1, true);
         visualization_msgs::Marker md;  // delete previous markers
         md.action = visualization_msgs::Marker::DELETEALL;
         visualization_msgs::MarkerArray ma;


Update deviceID when moving

Update deviceID when moving

--CAR and BRJ

--- APS/libaps-cpp/APSRack.cpp
+++ APS/libaps-cpp/APSRack.cpp
@@ -119,6 +119,7 @@
 		if ( serial2dev.count(tmpSerial) > 0) {
 			// move from old APSs_ vector to new
 			newAPS_.push_back(std::move(APSs_[serial2dev[tmpSerial]]));
+			newAPS_.back().deviceID_ = devicect;
 			FILE_LOG(logDEBUG) << "Old Device " << devicect << " [ " << tmpSerial << " ] moved";
 		} else {
 			// does not exist so construct it in the new vector


INTEGRATION: CWS changefileheader (1.7.246); FILE MERGED 2008/04/01 16:00:51 thb 1.7.246.3: #i85898# Stripping all external header guards 2008/04/01 12:56:42 thb 1.7.246.2: #i85898# Stripping all external header guards 2008/03/28 15:40:04 rt 1.7.246.1: #i87441# Change license header to LPGL v3.

--- toolkit/inc/toolkit/controls/accessiblecontrolcontext.hxx
+++ toolkit/inc/toolkit/controls/accessiblecontrolcontext.hxx
@@ -1,60 +1,42 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: accessiblecontrolcontext.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.7 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: hr $ $Date: 2006-06-19 22:55:37 $
+ * $RCSfile: accessiblecontrolcontext.hxx,v $
+ * $Revision: 1.8 $
  *
- *  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.
  *
  ************************************************************************/

 #ifndef TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX
 #define TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX

-#ifndef COMPHELPER_ACCESSIBLE_COMPONENT_HELPER_HXX
 #include <comphelper/accessiblecomponenthelper.hxx>
-#endif
-#ifndef COMPHELPER_ACCIMPLACCESS_HXX
 #include <comphelper/accimplaccess.hxx>
-#endif
-#ifndef _COMPHELPER_UNO3_HXX_
 #include <comphelper/uno3.hxx>
-#endif
-
-#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
 #include <com/sun/star/lang/XEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
 #include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
 #include <com/sun/star/awt/XWindow.hpp>
-#endif

 class Window;
 //........................................................................


Updated display helper

Updated display helper

This is needed as now the data is marked as
translucent because we use 4 component texture

Change-Id: Iff2a8832b7c461c9ec2748ad44c045322b73c659

--- Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx
+++ Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx
@@ -556,7 +556,7 @@
   // Render the polygon
   polydata->Modified();
   this->TextureObject->Bind();
-  this->TextureActor->RenderOpaqueGeometry(ren);
+  this->TextureActor->RenderTranslucentPolygonalGeometry(ren);
   this->TextureObject->UnBind();
   vtkOpenGLCheckErrorMacro("failed after RenderTextureInternal");


Update: cleanup

Update: cleanup

--- AUDIO_sample/audio_gui.hpp
+++ AUDIO_sample/audio_gui.hpp
@@ -120,6 +120,13 @@
 		typedef gui::widget_director<RENDER, TOUCH, 32> WIDD;
 		WIDD	widd_;

+		typedef gui::text TEXT;
+		TEXT	album_;
+		TEXT	title_;
+		TEXT	artist_;
+//		TEXT	year_;
+//		TEXT	td_info_;
+
 		typedef gui::slider SLIDER;
 		SLIDER	slider_;
 		typedef gui::button BUTTON;
@@ -137,6 +144,8 @@
 		uint32_t	ctrl_;

 		char		path_[256];
+
+		utils::STR256	fin_artist_;

 		struct th_sync_t {
 			volatile uint8_t	put;
@@ -211,16 +220,35 @@

 			render_.set_fore_color(graphics::def_color::White);
 			render_.set_back_color(graphics::def_color::Gray);
-			render_text_(0, 0 * 20, tag.get_album().c_str());
-			render_text_(0, 1 * 20, tag.get_title().c_str());
+//			render_text_(0, 0 * 20, tag.get_album().c_str());
+			album_.set_title(tag.get_album().c_str());
+			album_.reset_scroll();
+//			render_text_(0, 1 * 20, tag.get_title().c_str());
+			title_.set_title(tag.get_title().c_str());
+			title_.reset_scroll();
 			{
-				auto x = render_text_(0, 2 * 20, tag.get_artist().c_str());
+				fin_artist_ = tag.get_artist().c_str();
+///				auto x = render_text_(0, 2 * 20, tag.get_artist().c_str());
 				if(!tag.get_artist2().empty()) {
-					x = render_text_(x, 2 * 20, " / ");
-					render_text_(x, 2 * 20, tag.get_artist2().c_str());
-				}
-			}
-			render_text_(0, 3 * 20, tag.get_year().c_str());
+					fin_artist_ += " / ";
+					fin_artist_ += tag.get_artist2().c_str();
+///					x = render_text_(x, 2 * 20, " / ");
+///					render_text_(x, 2 * 20, tag.get_artist2().c_str());
+				}
+				artist_.set_title(fin_artist_.c_str());
+				artist_.reset_scroll();
+			}
+			{
+				auto x = render_text_(0, 3 * 20, tag.get_year().c_str());
+				if(!tag.get_date().empty()) {
+					x = render_text_(x, 3 * 20, "/");
+					char tmp[8];
+					utils::sformat("%c%c/%c%c", tmp, sizeof(tmp))
+						% tag.get_date()[0] % tag.get_date()[1]
+						% tag.get_date()[2] % tag.get_date()[3];
+					render_text_(x, 3 * 20, tag.get_date().c_str());
+				}
+			}
 			{
 				char tmp[10];
 				int16_t x = 0;
@@ -251,6 +279,11 @@
 			filer_(render_, false),
 			dialog_(render_, touch_),
 			widd_(render_, touch_),
+			album_(  vtx::srect(   0, 20*0, 206, 20)),
+		   	title_(  vtx::srect(   0, 20*1, 206, 20)),
+		   	artist_( vtx::srect(   0, 20*2, 206, 20)),
+//			year_(   vtx::srect(   0, 20*3, 206, 20)),
+//			td_info_(vtx::srect(   0, 20*4, 206, 20)),
 			slider_(vtx::srect(   0, 272-64*2-6-18, 206, 14)),
 			select_(vtx::srect(   0, 272-64*2-6, 64, 64), "Sel"),
 			rew_(   vtx::srect(70*0, 272-64, 64, 64), "<<"),
@@ -258,6 +291,7 @@
 			ff_(    vtx::srect(70*2, 272-64, 64, 64), ">>"),
 			scaling_(render_), img_in_(scaling_),
 			ctrl_(0), path_{ 0 },
+			fin_artist_(),
 			play_stop_(), play_rew_(), play_pause_(), play_ff_(),
 			path_tag_{ 0 }, req_tag_(), play_tag_(),
 			mount_state_(false), filer_state_(false)
@@ -389,6 +423,17 @@
 		//-------------------------------------------------------------//
 		void open() noexcept
 		{
+			album_.enable();
+			album_.set_base_color(DEF_COLOR::DarkSafeColor);
+			title_.enable();
+			title_.set_base_color(DEF_COLOR::LightSafeColor);
+			artist_.enable();
+			artist_.set_base_color(DEF_COLOR::DarkSafeColor);
+//			year_.enable();
+//			year_.set_base_color(DEF_COLOR::LightSafeColor);
+//			td_info_.enable();
+//			td_info_.set_base_color(DEF_COLOR::DarkSafeColor);
+
 			slider_.enable_read_only();
 			slider_.enable(false);