do #GP in x86-64 mode if NT flag is set

do #GP in x86-64 mode if NT flag is set

--- cpu/iret.cc
+++ cpu/iret.cc
@@ -1,5 +1,5 @@
 ////////////////////////////////////////////////////////////////////////
-// $Id: iret.cc,v 1.5 2005/08/14 17:23:03 sshwarts Exp $
+// $Id: iret.cc,v 1.6 2005/08/14 18:01:04 sshwarts Exp $
 /////////////////////////////////////////////////////////////////////////
 //
 //  Copyright (C) 2001  MandrakeSoft S.A.
@@ -263,7 +263,7 @@

     /* selector RPL must = RPL of return CS selector,
      * else #GP(SS selector) */
-    if ( ss_selector.rpl != cs_selector.rpl) {
+    if (ss_selector.rpl != cs_selector.rpl) {
       BX_ERROR(("iret: SS.rpl != CS.rpl"));
       exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
     }
@@ -278,7 +278,7 @@
      * else #GP(SS selector) */
     if ( ss_descriptor.valid==0 ||
          ss_descriptor.segment==0  ||
-         ss_descriptor.u.segment.executable  ||
+         ss_descriptor.u.segment.executable ||
          ss_descriptor.u.segment.r_w==0 )
     {
       BX_ERROR(("iret: SS AR byte not writable code segment"));
@@ -287,7 +287,7 @@

     /* stack segment DPL must equal the RPL of the return CS selector,
      * else #GP(SS selector) */
-    if ( ss_descriptor.dpl != cs_selector.rpl ) {
+    if (ss_descriptor.dpl != cs_selector.rpl) {
       BX_ERROR(("iret: SS.dpl != CS selector RPL"));
       exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
     }
@@ -330,9 +330,9 @@
     // perhaps I should always write_eflags(), thus zeroing
     // out the upper 16bits of eflags for CS.D_B==0 ???
     if (cs_descriptor.u.segment.d_b)
-      write_eflags(new_eflags, prev_cpl==0, prev_cpl<=BX_CPU_THIS_PTR get_IOPL (), 0, 1);
+      write_eflags(new_eflags, prev_cpl==0, prev_cpl<=BX_CPU_THIS_PTR get_IOPL(), 0, 1);
     else
-      write_flags((Bit16u) new_eflags, prev_cpl==0, prev_cpl<=BX_CPU_THIS_PTR get_IOPL ());
+      write_flags((Bit16u) new_eflags, prev_cpl==0, prev_cpl<=BX_CPU_THIS_PTR get_IOPL());

     // load SS:eSP from stack
     // load the SS-cache with SS descriptor
@@ -359,6 +359,11 @@
   unsigned top_nbytes_outer, ss_offset;

   BX_DEBUG (("LONG MODE IRET"));
+
+  if ( BX_CPU_THIS_PTR get_NT () ) {
+   BX_ERROR(("iret64: return from nested task not supported in x86-64 mode !"));
+   exception(BX_GP_EXCEPTION, 0, 0);
+  }

   /* 64bit opsize
    * ============


Added mkdir(), rmdir().

Added mkdir(), rmdir().

--- modules/ftp-client/ftp-client.xq.src/ftp_functions.cpp
+++ modules/ftp-client/ftp-client.xq.src/ftp_functions.cpp
@@ -490,11 +490,6 @@
   CURL *const cobj = cbuf->curl();
   curl_easy_setopt( cobj, CURLOPT_CUSTOMREQUEST, command.c_str() );

-  //
-  // Despite http://stackoverflow.com/a/13515807/99089, it seems like the
-  // thing that works is simply to perform the DELE, allow CURL to attempt
-  // the RETR that will fail, and ignore that error.
-  //
   try {
     curl_helper helper( cbuf );
     ZORBA_CURL_ASSERT( curl_easy_perform( cobj ) );
@@ -503,9 +498,15 @@
     int const code = get_ftp_response( cobj );
     switch ( code ) {
       case FTP_REPLY_ACTION_COMPLETED:
-        if ( e.curl_code() != CURLE_FTP_COULDNT_RETR_FILE )
-          THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
-        break;
+        if ( e.curl_code() == CURLE_FTP_COULDNT_RETR_FILE ) {
+          //
+          // After the file is deleted, CURL tries to RETR it which fails, so
+          // ignore that error.
+          // (Also see <http://stackoverflow.com/a/13515807/99089>.)
+          //
+          break;
+        }
+        THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
       case FTP_REPLY_ACTION_NOT_TAKEN:
         THROW_EXCEPTION( "FTP_ERROR", path, "file not found", code );
       default:
@@ -709,20 +710,27 @@
     curl_helper helper( cbuf );
     ZORBA_CURL_ASSERT( curl_easy_perform( cobj ) );
   }
-  catch ( std::exception const &e ) {
+  catch ( curl::exception const &e ) {
     int const code = get_ftp_response( cobj );
     switch ( code ) {
       case FTP_REPLY_ACTION_NOT_TAKEN:
         THROW_EXCEPTION( "FTP_ERROR", path, "directory already exists", code );
       case FTP_REPLY_PATH_CREATED:
-        //
-        // After the directory is created, CURL tries to RETR it which fails,
-        // so ignore that error.
-        //
-        break;
+        if ( e.curl_code() == CURLE_FTP_COULDNT_RETR_FILE ) {
+          //
+          // After the directory is created, CURL tries to RETR it which fails,
+          // so ignore that error.
+          // (Also see <http://stackoverflow.com/a/13515807/99089>.)
+          //
+          break;
+        }
+        THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
       default:
-        THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
+        THROW_EXCEPTION( "FTP_ERROR", path, e.what(), code );
     } // switch
+  }
+  catch ( std::exception const &e ) {
+    THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
   }
   return ItemSequence_t( new EmptySequence() );
 }
@@ -770,9 +778,15 @@
     int const code = get_ftp_response( cobj );
     switch ( code ) {
       case FTP_REPLY_ACTION_COMPLETED:
-        if ( e.curl_code() != CURLE_FTP_COULDNT_RETR_FILE )
-          THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
-        break;
+        if ( e.curl_code() == CURLE_FTP_COULDNT_RETR_FILE ) {
+          //
+          // After the directory is deleted, CURL tries to RETR it which fails,
+          // so ignore that error.
+          // (Also see <http://stackoverflow.com/a/13515807/99089>.)
+          //
+          break;
+        }
+        THROW_EXCEPTION( "FTP_ERROR", path, e.what() );
       case FTP_REPLY_ACTION_NOT_TAKEN:
         THROW_EXCEPTION( "FTP_ERROR", path, "directory not found", code );
       default:


make it possible to specify font size in percent

Ignore-this: 41793a20463100960f64d0f3631a489

darcs-hash:20140910153942-fae1a-cf92790f34256c936445e5f56f7fccfe77114bec

--- layouterXHTML.cpp
+++ layouterXHTML.cpp
@@ -189,11 +189,18 @@
     throw XhtmlException_c("only the # color scheme is supported and keyword transparent");
 }

+class szFunctor
+{
+  public:
+    virtual double get(void) = 0;
+};
+
+
 /** \brief evaluate size
  *  \param sz the size string from the CSS
  *  \return the resulting size in pixel
  */
-static double evalSize(const std::string & sz)
+static double evalSize(const std::string & sz, szFunctor * f = nullptr)
 {
   // right now we accept only pixel sizes
   size_t l = sz.length();
@@ -202,11 +209,36 @@
   {
     return atof(sz.c_str());
   }
+  else if (f && sz[l-1] == '%')
+  {
+    return f->get() * atof(sz.c_str()) / 100;
+  }

   throw XhtmlException_c("only pixel size format is supported");

   return 0;
 }
+
+class parentFunctor : public szFunctor
+{
+  private:
+    std::string tag;
+    pugi::xml_node node;
+    const textStyleSheet_c & rules;
+
+  public:
+    parentFunctor(const std::string & t, pugi::xml_node n, const textStyleSheet_c & r) :
+       tag(t), node(n), rules(r) {}
+
+    double get(void)
+    {
+      if (!node)
+        throw XhtmlException_c("no parent node to base a percent value on");
+
+      parentFunctor f(tag, node.parent(), rules);
+      return evalSize(rules.getValue(node, tag), &f);
+    }
+};

 static std::vector<codepointAttributes::shadow> evalShadows(const std::string & v)
 {
@@ -282,7 +314,9 @@
   std::string fontStyle = rules.getValue(xml, "font-style");
   std::string fontVariant = rules.getValue(xml, "font-variant");
   std::string fontWeight = rules.getValue(xml, "font-weight");
-  double fontSize = evalSize(rules.getValue(xml, "font-size"));
+
+  parentFunctor fkt("font-size", xml.parent(), rules);
+  double fontSize = evalSize(rules.getValue(xml, "font-size"), &fkt);

   auto f = rules.findFamily(fontFamily)->getFont(64*fontSize, fontStyle, fontVariant, fontWeight);


Small cleanups in audioproperties.cpp.

Small cleanups in audioproperties.cpp.

--- taglib/audioproperties.cpp
+++ taglib/audioproperties.cpp
@@ -57,7 +57,7 @@

 }

-int TagLib::AudioProperties::lengthInSeconds() const
+int AudioProperties::lengthInSeconds() const
 {
   // This is an ugly workaround but we can't add a virtual function.
   // Should be virtual in taglib2.
@@ -105,7 +105,7 @@
     return 0;
 }

-int TagLib::AudioProperties::lengthInMilliseconds() const
+int AudioProperties::lengthInMilliseconds() const
 {
   // This is an ugly workaround but we can't add a virtual function.
   // Should be virtual in taglib2.


Fix Qt build bustage in ScrollbarThemeQt.cpp

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@36496 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- WebCore/platform/qt/ScrollbarThemeQt.cpp
+++ WebCore/platform/qt/ScrollbarThemeQt.cpp
@@ -150,13 +150,13 @@
 ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
 {
     QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
-    const QPoint pos = convertFromContainingWindow(evt.pos());
+    const QPoint pos = scrollbar->convertFromContainingWindow(evt.pos());
     opt->rect.moveTo(QPoint(0, 0));
     QStyle::SubControl sc = QApplication::style()->hitTestComplexControl(QStyle::CC_ScrollBar, opt, pos, 0);
     return scrollbarPart(sc);
 }

-bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&)
+bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
 {
     // Middle click centers slider thumb (if supported)
     return QApplication::style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton;
@@ -182,7 +182,7 @@
 int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
 {
     if (scrollbar->isEnabled())
-        return (int)((float)scrollbar->currentPos() * (trackLength(scrollbar) - thumbLength(scrollbar)) / scrollbar->maximum();
+        return (int)((float)scrollbar->currentPos() * (trackLength(scrollbar) - thumbLength(scrollbar)) / scrollbar->maximum());
     return 0;
 }


integrated containerConnector

integrated containerConnector

--- internalconnector/internalmodule.cpp
+++ internalconnector/internalmodule.cpp
@@ -2,6 +2,8 @@
 #include <QSqlQuery>

 #include "kernel.h"
+#include "connectorinterface.h"
+#include "containerconnector.h"
 #include "angle.h"
 #include "point.h"
 #include "internalmodule.h"
@@ -46,6 +48,7 @@
     ConnectorFactory *factory = kernel()->factory<ConnectorFactory>("ilwis::ConnectorFactory");
     if (!factory)
         return ;
+    factory->addCreator(itCONTAINER,"internal",InternalCatalogConnector::create);

     factory->addCreator(itRASTER,"internal", InternalRasterCoverageConnector::create);
     factory->addCreator(itTABLE,"internal", InternalTableConnector::create);
@@ -54,8 +57,6 @@
     projfactory->prepare();
     kernel()->addFactory(projfactory );

-    CatalogConnectorFactory *catfactory = kernel()->factory<CatalogConnectorFactory>("catalogconnectorfactory","ilwis");
-    catfactory->add(InternalCatalogConnector::create);

 }


chore(thread): modify default tid length for windows (in theory it's equial to DWORD_MAX)

--- cplusplus/tyr2/basic/windows/TCurrentThreadWindows.cc
+++ cplusplus/tyr2/basic/windows/TCurrentThreadWindows.cc
@@ -38,7 +38,7 @@
   __declspec(thread) const int tMainTid = kern_gettid();
   __declspec(thread) int tCachedTid = 0;
   __declspec(thread) char tTidString[32];
-  __declspec(thread) int tTidStringLength = 6;
+  __declspec(thread) int tTidStringLength = 12;
   __declspec(thread) const char* tThreadName = "unknown";
   static_assert(std::is_same<int, pid_t>::value, "pid_t should be int");

@@ -55,7 +55,7 @@
   void cached_tid(void) {
     if (0 == tCachedTid) {
       tCachedTid = kern_gettid();
-      tTidStringLength = snprintf(tTidString, sizeof(tTidString), "%5d ", tCachedTid);
+      tTidStringLength = snprintf(tTidString, sizeof(tTidString), "%11d ", tCachedTid);
     }
   }


updated dfs

updated dfs


Moves solve and QR code into simplified functions

The arma default methods for solve and qr contain much more than I really need.
This commit strips out all the cruft and leaves a much simpler version of the
methods which use fewer allocations and mem copies.

--- src/polytope_candidate.cc
+++ src/polytope_candidate.cc
@@ -49,8 +49,96 @@
  * cache these at a program/global level */
 arma::vec __new_vec_cached;
 arma::vec __null_vec_cached;
-arma::mat __q_cached;
-arma::mat __r_cached;
+arma::mat __qr_matrix;
+arma::mat __solve_a;
+arma::podarray<double> __solve_work;
+arma::podarray<double> __qr_tau;
+arma::podarray<double> __qr_work;
+/* Simplification of arma::solve */
+bool
+solve(const arma::mat & A, const arma::vec & B) {
+	using arma::uword;
+	using arma::blas_int;
+	__solve_a = A;
+	const uword A_n_rows = A.n_rows;
+	const uword A_n_cols = A.n_cols;
+
+	const uword B_n_rows = B.n_rows;
+	const uword B_n_cols = B.n_cols;
+
+	char trans = 'N';
+	blas_int  m     = blas_int(A_n_rows);
+	blas_int  n     = blas_int(A_n_cols);
+	blas_int  lda   = blas_int(A_n_rows);
+	blas_int  ldb   = blas_int(A_n_cols);
+	blas_int  nrhs  = blas_int(B_n_cols);
+	blas_int  lwork = 3 * ( (std::max)(blas_int(1), m + (std::max)(m,nrhs)) );
+	blas_int  info  = 0;
+
+	__new_vec_cached.set_size(A_n_cols, B_n_cols);
+
+	for(uword col=0; col<B_n_cols; ++col) {
+		double* tmp_colmem = __new_vec_cached.colptr(col);
+		arma::arrayops::copy( tmp_colmem, B.colptr(col), B_n_rows );
+		for(uword row=B_n_rows; row<A_n_cols; ++row) {
+			tmp_colmem[row] = double(0);
+		}
+	}
+	__solve_work.set_min_size(static_cast<uword>(lwork));
+
+	arma::lapack::gels<double>( &trans, &m, &n, &nrhs, __solve_a.memptr(), &lda,
+			__new_vec_cached.memptr(), &ldb, __solve_work.memptr(), &lwork, &info );
+
+	return (info == 0);
+}
+/** Simplification of arma::qr. We don't actually care about the result for R,
+ * we only want to find the nullspace, so we can throw away a bunch of stuff. */
+bool
+qr_on_trans(const arma::mat & X) {
+	using arma::uword;
+	using arma::blas_int;
+	/* This makes QR too big for just R, but the right size for Q. qeqrf fills QR
+	 * with R in upper triangle and Q encoded in the bottom. orgqr decodes Q into
+	 * the fill Q matrix. By Using the same matrix for everything we avoid having
+	 * to copy all the values between Q and R between the function calls. */
+	__qr_matrix.set_size(X.n_cols, X.n_cols);
+	__qr_matrix.head_cols(X.n_rows) = X.t();
+
+	const uword R_n_rows = __qr_matrix.n_rows;
+	const uword R_n_cols = __qr_matrix.n_cols - 1;
+
+	blas_int m         = static_cast<blas_int>(R_n_rows);
+	blas_int n         = static_cast<blas_int>(R_n_cols);
+	blas_int lwork     = 0;
+	// take into account requirements of geqrf() _and_ orgqr()/ungqr()
+	blas_int lwork_min = (std::max)(blas_int(1), (std::max)(m,n));
+	blas_int k         = (std::min)(m,n);
+	blas_int info      = 0;
+
+	__qr_tau.set_min_size( static_cast<uword>(k) );
+
+	double work_query[2];
+	blas_int lwork_query = -1;
+
+	arma::lapack::geqrf(&m, &n, __qr_matrix.memptr(), &m, __qr_tau.memptr(),
+			&work_query[0], &lwork_query, &info);
+
+	if(info != 0)  { return false; }
+
+	blas_int lwork_proposed = static_cast<blas_int>(
+			arma::access::tmp_real(work_query[0]) );
+	lwork = (std::max)(lwork_proposed, lwork_min);
+	__qr_work.set_min_size( static_cast<uword>(lwork) );
+
+	arma::lapack::geqrf(&m, &n, __qr_matrix.memptr(), &m, __qr_tau.memptr(),
+			__qr_work.memptr(), &lwork, &info);
+
+	if(info != 0)  { return false; }
+
+	arma::lapack::orgqr(&m, &m, &k, __qr_matrix.memptr(), &m, __qr_tau.memptr(),
+			__qr_work.memptr(), &lwork, &info);
+	return (info == 0);
+}
 }
 PolytopeCandidate PolytopeCandidate::InValid;
 PolytopeCandidate::PolytopeCandidate()
@@ -132,7 +220,11 @@
 bool
 PolytopeCandidate::vector_from_inner_products(const arma::vec & inner_vector)
 		const {
-	arma::solve(__new_vec_cached, _basis_vecs_trans, inner_vector);
+	if(_hyperbolic) {
+		solve(_basis_vecs_trans, inner_vector);
+	} else {
+		arma::solve(__new_vec_cached, _basis_vecs_trans, inner_vector);
+	}
 	if(_hyperbolic &&
 			std::abs(__new_vec_cached(__new_vec_cached.size() - 1)) > error) {
 		/*
@@ -150,8 +242,8 @@
 		 * which has solution:
 		 * 	l = (-<a,x> + sqrt( <a,x>*<a,x> + <a,a>(<x,x> - 1) ))/<a,a>
 		 */
-		arma::qr(__q_cached, __r_cached, _basis_vecs_trans.t());
-		__null_vec_cached = __q_cached.col(__q_cached.n_cols - 1);
+		qr_on_trans(_basis_vecs_trans);
+		__null_vec_cached = __qr_matrix.col(__qr_matrix.n_cols - 1);
 		const double ax = mink_inner_prod(__null_vec_cached, __new_vec_cached);
 		const double aa = mink_inner_prod(__null_vec_cached);
 		const double xx = mink_inner_prod(__new_vec_cached);


Deleted the #endif that's caused the compiler erro

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@1821 2bbb7eff-a529-9590-31e7-b0007b416f81

--- src/ports/SkTime_Unix.cpp
+++ src/ports/SkTime_Unix.cpp
@@ -44,6 +44,4 @@
     struct timeval tv;
     gettimeofday(&tv, NULL);
     return (SkMSec) (tv.tv_sec * 1000 + tv.tv_usec / 1000 ); // microseconds to milliseconds
-}
-
-#endif
+}


add Tangram::GL

add Tangram::GL

- add wrapper for GL functions to allow platform specific implementations

--- core/common/platform_gl.cpp
+++ core/common/platform_gl.cpp
@@ -2,7 +2,6 @@

 #include "gl.h"
 #include "gl/error.h"
-
 namespace Tangram {

 GLenum GL::getError() {


Correct sequence-number injection into packets in rtp_packet_unittest.cc

BUG=None

Review-Url: https://codereview.webrtc.org/2899293002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#18257}

--- webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc
+++ webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc
@@ -24,7 +24,9 @@

 constexpr int8_t kPayloadType = 100;
 constexpr uint32_t kSsrc = 0x12345678;
-constexpr uint16_t kSeqNum = 88;
+constexpr uint16_t kSeqNum = 0x1234;
+constexpr uint8_t kSeqNumFirstByte = kSeqNum >> 8;
+constexpr uint8_t kSeqNumSecondByte = kSeqNum & 0xff;
 constexpr uint32_t kTimestamp = 0x65431278;
 constexpr uint8_t kTransmissionOffsetExtensionId = 1;
 constexpr uint8_t kAudioLevelExtensionId = 9;
@@ -36,19 +38,19 @@
 constexpr size_t kMaxPaddingSize = 224u;
 // clang-format off
 constexpr uint8_t kMinimumPacket[] = {
-    0x80, kPayloadType, 0x00, kSeqNum,
+    0x80, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,
     0x12, 0x34, 0x56, 0x78};

 constexpr uint8_t kPacketWithTO[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,
     0x12, 0x34, 0x56, 0x78,
     0xbe, 0xde, 0x00, 0x01,
     0x12, 0x00, 0x56, 0xce};

 constexpr uint8_t kPacketWithTOAndAL[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,
     0x12, 0x34, 0x56, 0x78,
     0xbe, 0xde, 0x00, 0x02,
@@ -56,7 +58,7 @@
     0x90, 0x80|kAudioLevel, 0x00, 0x00};

 constexpr uint8_t kPacketWithRsid[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,
     0x12, 0x34, 0x56, 0x78,
     0xbe, 0xde, 0x00, 0x03,
@@ -68,7 +70,7 @@
 constexpr uint8_t kPayload[] = {'p', 'a', 'y', 'l', 'o', 'a', 'd'};
 constexpr uint8_t kPacketPaddingSize = 8;
 constexpr uint8_t kPacket[] = {
-    0xb2, kPayloadType, 0x00, kSeqNum,
+    0xb2, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,
     0x12, 0x34, 0x56, 0x78,
     0x34, 0x56, 0x78, 0x90,
@@ -79,7 +81,7 @@
     'p', 'a', 'd', 'd', 'i', 'n', 'g', kPacketPaddingSize};

 constexpr uint8_t kPacketWithInvalidExtension[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,  // kTimestamp.
     0x12, 0x34, 0x56, 0x78,  // kSSrc.
     0xbe, 0xde, 0x00, 0x02,  // Extension block of size 2 x 32bit words.
@@ -312,7 +314,7 @@
 TEST(RtpPacketTest, ParseWithOverSizedExtension) {
   // clang-format off
   const uint8_t bad_packet[] = {
-      0x90, kPayloadType, 0x00, kSeqNum,
+      0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
       0x65, 0x43, 0x12, 0x78,  // kTimestamp.
       0x12, 0x34, 0x56, 0x78,  // kSsrc.
       0xbe, 0xde, 0x00, 0x01,  // Extension of size 1x32bit word.
@@ -407,7 +409,7 @@
 TEST(RtpPacketTest, ParseDynamicSizeExtension) {
   // clang-format off
   const uint8_t kPacket1[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,  // Timestamp.
     0x12, 0x34, 0x56, 0x78,  // Ssrc.
     0xbe, 0xde, 0x00, 0x02,  // Extensions block of size 2x32bit words.
@@ -415,7 +417,7 @@
     0x12, 'r', 't', 'x',     // Extension with id = 1, size = (2+1).
     0x00};  // Extension padding.
   const uint8_t kPacket2[] = {
-    0x90, kPayloadType, 0x00, kSeqNum,
+    0x90, kPayloadType, kSeqNumFirstByte, kSeqNumSecondByte,
     0x65, 0x43, 0x12, 0x78,  // Timestamp.
     0x12, 0x34, 0x56, 0x79,  // Ssrc.
     0xbe, 0xde, 0x00, 0x01,  // Extensions block of size 1x32bit words.


Fixing several instances of wrong printf format specifiers.
Review URL: https://breakpad.appspot.com/794002

git-svn-id: 7939527bf0a06ad24ad020f729d5600cb42ed5d7@1241 4c0a9323-5329-0410-9bdc-e9ce6186880e

--- src/processor/minidump.cc
+++ src/processor/minidump.cc
@@ -1580,12 +1580,12 @@
     case MD_CONTEXT_ARM64: {
       const MDRawContextARM64* context_arm64 = GetContextARM64();
       printf("MDRawContextARM64\n");
-      printf("  context_flags       = 0x%llx\n",
+      printf("  context_flags       = 0x%" PRIx64 "\n",
              context_arm64->context_flags);
       for (unsigned int ireg_index = 0;
            ireg_index < MD_CONTEXT_ARM64_GPR_COUNT;
            ++ireg_index) {
-        printf("  iregs[%2d]            = 0x%llx\n",
+        printf("  iregs[%2d]            = 0x%" PRIx64 "\n",
                ireg_index, context_arm64->iregs[ireg_index]);
       }
       printf("  cpsr                = 0x%x\n", context_arm64->cpsr);
@@ -1596,7 +1596,7 @@
            freg_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT;
            ++freg_index) {
         uint128_struct fp_value = context_arm64->float_save.regs[freg_index];
-        printf("  float_save.regs[%2d]            = 0x%llx%llx\n",
+        printf("  float_save.regs[%2d]            = 0x%" PRIx64 "%" PRIx64 "\n",
                freg_index, fp_value.high, fp_value.low);
       }
       break;


An unnecessary assignment has been removed, since the data has already been stored in the correct vector.


Added scrollbar for fit parameters in interactive fit window

--- fox-gui/InteractiveFit.cpp
+++ fox-gui/InteractiveFit.cpp
@@ -32,7 +32,8 @@
   new FXMenuTitle(menubar,"&Fit",NULL,fitmenu);

   FXHorizontalFrame *mf = new FXHorizontalFrame(this, LAYOUT_FILL_X|LAYOUT_FILL_Y);
-  FXMatrix *matrix = new FXMatrix(mf, 2, LAYOUT_FILL_Y|MATRIX_BY_COLUMNS, 0, 0, 0, 0, DEFAULT_SPACING, DEFAULT_SPACING, DEFAULT_SPACING, DEFAULT_SPACING, 1, 1);
+  FXScrollWindow *iw = new FXScrollWindow(mf, VSCROLLER_ALWAYS | HSCROLLING_OFF | LAYOUT_FILL_Y);
+  FXMatrix *matrix = new FXMatrix(iw, 2, LAYOUT_FILL_Y|MATRIX_BY_COLUMNS, 0, 0, 0, 0, DEFAULT_SPACING, DEFAULT_SPACING, DEFAULT_SPACING, DEFAULT_SPACING, 1, 1);

   fit_engine->config->subsampling = 0;


Only add preconditioners after field splits

Otherwise FieldSplitPreconditioner gets terribly confused.

This will hopefully fix the failing regression test in #8674

--- framework/src/base/Moose.C
+++ framework/src/base/Moose.C
@@ -1005,7 +1005,8 @@
 "(setup_adaptivity)"
 "(set_adaptivity_options)"
 "(add_ic)"
-"(add_preconditioning, add_constraint, add_field_split)"
+"(add_constraint, add_field_split)"
+"(add_preconditioning)"
 "(ready_to_init)"
 "(setup_dampers)"
 "(setup_residual_debug)"


added debug to ndb test

added debug to ndb test

--- ndb/test/src/NDBT_Test.cpp
+++ ndb/test/src/NDBT_Test.cpp
@@ -13,6 +13,9 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include <ndb_global.h>
+#include <my_sys.h>

 #include "NDBT.hpp"
 #include "NDBT_Test.hpp"
@@ -953,6 +956,9 @@

   int _print_cases = false;
   int _verbose = false;
+#ifndef DBUG_OFF
+  const char *debug_option= 0;
+#endif

   struct getargs args[] = {
     { "print", '\0', arg_flag, &_print, "Print execution tree", "" },
@@ -964,6 +970,10 @@
     { "remote_mgm", 'm', arg_string, &_remote_mgm,
       "host:port to mgmsrv of remote cluster", "host:port" },
     { "timer", 't', arg_flag, &_timer, "Print execution time", "time" },
+#ifndef DBUG_OFF
+    { "debug", 0, arg_string, &debug_option,
+      "Specify debug options e.g. d:t:i:o,out.trace", "options" },
+#endif
     { "verbose", 'v', arg_flag, &_verbose, "Print verbose status", "verbose" }
   };
   int num_args = sizeof(args) / sizeof(args[0]);
@@ -973,6 +983,13 @@
     arg_printusage(args, num_args, argv[0], "tabname1 tabname2 ... tabnameN\n");
     return NDBT_WRONGARGS;
   }
+
+#ifndef DBUG_OFF
+  my_init();
+  if (debug_option)
+    DBUG_PUSH(debug_option);
+#endif
+
   // Check if table name is supplied
   if (argv[optind] != NULL)
     _tabname = argv[optind];


cleanup

cleanup

--- plotter_gui/plotmatrix.cpp
+++ plotter_gui/plotmatrix.cpp
@@ -32,7 +32,6 @@

     plot->setWindowTitle(QString("PlotWidget ") + QString::number(widget_uid++));

-    connect( plot, SIGNAL(swapWidgets(QObject*,QObject*)),  this, SLOT(swapWidgetByName(QString,QString)) );
     connect( plot, SIGNAL(rectChanged(PlotWidget*,QRectF)), this, SLOT(on_singlePlotScaleChanged(PlotWidget*,QRectF)));

     plot->setAttribute(Qt::WA_DeleteOnClose);


DOC: New link to the geoid files

DOC: New link to the geoid files

--- Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx
+++ Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx
@@ -62,8 +62,8 @@
                                "Use a geoid grid to get the height "
                                "above the ellipsoid in case there is no DEM available, no coverage for "
                                "some points or pixels with no_data in the DEM tiles. A version of the "
-                               "geoid can be found on the OTB website"
-                               "(https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/blob/master/Input/DEM/egm96.grd).");
+                               "geoid can be found on the OTB website (egm96.grd and egm96.grd.hdr at "
+                               "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/master/Data/Input/DEM).");
   app->MandatoryOff(oss.str());

   std::string geoidFromConfig = otb::ConfigurationManager::GetGeoidFile();


INTEGRATION: CWS dba201b (1.2.146); FILE MERGED 2005/09/21 07:30:41 oj 1.2.146.2: RESYNC: (1.2-1.3); FILE MERGED 2005/07/11 13:37:06 fs 1.2.146.1: merging CWS dba201 into CWS dba201b

--- dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
+++ dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlHierarchyCollection.cxx,v $
  *
- *  $Revision: 1.3 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-08 14:07:17 $
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: hr $ $Date: 2005-09-23 12:11:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -67,6 +67,9 @@
 #endif
 #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
 #include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
 #endif

@@ -77,6 +80,7 @@
     using namespace ::com::sun::star::beans;
     using namespace ::com::sun::star::container;
     using namespace ::com::sun::star::xml::sax;
+DBG_NAME(OXMLHierarchyCollection)

 OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport
                 ,sal_uInt16 nPrfx
@@ -90,6 +94,8 @@
     ,m_sCollectionServiceName(_sCollectionServiceName)
     ,m_sComponentServiceName(_sComponentServiceName)
 {
+    DBG_CTOR(OXMLHierarchyCollection,NULL);
+
     const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
     const SvXMLTokenMap& rTokenMap = rImport.GetComponentElemTokenMap();

@@ -148,11 +154,14 @@
     SvXMLImportContext( rImport, nPrfx, _sLocalName )
     ,m_xContainer(_xContainer)
 {
+    DBG_CTOR(OXMLHierarchyCollection,NULL);
 }
 // -----------------------------------------------------------------------------

 OXMLHierarchyCollection::~OXMLHierarchyCollection()
 {
+
+    DBG_DTOR(OXMLHierarchyCollection,NULL);
 }
 // -----------------------------------------------------------------------------
 SvXMLImportContext* OXMLHierarchyCollection::CreateChildContext(


Extend test of array store compaction context.

--- vespalib/src/tests/datastore/array_store/array_store_test.cpp
+++ vespalib/src/tests/datastore/array_store/array_store_test.cpp
@@ -18,7 +18,14 @@
 using MemStats = vespalib::datastore::test::MemStats;
 using BufferStats = vespalib::datastore::test::BufferStats;

+namespace {
+
 constexpr float ALLOC_GROW_FACTOR = 0.2;
+
+EntryRef as_entry_ref(const EntryRef& ref) noexcept { return ref; }
+EntryRef as_entry_ref(const AtomicEntryRef& ref) noexcept { return ref.load_relaxed(); }
+
+}

 template <typename EntryT, typename RefT = EntryRefT<19> >
 struct Fixture
@@ -115,19 +122,20 @@
         store.transferHoldLists(generation++);
         store.trimHoldLists(generation);
     }
+    template <typename TestedRefType>
     void compactWorst(bool compactMemory, bool compactAddressSpace) {
         ICompactionContext::UP ctx = store.compactWorst(compactMemory, compactAddressSpace);
-        std::vector<EntryRef> refs;
+        std::vector<TestedRefType> refs;
         for (auto itr = refStore.begin(); itr != refStore.end(); ++itr) {
-            refs.push_back(itr->first);
+            refs.emplace_back(itr->first);
         }
-        std::vector<EntryRef> compactedRefs = refs;
-        ctx->compact(ArrayRef<EntryRef>(compactedRefs));
+        std::vector<TestedRefType> compactedRefs = refs;
+        ctx->compact(ArrayRef<TestedRefType>(compactedRefs));
         ReferenceStore compactedRefStore;
         for (size_t i = 0; i < refs.size(); ++i) {
-            ASSERT_EQUAL(0u, compactedRefStore.count(compactedRefs[i]));
-            ASSERT_EQUAL(1u, refStore.count(refs[i]));
-            compactedRefStore.insert(std::make_pair(compactedRefs[i], refStore[refs[i]]));
+            ASSERT_EQUAL(0u, compactedRefStore.count(as_entry_ref(compactedRefs[i])));
+            ASSERT_EQUAL(1u, refStore.count(as_entry_ref(refs[i])));
+            compactedRefStore.insert(std::make_pair(as_entry_ref(compactedRefs[i]), refStore[as_entry_ref(refs[i])]));
         }
         refStore = compactedRefStore;
     }
@@ -252,7 +260,11 @@
     TEST_DO(f.assertStoreContent());
 }

-TEST_F("require that the buffer with most dead space is compacted", NumberFixture(2))
+namespace {
+
+template <typename TestedRefType>
+void
+test_compaction(NumberFixture &f)
 {
     EntryRef size1Ref = f.add({1});
     EntryRef size2Ref = f.add({2,2});
@@ -267,7 +279,7 @@
     uint32_t size3BufferId = f.getBufferId(size3Ref);

     EXPECT_EQUAL(3u, f.refStore.size());
-    f.compactWorst(true, false);
+    f.compactWorst<TestedRefType>(true, false);
     EXPECT_EQUAL(3u, f.refStore.size());
     f.assertStoreContent();

@@ -281,6 +293,18 @@
     EXPECT_TRUE(f.store.bufferState(size2Ref).isFree());
 }

+}
+
+TEST_F("require that the buffer with most dead space is compacted (EntryRef vector)", NumberFixture(2))
+{
+    test_compaction<EntryRef>(f);
+}
+
+TEST_F("require that the buffer with most dead space is compacted (AtomicEntryRef vector)", NumberFixture(2))
+{
+    test_compaction<AtomicEntryRef>(f);
+}
+
 namespace {

 void testCompaction(NumberFixture &f, bool compactMemory, bool compactAddressSpace)
@@ -300,7 +324,7 @@
     uint32_t size3BufferId = f.getBufferId(size3Ref);

     EXPECT_EQUAL(3u, f.refStore.size());
-    f.compactWorst(compactMemory, compactAddressSpace);
+    f.compactWorst<EntryRef>(compactMemory, compactAddressSpace);
     EXPECT_EQUAL(3u, f.refStore.size());
     f.assertStoreContent();


Simplify CheckValidR function PR feedback


Fix error in is_single_node

Fix error in is_single_node

--- src/manager.cc
+++ src/manager.cc
@@ -248,7 +248,7 @@
 bool
 XapiandManager::is_single_node()
 {
-	return nodes.size() == 1;
+	return nodes.size() == 0;
 }


ENH:Adjusted bounding box size; fixed bug in GetTetras() due to size of point array

--- common/vtkOrderedTriangulator.cxx
+++ common/vtkOrderedTriangulator.cxx
@@ -353,7 +353,7 @@
   center[0] = (double) (bounds[0]+bounds[1])/2.0;
   center[1] = (double) (bounds[2]+bounds[3])/2.0;
   center[2] = (double) (bounds[4]+bounds[5])/2.0;
-  length = 2.5 * sqrt( (radius2 = (bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
+  length = 3.0 * sqrt( (radius2 = (bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
                  (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
                  (bounds[5]-bounds[4])*(bounds[5]-bounds[4])) );
   radius2 /= 2.0;
@@ -836,7 +836,7 @@
   int numTetras=0;
   vtkOTVector<vtkOTPoint>::Iterator p;
   vtkPoints *points = vtkPoints::New();
-  points->SetNumberOfPoints(this->MaximumNumberOfPoints);
+  points->SetNumberOfPoints(this->MaximumNumberOfPoints+6);
   for ( p=this->Mesh->Points.Begin();
         p != this->Mesh->Points.End(); ++p)
     {


Revert this file submitted by accident
Review URL: http://codereview.chromium.org/13222

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

--- webkit/glue/plugins/test/plugin_execute_script_delete_test.cc
+++ webkit/glue/plugins/test/plugin_execute_script_delete_test.cc
@@ -31,17 +31,6 @@
   if (WM_PAINT == np_event->event &&
       base::strcasecmp(test_name_.c_str(),
                        "execute_script_delete_in_paint") == 0) {
-    NPString script_string;
-    script_string.UTF8Characters = "javascript:alert(\"hi\")";
-    script_string.UTF8Length =
-        static_cast<unsigned int>(strlen("javascript:alert(\"hi\")"));
-
-    NPObject *window_obj = NULL;
-    browser->getvalue(id(), NPNVWindowNPObject, &window_obj);
-    NPVariant result_var;
-    NPError result = browser->evaluate(id(), window_obj,
-                                       &script_string, &result_var);
-
     NPUTF8* urlString = "javascript:DeletePluginWithinScript()";
     NPUTF8* targetString = NULL;
     browser->geturl(id(), urlString, targetString);


[TF:TRT] Fix memory leakage in TRTEngineOp::ExecuteNativeSegment.

The statement `delete outputs` may not be executed in the original implementation.

PiperOrigin-RevId: 347915990
Change-Id: Ic5cee6b19eb55ce5da5b3669ede0059d1889288c

--- tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc
+++ tensorflow/compiler/tf2tensorrt/kernels/trt_engine_op.cc
@@ -461,12 +461,12 @@
   lib->Run(opts, native_execution_func_handle_, inputs, outputs,
            [this, ctx, outputs, helper](const Status& s) {
              core::ScopedUnref sc(helper);
+             std::unique_ptr<std::vector<Tensor>> outputs_wrapper(outputs);
              OP_REQUIRES_OK_ASYNC(ctx, s, *helper);
              VLOG(1) << "Native Segment completed";
              for (size_t t = 0; t < outputs->size(); ++t) {
                ctx->set_output(t, outputs->at(t));
              }
-             delete outputs;
            });
 }


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: de016e52bd170d2d4f2344f9bf92d50478b649e0@9044 0039d316-1c4b-4281-b951-d872f2087c98

--- 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());
       }


Have 5 second timeout with NATPMP, instead of random timeout

--- net/networklistener.cpp
+++ net/networklistener.cpp
@@ -385,14 +385,27 @@
             int loopCount = 0 ;
             initnatpmp(&natpmp,forcegw,gateway);
             sendnewportmappingrequest(&natpmp, NATPMP_PROTOCOL_TCP, iModel->nodeModel().listenPortOfThisNode(), iModel->nodeModel().listenPortOfThisNode(),INT_MAX-1);
+            int select_retval ( -1 ) ;
             do {
                 fd_set fds;
                 struct timeval timeout;
                 FD_ZERO(&fds);
                 FD_SET(natpmp.s, &fds);
                 getnatpmprequesttimeout(&natpmp, &timeout);
-                select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
-                r = readnatpmpresponseorretry(&natpmp, &response);
+                select_retval = select(FD_SETSIZE, &fds, NULL, NULL, &timeout);
+                if ( select_retval == -1 ) {
+                    QLOG_STR("natpmp wait select error = " +
+                             QString::number(select_retval)) ;
+                    r = NATPMP_ERR_CANNOTGETGATEWAY ;
+                    break ; // out of the loop
+                } else if ( select_retval ) {
+                    r = readnatpmpresponseorretry(&natpmp, &response);
+                } else {
+                    // no data within timeout:
+                    QLOG_STR("natpmp wait timeout reached") ;
+                    r = NATPMP_ERR_CANNOTGETGATEWAY ;
+                    break ; // out of the loop
+                }
             } while(r==NATPMP_TRYAGAIN && ++loopCount < 100 );
             if(r>=0) {
                 printf("Mapped public port %hu protocol %s to local port %hu "


CookieMonster: don't initialize store when we don't use it.

The CookieMonster destructor calls DeleteAll(false); "false"
here means "don't synchronize this change to the backing store".
If we call InitIfNecessary(), we can end up actually creating
the store (which does SQLite calls and disk syncs etc.) during
this destructor!

I found this was delaying shutdown by a full fsync in a UI test.

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

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@61524 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- net/base/cookie_monster.cc
+++ net/base/cookie_monster.cc
@@ -1122,7 +1122,8 @@

 int CookieMonster::DeleteAll(bool sync_to_store) {
   AutoLock autolock(lock_);
-  InitIfNecessary();
+  if (sync_to_store)
+    InitIfNecessary();

   int num_deleted = 0;
   for (CookieMap::iterator it = cookies_.begin(); it != cookies_.end();) {


Fixed port boundary check in test_server.cc

BUG=53934
TEST=manual

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

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

Former-commit-id: b201629122989420bc5522661e0c5fb02442c00a

--- net/test/test_server.cc
+++ net/test/test_server.cc
@@ -397,7 +397,7 @@
     LOG(ERROR) << "Could not find port value";
     return false;
   }
-  if ((port <= 0) || (port >= kuint16max)) {
+  if ((port <= 0) || (port > kuint16max)) {
     LOG(ERROR) << "Invalid port value: " << port;
     return false;
   }


No comment.

No comment.

--- frontends/CsoundAC/Score.cpp
+++ frontends/CsoundAC/Score.cpp
@@ -317,7 +317,7 @@
     System::inform("BEGAN Score::save(%s)...\n", filename.c_str());
     std::ofstream stream;
     //stream.open(filename.c_str(), std::ios_base::binary);
-    stream.open(filename.c_str(), std::ifstream::binary);
+    stream.open(filename.c_str(), std::ios::out | std::ios::binary);
     if (filename.find(".mid") != std::string::npos ||
             filename.find(".MID") != std::string::npos) {
         save(stream);
@@ -363,13 +363,14 @@
 	int identifier = i;
 	Alg_note *note = seq.create_note(time,
 					 channel,
-					 identifier,
+					 pitch,
 					 pitch,
 					 loudness,
 					 duration);
 	seq.add(note);
       }
     }
+    seq.write(std::cout, false);
     seq.smf_write(stream);
   // save(midifile);
   // midifile.write(stream);


Simplify comphelper::string::isdigitAsciiString definitions

Change-Id: I26c889e51287a239ef92a798a6899266837064d9

--- comphelper/source/misc/string.cxx
+++ comphelper/source/misc/string.cxx
@@ -24,6 +24,7 @@
 #include <vector>
 #include <algorithm>

+#include <rtl/character.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <rtl/string.hxx>
@@ -342,30 +343,18 @@
     m_xBI = i18n::BreakIterator::create( rContext );
 }

-namespace
-{
-    //do OPER on each element of the string, return false
-    //if any OPER is false, true otherwise
-    template <bool (*OPER)(sal_Unicode), typename T>
-    bool tmpl_is_OPER_AsciiString(const T &rString)
-    {
-        for (sal_Int32 i = 0; i < rString.getLength(); ++i)
-        {
-            if (!OPER(rString[i]))
-                return false;
-        }
-        return true;
-    }
-}
-
 bool isdigitAsciiString(const OString &rString)
 {
-    return tmpl_is_OPER_AsciiString<isdigitAscii>(rString);
+    return std::all_of(
+        rString.getStr(), rString.getStr() + rString.getLength(),
+        [](unsigned char c){ return rtl::isAsciiDigit(c); });
 }

 bool isdigitAsciiString(const OUString &rString)
 {
-    return tmpl_is_OPER_AsciiString<isdigitAscii>(rString);
+    return std::all_of(
+        rString.getStr(), rString.getStr() + rString.getLength(),
+        rtl::isAsciiDigit);
 }

 namespace


Remove all PSL support code from verific.cc

--- frontends/verific/verific.cc
+++ frontends/verific/verific.cc
@@ -104,9 +104,9 @@
 void svapp_cover(VerificImporter *importer, Instance *inst);

 struct VerificClockEdge {
-	Net *clock_net;
-	SigBit clock_sig;
-	bool posedge;
+	Net *clock_net = nullptr;
+	SigBit clock_sig = State::Sx;
+	bool posedge = false;
 	VerificClockEdge(VerificImporter *importer, Instance *inst);
 };

@@ -121,7 +121,6 @@
 	bool mode_gates, mode_keep, mode_nosva, mode_nosvapp, mode_names, verbose;

 	pool<int> verific_sva_prims;
-	pool<int> verific_psl_prims;

 	VerificImporter(bool mode_gates, bool mode_keep, bool mode_nosva, bool mode_nosvapp, bool mode_names, bool verbose) :
 			mode_gates(mode_gates), mode_keep(mode_keep), mode_nosva(mode_nosva),
@@ -152,29 +151,6 @@

 		for (int p : sva_prims)
 			verific_sva_prims.insert(p);
-
-		// Copy&paste from Verific 3.16_484_32_170630 Netlist.h
-		vector<int> psl_prims {
-			OPER_PSLPREV, OPER_PSLNEXTFUNC, PRIM_PSL_ASSERT, PRIM_PSL_ASSUME,
-			PRIM_PSL_ASSUME_GUARANTEE, PRIM_PSL_RESTRICT, PRIM_PSL_RESTRICT_GUARANTEE,
-			PRIM_PSL_COVER, PRIM_ENDPOINT,  PRIM_ROSE, PRIM_FELL, PRIM_AT, PRIM_ATSTRONG,
-			PRIM_ABORT, PRIM_PSL_NOT, PRIM_PSL_AND, PRIM_PSL_OR, PRIM_IMPL, PRIM_EQUIV,
-			PRIM_PSL_X, PRIM_PSL_XSTRONG, PRIM_PSL_G, PRIM_PSL_F, PRIM_PSL_U, PRIM_PSL_W,
-			PRIM_NEXT, PRIM_NEXTSTRONG, PRIM_ALWAYS, PRIM_NEVER, PRIM_EVENTUALLY,
-			PRIM_UNTIL, PRIM_UNTIL_, PRIM_UNTILSTRONG, PRIM_UNTILSTRONG_, PRIM_BEFORE,
-			PRIM_BEFORE_, PRIM_BEFORESTRONG, PRIM_BEFORESTRONG_, PRIM_NEXT_A,
-			PRIM_NEXT_ASTRONG, PRIM_NEXT_E, PRIM_NEXT_ESTRONG, PRIM_NEXT_EVENT,
-			PRIM_NEXT_EVENTSTRONG, PRIM_NEXT_EVENT_A, PRIM_NEXT_EVENT_ASTRONG,
-			PRIM_NEXT_EVENT_E, PRIM_NEXT_EVENT_ESTRONG, PRIM_SEQ_IMPL, PRIM_OSUFFIX_IMPL,
-			PRIM_SUFFIX_IMPL, PRIM_OSUFFIX_IMPLSTRONG, PRIM_SUFFIX_IMPLSTRONG, PRIM_WITHIN,
-			PRIM_WITHIN_, PRIM_WITHINSTRONG, PRIM_WITHINSTRONG_, PRIM_WHILENOT,
-			PRIM_WHILENOT_, PRIM_WHILENOTSTRONG, PRIM_WHILENOTSTRONG_, PRIM_CONCAT,
-			PRIM_FUSION, PRIM_SEQ_AND_LEN, PRIM_SEQ_AND, PRIM_SEQ_OR, PRIM_CONS_REP,
-			PRIM_NONCONS_REP, PRIM_GOTO_REP
-		};
-
-		for (int p : psl_prims)
-			verific_psl_prims.insert(p);
 	}

 	RTLIL::SigBit net_map_at(Net *net)
@@ -1126,20 +1102,20 @@
 			if (!mode_gates) {
 				if (import_netlist_instance_cells(inst, inst_name))
 					continue;
-				if (inst->IsOperator() && !verific_sva_prims.count(inst->Type()) && !verific_psl_prims.count(inst->Type()))
+				if (inst->IsOperator() && !verific_sva_prims.count(inst->Type()))
 					log_warning("Unsupported Verific operator: %s (fallback to gate level implementation provided by verific)\n", inst->View()->Owner()->Name());
 			} else {
 				if (import_netlist_instance_gates(inst, inst_name))
 					continue;
 			}

-			if (inst->Type() == PRIM_SVA_ASSERT || inst->Type() == PRIM_PSL_ASSERT)
+			if (inst->Type() == PRIM_SVA_ASSERT)
 				sva_asserts.insert(inst);

-			if (inst->Type() == PRIM_SVA_ASSUME || inst->Type() == PRIM_PSL_ASSUME)
+			if (inst->Type() == PRIM_SVA_ASSUME)
 				sva_assumes.insert(inst);

-			if (inst->Type() == PRIM_SVA_COVER || inst->Type() == PRIM_PSL_COVER)
+			if (inst->Type() == PRIM_SVA_COVER)
 				sva_covers.insert(inst);

 			if (inst->Type() == PRIM_SVA_PAST && !mode_nosva)
@@ -1159,38 +1135,9 @@
 					continue;
 			}

-			if (inst->Type() == OPER_PSLPREV && !mode_nosva)
-			{
-				Net *clock = inst->GetClock();
-
-				if (!clock->IsConstant())
-				{
-					VerificClockEdge clock_edge(this, clock->Driver());
-
-					SigSpec sig_d, sig_q;
-
-					for (int i = 0; i < int(inst->InputSize()); i++) {
-						sig_d.append(net_map_at(inst->GetInputBit(i)));
-						sig_q.append(net_map_at(inst->GetOutputBit(i)));
-					}
-
-					if (verbose)
-						log("    %sedge FF with D=%s, Q=%s, C=%s.\n", clock_edge.posedge ? "pos" : "neg",
-								log_signal(sig_d), log_signal(sig_q), log_signal(clock_edge.clock_sig));
-
-					RTLIL::Cell *ff = module->addDff(NEW_ID, clock_edge.clock_sig, sig_d, sig_q, clock_edge.posedge);
-
-					if (inst->InputSize() == 1)
-						past_ffs.insert(ff);
-
-					if (!mode_keep)
-						continue;
-				}
-			}
-
-			if (!mode_keep && (verific_sva_prims.count(inst->Type()) || verific_psl_prims.count(inst->Type()))) {
+			if (!mode_keep && verific_sva_prims.count(inst->Type())) {
 				if (verbose)
-					log("    skipping SVA/PSL cell in non k-mode\n");
+					log("    skipping SVA cell in non k-mode\n");
 				continue;
 			}

@@ -1202,7 +1149,7 @@
 				if (!mode_keep)
 					log_error("Unsupported Verific primitive %s of type %s\n", inst->Name(), inst->View()->Owner()->Name());

-				if (!verific_sva_prims.count(inst->Type()) && !verific_psl_prims.count(inst->Type()))
+				if (!verific_sva_prims.count(inst->Type()))
 					log_warning("Unsupported Verific primitive %s of type %s\n", inst->Name(), inst->View()->Owner()->Name());
 			}

@@ -1277,36 +1224,6 @@
 	}
 };

-Net *verific_follow_inv(Net *w)
-{
-	if (w == nullptr || w->IsMultipleDriven())
-		return nullptr;
-
-	Instance *i = w->Driver();
-	if (i == nullptr || i->Type() != PRIM_INV)
-		return nullptr;
-
-	return i->GetInput();
-}
-
-Net *verific_follow_pslprev(Net *w)
-{
-	if (w == nullptr || w->IsMultipleDriven())
-		return nullptr;
-
-	Instance *i = w->Driver();
-	if (i == nullptr || i->Type() != OPER_PSLPREV || i->InputSize() != 1)
-		return nullptr;
-
-	return i->GetInputBit(0);
-}
-
-Net *verific_follow_inv_pslprev(Net *w)
-{
-	w = verific_follow_inv(w);
-	return verific_follow_pslprev(w);
-}
-
 VerificClockEdge::VerificClockEdge(VerificImporter *importer, Instance *inst)
 {
 	log_assert(importer != nullptr);
@@ -1327,43 +1244,6 @@
 		clock_sig = importer->net_map_at(clock_net);
 		return;
 	}
-
-	// VHDL-flavored PSL clock
-	if (inst->Type() == PRIM_AND)
-	{
-		Net *w1 = inst->GetInput1();
-		Net *w2 = inst->GetInput2();
-
-		clock_net = verific_follow_inv_pslprev(w1);
-		if (clock_net == w2) {
-			clock_sig = importer->net_map_at(clock_net);
-			posedge = true;
-			return;
-		}
-
-		clock_net = verific_follow_inv_pslprev(w2);
-		if (clock_net == w1) {
-			clock_sig = importer->net_map_at(clock_net);
-			posedge = true;
-			return;
-		}
-
-		clock_net = verific_follow_pslprev(w1);
-		if (clock_net == verific_follow_inv(w2)) {
-			clock_sig = importer->net_map_at(clock_net);
-			posedge = false;
-			return;
-		}
-
-		clock_net = verific_follow_pslprev(w2);
-		if (clock_net == verific_follow_inv(w1)) {
-			clock_sig = importer->net_map_at(clock_net);
-			posedge = false;
-			return;
-		}
-
-		log_abort();
-	}
 }

 // ==================================================================
@@ -1393,8 +1273,7 @@
 		if (inst == nullptr)
 			return nullptr;

-		if (!importer->verific_sva_prims.count(inst->Type()) &&
-				!importer->verific_psl_prims.count(inst->Type()))
+		if (!importer->verific_sva_prims.count(inst->Type()))
 			return nullptr;

 		if (inst->Type() == PRIM_SVA_PAST)
@@ -1515,8 +1394,7 @@
 		if (inst == nullptr)
 			return nullptr;

-		if (!importer->verific_sva_prims.count(inst->Type()) &&
-				!importer->verific_psl_prims.count(inst->Type()))
+		if (!importer->verific_sva_prims.count(inst->Type()))
 			return nullptr;

 		if (inst->Type() == PRIM_SVA_PAST)
@@ -1625,31 +1503,6 @@
 			return;
 		}

-		// PSL Primitives
-
-		if (inst->Type() == PRIM_ALWAYS)
-		{
-			parse_sequence(seq, inst->GetInput());
-			return;
-		}
-
-		if (inst->Type() == PRIM_IMPL)
-		{
-			parse_sequence(seq, inst->GetInput1());
-			seq.sig_en = module->And(NEW_ID, seq.sig_en, seq.sig_a);
-			parse_sequence(seq, inst->GetInput2());
-			return;
-		}
-
-		if (inst->Type() == PRIM_SUFFIX_IMPL)
-		{
-			parse_sequence(seq, inst->GetInput1());
-			seq.sig_en = module->And(NEW_ID, seq.sig_en, seq.sig_a);
-			sequence_ff(seq);
-			parse_sequence(seq, inst->GetInput2());
-			return;
-		}
-
 		// Handle unsupported primitives

 		if (!importer->mode_keep)
@@ -1665,15 +1518,15 @@
 		// parse SVA property clock event

 		Instance *at_node = get_ast_input(root);
-		log_assert(at_node && (at_node->Type() == PRIM_SVA_AT || at_node->Type() == PRIM_AT));
-
-		VerificClockEdge clock_edge(importer, at_node->Type() == PRIM_SVA_AT ? get_ast_input1(at_node) : at_node->GetInput2()->Driver());
+		log_assert(at_node && at_node->Type() == PRIM_SVA_AT);
+
+		VerificClockEdge clock_edge(importer, get_ast_input1(at_node));
 		clock = clock_edge.clock_sig;
 		clock_posedge = clock_edge.posedge;

 		// parse disable_iff expression

-		Net *sequence_net = at_node->Type() == PRIM_SVA_AT ? at_node->GetInput2() : at_node->GetInput1();
+		Net *sequence_net = at_node->GetInput2();

 		while (1)
 		{
@@ -1688,12 +1541,6 @@
 			if (sequence_node && sequence_node->Type() == PRIM_SVA_DISABLE_IFF) {
 				disable_iff = importer->net_map_at(sequence_node->GetInput1());
 				sequence_net = sequence_node->GetInput2();
-				continue;
-			}
-
-			if (sequence_node && sequence_node->Type() == PRIM_ABORT) {
-				disable_iff = importer->net_map_at(sequence_node->GetInput2());
-				sequence_net = sequence_node->GetInput1();
 				continue;
 			}

@@ -1846,7 +1693,7 @@
 		log("Load the specified Verilog/SystemVerilog files into Verific.\n");
 		log("\n");
 		log("\n");
-		log("    verific {-vhdl87|-vhdl93|-vhdl2k|-vhdl2008|-vhdl|-vhdpsl} <vhdl-file>..\n");
+		log("    verific {-vhdl87|-vhdl93|-vhdl2k|-vhdl2008|-vhdl} <vhdl-file>..\n");
 		log("\n");
 		log("Load the specified VHDL files into Verific.\n");
 		log("\n");
@@ -1900,8 +1747,7 @@
 		log("    the checker logic inferred by it.\n");
 		log("\n");
 		log("  -nosva\n");
-		log("    Ignore SVA properties, do not infer checker logic. (This also disables\n");
-		log("    PSL properties in -vhdpsl mode.)\n");
+		log("    Ignore SVA properties, do not infer checker logic.\n");
 		log("\n");
 		log("  -nosvapp\n");
 		log("    Disable SVA properties pre-processing pass. This implies -nosva.\n");
@@ -2033,14 +1879,6 @@
 			for (argidx++; argidx < GetSize(args); argidx++)
 				if (!vhdl_file::Analyze(args[argidx].c_str(), "work", vhdl_file::VHDL_2008))
 					log_cmd_error("Reading `%s' in VHDL_2008 mode failed.\n", args[argidx].c_str());
-			goto check_error;
-		}
-
-		if (GetSize(args) > argidx && args[argidx] == "-vhdpsl") {
-			vhdl_file::SetDefaultLibraryPath((proc_share_dirname() + "verific/vhdl_vdbs_2008").c_str());
-			for (argidx++; argidx < GetSize(args); argidx++)
-				if (!vhdl_file::Analyze(args[argidx].c_str(), "work", vhdl_file::VHDL_PSL))
-					log_cmd_error("Reading `%s' in VHDL_PSL mode failed.\n", args[argidx].c_str());
 			goto check_error;
 		}


verific: unflatten struct ports

verific: unflatten struct ports

--- frontends/verific/verific.cc
+++ frontends/verific/verific.cc
@@ -2470,6 +2470,9 @@
 					worker.run(nl);
 			}

+			for (auto nl : nl_todo)
+				nl->ChangePortBusStructures(1 /* hierarchical */);
+
 			if (!dumpfile.empty()) {
 				VeriWrite veri_writer;
 				veri_writer.WriteFile(dumpfile.c_str(), Netlist::PresentDesign());


Exceptions.

Exceptions.

--- src/pybindings/except.cpp
+++ src/pybindings/except.cpp
@@ -1,4 +1,5 @@
 #include <ecto/ecto.hpp>
+#include <boost/python/errors.hpp>
 namespace bp = boost::python;
 using namespace ecto::except;
 namespace ecto


Up max_connections on the MEM chainer from 10 to 20

Should help prevent us from mapping only one read of a pair
sometimes.

--- src/mapper.hpp
+++ src/mapper.hpp
@@ -101,7 +101,7 @@
         const function<double(const MaximalExactMatch&, const MaximalExactMatch&)>& transition_weight,
         int band_width = 10,
         int position_depth = 1,
-        int max_connections = 10);
+        int max_connections = 20);
     void score(const set<MEMChainModelVertex*>& exclude);
     MEMChainModelVertex* max_vertex(void);
     vector<vector<MaximalExactMatch> > traceback(int alt_alns, bool paired, bool debug);


Some more minor editing.

Some more minor editing.

--- src/plugins/misc/CellMLSupport/src/cellmlmodelruntime.cpp
+++ src/plugins/misc/CellMLSupport/src/cellmlmodelruntime.cpp
@@ -550,7 +550,7 @@
                 "         *gcd(3, 15, 35, 55)/gcd(5, 21, 35, 7*pData[3], pData[4], 49)"
                 "         *xor(pData[3], 0)*xor(3, 0)"
                 "         *rem(pData[3], pData[4])*rem(5, 3)*quotient(pData[4], pData[3])"
-                "         *quotient(17, 5)"
+                "         *quotient(pData[4], pData[3])*quotient(17, 5)"
                 "         *factorOf(15, pData[3])*factorOf(9, 3)"
                 "         *arbitraryLog(pData[4], pData[3])"
                 "         *atanh(tanh(acosh(cosh(asinh(sinh(atan(tan(acos(cos(asin(sin(factorial(pData[3])/factorial(4)*pow(0+fabs(-3)*-pData[0]-0+exp(+log(pData[1])*1)/-ceil(pData[2])/-1e6, floor(fabs(pData[3])/3+0)+1)))))))))))));\n"


wrong doubleside

wrong doubleside

--- test/candidates/amortized/linear/deamortized_hash_set.hh
+++ test/candidates/amortized/linear/deamortized_hash_set.hh
@@ -101,7 +101,7 @@
   }

   void init(const size_t left) {
-    assert ((0 == capacity) || (state == RESET) || (state == INIT));
+    assert ((0 == capacity) || (state == RESET) || (state == INIT) || (FILL == state));
     if (RESET == state) {
       progress = 0;
     }
@@ -114,7 +114,7 @@
   }

   void reset(const size_t new_capacity) {
-    assert ((0 == capacity) || (state == CLEAR) || (INIT == state) || (FILL == state));
+    assert ((0 == capacity) || (state == CLEAR) || (INIT == state));
     state = RESET;
     size = 0;
     if (new_capacity != capacity) {


detail::MemoryIdler should use Malloc.h's mallctl decl

Summary:
Malloc.h now takes care to declare mallctl properly on platforms
that aren't using weak symbols, so we should just rely on that for
MemoryIdler.cpp.  This is one step toward fixing folly build on OS X.

Test Plan: fbmake runtests

Reviewed By: je@fb.com

Subscribers: yiding, njormrod

FB internal diff: D1596930

Tasks: 4952724

Blame Revision:

--- folly/detail/MemoryIdler.cpp
+++ folly/detail/MemoryIdler.cpp
@@ -26,13 +26,6 @@
 #include <unistd.h>
 #include <sys/mman.h>
 #include <utility>
-
-
-// weak linking means the symbol will be null if not available, instead
-// of a link failure
-extern "C" int mallctl(const char *name, void *oldp, size_t *oldlenp,
-                       void *newp, size_t newlen)
-    __attribute__((__weak__));

 namespace folly { namespace detail {


Handle event_base_new failure when out of file descriptors.

Summary:
Both event_base_new and event_init return nullptr when out of file descriptors.
Using null event_base will result in segfault.

Test Plan: (ulimit -n 50000 && _build/opt/sigma/service/sigma_server --instance_name=si_sigma_push --min_scribe_log_level=0 --allow_status_port_fallback=true --minloglevel=1 --v=0 --feature_objects_limit=1000000 --hbase_default_timeout_ms=250 --max_total_connections_per_region_server=10 --max_retained_connections_per_region_server=10 --tao_default_timeout_ms=5000 --enable_writes_scribe_si_floop=false --enable_writes_all=false --arena_size_limit=268435456 --run_fxl=true)

Reviewed By: davejwatson@fb.com

FB internal diff: D1311855

--- folly/io/async/EventBase.cpp
+++ folly/io/async/EventBase.cpp
@@ -144,6 +144,10 @@
   , startWork_(0)
   , observer_(nullptr)
   , observerSampleCount_(0) {
+  if (UNLIKELY(evb_ == nullptr)) {
+    LOG(ERROR) << "EventBase(): Failed to init event base.";
+    folly::throwSystemError("error in EventBase::EventBase()");
+  }
   VLOG(5) << "EventBase(): Created.";
   initNotificationQueue();
   RequestContext::getStaticContext();
@@ -165,6 +169,10 @@
   , startWork_(0)
   , observer_(nullptr)
   , observerSampleCount_(0) {
+  if (UNLIKELY(evb_ == nullptr)) {
+    LOG(ERROR) << "EventBase(): Pass nullptr as event base.";
+    throw std::invalid_argument("EventBase(): event base cannot be nullptr");
+  }
   initNotificationQueue();
   RequestContext::getStaticContext();
 }


lang/c/msgpack: C++ binding: abolished implicit convertion and added object::convert()

git-svn-id: b1909e69a052d69f94efe837783fda889aa120ca@79 5a5092ae-2292-43ba-b2d5-dcab9c1a2731

--- cpp/object.hpp
+++ cpp/object.hpp
@@ -44,8 +44,7 @@

 struct object {
-	unsigned char type;
-	union {
+	union union_type {
 		bool boolean;
 		uint64_t u64;
 		int64_t  i64;
@@ -58,15 +57,36 @@
 			const char* ptr;
 			uint32_t size;
 		} ref;
-	} via;
+	};
+
+	unsigned char type;
+	union_type via;
+
+	bool is_nil() { return type == type::NIL; }

 	template <typename T>
-	operator T() { T v; convert(v, *this); return v; };
+	T as();

 	template <typename T>
-	T as() { T v; convert(v, *this); return v; }
-
-	bool is_nil() { return type == type::NIL; }
+	void convert(T& v);
+
+private:
+	struct implicit_type;
+
+public:
+	implicit_type convert();
+};
+
+
+struct object::implicit_type {
+	implicit_type(object o) : obj(o) { }
+	~implicit_type() { }
+
+	template <typename T>
+	operator T() { return obj.as<T>(); }
+
+private:
+	object obj;
 };

 std::ostream& operator<< (std::ostream& s, const object o);
@@ -74,9 +94,11 @@
 bool operator==(const object x, const object y);
 inline bool operator!=(const object x, const object y) { return !(x == y); }

-
 inline object& operator>> (object o, object& v)
-	{ v = o; return v; }
+{
+	v = o;
+	return v;
+}

 template <typename Stream>
 packer<Stream>& operator<< (packer<Stream>& o, const object& v);
@@ -146,6 +168,25 @@
 };

+
+inline object::implicit_type object::convert()
+{
+	return implicit_type(*this);
+}
+
+template <typename T>
+inline T object::as()
+{
+	T v;
+	msgpack::convert(v, *this);
+	return v;
+}
+
+template <typename T>
+void object::convert(T& v)
+{
+	msgpack::convert(v, *this);
+}

 template <typename Stream>
 packer<Stream>& operator<< (packer<Stream>& o, const object& v)


modularize parallelization

modularize parallelization

--- galaxy.cc
+++ galaxy.cc
@@ -25,36 +25,47 @@
 }

 void Simulator::stop() {
-	std::cerr << "Simulator stopping\n";
 	stop_ = true;
 	if(!stopped_) {
 		std::unique_lock<std::mutex> lk(mustop_);
 		while(!stopped_)
 			cvstop_.wait(lk);
 	}
-	std::cerr << "Simulator stopped\n";
-}
-
-std::array<std::mutex, 3> mu;
-std::array<std::condition_variable, 3> cv;
-std::array<std::atomic_bool, 3> go;
-std::atomic_bool die;
-std::mutex mudone;
-std::condition_variable cvdone;
-std::atomic_int running;
+}
+
+template <int n>
+struct Parallel {
+	std::array<std::mutex, n> mu;
+	std::array<std::condition_variable, n> cv;
+	std::array<std::atomic_bool, n> go;
+	std::atomic_bool die;
+	std::mutex mudone;
+	std::condition_variable cvdone;
+	std::atomic_int running;
+
+	void goThreads() {
+		running = n;
+		for(auto i = 0; i < n; ++i) {
+			go[i] = true;
+			cv[i].notify_one();
+		}
+	}
+};
+
+Parallel<3> par;

 void calcLoop(Galaxy& g, BHTree& tree, const int tid) {
 	for(;;) {
-		if(!go[tid]) {
-			std::unique_lock<std::mutex> lk(mu[tid]);
-			while(!go[tid])
-				cv[tid].wait(lk);
-		}
-		if(die) {
+		if(!par.go[tid]) {
+			std::unique_lock<std::mutex> lk(par.mu[tid]);
+			while(!par.go[tid])
+				par.cv[tid].wait(lk);
+		}
+		if(par.die) {
 			std::cerr << "Calcloop " << tid << " dying\n";
 			return;
 		}
-		go[tid] = false;
+		par.go[tid] = false;

 		auto nbody = g.bodies.size()/4;
 		auto start = g.bodies.begin() + nbody*tid;
@@ -62,17 +73,8 @@
 		for(auto& i = start; i < end; ++i)
 			tree.calcforce(*i);

-		--running;
-		if(running == 0)
-			cvdone.notify_one();
-	}
-}
-
-void goThreads() {
-	running = 3;
-	for(auto i = 0; i < 3; ++i) {
-		go[i] = true;
-		cv[i].notify_one();
+		if(--par.running == 0)
+			par.cvdone.notify_one();
 	}
 }

@@ -95,10 +97,9 @@

 		if(stop_) {
 			stopped_ = true;
-			die = true;
-			goThreads();
+			par.die = true;
+			par.goThreads();
 			cvstop_.notify_one();
-			std::cerr << "simLoop returning\n";
 			return;
 		}

@@ -106,17 +107,17 @@

 		tree.insert(g);

-		goThreads();
+		par.goThreads();

 		auto nbody = g.bodies.size()/4;
 		auto i = g.bodies.begin() + nbody*3;
 		while(i < g.bodies.end())
 			tree.calcforce(*i++);

-		if(running > 0) {
-			std::unique_lock<std::mutex> lk(mudone);
-			while(running > 0)
-				cvdone.wait(lk);
+		if(par.running > 0) {
+			std::unique_lock<std::mutex> lk(par.mudone);
+			while(par.running > 0)
+				par.cvdone.wait(lk);
 		}

 		for(auto& b : g.bodies) {


Implement device rescan

Implement device rescan

--- src/midiio.cpp
+++ src/midiio.cpp
@@ -198,33 +198,49 @@
 };

 // Template it, baby
-void setClient(QStandardItem* item, int client) {
+template<typename T, int Role>
+void set(QStandardItem* item, T v) {
     Q_CHECK_PTR(item);

-    item->setData(client, ClientRole);
-}
-
-int client(const QStandardItem* item) {
+    item->setData(v, Role);
+}
+
+template<typename T, int Role>
+T get(const QStandardItem* item) {
     Q_CHECK_PTR(item);

-    return item->data(ClientRole).toInt();
-}
-
-void setPort(QStandardItem* item, int port) {
-    Q_CHECK_PTR(item);
-
-    item->setData(port, PortRole);
-}
-
-int port(const QStandardItem* item) {
-    Q_CHECK_PTR(item);
-
-    return item->data(PortRole).toInt();
+    return item->data(Role).value<T>();
+}
+
+void (&setClient)(QStandardItem*, int) = set<int, ClientRole>;
+void (&setPort)(QStandardItem*, int) = set<int, PortRole>;
+int (&client)(const QStandardItem*) = get<int, ClientRole>;
+int (&port)(const QStandardItem*) = get<int, PortRole>;
+
+QStandardItem* takeItemFromAlsaAddress(QList<QStandardItem*>& items, const snd_seq_addr_t* addr) {
+    Q_CHECK_PTR(addr);
+
+    QStandardItem* item = Q_NULLPTR;
+    foreach (item, items) {
+        if (client(item) == addr->client && port(item) == addr->port) {
+            break;
+        }
+    }
+    if (item) {
+        items.removeAt(items.indexOf(item));
+    }
+    return item;
 }

 void MidiIO::rescanPorts() {
     Q_CHECK_PTR(m_seq_handle);
     Q_CHECK_PTR(m_ports_model);
+
+    // Existing items
+    QList<QStandardItem*> existing;
+    for (int i = 0 ; i < m_ports_model->rowCount() ; ++i) {
+        existing << m_ports_model->item(i);
+    }

     snd_seq_client_info_t *cinfo;
     snd_seq_port_info_t *pinfo;
@@ -238,14 +254,34 @@
         snd_seq_port_info_set_port(pinfo, -1);

         while (snd_seq_query_next_port(m_seq_handle, pinfo) >= 0) {
-            QStandardItem* item = new QStandardItem();
-            item->setText(snd_seq_port_info_get_name(pinfo));
             const snd_seq_addr_t* addr = snd_seq_port_info_get_addr(pinfo);
             Q_CHECK_PTR(addr);
-            setClient(item, addr->client);
-            setPort(item, addr->port);
-            m_ports_model->appendRow(item);
+
+            QStandardItem* item = takeItemFromAlsaAddress(existing, addr);
+            if (!item) {
+                item = new QStandardItem();
+                setClient(item, addr->client);
+                setPort(item, addr->port);
+                m_ports_model->appendRow(item);
+            }
+            item->setText(snd_seq_port_info_get_name(pinfo));
         }
+    }
+
+    // Remove old items
+    int rc = m_ports_model->rowCount();
+    QStandardItem* item = Q_NULLPTR;
+    foreach (item, existing) {
+        const QModelIndex index = m_ports_model->indexFromItem(item);
+        Q_ASSERT(index.isValid());
+
+        QStandardItem* rowItem = Q_NULLPTR;
+        foreach (rowItem, m_ports_model->takeRow(index.row())) {
+            Q_CHECK_PTR(rowItem);
+            delete rowItem;
+        }
+        rc = m_ports_model->rowCount();
+        Q_UNUSED(rc);
     }
 }


am a3b83429: Merge "x86 compiler should handle the "div/rem by 1" case"

* commit 'a3b834298c92750e6d3922ccb2e08c38df4b3f37':
  x86 compiler should handle the "div/rem by 1" case

--- compiler/dex/quick/x86/int_x86.cc
+++ compiler/dex/quick/x86/int_x86.cc
@@ -456,10 +456,20 @@
   RegLocation rl_result = {kLocPhysReg, 0, 0, 0, 0, 0, 0, 0, 1, kVectorNotUsed,
                           r2, INVALID_REG, INVALID_SREG, INVALID_SREG};

-  // handle 0x80000000 / -1 special case.
-  LIR *minint_branch = 0;
-  if (imm == -1) {
+  // handle div/rem by 1 special case.
+  if (imm == 1) {
     if (is_div) {
+      // x / 1 == x.
+      StoreValue(rl_result, rl_src);
+    } else {
+      // x % 1 == 0.
+      LoadConstantNoClobber(r0, 0);
+      // For this case, return the result in EAX.
+      rl_result.low_reg = r0;
+    }
+  } else if (imm == -1) {  // handle 0x80000000 / -1 special case.
+    if (is_div) {
+      LIR *minint_branch = 0;
       LoadValueDirectFixed(rl_src, r0);
       OpRegImm(kOpCmp, r0, 0x80000000);
       minint_branch = NewLIR2(kX86Jcc8, 0, kX86CondEq);
@@ -479,7 +489,7 @@
     // For this case, return the result in EAX.
     rl_result.low_reg = r0;
   } else {
-    DCHECK(imm <= -2 || imm >= 2);
+    CHECK(imm <= -2 || imm >= 2);
     // Use H.S.Warren's Hacker's Delight Chapter 10 and
     // T,Grablund, P.L.Montogomery's Division by invariant integers using multiplication.
     int magic, shift;


layers: Pass whole layer_data down through more of SC

I know I'd done a bunch of work to reduce the dependency on layer_data
here before, but capability checking needs more broad access when
extensions gate capabilities. Adding yet another crazy parameter to the
intermediate functions just to avoid using layer_data here is silly.

Just plumb it all back through...

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -2391,9 +2391,11 @@
     return true;
 }

-static bool validate_shader_capabilities(debug_report_data *report_data, shader_module const *src,
-                                         VkPhysicalDeviceFeatures const *enabledFeatures) {
+static bool validate_shader_capabilities(layer_data *dev_data, shader_module const *src) {
     bool pass = true;
+
+    auto report_data = dev_data->report_data;
+    auto const & enabledFeatures = dev_data->enabled_features;

     for (auto insn : *src) {
         if (insn.opcode() == spv::OpCapability) {
@@ -2411,110 +2413,110 @@
                     break;

                 case spv::CapabilityGeometry:
-                    pass &= require_feature(report_data, enabledFeatures->geometryShader, "geometryShader");
+                    pass &= require_feature(report_data, enabledFeatures.geometryShader, "geometryShader");
                     break;

                 case spv::CapabilityTessellation:
-                    pass &= require_feature(report_data, enabledFeatures->tessellationShader, "tessellationShader");
+                    pass &= require_feature(report_data, enabledFeatures.tessellationShader, "tessellationShader");
                     break;

                 case spv::CapabilityFloat64:
-                    pass &= require_feature(report_data, enabledFeatures->shaderFloat64, "shaderFloat64");
+                    pass &= require_feature(report_data, enabledFeatures.shaderFloat64, "shaderFloat64");
                     break;

                 case spv::CapabilityInt64:
-                    pass &= require_feature(report_data, enabledFeatures->shaderInt64, "shaderInt64");
+                    pass &= require_feature(report_data, enabledFeatures.shaderInt64, "shaderInt64");
                     break;

                 case spv::CapabilityTessellationPointSize:
                 case spv::CapabilityGeometryPointSize:
-                    pass &= require_feature(report_data, enabledFeatures->shaderTessellationAndGeometryPointSize,
+                    pass &= require_feature(report_data, enabledFeatures.shaderTessellationAndGeometryPointSize,
                                             "shaderTessellationAndGeometryPointSize");
                     break;

                 case spv::CapabilityImageGatherExtended:
-                    pass &= require_feature(report_data, enabledFeatures->shaderImageGatherExtended, "shaderImageGatherExtended");
+                    pass &= require_feature(report_data, enabledFeatures.shaderImageGatherExtended, "shaderImageGatherExtended");
                     break;

                 case spv::CapabilityStorageImageMultisample:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageMultisample,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageMultisample,
                                             "shaderStorageImageMultisample");
                     break;

                 case spv::CapabilityUniformBufferArrayDynamicIndexing:
-                    pass &= require_feature(report_data, enabledFeatures->shaderUniformBufferArrayDynamicIndexing,
+                    pass &= require_feature(report_data, enabledFeatures.shaderUniformBufferArrayDynamicIndexing,
                                             "shaderUniformBufferArrayDynamicIndexing");
                     break;

                 case spv::CapabilitySampledImageArrayDynamicIndexing:
-                    pass &= require_feature(report_data, enabledFeatures->shaderSampledImageArrayDynamicIndexing,
+                    pass &= require_feature(report_data, enabledFeatures.shaderSampledImageArrayDynamicIndexing,
                                             "shaderSampledImageArrayDynamicIndexing");
                     break;

                 case spv::CapabilityStorageBufferArrayDynamicIndexing:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageBufferArrayDynamicIndexing,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageBufferArrayDynamicIndexing,
                                             "shaderStorageBufferArrayDynamicIndexing");
                     break;

                 case spv::CapabilityStorageImageArrayDynamicIndexing:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageArrayDynamicIndexing,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageArrayDynamicIndexing,
                                             "shaderStorageImageArrayDynamicIndexing");
                     break;

                 case spv::CapabilityClipDistance:
-                    pass &= require_feature(report_data, enabledFeatures->shaderClipDistance, "shaderClipDistance");
+                    pass &= require_feature(report_data, enabledFeatures.shaderClipDistance, "shaderClipDistance");
                     break;

                 case spv::CapabilityCullDistance:
-                    pass &= require_feature(report_data, enabledFeatures->shaderCullDistance, "shaderCullDistance");
+                    pass &= require_feature(report_data, enabledFeatures.shaderCullDistance, "shaderCullDistance");
                     break;

                 case spv::CapabilityImageCubeArray:
-                    pass &= require_feature(report_data, enabledFeatures->imageCubeArray, "imageCubeArray");
+                    pass &= require_feature(report_data, enabledFeatures.imageCubeArray, "imageCubeArray");
                     break;

                 case spv::CapabilitySampleRateShading:
-                    pass &= require_feature(report_data, enabledFeatures->sampleRateShading, "sampleRateShading");
+                    pass &= require_feature(report_data, enabledFeatures.sampleRateShading, "sampleRateShading");
                     break;

                 case spv::CapabilitySparseResidency:
-                    pass &= require_feature(report_data, enabledFeatures->shaderResourceResidency, "shaderResourceResidency");
+                    pass &= require_feature(report_data, enabledFeatures.shaderResourceResidency, "shaderResourceResidency");
                     break;

                 case spv::CapabilityMinLod:
-                    pass &= require_feature(report_data, enabledFeatures->shaderResourceMinLod, "shaderResourceMinLod");
+                    pass &= require_feature(report_data, enabledFeatures.shaderResourceMinLod, "shaderResourceMinLod");
                     break;

                 case spv::CapabilitySampledCubeArray:
-                    pass &= require_feature(report_data, enabledFeatures->imageCubeArray, "imageCubeArray");
+                    pass &= require_feature(report_data, enabledFeatures.imageCubeArray, "imageCubeArray");
                     break;

                 case spv::CapabilityImageMSArray:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageMultisample,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageMultisample,
                                             "shaderStorageImageMultisample");
                     break;

                 case spv::CapabilityStorageImageExtendedFormats:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageExtendedFormats,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageExtendedFormats,
                                             "shaderStorageImageExtendedFormats");
                     break;

                 case spv::CapabilityInterpolationFunction:
-                    pass &= require_feature(report_data, enabledFeatures->sampleRateShading, "sampleRateShading");
+                    pass &= require_feature(report_data, enabledFeatures.sampleRateShading, "sampleRateShading");
                     break;

                 case spv::CapabilityStorageImageReadWithoutFormat:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageReadWithoutFormat,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageReadWithoutFormat,
                                             "shaderStorageImageReadWithoutFormat");
                     break;

                 case spv::CapabilityStorageImageWriteWithoutFormat:
-                    pass &= require_feature(report_data, enabledFeatures->shaderStorageImageWriteWithoutFormat,
+                    pass &= require_feature(report_data, enabledFeatures.shaderStorageImageWriteWithoutFormat,
                                             "shaderStorageImageWriteWithoutFormat");
                     break;

                 case spv::CapabilityMultiViewport:
-                    pass &= require_feature(report_data, enabledFeatures->multiViewport, "multiViewport");
+                    pass &= require_feature(report_data, enabledFeatures.multiViewport, "multiViewport");
                     break;

                 default:
@@ -2570,19 +2572,19 @@
 }

 static bool validate_pipeline_shader_stage(
-    debug_report_data *report_data, VkPipelineShaderStageCreateInfo const *pStage, PIPELINE_STATE *pipeline,
-    shader_module **out_module, spirv_inst_iter *out_entrypoint, VkPhysicalDeviceFeatures const *enabledFeatures,
-    std::unordered_map<VkShaderModule, std::unique_ptr<shader_module>> const &shaderModuleMap) {
+    layer_data *dev_data, VkPipelineShaderStageCreateInfo const *pStage, PIPELINE_STATE *pipeline,
+    shader_module **out_module, spirv_inst_iter *out_entrypoint) {
     bool pass = true;
-    auto module_it = shaderModuleMap.find(pStage->module);
+    auto module_it = dev_data->shaderModuleMap.find(pStage->module);
     auto module = *out_module = module_it->second.get();
+    auto report_data = dev_data->report_data;

     if (!module->has_valid_spirv) return pass;

     // Find the entrypoint
     auto entrypoint = *out_entrypoint = find_entrypoint(module, pStage->pName, pStage->stage);
     if (entrypoint == module->end()) {
-        if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, VALIDATION_ERROR_00510,
+        if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__, VALIDATION_ERROR_00510,
                     "SC", "No entrypoint found named `%s` for stage %s. %s.", pStage->pName,
                     string_VkShaderStageFlagBits(pStage->stage), validation_error_map[VALIDATION_ERROR_00510])) {
             return false;  // no point continuing beyond here, any analysis is just going to be garbage.
@@ -2590,7 +2592,7 @@
     }

     // Validate shader capabilities against enabled device features
-    pass &= validate_shader_capabilities(report_data, module, enabledFeatures);
+    pass &= validate_shader_capabilities(dev_data, module);

     // Mark accessible ids
     auto accessible_ids = mark_accessible_ids(module, entrypoint);
@@ -2686,9 +2688,7 @@

 // Validate that the shaders used by the given pipeline and store the active_slots
 //  that are actually used by the pipeline into pPipeline->active_slots
-static bool validate_and_capture_pipeline_shader_state(
-    debug_report_data *report_data, PIPELINE_STATE *pPipeline, VkPhysicalDeviceFeatures const *enabledFeatures,
-    std::unordered_map<VkShaderModule, unique_ptr<shader_module>> const &shaderModuleMap) {
+static bool validate_and_capture_pipeline_shader_state(layer_data *dev_data, PIPELINE_STATE *pPipeline) {
     auto pCreateInfo = pPipeline->graphicsPipelineCI.ptr();
     int vertex_stage = get_shader_stage_id(VK_SHADER_STAGE_VERTEX_BIT);
     int fragment_stage = get_shader_stage_id(VK_SHADER_STAGE_FRAGMENT_BIT);
@@ -2697,27 +2697,25 @@
     memset(shaders, 0, sizeof(shaders));
     spirv_inst_iter entrypoints[5];
     memset(entrypoints, 0, sizeof(entrypoints));
-    VkPipelineVertexInputStateCreateInfo const *vi = 0;
     bool pass = true;

     for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
         auto pStage = &pCreateInfo->pStages[i];
         auto stage_id = get_shader_stage_id(pStage->stage);
-        pass &= validate_pipeline_shader_stage(report_data, pStage, pPipeline, &shaders[stage_id], &entrypoints[stage_id],
-                                               enabledFeatures, shaderModuleMap);
+        pass &= validate_pipeline_shader_stage(dev_data, pStage, pPipeline, &shaders[stage_id], &entrypoints[stage_id]);
     }

     // if the shader stages are no good individually, cross-stage validation is pointless.
     if (!pass) return false;

-    vi = pCreateInfo->pVertexInputState;
+    auto vi = pCreateInfo->pVertexInputState;

     if (vi) {
-        pass &= validate_vi_consistency(report_data, vi);
+        pass &= validate_vi_consistency(dev_data->report_data, vi);
     }

     if (shaders[vertex_stage] && shaders[vertex_stage]->has_valid_spirv) {
-        pass &= validate_vi_against_vs_inputs(report_data, vi, shaders[vertex_stage], entrypoints[vertex_stage]);
+        pass &= validate_vi_against_vs_inputs(dev_data->report_data, vi, shaders[vertex_stage], entrypoints[vertex_stage]);
     }

     int producer = get_shader_stage_id(VK_SHADER_STAGE_VERTEX_BIT);
@@ -2731,7 +2729,7 @@
     for (; producer != fragment_stage && consumer <= fragment_stage; consumer++) {
         assert(shaders[producer]);
         if (shaders[consumer] && shaders[consumer]->has_valid_spirv && shaders[producer]->has_valid_spirv) {
-            pass &= validate_interface_between_stages(report_data, shaders[producer], entrypoints[producer],
+            pass &= validate_interface_between_stages(dev_data->report_data, shaders[producer], entrypoints[producer],
                                                       &shader_stage_attribs[producer], shaders[consumer], entrypoints[consumer],
                                                       &shader_stage_attribs[consumer]);

@@ -2740,23 +2738,20 @@
     }

     if (shaders[fragment_stage] && shaders[fragment_stage]->has_valid_spirv) {
-        pass &= validate_fs_outputs_against_render_pass(report_data, shaders[fragment_stage], entrypoints[fragment_stage],
+        pass &= validate_fs_outputs_against_render_pass(dev_data->report_data, shaders[fragment_stage], entrypoints[fragment_stage],
                                                         pPipeline->render_pass_ci.ptr(), pCreateInfo->subpass);
     }

     return pass;
 }

-static bool validate_compute_pipeline(debug_report_data *report_data, PIPELINE_STATE *pPipeline,
-                                      VkPhysicalDeviceFeatures const *enabledFeatures,
-                                      std::unordered_map<VkShaderModule, unique_ptr<shader_module>> const &shaderModuleMap) {
+static bool validate_compute_pipeline(layer_data *dev_data, PIPELINE_STATE *pPipeline) {
     auto pCreateInfo = pPipeline->computePipelineCI.ptr();

     shader_module *module;
     spirv_inst_iter entrypoint;

-    return validate_pipeline_shader_stage(report_data, &pCreateInfo->stage, pPipeline, &module, &entrypoint, enabledFeatures,
-                                          shaderModuleMap);
+    return validate_pipeline_shader_stage(dev_data, &pCreateInfo->stage, pPipeline, &module, &entrypoint);
 }
 // Return Set node ptr for specified set or else NULL
 cvdescriptorset::DescriptorSet *GetSetNode(const layer_data *dev_data, VkDescriptorSet set) {
@@ -3149,8 +3144,7 @@
     }

     if (!GetDisables(dev_data)->shader_validation &&
-        !validate_and_capture_pipeline_shader_state(dev_data->report_data, pPipeline, &dev_data->enabled_features,
-                                                    dev_data->shaderModuleMap)) {
+        !validate_and_capture_pipeline_shader_state(dev_data, pPipeline)) {
         skip_call = true;
     }
     // Each shader's stage must be unique
@@ -6445,8 +6439,7 @@
         pPipeState[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout);

         // TODO: Add Compute Pipeline Verification
-        skip |= !validate_compute_pipeline(dev_data->report_data, pPipeState[i], &dev_data->enabled_features,
-                                           dev_data->shaderModuleMap);
+        skip |= !validate_compute_pipeline(dev_data, pPipeState[i]);
         // skip |= verifyPipelineCreateState(dev_data, pPipeState[i]);
     }


Stdout write timeout increased to suit 115200 baud interface

--- zubax_chibios/sys/sys.hpp
+++ zubax_chibios/sys/sys.hpp
@@ -49,7 +49,7 @@
 namespace os
 {

-static constexpr unsigned DefaultStdIOByteWriteTimeoutMSec = 1;
+static constexpr unsigned DefaultStdIOByteWriteTimeoutMSec = 2;		///< Enough for 115200 baud and higher

 /**
  * NuttX-like console print; should be used instead of printf()/chprintf()


Server/Client setup

Server/Client setup

--- driver.cpp
+++ driver.cpp
@@ -63,7 +63,7 @@

 		//Check and Process Messages
 		Message = Mailbox.GetNextMessage();
-		if (Message.size() != "") { cout << Message; }
+		if (Message != "") { cout << Message; }
 		getFormData(Message);
 		Action = GetValueFromKey("Action");


layers: Fix swapchain extent check

layers: Fix swapchain extent check

This fixes a regression introduced -- by me :( -- in commit
583b0c41dfd0876d0481920f2e6d8d87433bc1d7. The swapchain's
imageExtent must always be within the surface's min/max extent,
regardless of the surface's current extent.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -8888,11 +8888,10 @@
         }

         // Validate pCreateInfo->imageExtent against VkSurfaceCapabilitiesKHR::{current|min|max}ImageExtent:
-        if ((capabilities.currentExtent.width == kSurfaceSizeFromSwapchain) &&
-            ((pCreateInfo->imageExtent.width < capabilities.minImageExtent.width) ||
-             (pCreateInfo->imageExtent.width > capabilities.maxImageExtent.width) ||
-             (pCreateInfo->imageExtent.height < capabilities.minImageExtent.height) ||
-             (pCreateInfo->imageExtent.height > capabilities.maxImageExtent.height))) {
+        if ((pCreateInfo->imageExtent.width < capabilities.minImageExtent.width) ||
+            (pCreateInfo->imageExtent.width > capabilities.maxImageExtent.width) ||
+            (pCreateInfo->imageExtent.height < capabilities.minImageExtent.height) ||
+            (pCreateInfo->imageExtent.height > capabilities.maxImageExtent.height)) {
             if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
                         HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_146009f4, "DS",
                         "%s called with imageExtent = (%d,%d), which is outside the bounds returned by "


make contact search working again

make contact search working again

--- examples/GuiClient/rosterItemSortFilterProxyModel.cpp
+++ examples/GuiClient/rosterItemSortFilterProxyModel.cpp
@@ -78,6 +78,9 @@

 bool rosterItemSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
 {
+    if(!filterRegExp().isEmpty())
+        return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
+
     if(m_showOfflineContacts)
         return true;


layers: Avoid potential NULL pointer dereference

The boundDescriptorSets vector may be resized in
PreCallRecordCmdBindDescriptorSets().

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -5629,10 +5629,6 @@
     if (set >= cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.size()) {
         cb_state->lastBound[pipelineBindPoint].boundDescriptorSets.resize(set + 1);
         cb_state->lastBound[pipelineBindPoint].dynamicOffsets.resize(set + 1);
-    } else {
-        if (cb_state->lastBound[pipelineBindPoint].boundDescriptorSets[set]->IsPushDescriptor()) {
-            cb_state->lastBound[pipelineBindPoint].push_descriptors[set] = nullptr;
-        }
     }
     const auto &layout_state = getPipelineLayout(device_data, layout);
     std::unique_ptr<cvdescriptorset::DescriptorSet> new_desc{


fixed live alien spotted circle

fixed live alien spotted circle

--- game/state/battle/battle.cpp
+++ game/state/battle/battle.cpp
@@ -2629,6 +2629,13 @@
 		}
 	}

+	// If mission == Alien extermination, remove the red alien spotted circle
+	if (state.current_battle->mission_type == Battle::MissionType::AlienExtermination)
+	{
+		StateRef<Building> location = {&state, state.current_battle->mission_location_id};
+		location->detected = false;
+	}
+
 	// If player won and didn't retreat, player secures the area
 	// - give him loot
 	// - give him alien remains


Add the root item if it doesn't exist, before adding other items

git-svn-id: 7e36d3665aeca4d4e1f6df8911a80efc6ef565e7@2847 1f79f812-37fb-46fe-a122-30589dd2bf55

--- pwsafe/pwsafe/src/ui/wxWidgets/PWStree.cpp
+++ pwsafe/pwsafe/src/ui/wxWidgets/PWStree.cpp
@@ -176,6 +176,9 @@
 wxTreeItemId PWSTreeCtrl::AddGroup(const StringX &group)
 {
   wxTreeItemId ti = GetRootItem();
+  if (!ti.IsOk())
+    ti=AddRoot(wxString());
+
   // Add a group at the end of path
   wxTreeItemId si;
   if (!group.empty()) {


Fixed compile errors that were not commited last time for some strange reason...

--- src/qminer/qminer_ftr.cpp
+++ src/qminer/qminer_ftr.cpp
@@ -626,10 +626,10 @@
         // do the join
         TRec JoinRec = FtrRec.DoSingleJoin(GetBase(), GetJoinIdV(FtrRec.GetStoreId()));
         // get feature value
-		return _GetVal(JoinRec);
+		return _GetVal(JoinRec, NumSpV);
     } else {
         // get feature value
-        return _GetVal(FtrRec);
+        return _GetVal(FtrRec, NumSpV);
 	}
 }

@@ -640,8 +640,8 @@

 TNumSpV::TNumSpV(const TWPt<TBase>& Base, const PJsonVal& ParamVal): TFtrExt(Base, ParamVal) {
     // parse out parameters and initialize feature generator
-    const bool Dim = ParamVal->GetObjBool("dimension", false);
-    const bool NormalizeP = ParamVal->GetObjBool("normalize", false);
+    Dim = ParamVal->GetObjInt("dimension", 0);
+    NormalizeP = ParamVal->GetObjBool("normalize", false);
     // parse out input parameters
     TStr FieldNm = ParamVal->GetObjStr("field");
     QmAssertR(GetFtrStore()->IsFieldNm(FieldNm), "Unknown field '" +
@@ -701,23 +701,25 @@
     // we only need to update dimensionality, if new record makes it out-of-bounds
     TIntFltKdV NumSpV; GetVal(Rec, NumSpV);
     const int NewDim = TLAMisc::GetMaxDimIdx(NumSpV);
-    if (NewDim > Dim) { Dim = NewDin; return true; }
+    if (NewDim > Dim) { Dim = NewDim; return true; }
     return false;
 }

 void TNumSpV::AddSpV(const TRec& Rec, TIntFltKdV& SpV, int& Offset) const {
     TIntFltKdV NumSpV; GetVal(Rec, NumSpV);
+    if (NormalizeP) { TLinAlg::Normalize(NumSpV); }
     for (int NumSpN = 0; NumSpN < NumSpV.Len(); NumSpN++) {
-        const TIntFltKd& NumSp = NumSpV[NumspN];
-        SpV.Add(TIntFldKdV(Offset + NumSp.Key, NumSp.Dat));
+        const TIntFltKd& NumSp = NumSpV[NumSpN];
+        SpV.Add(TIntFltKd(Offset + NumSp.Key, NumSp.Dat));
     }
     Offset += GetDim();
 }

 void TNumSpV::AddFullV(const TRec& Rec, TFltV& FullV, int& Offset) const {
     TIntFltKdV NumSpV; GetVal(Rec, NumSpV);
+    if (NormalizeP) { TLinAlg::Normalize(NumSpV); }
     for (int NumSpN = 0; NumSpN < NumSpV.Len(); NumSpN++) {
-        const TIntFltKd& NumSp = NumSpV[NumspN];
+        const TIntFltKd& NumSp = NumSpV[NumSpN];
         FullV[Offset + NumSp.Key] = NumSp.Dat;
     }
     Offset += GetDim();


`mvsot()` will set `contents.waiting_for_desired` to false.

--- src/mv_text.cc
+++ src/mv_text.cc
@@ -7,6 +7,7 @@
 namespace move {

 boost::optional< std::shared_ptr<change> > mvsot(contents& contents, boost::optional<int>) {
+    contents.waiting_for_desired = false;
     contents.x = 0;
     for(auto x : contents.cont[contents.y]) {
         if(x == ' ' || x == '\t') contents.x++;


removed configuration file name from structure in order to avoid to overwrite it

--- daemon/main.cpp
+++ daemon/main.cpp
@@ -20,8 +20,8 @@
 struct config{
 	// put here all configurations of the service
 	unsigned int delay = 0;
-	std::string conf_file_name;
 };
+std::string conf_file_name;

 const char daemon_name[] = "my_daemon";

@@ -61,7 +61,7 @@
 	while ((value = getopt_long(argc, argv, "c:p:d:h", options, &option_index)) != -1) {
 		switch (value) {
 			case 'c':
-				conf.conf_file_name = optarg;
+				conf_file_name = optarg;
 				break;
 			case 'l':
 				break;
@@ -97,7 +97,7 @@
 	syslog(LOG_INFO, "%s has been started", daemon_name);

 	// Read configuration from config file (before registering signal for reloading configuration, otherwise update global flag)
-	auto res = read_conf_file(conf.conf_file_name);
+	auto res = read_conf_file(conf_file_name);
 	if(res.first){
 		conf = res.second;
 	}else{
@@ -119,7 +119,7 @@
 		// check if we need to reload configuration
 		if(g_reload_conf_flag == reload_conf_stat::reload){
 			const update_flag up(g_reload_conf_flag, reload_conf_stat::reloading, reload_conf_stat::done);
-			const auto conf_tmp = read_conf_file(conf.conf_file_name);
+			const auto conf_tmp = read_conf_file(conf_file_name);
 			if(conf_tmp.first){
 				syslog(LOG_INFO, "configuration reloaded successfully");
 				conf = conf_tmp.second;


Remove a couple of includes that are not required any more

--- programs/applesedemo/main.cpp
+++ programs/applesedemo/main.cpp
@@ -10,10 +10,6 @@

 #include <array>
 #include "r1_signature_compactor.hpp"
-
-#include <fc/crypto/public_key.hpp>
-#include <fc/crypto/private_key.hpp>
-#include <fc/crypto/signature.hpp>

 namespace po = boost::program_options;
 using namespace std;


removed GIL release in cases where buffer is not guaranteed to be locked

--- leveldb_object.cc
+++ leveldb_object.cc
@@ -192,13 +192,14 @@
 	#else
 	leveldb::Slice key_slice((const char*)s_key, (size_t)n_key);
 	leveldb::Slice value_slice((const char*)s_value, (size_t)n_value);
-	Py_BEGIN_ALLOW_THREADS
 	#endif

 	options.sync = (sync == Py_True) ? true : false;
 	status = self->_db->Put(options, key_slice, value_slice);

+	#ifdef PY_LEVELDB_BUFFER
 	Py_END_ALLOW_THREADS
+	#endif

 	PY_LEVELDB_RELEASE_BUFFER(key);
 	PY_LEVELDB_RELEASE_BUFFER(value);
@@ -237,7 +238,6 @@
 	leveldb::Slice key_slice((const char*)key.buf, (size_t)key.len);
 	#else
 	leveldb::Slice key_slice((const char*)s_key, (size_t)n_key);
-	Py_BEGIN_ALLOW_THREADS
 	#endif

 	leveldb::ReadOptions options;;
@@ -247,7 +247,9 @@

 	status = db->Get(options, key_slice, &value);

+	#ifdef PY_LEVELDB_BUFFER
 	Py_END_ALLOW_THREADS
+	#endif

 	PY_LEVELDB_RELEASE_BUFFER(key);

@@ -297,14 +299,16 @@
 	leveldb::Slice key_slice((const char*)key.buf, (size_t)key.len);
 	#else
 	leveldb::Slice key_slice((const char*)s_key, (size_t)n_key);
-	Py_BEGIN_ALLOW_THREADS
 	#endif

 	leveldb::WriteOptions options;
 	options.sync = (sync == Py_True) ? true : false;

 	status = self->_db->Delete(options, key_slice);
+
+	#ifdef PY_LEVELDB_BUFFER
 	Py_END_ALLOW_THREADS
+	#endif

 	PY_LEVELDB_RELEASE_BUFFER(key);


Revert "layers: LX459,GH#99,#100, Fix semaphore reference count"

This reverts commit 541bb5afc50581e7c765fc5c05400540369f0044.

Reverting this as the original issue is still present and being worked on
so restoring original state until correct fix is complete.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -5105,10 +5105,10 @@
         vector<VkSemaphore> semaphoreList;
         for (uint32_t i = 0; i < submit->waitSemaphoreCount; ++i) {
             const VkSemaphore &semaphore = submit->pWaitSemaphores[i];
+            semaphoreList.push_back(semaphore);
             if (dev_data->semaphoreMap.find(semaphore) != dev_data->semaphoreMap.end()) {
                 if (dev_data->semaphoreMap[semaphore].signaled) {
                     dev_data->semaphoreMap[semaphore].signaled = false;
-                    dev_data->semaphoreMap[semaphore].in_use.fetch_sub(1);
                 } else {
                     skipCall |=
                         log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT,
@@ -10359,7 +10359,6 @@
                                "vkAcquireNextImageKHR: Semaphore must not be currently signaled or in a wait state");
         }
         dev_data->semaphoreMap[semaphore].signaled = true;
-        dev_data->semaphoreMap[semaphore].in_use.fetch_add(1);
     }
     auto fence_data = dev_data->fenceMap.find(fence);
     if (fence_data != dev_data->fenceMap.end()) {


Ripristino richiesta caldo

Ripristino richiesta caldo

--- control.cpp
+++ control.cpp
@@ -138,7 +138,7 @@
 			xPompaCaloreInUso = xUsaPompaCalore;

 		HW.PompaCalore.xStopPompaCalore->setValue(!xPompaCaloreInUso);
-//		HW.PompaCalore.xRichiestaCaldo->setValue(risc_acceso || xFanCoil);
+		HW.PompaCalore.xRichiestaCaldo->setValue(risc_acceso || xFanCoil);

 		bool zona_attiva = false;
 		if (!xUsaPompaCalore) {


Fix savemenu crash

Fix savemenu crash

--- game/ui/general/savemenu.cpp
+++ game/ui/general/savemenu.cpp
@@ -27,7 +27,10 @@

 void SaveMenu::Begin()
 {
-	menuform->FindControlTyped<Label>("TEXT_FUNDS")->SetText(currentState->getPlayerBalance());
+	if (currentState)
+	{
+		menuform->FindControlTyped<Label>("TEXT_FUNDS")->SetText(currentState->getPlayerBalance());
+	}

 	auto saveListBox = menuform->FindControlTyped<ListBox>("LISTBOX_OPTIONS");