Visual Studio 2019 fix. It cannot deduce a template type from constructor parameters. Make the template type implicit.

--- include/signal_slot.hpp
+++ include/signal_slot.hpp
@@ -307,12 +307,12 @@
     {
         if (!_enabled) return;

-        std::scoped_lock lock { _emit_lock };
+        std::scoped_lock<std::mutex> lock { _emit_lock };

         if (!_enabled) return;

         {
-            std::scoped_lock lock { _connect_lock };
+            std::scoped_lock<std::mutex> lock { _connect_lock };

             if (!std::empty(_pending_connections))
             {
@@ -347,7 +347,7 @@
         slot<Args...> new_slot(std::forward<std::function<void(Args...)>>(callable));
         connection to_return(this, new_slot);

-        std::scoped_lock lock { _connect_lock };
+        std::scoped_lock<std::mutex> lock { _connect_lock };
         auto end { std::end(_pending_connections) };

         _pending_connections.erase(std::remove_if(std::begin(_pending_connections), end, std::mem_fn(&slot<Args...>::is_disconnected)), end);
@@ -369,7 +369,7 @@

     virtual void clear()
     {
-        std::scoped_lock lock { _connect_lock, _emit_lock };
+        std::scoped_lock<std::mutex, std::mutex> lock { _connect_lock, _emit_lock };

         _pending_connections.clear();
         _slots.clear();
@@ -377,21 +377,21 @@

     virtual size_t size() const override
     {
-        std::scoped_lock lock { _emit_lock };
+        std::scoped_lock<std::mutex> lock { _emit_lock };

         return _slots.size();
     }

     void name(const std::u8string &name)
     {
-        std::scoped_lock lock { _name_lock };
+        std::scoped_lock<std::mutex> lock { _name_lock };

         _name = name;
     }

     virtual std::u8string_view name() const override
     {
-        std::scoped_lock lock { _name_lock };
+        std::scoped_lock<std::mutex> lock { _name_lock };

         return _name;
     }
@@ -494,7 +494,7 @@
         if (_bridge_enabled)
         {
             {
-                std::scoped_lock lock { _queue_lock };
+                std::scoped_lock<std::mutex> lock { _queue_lock };

                 _signal_queue.push_back(std::make_tuple(args...));
             }
@@ -518,7 +518,7 @@
     {
         if (std::empty(_signal_queue)) return false;

-        std::scoped_lock lock { _queue_lock };
+        std::scoped_lock<std::mutex> lock { _queue_lock };

         if (std::empty(_signal_queue)) return false;

@@ -533,7 +533,7 @@
     {
         if (std::empty(_signal_queue)) return;

-        std::scoped_lock lock { _queue_lock };
+        std::scoped_lock<std::mutex> lock { _queue_lock };

         if (std::empty(_signal_queue)) return;

@@ -546,7 +546,7 @@
     {
         if (std::empty(_signal_queue)) return;

-        std::scoped_lock lock { _queue_lock };
+        std::scoped_lock<std::mutex> lock { _queue_lock };

         if (std::empty(_signal_queue)) return;

@@ -567,7 +567,7 @@

     uint64_t get_queue_size() const
     {
-        std::scoped_lock lock { _queue_lock };
+        std::scoped_lock<std::mutex> lock { _queue_lock };

         return std::size(_signal_queue);
     }
@@ -586,7 +586,7 @@
     {
         if (std::empty(_signal_queue)) return;

-        std::scoped_lock lock { _queue_lock };
+        std::scoped_lock<std::mutex> lock { _queue_lock };

         if (std::empty(_signal_queue)) return;

@@ -624,7 +624,7 @@

         if (_dispatch_all_on_destroy)
         {
-            std::scoped_lock lock { _emit_lock };
+            std::scoped_lock<std::mutex> lock { _emit_lock };

             while (!std::empty(_signal_queue))
             {
@@ -637,7 +637,7 @@

     void emit(const Args &... args)
     {
-        std::scoped_lock lock { _emit_lock };
+        std::scoped_lock<std::mutex> lock { _emit_lock };

         _signal_queue.push_back(std::make_tuple(args...));

@@ -688,7 +688,7 @@
         while (!_cancelled)
         {
             {
-                std::scoped_lock lock { _emit_lock };
+                std::scoped_lock<std::mutex> lock { _emit_lock };

                 if (_cancelled || std::empty(_signal_queue)) break;

@@ -728,7 +728,7 @@

     virtual ~queued_signal_base() override
     {
-        std::scoped_lock lock_ { _destruct_lock };
+        std::scoped_lock<std::mutex> lock_ { _destruct_lock };

         _cancelled = true;

@@ -736,7 +736,7 @@

         if (_dispatch_all_on_destroy)
         {
-            std::scoped_lock lock { _emit_lock };
+            std::scoped_lock<std::mutex> lock { _emit_lock };

             auto end { std::end(_signal_queue) };

@@ -761,7 +761,7 @@

     void emit(const Args &... args)
     {
-        std::scoped_lock lock { _emit_lock };
+        std::scoped_lock<std::mutex> lock { _emit_lock };

         _signal_queue.push_back({ this, std::make_tuple(args...) });

@@ -821,7 +821,7 @@
         while (!_cancelled)
         {
             {
-                std::scoped_lock lock { _emit_lock };
+                std::scoped_lock<std::mutex> lock { _emit_lock };

                 if (_cancelled || std::empty(_signal_queue)) break;

@@ -907,7 +907,7 @@
         while (_timer_enabled)
         {
             {
-                std::scoped_lock lock { _emit_lock };
+                std::scoped_lock<std::mutex> lock { _emit_lock };

                 std::apply([this](timer_signal *s, const Args&... a){ base_class::emit(s, a...); }, _args);


Fixed bug with saturation calls using REFPROP and mixtures.  Mole fractions were not being re-calculated properly (https://github.com/ibell/coolprop/issues/28)

Signed-off-by: Ian Bell <6f1c5b737f3c5cff42a9b8f8dcfce305d97fd07b@gmail.com>

--- CoolProp/REFPROP.cpp
+++ CoolProp/REFPROP.cpp
@@ -537,7 +537,7 @@

 	long ierr=0,iOutput,iName1,iName2;
 	char herr[errormessagelength+1];
-	double xliq[ncmax],xvap[ncmax], output_val;
+	double xliq[ncmax],xvap[ncmax], dummyv[ncmax], output_val;

 	double TL, TV, dummy;
 	double T,p=0,d,dl,dv,q,e,h,s,cv,cp,w,MW,hl,hv,sl,sv,ul,
@@ -753,9 +753,9 @@
 			// Saturation Density
 			long ic;
 			ic=1;
-			SATTdll(&T,&(x[0]),&ic,&pl,&dl,&dummy,xliq,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
+			SATTdll(&T,&(x[0]),&ic,&pl,&dl,&dummy,xliq,dummyv,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
 			ic=2;
-			SATTdll(&T,&(x[0]),&ic,&pv,&dummy,&dv,xliq,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
+			SATTdll(&T,&(x[0]),&ic,&pv,&dummy,&dv,dummyv,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }

 			p = (pv*Q+pl*(1-Q))*1000; // [Pa]
 		}
@@ -768,10 +768,10 @@
 			// Saturation Density for the liquid

 			long ic = 1;
-			SATPdll(&p,&(x[0]),&ic,&TL,&dl,&dummy,xliq,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
+			SATPdll(&p,&(x[0]),&ic,&TL,&dl,&dummy,xliq,dummyv,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
 			// Saturation density for the vapor
 			ic = 2;
-			SATPdll(&p,&(x[0]),&ic,&TV,&dummy,&dv,xliq,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }
+			SATPdll(&p,&(x[0]),&ic,&TV,&dummy,&dv,dummyv,xvap,&ierr,herr,errormessagelength); if (ierr != 0) { throw ValueError(format("%s",herr).c_str()); }

 			T = (TV*Q+TL*(1-Q));
 		}


Add some warnings when using DISABLE/WARN in DFB

If you specify an operation that is not recognized in
QT_DIRECTFB_WARN_ON_RASTERFALLBACKS or
QT_DIRECTFB_DISABLE_RASTERFALLBACKS

Reviewed-by: muthu <16428ae5913a7c3c5005dafd922ce9ed988ba3fe@nokia.com>

--- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -204,21 +204,36 @@
         { 0, ALL }
     };

-    const QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'));
-    const QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'));
+    QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
+                                                                                QString::SkipEmptyParts);
+    QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'),
+                                                                                QString::SkipEmptyParts);
     *warningMask = 0;
     *disableMask = 0;
     if (!warning.isEmpty() || !disable.isEmpty()) {
         for (int i=0; operations[i].name; ++i) {
             const QString name = QString::fromLatin1(operations[i].name);
-            if (warning.contains(name)) {
+            int idx = warning.indexOf(name);
+            if (idx != -1) {
                 *warningMask |= operations[i].operation;
+                warning.remove(warning.begin() + idx);
             }
-            if (disable.contains(name)) {
+            idx = disable.indexOf(name);
+            if (idx != -1) {
                 *disableMask |= operations[i].operation;
+                disable.remove(disable.begin() + idx);
             }
         }
     }
+    if (!warning.isEmpty()) {
+        qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s",
+                 qPrintable(warning.join(QLatin1String("|"))));
+    }
+    if (!disable.isEmpty()) {
+        qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s",
+                 qPrintable(disable.join(QLatin1String("|"))));
+    }
+
 }
 #endif


Display attribute only when class is fully defined

--- interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp
+++ interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp
@@ -670,7 +670,8 @@
     if (!Policy.SuppressSpecifiers && D->isModulePrivate())
       Out << "__module_private__ ";
     Out << D->getKindName();
-    prettyPrintAttributes(D);
+    if(D->isCompleteDefinition())
+      prettyPrintAttributes(D);
     if (D->getIdentifier())
       Out << ' ' << *D ;

@@ -703,7 +704,9 @@
     //    Indent() << "}";
     //  }
     Out << ";\n";
-    ClassDeclNames.insert(D->getNameAsString());
+    m_SkipFlag = true;
+    if(D->isCompleteDefinition())
+      ClassDeclNames.insert(D->getNameAsString());
   }

   void ForwardDeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {


Better debug output for QDirectFBPaintEngine

Add unsupportedCompositionMode to the output.

Reviewed-by: TrustMe

--- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -81,7 +81,7 @@
 template <typename device, typename T1, typename T2, typename T3>
 static void rasterFallbackWarn(const char *msg, const char *func, const device *dev,
                                int scale, bool matrixRotShear, bool simplePen,
-                               bool dfbHandledClip,
+                               bool dfbHandledClip, bool unsupportedCompositionMode,
                                const char *nameOne, const T1 &one,
                                const char *nameTwo, const T2 &two,
                                const char *nameThree, const T3 &three)
@@ -98,7 +98,8 @@
     dbg << "scale" << scale
         << "matrixRotShear" << matrixRotShear
         << "simplePen" << simplePen
-        << "dfbHandledClip" << dfbHandledClip;
+        << "dfbHandledClip" << dfbHandledClip
+        << "unsupportedCompositionMode" << unsupportedCompositionMode;

     const T1 *t1 = ptr(one);
     const T2 *t2 = ptr(two);
@@ -124,6 +125,7 @@
                            __FUNCTION__, state()->painter->device(),    \
                            d_func()->scale, d_func()->matrixRotShear, \
                            d_func()->simplePen, d_func()->dfbCanHandleClip(), \
+                           d_func()->unsupportedCompositionMode, \
                            #one, one, #two, two, #three, three);        \
     if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS))                     \
         return;
@@ -138,6 +140,7 @@
                            __FUNCTION__, state()->painter->device(),    \
                            d_func()->scale, d_func()->matrixRotShear, \
                            d_func()->simplePen, d_func()->dfbCanHandleClip(), \
+                           d_func()->unsupportedCompositionMode, \
                            #one, one, #two, two, #three, three);
 #else
 #define RASTERFALLBACK(op, one, two, three)


Fix importing via "import settings" label addind a unecessary -spec

--- src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
+++ src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
@@ -290,13 +290,18 @@

             QString versionSpec = version->sourcePath() + "/mkspecs/" + version->mkspec();
             QString parsedSpec = Qt4Project::extractSpecFromArgumentList(additionalArguments);
-            QString parsedSpecOrginal = parsedSpec;
-            if (QFileInfo(parsedSpec).isRelative())
-                parsedSpec = QDir::cleanPath(directory + "/" + parsedSpec);
-            additionalArguments = Qt4Project::removeSpecFromArgumentList(additionalArguments);
-            if (parsedSpec != versionSpec) {
-                additionalArguments.prepend(parsedSpecOrginal);
-                additionalArguments.prepend("-spec");
+
+            if (parsedSpec.isEmpty()) {
+                // using the default spec, don't modify additional arguments
+            } else {
+                QString parsedSpecOrginal = parsedSpec;
+                if (QFileInfo(parsedSpec).isRelative())
+                    parsedSpec = QDir::cleanPath(directory + "/" + parsedSpec);
+                additionalArguments = Qt4Project::removeSpecFromArgumentList(additionalArguments);
+                if (parsedSpec != versionSpec) {
+                    additionalArguments.prepend(parsedSpecOrginal);
+                    additionalArguments.prepend("-spec");
+                }
             }

             // So we got all the information now apply it...


test: DecodeBase58 skipping whitespace

test: DecodeBase58 skipping whitespace

--- src/test/base58_tests.cpp
+++ src/test/base58_tests.cpp
@@ -55,6 +55,12 @@
     }

     BOOST_CHECK(!DecodeBase58("invalid", result));
+
+    // check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end.
+    BOOST_CHECK(!DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t a", result));
+    BOOST_CHECK( DecodeBase58(" \t\n\v\f\r skip \r\f\v\n\t ", result));
+    std::vector<unsigned char> expected = ParseHex("971a55");
+    BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());
 }

 // Visitor to check address type


tests: Fuzz additional functions in the integer fuzzing harness

--- src/test/fuzz/integer.cpp
+++ src/test/fuzz/integer.cpp
@@ -23,6 +23,7 @@
 #include <test/fuzz/FuzzedDataProvider.h>
 #include <test/fuzz/fuzz.h>
 #include <uint256.h>
+#include <util/moneystr.h>
 #include <util/strencodings.h>
 #include <util/system.h>
 #include <util/time.h>
@@ -76,11 +77,19 @@
     (void)DecompressAmount(u64);
     (void)FormatISO8601Date(i64);
     (void)FormatISO8601DateTime(i64);
+    // FormatMoney(i) not defined when i == std::numeric_limits<int64_t>::min()
+    if (i64 != std::numeric_limits<int64_t>::min()) {
+        int64_t parsed_money;
+        if (ParseMoney(FormatMoney(i64), parsed_money)) {
+            assert(parsed_money == i64);
+        }
+    }
     (void)GetSizeOfCompactSize(u64);
     (void)GetSpecialScriptSize(u32);
     // (void)GetVirtualTransactionSize(i64, i64); // function defined only for a subset of int64_t inputs
     // (void)GetVirtualTransactionSize(i64, i64, u32); // function defined only for a subset of int64_t/uint32_t inputs
     (void)HexDigit(ch);
+    (void)MoneyRange(i64);
     (void)i64tostr(i64);
     (void)IsDigit(ch);
     (void)IsSpace(ch);
@@ -106,6 +115,14 @@
     (void)SipHashUint256(u64, u64, u256);
     (void)SipHashUint256Extra(u64, u64, u256, u32);
     (void)ToLower(ch);
+    (void)ToUpper(ch);
+    // ValueFromAmount(i) not defined when i == std::numeric_limits<int64_t>::min()
+    if (i64 != std::numeric_limits<int64_t>::min()) {
+        int64_t parsed_money;
+        if (ParseMoney(ValueFromAmount(i64).getValStr(), parsed_money)) {
+            assert(parsed_money == i64);
+        }
+    }

     const arith_uint256 au256 = UintToArith256(u256);
     assert(ArithToUint256(au256) == u256);


Fixed Windows build

Fixed Windows build

--- src/test/merkle_tests.cpp
+++ src/test/merkle_tests.cpp
@@ -100,14 +100,14 @@
     {
         // add a random leaf
         uint256 temp;
-        for (uint j = 0; j < 32; j++)
+        for (uint32_t j = 0; j < 32; j++)
             *(temp.begin() + j) = insecure_rand() & 255;
         leafData.push_back(temp);
     }

     for (unsigned int i = 0; i < MAX_TRIES; i++)
     {
-        uint size = insecure_rand() % MAX_LEAVES;
+        uint32_t size = insecure_rand() % MAX_LEAVES;
         std::vector<uint256> leaves = leafData;
         leaves.resize(size);


Fix crash when dumping cubemap texture

Fix crash when dumping cubemap texture

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@30119 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- plugins/video/render3d/opengl/gl_txtmgr_basictex.cpp
+++ plugins/video/render3d/opengl/gl_txtmgr_basictex.cpp
@@ -978,25 +978,25 @@
   csGLGraphics3D::statecache->SetTexture (textarget, GetHandle ());
   if (textarget == GL_TEXTURE_3D) return 0; // @@@ Not supported yet

-  glGetTexLevelParameteriv (textarget, 0, GL_TEXTURE_WIDTH, &tw);
-  glGetTexLevelParameteriv (textarget, 0, GL_TEXTURE_HEIGHT, &th);
+  GLenum useTarget = (textarget == GL_TEXTURE_CUBE_MAP)
+      ? GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB : textarget;
+  glGetTexLevelParameteriv (useTarget, 0, GL_TEXTURE_WIDTH, &tw);
+  glGetTexLevelParameteriv (useTarget, 0, GL_TEXTURE_HEIGHT, &th);

   GLint depthSize;
-  glGetTexLevelParameteriv ((textarget == GL_TEXTURE_CUBE_MAP)
-      ? GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB : textarget,
-      0, GL_TEXTURE_DEPTH_SIZE, &depthSize);
+  glGetTexLevelParameteriv (useTarget, 0, GL_TEXTURE_DEPTH_SIZE, &depthSize);

   uint8* data = new uint8[tw * th * 4];

   if (depthSize > 0)
   {
     // Depth texture
-    glGetTexImage (textarget, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, data);
+    glGetTexImage (useTarget, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, data);
   }
   else
   {
     // Color texture
-    glGetTexImage (textarget, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
+    glGetTexImage (useTarget, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
   }
   csImageMemory* lmimg =
       new csImageMemory (tw, th,


ana and gmap colors

ana and gmap colors


INTEGRATION: CWS changefileheader (1.3.300); FILE MERGED 2008/03/31 13:01:01 rt 1.3.300.1: #i87441# Change license header to LPGL v3.

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


added missing ()

added missing ()

--- include/vigra/error.hxx
+++ include/vigra/error.hxx
@@ -142,12 +142,12 @@
   public:
     PreconditionViolation(char const * message, const char * file, int line)
     {
-        snprintf( what_, bufsize_, "\nPrecondition Violation!\n%s\n(%s:%d)\n", message, file, line);
+        snprintf( what_, bufsize_, "\nPrecondition violation!\n%s\n(%s:%d)\n", message, file, line);
     }

     PreconditionViolation(char const * message)
     {
-        snprintf( what_, bufsize_, "\nPrecondition Violation!\n%s\n", message);
+        snprintf( what_, bufsize_, "\nPrecondition violation!\n%s\n", message);
     }
 };

@@ -156,12 +156,12 @@
   public:
     PostconditionViolation(char const * message, const char * file, int line)
     {
-        snprintf( what_, bufsize_, "\nPostcondition Violation!\n%s\n(%s:%d)\n", message, file, line);
+        snprintf( what_, bufsize_, "\nPostcondition violation!\n%s\n(%s:%d)\n", message, file, line);
     }

     PostconditionViolation(char const * message)
     {
-        snprintf( what_, bufsize_, "\nPostcondition Violation!\n%s\n", message);
+        snprintf( what_, bufsize_, "\nPostcondition violation!\n%s\n", message);
     }
 };

@@ -170,12 +170,12 @@
   public:
     InvariantViolation(char const * message, const char * file, int line)
     {
-        snprintf( what_, bufsize_, "\nInvariant Violation!\n%s\n(%s:%d)\n", message, file, line);
+        snprintf( what_, bufsize_, "\nInvariant violation!\n%s\n(%s:%d)\n", message, file, line);
     }

     InvariantViolation(char const * message)
     {
-        snprintf( what_, bufsize_, "\nInvariant Violation!\n%s\n", message);
+        snprintf( what_, bufsize_, "\nInvariant violation!\n%s\n", message);
     }
 };


rjson::v2

--- cc/rjson.hh
+++ cc/rjson.hh
@@ -957,15 +957,22 @@

         template <typename T, typename F> inline void transform(const value& source, T&& target, F&& transformer)
         {
-            static_assert(std::is_invocable_v<F, const key_value_t&> || std::is_invocable_v<F, const value&> || std::is_invocable_v<F, const value&, size_t>,
+            static_assert(std::is_invocable_v<F, const key_value_t&> || std::is_invocable_v<F, const std::string&, const value&> || std::is_invocable_v<F, const value&> ||
+                              std::is_invocable_v<F, const value&, size_t>,
                           "rjson::transform: unsupported transformer signature");

             // std::is_const<typename std::remove_reference<const int&>::type>::value
             std::visit(
                 [&target, &transformer, &source](auto&& arg) {
                     using TT = std::decay_t<decltype(arg)>;
-                    if constexpr (std::is_same_v<TT, object> && std::is_invocable_v<F, const key_value_t&>)
-                        arg.transform_to(std::forward<T>(target), std::forward<F>(transformer));
+                    if constexpr (std::is_same_v<TT, object>) {
+                        if constexpr (std::is_invocable_v<F, const key_value_t&>)
+                            arg.transform_to(std::forward<T>(target), std::forward<F>(transformer));
+                        else if constexpr (std::is_invocable_v<F, const std::string&, const value&>)
+                            arg.transform_to(std::forward<T>(target), [&transformer](const key_value_t& kv) { return transformer(kv.first, kv.second); });
+                        else
+                            throw value_type_mismatch("object and corresponding transformer", source.actual_type(), DEBUG_LINE_FUNC);
+                    }
                     else if constexpr (std::is_same_v<TT, array> && (std::is_invocable_v<F, const value&> || std::is_invocable_v<F, const value&, size_t>))
                         arg.transform_to(std::forward<T>(target), std::forward<F>(transformer));
                     else if constexpr (!std::is_same_v<TT, null> && !std::is_same_v<TT, const_null>) // do not remove, essential!


INTEGRATION: CWS warnings01 (1.14.58); FILE MERGED 2005/11/15 17:54:37 pl 1.14.58.2: #i55991# removed warnings 2005/10/26 16:05:38 pl 1.14.58.1: #i55991# no more new.hxx

--- svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: jpeg.cxx,v $
  *
- *  $Revision: 1.14 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-08 15:43:56 $
+ *  $Revision: 1.15 $
+ *
+ *  last change: $Author: hr $ $Date: 2006-06-19 21:07:20 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -52,7 +52,6 @@
 #endif

 #define _JPEGPRIVATE
-#include <tools/new.hxx>
 #include <vcl/bmpacc.hxx>
 #include "jpeg.hxx"
 #include "FilterConfigItem.hxx"
@@ -84,7 +83,7 @@

 // ------------------------------------------------------------------------

-extern "C" long JPEGCallback( void* pCallbackData, long nPercent )
+extern "C" long JPEGCallback( void* /*pCallbackData*/, long /*nPercent*/ )
 {
 /*
     MyCallbackHandler* pH = (MyCallbackHandler*) pCallbackData;
@@ -274,7 +273,7 @@
   }
 }

-extern "C" void term_source (j_decompress_ptr cinfo)
+extern "C" void term_source (j_decompress_ptr)
 {
   /* no work necessary here */
 }
@@ -316,7 +315,7 @@
 // - JPEGReader -
 // --------------

-JPEGReader::JPEGReader( SvStream& rStm, void* pCallData, sal_Bool bSetLS ) :
+JPEGReader::JPEGReader( SvStream& rStm, void*, sal_Bool bSetLS ) :
         rIStm           ( rStm ),
         pAcc            ( NULL ),
         pAcc1           ( NULL ),
@@ -334,7 +333,7 @@
 JPEGReader::~JPEGReader()
 {
     if( pBuffer )
-        SvMemFree( pBuffer );
+        rtl_freeMemory( pBuffer );

     if( pAcc )
         aBmp.ReleaseAccess( pAcc );
@@ -415,7 +414,7 @@
         {
             nAlignedWidth = AlignedWidth4Bytes( aSize.Width() * ( bGray ? 8 : 24 ) );
             ((JPEGCreateBitmapParam*)pParam)->bTopDown = TRUE;
-            pBmpBuf = pBuffer = SvMemAlloc( nAlignedWidth * aSize.Height() );
+            pBmpBuf = pBuffer = rtl_allocateMemory( nAlignedWidth * aSize.Height() );
         }
         ((JPEGCreateBitmapParam*)pParam)->nAlignedWidth = nAlignedWidth;
     }
@@ -566,7 +565,7 @@
         if( pBuffer )
         {
             FillBitmap();
-            SvMemFree( pBuffer );
+            rtl_freeMemory( pBuffer );
             pBuffer = NULL;
         }

@@ -678,17 +677,17 @@
 {
     BOOL bRet = FALSE;

-    Bitmap aBmp( rGraphic.GetBitmap() );
+    Bitmap aGraphicBmp( rGraphic.GetBitmap() );
     FilterConfigItem aConfigItem( (::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >*)pFilterData );
     const sal_Bool bGreys = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 ) != 0;
     if ( bGreys )
     {
-        if ( !aBmp.Convert( BMP_CONVERSION_8BIT_GREYS ) )
-            aBmp = rGraphic.GetBitmap();
+        if ( !aGraphicBmp.Convert( BMP_CONVERSION_8BIT_GREYS ) )
+            aGraphicBmp = rGraphic.GetBitmap();
     }
     sal_Int32 nQuality = aConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 );

-    pAcc = aBmp.AcquireReadAccess();
+    pAcc = aGraphicBmp.AcquireReadAccess();
     if( pAcc )
     {
 #ifndef SYSTEM_JPEG
@@ -712,7 +711,7 @@
         delete[] pBuffer;
         pBuffer = NULL;

-        aBmp.ReleaseAccess( pAcc );
+        aGraphicBmp.ReleaseAccess( pAcc );
         pAcc = NULL;
     }
     return bRet;


better initial size string for pre-update

--- sw/source/ui/dialog/wordcountdialog.cxx
+++ sw/source/ui/dialog/wordcountdialog.cxx
@@ -74,7 +74,7 @@
     , aOK(&action_area, SW_RES(PB_OK))
     , aHelp(&action_area, SW_RES(PB_HELP))
 {
-    rtl::OUString sForceInitialSize(RTL_CONSTASCII_USTRINGPARAM("00000000"));
+    rtl::OUString sForceInitialSize(RTL_CONSTASCII_USTRINGPARAM("        "));
     aCurrentWordFI.SetText(sForceInitialSize);
     aCurrentCharacterFI.SetText(sForceInitialSize);
     aCurrentCharacterExcludingSpacesFI.SetText(sForceInitialSize);


Reland of 'Bug in histogram metric reporting.'

Original CL: https://webrtc-review.googlesource.com/c/src/+/101340

A (actually several weeks) while ago, we noticed an error with the
WebRTC.Audio.Agc2.EstimatedNoiseLevel histogram. It always reported
the value 0. Here is why:

The histogram bins go from 0 to 100. But the value logged is dBFS. It
is always less than or equal to 0. This CL changes inverts the value
logged. The noise level value should be somewhere between -90 and 0
dBFS.

The histogram description is updated in
https://chromium-review.googlesource.com/c/chromium/src/+/1264578

Bug: webrtc:7494
Change-Id: I0b53630d4284ce1078fd453e05e89ee53ca9f6c7
Reviewed-on: https://webrtc-review.googlesource.com/c/104063
Reviewed-by: Ivo Creusen <ab68de427b265c46935558af10238a1ba5449aeb@webrtc.org>
Commit-Queue: Alex Loiko <999d0b481e5703ad7006f0848e249f8b2c3f29bd@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25021}

--- modules/audio_processing/agc2/adaptive_digital_gain_applier.cc
+++ modules/audio_processing/agc2/adaptive_digital_gain_applier.cc
@@ -100,7 +100,7 @@
     RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.Agc2.DigitalGainApplied",
                                 last_gain_db_, 0, kMaxGainDb, kMaxGainDb + 1);
     RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.Agc2.EstimatedNoiseLevel",
-                                signal_with_levels.input_noise_level_dbfs, 0,
+                                -signal_with_levels.input_noise_level_dbfs, 0,
                                 100, 101);
   }


Add bench loops

Add bench loops

--- problem/numeric/mandelbrot/cxx_d/cout_d/cout_bench.C
+++ problem/numeric/mandelbrot/cxx_d/cout_d/cout_bench.C
@@ -22,12 +22,18 @@
 using namespace std;

-void bench_cout(const uint n) {
-    cout << "cout!" << endl;
+#define VAL 100
+
+void bench_cout(const uint n) {  // 10x slower than printf
+    for (uint i = 0; i < n; i++) {
+        cout << VAL << " " << VAL << " " << VAL << " " << endl;
+    }
 }

 void bench_printf(const uint n) {
-    cout << "printf!" << endl;
+    for (uint i = 0; i < n; i++) {
+        printf("%u %u %u\n", VAL, VAL, VAL);
+    }
 }

@@ -55,9 +61,9 @@
     }
     chrono::steady_clock::time_point t0 = chrono::steady_clock::now();

-    fn(10);
+    fn(1e6);

     float elapsed = chrono::duration_cast<chrono::milliseconds>(
          chrono::steady_clock::now() - t0).count() / 1e3;
-    cerr << elapsed << " seconds" << endl;
+    cerr << elapsed << " seconds for " << opt << endl;
 }


Using SIGINFO only in Apple or FreeBSD

Using SIGINFO only in Apple or FreeBSD

--- src/xapiand.cc
+++ src/xapiand.cc
@@ -186,7 +186,9 @@
 	act.sa_handler = sig_handler;
 	sigaction(SIGTERM, &act, nullptr);  // On software termination signal
 	sigaction(SIGINT, &act, nullptr);   // On interrupt program (Ctrl-C)
+#if defined(__APPLE__) || defined(__FreeBSD__)
 	sigaction(SIGINFO, &act, nullptr);  // On status request from keyboard (Ctrl-T)
+#endif
 	sigaction(SIGUSR1, &act, nullptr);
 	sigaction(SIGUSR1, &act, nullptr);
 }


trigger travis rerun

trigger travis rerun

--- src/test/test_bitcoin.cpp
+++ src/test/test_bitcoin.cpp
@@ -156,7 +156,8 @@
   return false;
 }

-struct SetupCleanup {
+struct SetupCleanup
+{
     SetupCleanup()   { std::cout << "setup\n"; }
     ~SetupCleanup()
     {


make constants global, for now

make constants global, for now

--- src/ypixbuf.cc
+++ src/ypixbuf.cc
@@ -86,12 +86,13 @@
  * A scaler for Grayscale/RGB/RGBA pixel buffers
  ******************************************************************************/

+typedef unsigned long fixed;
+static fixed const fUnit = 1L << 12;
+static fixed const fPrec = 12;
+enum { R, G, B, A };
+
 template <class Pixel, int Channels> class YScaler {
 public:
-    typedef unsigned long fixed;
-    static fixed const fUnit = 1L << 12;
-    static fixed const fPrec = 12;
-    enum { R, G, B, A };

     YScaler(Pixel const * src, unsigned const sStep,
             unsigned const sw, unsigned const sh,
@@ -114,8 +115,8 @@
         for (unsigned n(0); n < sLen; ++n, src+= Channels) {
             if ((acc+= inc) >= unit) {
                 acc-= unit;
-                typename YScaler<Pixel, Channels>::fixed const p((acc << fPrec) / unit);
-                typename YScaler<Pixel, Channels>::fixed const q(fUnit - p);
+                fixed const p((acc << fPrec) / unit);
+                fixed const q(fUnit - p);

                 if (Channels == 1) {
                     accA+= p * *src;
@@ -195,8 +196,8 @@

             if ((acc+= inc) >= unit) {
                 acc-= unit;
-                typename YScaler<Pixel, Channels>::fixed const p((acc << fPrec) / unit);
-                typename YScaler<Pixel, Channels>::fixed const q(fUnit - p);
+                fixed const p((acc << fPrec) / unit);
+                fixed const q(fUnit - p);

                 accL+= p;

@@ -251,8 +252,8 @@
         unsigned const inc(sLen - 1), unit(dLen - 1);

         for (unsigned n(0); n < dLen; ++n, dst+= Channels) {
-            typename YScaler<Pixel, Channels>::fixed const p((acc << fPrec) / unit);
-            typename YScaler<Pixel, Channels>::fixed const q(fUnit - p);
+            fixed const p((acc << fPrec) / unit);
+            fixed const q(fUnit - p);

             if (p) {
                 if (Channels == 1) {
@@ -295,8 +296,8 @@
         unsigned const inc(sh - 1), unit(dh - 1);

         for (unsigned n(dh); n > 1; --n, dst+= dStep) {
-            typename YScaler<Pixel, Channels>::fixed const p((acc << fPrec) / unit);
-            typename YScaler<Pixel, Channels>::fixed const q(fUnit - p);
+            fixed const p((acc << fPrec) / unit);
+            fixed const q(fUnit - p);

             if (p)
                 for (unsigned c(0); c < len; ++c)


[bugfix] Always enable lighting, otherwise mesh coloring doesn't work when alpha=1

--- src/rviz/default_plugin/markers/mesh_resource_marker.cpp
+++ src/rviz/default_plugin/markers/mesh_resource_marker.cpp
@@ -215,7 +215,7 @@
       technique->setDiffuse( r, g, b, a );
       technique->setSceneBlending( blending );
       technique->setDepthWriteEnabled( depth_write );
-      technique->setLightingEnabled( !depth_write );
+      technique->setLightingEnabled( true );
     }
   }


Enable better packing for small atlasses

--- src/tools/tools/src/assets/importers/sprite_importer.cpp
+++ src/tools/tools/src/assets/importers/sprite_importer.cpp
@@ -316,7 +316,7 @@
 		}

 		Logger::logInfo("Trying " + toString(size.x) + "x" + toString(size.y) + " px...");
-		auto res = BinPack::fastPack(entries, size);
+		auto res = entries.size() < 50 ? BinPack::pack(entries, size) : BinPack::fastPack(entries, size);
 		if (res) {
 			// Found a pack
 			if (images.size() > 1) {


Publish feedbacks continuously among command points

--- jsk_2016_01_baxter_apc/src/gripper_trajectory_server.cpp
+++ jsk_2016_01_baxter_apc/src/gripper_trajectory_server.cpp
@@ -38,23 +38,27 @@
     angle_msg.data = rad;
     g_gripper_servo_angle_pub[side].publish(angle_msg);

-    control_msgs::FollowJointTrajectoryFeedback feedback_;
+    // Publish feedbacks until next point
+    ros::Rate feedback_rate(100);
+    do
+    {
+      feedback_rate.sleep();

-    feedback_.joint_names.push_back(goal->trajectory.joint_names[0]);
-    feedback_.desired.positions.resize(1);
-    feedback_.actual.positions.resize(1);
-    feedback_.error.positions.resize(1);
+      control_msgs::FollowJointTrajectoryFeedback feedback_;

-    feedback_.desired.positions[0] = rad;
-    feedback_.actual.positions[0] = rad;
-    feedback_.error.positions[0] = 0;
+      feedback_.joint_names.push_back(goal->trajectory.joint_names[0]);
+      feedback_.desired.positions.resize(1);
+      feedback_.actual.positions.resize(1);
+      feedback_.error.positions.resize(1);

-    ros::Duration wait =
-        (goal->trajectory.header.stamp + goal->trajectory.points[i].time_from_start) - ros::Time::now();
-    if (wait > ros::Duration(0))
-      wait.sleep();
-    feedback_.header.stamp = ros::Time::now();
-    as_->publishFeedback(feedback_);
+      feedback_.desired.positions[0] = rad;
+      feedback_.actual.positions[0] = rad;
+      feedback_.error.positions[0] = 0;
+
+      feedback_.header.stamp = ros::Time::now();
+      as_->publishFeedback(feedback_);
+    } while (ros::ok() && i < (goal->trajectory.points.size() - 1) &&
+             ros::Time::now() < (goal->trajectory.header.stamp + goal->trajectory.points[i + 1].time_from_start));
   }

   control_msgs::FollowJointTrajectoryResult result_;


Fixed crash when # of positions or # of velocities is zero.

--- systems/plants/RigidBodyManipulator.cpp
+++ systems/plants/RigidBodyManipulator.cpp
@@ -653,14 +653,22 @@
 template <typename Derived>
 void RigidBodyManipulator::doKinematics(MatrixBase<Derived> & q, bool b_compute_second_derivatives)
 {
-   doKinematics(&q[0], b_compute_second_derivatives);
+  double* q_ptr = nullptr;
+  if (q.size() > 0)
+    q_ptr = &q[0];
+  doKinematics(q_ptr, b_compute_second_derivatives);
 }

 template <typename DerivedA, typename DerivedB>
 void RigidBodyManipulator::doKinematics(MatrixBase<DerivedA>  & q, bool b_compute_second_derivatives, MatrixBase<DerivedB>  & v)
 {
-
-  doKinematics(&q[0], b_compute_second_derivatives, &v[0]);
+  double* q_ptr = nullptr;
+  if (q.size() > 0)
+    q_ptr = &q[0];
+  double* v_ptr = nullptr;
+  if (v.size() > 0)
+    v_ptr = &v[0];
+  doKinematics(q_ptr, b_compute_second_derivatives, v_ptr);
 }

 void RigidBodyManipulator::doKinematics(double* q, bool b_compute_second_derivatives, double* qd)


Match "arrayed" bindings correctly in D3D12

--- qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp
+++ qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp
@@ -2264,7 +2264,10 @@

       for(int i = 0; i < bindArray.count(); i++)
       {
-        if(bindArray[i].bindset == view.space && bindArray[i].bind == (int)view.res.bind)
+        if(bindArray[i].bindset == view.space &&
+           (bindArray[i].bind == (int)view.res.bind ||
+            (bindArray[i].bind <= (int)view.res.bind &&
+             bindArray[i].bind + bindArray[i].arraySize > (int)view.res.bind)))
         {
           shaderRes = &resArray[i];
           break;


Used temporary directory for fixture creating output files.

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

--- src/tests/state_tests.cpp
+++ src/tests/state_tests.cpp
@@ -391,18 +391,21 @@
 }

-class LevelDBStateTest : public ::testing::Test
+class LevelDBStateTest : public TemporaryDirectoryTest
 {
 public:
   LevelDBStateTest()
     : storage(NULL),
-      state(NULL),
-      path(os::getcwd() + "/.state") {}
+      state(NULL) {}

 protected:
   virtual void SetUp()
   {
-    os::rmdir(path);
+    TemporaryDirectoryTest::SetUp();
+
+    ASSERT_SOME(sandbox);
+    path = sandbox.get() + "/.state";
+
     storage = new state::LevelDBStorage(path);
     state = new State(storage);
   }
@@ -411,14 +414,15 @@
   {
     delete state;
     delete storage;
-    os::rmdir(path);
+
+    TemporaryDirectoryTest::TearDown();
   }

   state::Storage* storage;
   State* state;

 private:
-  const string path;
+  string path;
 };


Remove bogus test

Remove bogus test

--- src/tests/test_bigint.cpp
+++ src/tests/test_bigint.cpp
@@ -117,16 +117,6 @@
             result.test_eq("P is prime", Botan::is_prime(p, Test::rng()), true);
             }

-         for(size_t bits = 5; bits <= 32; ++bits)
-            {
-            const BigInt last_p = p;
-            p = Botan::random_prime(Test::rng(), bits, last_p);
-
-            result.test_eq("Relatively prime", Botan::gcd(last_p, p), 1);
-            result.test_eq("Expected bit size", p.bits(), bits);
-            result.test_eq("P is prime", Botan::is_prime(p, Test::rng()), true);
-            }
-
          const size_t safe_prime_bits = 65;
          const BigInt safe_prime = Botan::random_safe_prime(Test::rng(), safe_prime_bits);
          result.test_eq("Safe prime size", safe_prime.bits(), safe_prime_bits);


Avoid calling run() on SIMD tests if SIMD instructions not available.

Problem is the same flag that enables the intrinsics also gives the
compiler a free hand to emit same instructions for everything including
function preambles. So on systems without SSE2/NEON/etc, even jumping
to the test briefly causes a crash because GCC emits SIMD instructions
for things other than our intrinsics.

GH #1495

--- src/tests/test_runner.cpp
+++ src/tests/test_runner.cpp
@@ -10,6 +10,7 @@
 #include <botan/version.h>
 #include <botan/rotate.h>
 #include <botan/loadstor.h>
+#include <botan/cpuid.h>

 namespace Botan_Tests {

@@ -249,7 +250,11 @@

       try
          {
-         if(Test* test = Test::get_test(test_name))
+         if(test_name == "simd_32" && Botan::CPUID::has_simd_32() == false)
+            {
+            results.push_back(Test::Result::Note(test_name, "SIMD not available on this platform"));
+            }
+         else if(Test* test = Test::get_test(test_name))
             {
             std::vector<Test::Result> test_results = test->run();
             results.insert(results.end(), test_results.begin(), test_results.end());


Delete get_ro calls from TransferManager

(cherry picked from commit ca10b5a5d8b50a0a7a30409f4d1b9856ceef9c28)


Update for individual file compiling.

Update for individual file compiling.

--- src/tool-musicxml2hum.cpp
+++ src/tool-musicxml2hum.cpp
@@ -15,6 +15,7 @@
 #include "tool-musicxml2hum.h"
 #include "tool-ruthfix.h"
 #include "tool-transpose.h"
+#include "tool-tremolo.h"
 #include "tool-trillspell.h"

 #include "Convert.h"


updating collision checking API

updating collision checking API

--- moveit_core/kinematic_constraints/src/kinematic_constraint.cpp
+++ moveit_core/kinematic_constraints/src/kinematic_constraint.cpp
@@ -540,7 +540,7 @@
     collision_detection::CollisionResult res;
     req.contacts = true;
     req.max_contacts = 1;
-    cw_->checkWorldCollision(req, res, *cr_, state);
+    cw_->checkRobotCollision(req, res, *cr_, state);

     if (verbose)
     {


csg_dlptopol: shorten help

csg_dlptopol: shorten help

--- src/tools/csg_dlptopol.cc
+++ src/tools/csg_dlptopol.cc
@@ -38,15 +38,11 @@
     string ProgramName() { return "csg_dlptopol"; }
     void HelpText(ostream &out) {
         out << "Create a dlpoly topology template based on an existing (atomistic) topology and \n"
-	    << "a mapping xml-file. The conventional file extensions of other simulation engines, \n"
-            << "e.g. Gromacs, are recognized in the input (option --top), whereas <name>.dlpf must \n"
-            << "be used for DL_POLY topology files. By convention, <name> can be omitted, in which \n"
-            << "case '.dlpf' implies 'using standard naming': FIELD as input or FIELD_CGV as output. \n"
-	    << "- NOTE: the created template file needs to be inspected and amended by the user!\n\n"
+	    << "a mapping xml-file. The created template file needs to be inspected and amended by the user!\n\n"
 	    << "Examples:\n"
-	    << "* csg_dlptopol --top .dlpf --out .dlpf --cg cg-map.xml\n  - convert FIELD to FIELD_CGV using cg-map.xml\n"
-	    << "* csg_dlptopol --top FA-dlpoly.dlpf --out CG-dlpoly.dlpf --cg cg-map.xml\n  - convert FA-dlpoly.dlpf to CG-dlpoly.dlpf\n"
-	    << "* csg_dlptopol --top FA-gromacs.tpr --out FA-dlpoly.dlpf --no-map\n  - convert FA-gromacs.tpr to FA-dlpoly.dlpf";
+	    << "* csg_dlptopol --top .dlpf --out .dlpf --cg cg-map.xml\n  convert FIELD to FIELD_CGV using cg-map.xml\n"
+	    << "* csg_dlptopol --top FA-dlpoly.dlpf --out CG-dlpoly.dlpf --cg cg-map.xml\n"
+	    << "* csg_dlptopol --top FA-gromacs.tpr --out FA-dlpoly.dlpf --no-map\n";
     }

     bool DoMapping(void) { return true; }
@@ -74,8 +70,7 @@
     //"  input topology in any known format:\n  <name>.dlpf for dlpoly, <name>.tpr for gromacs\n  (convention: '.dlpf'='use FIELD')");
     AddProgramOptions()
       ("out", boost::program_options::value<string>(),
-       "  output topology in dlpoly format; examples:\n"
-       "  - <name>.dlpf, .dlpf (convention: '.dlpf'='use FIELD_CGV')");
+       "  output topology in dlpoly format");
 }

 bool DLPTopolApp::EvaluateTopology(Topology *top, Topology *top_ref)


Added using std to csg_reupdate.cc

Added using std to csg_reupdate.cc

--- src/tools/csg_reupdate.cc
+++ src/tools/csg_reupdate.cc
@@ -27,6 +27,9 @@
 /*
  *
  */
+
+using namespace std;
+
 int main(int argc, char** argv) {
   CsgREupdate app;
   return app.Exec(argc, argv);


Fixed test for Bam vs Bgzip to allow for empty references.

--- src/utils/FileRecordTools/FileReaders/InputStreamMgr.cpp
+++ src/utils/FileRecordTools/FileReaders/InputStreamMgr.cpp
@@ -175,9 +175,8 @@
 			_bamReader = new BamTools::BamReader();
 			_bamReader->OpenStream(_finalInputStream);
 			QuickString bamHeader(_bamReader->GetHeaderText());
-			BamTools::RefVector bamRefs(_bamReader->GetReferenceData());
-
-			if (bamHeader.empty() || bamRefs.empty()) {
+
+			if (bamHeader.empty()) {
 				//This is NOT a bam file.
 				_pushBackStreamBuf->clear();
 				_compressedSaveData.clear();


HttpServer/KmsHttpEPServer: Remove duplicate disconnect()

--- src/server/implementation/HttpServer/KmsHttpEPServer.cpp
+++ src/server/implementation/HttpServer/KmsHttpEPServer.cpp
@@ -1186,7 +1186,7 @@
   }

   if (self->priv->server != nullptr) {
-    soup_server_disconnect (self->priv->server);
+    // soup_server_disconnect (self->priv->server);  g_clear_object -> dispose -> Already does soup_server_disconnect
     g_clear_object (&self->priv->server);
   }


*** empty log message ***

*** empty log message ***

--- helpcontents.cpp
+++ helpcontents.cpp
@@ -46,6 +46,10 @@
 //#include "wx/html/htmlfilt.h"

 #include "paravermain.h"
+
+#include "trace.h"        // load xml
+#include "traceoptions.h" // load xml
+
 ////@begin XPM images
 ////@end XPM images

@@ -359,12 +363,19 @@
 }

+std::string HelpContents::getCurrentTutorialFullPath()
+{
+  string fullPath = paraverMain::myParaverMain->GetParaverConfig()->getGlobalTutorialsPath();
+  fullPath += wxString( wxFileName::GetPathSeparator() ).mb_str();
+  fullPath += currentTutorialDir.mb_str();
+  fullPath += wxString( wxFileName::GetPathSeparator() ).mb_str();
+
+  return fullPath;
+}
+
 std::string HelpContents::getHrefFullPath( wxHtmlLinkEvent &event )
 {
-  string hrefFullPath = paraverMain::myParaverMain->GetParaverConfig()->getGlobalTutorialsPath();
-  hrefFullPath += wxString( wxFileName::GetPathSeparator() ).mb_str();
-  hrefFullPath += currentTutorialDir.mb_str();
-  hrefFullPath += wxString( wxFileName::GetPathSeparator() ).mb_str();
+  string hrefFullPath = getCurrentTutorialFullPath();
   hrefFullPath += std::string( event.GetLinkInfo().GetHref().mb_str() );

   return hrefFullPath;
@@ -398,6 +409,14 @@
       wxMessageDialog message( this, _("No trace loaded."), _( "Warning" ), wxOK );
       message.ShowModal();
     }
+  }
+  else if ( matchHrefExtension( event, _(".xml")))
+  {
+    string traceName = getCurrentTutorialFullPath();
+    bool loadTrace = true;
+    string strXmlFile = getHrefFullPath( event );
+
+    paraverMain::myParaverMain->ShowCutTraceWindow( traceName, loadTrace, strXmlFile );
   }
   else if ( event.GetLinkInfo().GetHref().Cmp( _("init_preferences") ) == 0 )
   {


Sync from tflite-micro. (#127)

Sync from tflite-micro. (#127)

--- src/tensorflow/lite/micro/kernels/micro_tensor_utils.cpp
+++ src/tensorflow/lite/micro/kernels/micro_tensor_utils.cpp
@@ -663,7 +663,7 @@
       const int16_t b = input_2[index];
       int32_t value = static_cast<int32_t>(a) * static_cast<int32_t>(b);
       value = MultiplyByQuantizedMultiplier(value, multiplier, shift);
-      value -= output_zp;
+      value += output_zp;
       value = std::min(std::max(static_cast<int32_t>(-128), value),
                        static_cast<int32_t>(127));


In the Win32LCPTranscoder, don't use wcstombs or mbstowcs, as they don't pick up the correct local code page; use the Win32 API using CP_ACP as the code page

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

--- src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
+++ src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
@@ -849,15 +849,10 @@
     if (!srcText)
         return 0;

-    unsigned charLen = ::mblen(srcText, MB_CUR_MAX);
-    if (charLen == -1)
+    int retVal = ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, srcText, -1, NULL, 0);
+    if (retVal == -1)
         return 0;
-    else if (charLen != 0)
-        charLen = strlen(srcText)/charLen;
-
-    if (charLen == -1)
-        return 0;
-    return charLen;
+    return retVal;
 }

@@ -867,8 +862,8 @@
     if (!srcText)
         return 0;

-    const unsigned int retVal = ::WideCharToMultiByte(CP_ACP, 0, srcText, -1, NULL, 0, NULL, NULL);
-    if (retVal == (unsigned int)-1)
+    int retVal = ::WideCharToMultiByte(CP_ACP, 0, srcText, -1, NULL, 0, NULL, NULL);
+    if (retVal == -1)
         return 0;
     return retVal;
 }
@@ -888,7 +883,7 @@

         // Allocate a buffer of that size plus one for the null and transcode
         retVal = new char[neededLen + 1];
-        ::wcstombs(retVal, toTranscode, neededLen + 1);
+        ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)toTranscode, -1, retVal, neededLen+1, NULL, NULL);

         // And cap it off anyway just to make sure
         retVal[neededLen] = 0;
@@ -915,7 +910,7 @@

         // Allocate a buffer of that size plus one for the null and transcode
         retVal = (char*) manager->allocate((neededLen + 1) * sizeof(char)); //new char[neededLen + 1];
-        ::wcstombs(retVal, toTranscode, neededLen + 1);
+        ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)toTranscode, -1, retVal, neededLen+1, NULL, NULL);

         // And cap it off anyway just to make sure
         retVal[neededLen] = 0;
@@ -949,7 +944,7 @@

         // Allocate a buffer of that size plus one for the null and transcode
         retVal = new XMLCh[neededLen + 1];
-        ::mbstowcs(retVal, toTranscode, neededLen + 1);
+        ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, toTranscode, -1, (LPWSTR)retVal, neededLen + 1);

         // Cap it off just to make sure. We are so paranoid!
         retVal[neededLen] = 0;
@@ -982,7 +977,7 @@

         // Allocate a buffer of that size plus one for the null and transcode
         retVal = (XMLCh*) manager->allocate((neededLen + 1) * sizeof(XMLCh)); //new XMLCh[neededLen + 1];
-        ::mbstowcs(retVal, toTranscode, neededLen + 1);
+        ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, toTranscode, -1, (LPWSTR)retVal, neededLen + 1);

         // Cap it off just to make sure. We are so paranoid!
         retVal[neededLen] = 0;
@@ -1015,7 +1010,7 @@
     }

     // This one has a fixed size output, so try it and if it fails it fails
-    if (::mbstowcs(toFill, toTranscode, maxChars + 1) == size_t(-1))
+    if ( size_t(-1) == ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, toTranscode, -1, (LPWSTR)toFill, maxChars + 1) )
         return false;
     return true;
 }
@@ -1040,7 +1035,7 @@
     }

     // This one has a fixed size output, so try it and if it fails it fails
-    if (::wcstombs(toFill, toTranscode, maxBytes + 1) == size_t(-1))
+    if ( size_t(-1) == ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)toTranscode, -1, toFill, maxBytes + 1, NULL, NULL) )
         return false;

     // Cap it off just in case


Fixed FFTW-enabled compilation of fourier.cpp

--- src/transform/fourier.cpp
+++ src/transform/fourier.cpp
@@ -816,6 +816,8 @@
    //std::cout << "outSize = " << outSize << std::endl;
    //std::cout << "border = " << border << std::endl;

+   Image const in_copy = in; // Make a copy of the header to preserve image in case in == out
+
 #ifdef DIP__HAS_FFTW

    // Determine floating point size and call appropriate work horse
@@ -838,7 +840,6 @@
    // Determine output data type
    DataType dtype = DataType::SuggestComplex( in.DataType() );
    // Allocate output image, so that it has the right (padded) size. If we don't do padding, then we're just doing the framework's work here
-   Image const in_copy = in; // Make a copy of the header to preserve image in case in == out
    Image tmp;
    if( real ) {
       tmp.ReForge( outSize, in_copy.TensorElements(), dtype );


Add int16 support for `tf.as_string`

Add int16 support for `tf.as_string`

In `tf.as_string`, integers are mostly supported (`int8`, `int32`, `int64`)
but not `int16`. This fix adds the `int16` support for `tf.as_string`.

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

--- tensorflow/core/kernels/as_string_op.cc
+++ tensorflow/core/kernels/as_string_op.cc
@@ -73,6 +73,7 @@
     }
     switch (dtype) {
       case DT_INT8:
+      case DT_INT16:
       case DT_INT32:
         strings::Appendf(&format_, "d");
         break;
@@ -129,6 +130,7 @@
       ENCODE_TYPE(DT_FLOAT, float, format_);
       ENCODE_TYPE(DT_DOUBLE, double, format_);
       ENCODE_TYPE(DT_INT8, int8, format_);
+      ENCODE_TYPE(DT_INT16, int16, format_);
       case (DT_BOOL): {
         const auto& input_flat = input_tensor->flat<bool>();
         for (int i = 0; i < input_flat.size(); ++i) {


refactor(screen/index): impove `on_resize`

--- src/tui/screens/index.cpp
+++ src/tui/screens/index.cpp
@@ -152,18 +152,9 @@

         update_column_widths();

-        /*
-         * When the window is resized from the lower left/right
-         * corner, the currently selected item may escape the
-         * menu, so we lock it here.
-         *
-         * TODO: fix this for cases where the cursor has
-         * jumped more than one step down under.
-         * (check whether it's just below what's valid, and
-         * if so, move it to menu_bot).
-         */
-        if (menu_at_bot())
-            selected_item_--;
+        /* Ensure we don't select an item past the tail. */
+        if (auto tail = scroll_offset_ + menu_capacity() - 1; selected_item_ > tail)
+            selected_item_ = tail;
     }

     int index::print_header(const columns_t::column_t &col)


Refining the condition for parallel IsDirectory(). Avoiding "defined()" for TARGET_OS_IPHONE since it is often defined as zero.  Removing "defined(__ANDROID__)" since the problem with the android emulator cannot be reproduced now. Change: 138138237

--- tensorflow/core/platform/file_system.cc
+++ tensorflow/core/platform/file_system.cc
@@ -38,7 +38,7 @@
 // Run a function in parallel using a ThreadPool, but skip the ThreadPool
 // on the iOS platform due to its problems with more than a few threads.
 void ForEach(int first, int last, std::function<void(int)> f) {
-#if defined(__ANDROID__) || defined(TARGET_OS_IPHONE)
+#if TARGET_OS_IPHONE
   for (int i = first; i < last; i++) {
     f(i);
   }


fix pyobject casing throughout.  no NPY warnings now

--- base/crappy.cxx
+++ base/crappy.cxx
@@ -308,7 +308,7 @@

             /* Cast if necessary */
             arg = arg_arrays[j];
-            if (!PyArray_EquivTypenums(PyArray_DESCR(arg)->type_num,
+            if (!PyArray_EquivTypenums(PyArray_DESCR((PyArrayObject *) arg)->type_num,
                                        cur_typenum))
             {
                 arg_arrays[j] = c_array_from_object(arg, cur_typenum, is_output[j]);
@@ -320,11 +320,11 @@
         }

         /* Grab value */
-        arg_list[j] = PyArray_DATA(arg_arrays[j]);
+        arg_list[j] = PyArray_DATA((PyArrayObject *) arg_arrays[j]);

         /* Find maximum array size */
-        if (PyArray_SIZE(arg_arrays[j]) > max_array_size) {
-            max_array_size = PyArray_SIZE(arg_arrays[j]);
+        if (PyArray_SIZE((PyArrayObject *) arg_arrays[j]) > max_array_size) {
+            max_array_size = PyArray_SIZE((PyArrayObject *) arg_arrays[j]);
         }
     }

@@ -512,7 +512,7 @@
         npy_intp length = v->size();                            \
         PyObject *obj = PyArray_SimpleNew(1, &length, typenum); \
         if (length > 0) {                                       \
-            memcpy(PyArray_DATA(obj), &((*v)[0]),               \
+            memcpy(PyArray_DATA((PyArrayObject *) obj), &((*v)[0]),               \
                    sizeof(ctype)*length);                       \
         }                                                       \
         delete v;                                               \


Another attempt at enabling stderr logging for ERROR and FATAL logs.  This will break a few layout tests. (I'll add them to the fixable list shortly)

BUG=1343647

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

--- base/logging.cc
+++ base/logging.cc
@@ -413,7 +413,8 @@
       logging_destination == LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG) {
 #if defined(OS_WIN)
     OutputDebugStringA(str_newline.c_str());
-#elif defined(OS_POSIX)
+    if (severity_ >= kAlwaysPrintErrorLevel)
+#endif
     // TODO(erikkay): this interferes with the layout tests since it grabs
     // stderr and stdout and diffs them against known data. Our info and warn
     // logs add noise to that.  Ideally, the layout tests would set the log
@@ -424,7 +425,6 @@
     // they won't be able to pass any layout tests that have info or warn logs.
     // See http://b/1343647
     fprintf(stderr, "%s", str_newline.c_str());
-#endif
   } else if (severity_ >= kAlwaysPrintErrorLevel) {
     // When we're only outputting to a log file, above a certain log level, we
     // should still output to stderr so that we can better detect and diagnose


Log message is captured on stack prior to generating minidump for fatal errors.

This is to aid in diagnosing minidumps from fatal errors in the field.
Review URL: https://chromiumcodereview.appspot.com/9921024

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

--- base/logging.cc
+++ base/logging.cc
@@ -46,6 +46,7 @@

 #include "base/base_switches.h"
 #include "base/command_line.h"
+#include "base/debug/alias.h"
 #include "base/debug/debugger.h"
 #include "base/debug/stack_trace.h"
 #include "base/eintr_wrapper.h"
@@ -636,6 +637,12 @@
   }

   if (severity_ == LOG_FATAL) {
+    // Ensure the first characters of the string are on the stack so they
+    // are contained in minidumps for diagnostic purposes.
+    char str_stack[1024];
+    str_newline.copy(str_stack, arraysize(str_stack));
+    base::debug::Alias(str_stack);
+
     // display a message or break into the debugger on a fatal error
     if (base::debug::BeingDebugged()) {
       base::debug::BreakDebugger();


Allow unique_ptr to convert to bool

Allow unique_ptr to convert to bool

--- agency/cuda/detail/unique_ptr.hpp
+++ agency/cuda/detail/unique_ptr.hpp
@@ -140,6 +140,12 @@
       return *ptr_;
     }

+    __host__ __device__
+    operator bool () const
+    {
+      return get();
+    }
+
   private:
     thrust::cuda::pointer<T> ptr_;
     default_delete<T> deleter_;


Added a unit test for the docker volume chown support.

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

--- src/tests/containerizer/docker_volume_isolator_tests.cpp
+++ src/tests/containerizer/docker_volume_isolator_tests.cpp
@@ -1267,6 +1267,148 @@
 }

+// This test verifies that a docker volume with absolute path can
+// be properly mounted to a container with rootfs, and launches a
+// command task that is running as a non-root user and is able to
+// write files from the mounted docker volume.
+TEST_F(DockerVolumeIsolatorTest,
+       ROOT_INTERNET_CURL_UNPRIVILEGED_USER_CommandTaskRootfs)
+{
+  Try<Owned<cluster::Master>> master = StartMaster();
+  ASSERT_SOME(master);
+
+  slave::Flags flags = CreateSlaveFlags();
+  flags.isolation = "docker/volume,docker/runtime,filesystem/linux";
+  flags.image_providers = "docker";
+  flags.docker_volume_chown = true;
+
+  MockDockerVolumeDriverClient* mockClient = new MockDockerVolumeDriverClient;
+
+  Try<Owned<MesosContainerizer>> containerizer =
+    createContainerizer(flags, Owned<DriverClient>(mockClient));
+
+  ASSERT_SOME(containerizer);
+
+  Owned<MasterDetector> detector = master.get()->createDetector();
+
+  Try<Owned<cluster::Slave>> slave = StartSlave(
+      detector.get(),
+      containerizer->get(),
+      flags);
+
+  ASSERT_SOME(slave);
+
+  MockScheduler sched;
+
+  MesosSchedulerDriver driver(
+      &sched,
+      DEFAULT_FRAMEWORK_INFO,
+      master.get()->pid,
+      DEFAULT_CREDENTIAL);
+
+  Future<FrameworkID> frameworkId;
+  EXPECT_CALL(sched, registered(&driver, _, _))
+    .WillOnce(FutureArg<1>(&frameworkId));
+
+  Future<vector<Offer>> offers;
+  EXPECT_CALL(sched, resourceOffers(&driver, _))
+    .WillOnce(FutureArg<1>(&offers))
+    .WillRepeatedly(Return()); // Ignore subsequent offers.
+
+  driver.start();
+
+  AWAIT_READY(frameworkId);
+
+  AWAIT_READY(offers);
+  ASSERT_FALSE(offers->empty());
+
+  const Offer& offer = offers.get()[0];
+
+  // Create a volume with absolute path.
+  const string volumeDriver = "driver";
+  const string name = "name";
+
+  const string containerPath = path::join(os::getcwd(), "foo");
+
+  Volume volume = createDockerVolume(volumeDriver, name, containerPath);
+
+  Option<string> user = os::getenv("SUDO_USER");
+  ASSERT_SOME(user);
+
+  // NOTE: We use a non-shell command here because 'sh' might not be
+  // in the PATH. 'alpine' does not specify env PATH in the image. On
+  // some linux distribution, '/bin' is not in the PATH by default.
+  CommandInfo command;
+  command.set_shell(false);
+  command.set_value("/usr/bin/test");
+  command.add_arguments("test");
+  command.add_arguments("-w");
+  command.add_arguments(containerPath);
+
+  command.set_user(user.get());
+
+  TaskInfo task = createTask(
+      offer.slave_id(),
+      offer.resources(),
+      command);
+
+  Image image;
+  image.set_type(Image::DOCKER);
+  image.mutable_docker()->set_name("alpine");
+
+  ContainerInfo containerInfo;
+  containerInfo.set_type(ContainerInfo::MESOS);
+  containerInfo.add_volumes()->CopyFrom(volume);
+
+  containerInfo.mutable_mesos()->mutable_image()->CopyFrom(image);
+
+  task.mutable_container()->CopyFrom(containerInfo);
+
+  // Create mount point for volume.
+  const string mountPoint = path::join(os::getcwd(), "volume");
+  ASSERT_SOME(os::mkdir(mountPoint));
+
+  Future<string> mountName;
+
+  EXPECT_CALL(*mockClient, mount(volumeDriver, _, _))
+    .WillOnce(DoAll(FutureArg<1>(&mountName),
+                    Return(mountPoint)));
+
+  Future<string> unmountName;
+
+  EXPECT_CALL(*mockClient, unmount(volumeDriver, _))
+    .WillOnce(DoAll(FutureArg<1>(&unmountName),
+                    Return(Nothing())));
+
+  Future<TaskStatus> statusStarting;
+  Future<TaskStatus> statusRunning;
+  Future<TaskStatus> statusFinished;
+
+  EXPECT_CALL(sched, statusUpdate(&driver, _))
+    .WillOnce(FutureArg<1>(&statusStarting))
+    .WillOnce(FutureArg<1>(&statusRunning))
+    .WillOnce(FutureArg<1>(&statusFinished));
+
+  driver.launchTasks(offer.id(), {task});
+
+  AWAIT_READY(statusStarting);
+  EXPECT_EQ(TASK_STARTING, statusStarting->state());
+
+  AWAIT_READY(statusRunning);
+  EXPECT_EQ(TASK_RUNNING, statusRunning->state());
+
+  AWAIT_EXPECT_EQ(name, mountName);
+
+  AWAIT_READY(statusFinished);
+  EXPECT_EQ(TASK_FINISHED, statusFinished->state());
+
+  AWAIT_EXPECT_EQ(name, unmountName);
+
+  driver.stop();
+  driver.join();
+}
+
+
 // This test verifies that a container launched without
 // a rootfs cannot write to a read-only docker volume.
 TEST_F(DockerVolumeIsolatorTest, ROOT_CommandTaskNoRootfsWithReadOnlyVolume)


[Dev] Improved the logs in CRSTestSuite.

--- simcrs/batches/simcrs.cpp
+++ simcrs/batches/simcrs.cpp
@@ -281,11 +281,19 @@
   stdair::TravelSolutionList_T lTravelSolutionList =
     simcrsService.fareQuote (lBookingRequest, lSegmentPath);

+  // Choose a random travel solution: the first one.
+  const stdair::TravelSolutionStruct& lChosenTravelSolution =
+    lTravelSolutionList.front();
+
+  // Get the segment path of the travel solution.
+  stdair::KeyList_T lsegmentDateKeyList =
+    lChosenTravelSolution.getSegmentDateKeyList();
+
   // DEBUG
-  const stdair::TravelSolutionStruct& lTravelSolution =
-    lTravelSolutionList.front();
-  STDAIR_LOG_DEBUG ("The price given by the fare quoter is: "
-                    << lTravelSolution.getFare() << " Euros");
+  STDAIR_LOG_DEBUG ("The chosen travel solution is: "
+                    << lsegmentDateKeyList.front()
+                    << ", the fare is: "
+                    << lChosenTravelSolution.getFare() << " Euros.");

   // Make a booking
   // const std::string lAirlineCode ("SV");


HTTP: adjust request-connection assignment.

Prefer existing, idle connections to creating new connections,
even when below the max-connection limit. Gives much better re-use
and pipeline-ing, and hence reduced setup time/trips.

--- simgear/io/HTTPClient.cxx
+++ simgear/io/HTTPClient.cxx
@@ -696,10 +696,7 @@

     void responseComplete()
     {
-     //   SG_LOG(SG_IO, SG_INFO, "*** responseComplete:" << activeRequest->url());
-        activeRequest->responseComplete();
-        client->requestFinished(this);
-
+        Request_ptr completedRequest = activeRequest;
         if (contentDeflate) {
           inflateEnd(&zlib);
         }
@@ -723,6 +720,13 @@
         if (state != STATE_CLOSED)  {
             state = sentRequests.empty() ? STATE_IDLE : STATE_WAITING_FOR_RESPONSE;
         }
+
+    // notify request after we change state, so this connection is idle
+    // if completion triggers other requests (which is likely)
+        //   SG_LOG(SG_IO, SG_INFO, "*** responseComplete:" << activeRequest->url());
+        completedRequest->responseComplete();
+        client->requestFinished(this);
+
         setTerminator("\r\n");
     }

@@ -844,43 +848,43 @@
     ss << host << "-" << port;
     string connectionId = ss.str();
     bool havePending = !d->pendingRequests.empty();
+    bool atConnectionsLimit = d->connections.size() >= d->maxConnections;
     ConnectionDict::iterator consEnd = d->connections.end();

     // assign request to an existing Connection.
     // various options exist here, examined in order
-    if (d->connections.size() >= d->maxConnections) {
-        ConnectionDict::iterator it = d->connections.find(connectionId);
-        if (it == consEnd) {
-            // maximum number of connections active, queue this request
-            // when a connection goes inactive, we'll start this one
-            d->pendingRequests.push_back(r);
-            return;
-        }
-
-        // scan for an idle Connection to the same host (likely if we're
-        // retrieving multiple resources from the same host in quick succession)
-        // if we have pending requests (waiting for a free Connection), then
-        // force new requests on this id to always use the first Connection
-        // (instead of the random selection below). This ensures that when
-        // there's pressure on the number of connections to keep alive, one
-        // host can't DoS every other.
-        int count = 0;
-        for (; (it != consEnd) && (it->first == connectionId); ++it, ++count) {
-            if (havePending || !it->second->isActive()) {
-                con = it->second;
-                break;
-            }
-        }
-
-        if (!con) {
-            // we have at least one connection to the host, but they are
-            // all active - we need to pick one to queue the request on.
-            // we use random but round-robin would also work.
-            int index = rand() % count;
-            for (it = d->connections.find(connectionId); index > 0; --index) { ; }
+    ConnectionDict::iterator it = d->connections.find(connectionId);
+    if (atConnectionsLimit && (it == consEnd)) {
+        // maximum number of connections active, queue this request
+        // when a connection goes inactive, we'll start this one
+        d->pendingRequests.push_back(r);
+        return;
+    }
+
+    // scan for an idle Connection to the same host (likely if we're
+    // retrieving multiple resources from the same host in quick succession)
+    // if we have pending requests (waiting for a free Connection), then
+    // force new requests on this id to always use the first Connection
+    // (instead of the random selection below). This ensures that when
+    // there's pressure on the number of connections to keep alive, one
+    // host can't DoS every other.
+    int count = 0;
+    for (; (it != consEnd) && (it->first == connectionId); ++it, ++count) {
+        if (havePending || !it->second->isActive()) {
             con = it->second;
-        }
-    } // of at max connections limit
+            break;
+        }
+    }
+
+    if (!con && atConnectionsLimit) {
+        // all current connections are busy (active), and we don't
+        // have free connections to allocate, so let's assign to
+        // an existing one randomly. Ideally we'd used whichever one will
+        // complete first but we don't have that info.
+        int index = rand() % count;
+        for (it = d->connections.find(connectionId); index > 0; --index) { ; }
+        con = it->second;
+    }

     // allocate a new connection object
     if (!con) {


expose incident_faces function

expose incident_faces function

--- geode/openmesh/TriMesh.cpp
+++ geode/openmesh/TriMesh.cpp
@@ -1817,6 +1817,7 @@
     .GEODE_METHOD(mean_edge_length)
     .GEODE_OVERLOADED_METHOD_2(Vvh3_Method_fh, "face_vertex_handles", vertex_handles)
     .GEODE_OVERLOADED_METHOD_2(Vvh2_Method_eh, "edge_vertex_handles", vertex_handles)
+    .GEODE_METHOD(incident_faces)
     .GEODE_METHOD(vertex_one_ring)
     .GEODE_METHOD(smooth_normal)
     .GEODE_METHOD(add_cylinder)


Check return value of vsnprintf in utils::format_string

Check that vsnprintf doesn't return -1 or larger than the buffer
in utils::format_string.

--- src/utils/string_utils.cc
+++ src/utils/string_utils.cc
@@ -16,6 +16,7 @@
  */

 #include <cstdarg>
+#include <stdexcept>
 #include <vector>

 #include "string_utils.h"
@@ -25,11 +26,24 @@

         std::string format_string(const char *fmt...) {
             std::vector<char> buffer;
+
             va_list args, cpy;
             va_start(args, fmt);
             va_copy(cpy, args);
-            buffer.resize(vsnprintf(nullptr, 0, fmt, cpy) + 1);
-            vsnprintf(buffer.data(), buffer.size(), fmt, args);
+
+            ssize_t len = vsnprintf(nullptr, 0, fmt, cpy) + 1;
+            if(len < 0) {
+                throw std::runtime_error("phosphor::utils::format_string "
+                                         "failed: vsnprintf returned < 0");
+            }
+            buffer.resize(len);
+            len = vsnprintf(buffer.data(), buffer.size(), fmt, args);
+            if(len < 0 || len > buffer.size()) {
+                throw std::runtime_error("phosphor::utils::format_string "
+                                         "failed: vsnprintf returned < 0 or "
+                                         "larger than the buffer.");
+            }
+
             va_end(args);
             va_end(cpy);
             return buffer.data();


[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/stable/2017-11-14)

--- stan/math/prim/mat/functor/finite_diff_gradient_auto.hpp
+++ stan/math/prim/mat/functor/finite_diff_gradient_auto.hpp
@@ -19,8 +19,8 @@
  */
 double finite_diff_stepsize(double u) {
   using std::cbrt;
+  using std::fmax;
   using std::numeric_limits;
-  using std::fmax;
   static const double cbrt_epsilon = cbrt(numeric_limits<double>::epsilon());
   return cbrt_epsilon * fmax(1, fabs(u));
 }


* handle the empty string case

* handle the empty string case

--- common/utils/StringUtils.cpp
+++ common/utils/StringUtils.cpp
@@ -91,6 +91,8 @@
  * @returns true if sucessfull, false otherwise
  */
 bool StringToUInt(const string &value, unsigned int *output) {
+  if (value.empty())
+    return false;
   errno = 0;
   long l = strtol(value.data(), NULL, 10);
   if (l < 0 || (l == 0 && errno != 0))


Coding style nit.

Coding style nit.

--- src/vast/ingest/reader.cc
+++ src/vast/ingest/reader.cc
@@ -343,11 +343,12 @@
       continue;
     }

+    ze::value v;
     if (field_types_[f] == ze::set_type)
-      e.push_back(ze::set::parse(
-              set_types_[sets++], start, end, set_separator_));
+      v = ze::set::parse(set_types_[sets++], start, end, set_separator_);
     else
-      e.emplace_back(ze::value::parse(field_types_[f], start, end));
+      v = ze::value::parse(field_types_[f], start, end);
+    e.emplace_back(std::move(v));
   }

   return e;


Issue 3350: traffic_server using 100% CPU

--- mgmt/ProcessManager.cc
+++ mgmt/ProcessManager.cc
@@ -148,6 +148,8 @@

   if (pmgmt->require_lm) { /* Allow p. process to run w/o a lm */
     pmgmt->initLMConnection();
+  } else {
+    return ret;
   }

   if (pmgmt->init) {


* subversion/bindings/javahl/native/LogMessageCallback.cpp
  (LogMessageCallback::~LogMessageCallback):
    Correct the documentation for this destructor.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@864692 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/bindings/javahl/native/LogMessageCallback.cpp
+++ subversion/bindings/javahl/native/LogMessageCallback.cpp
@@ -38,8 +38,9 @@
  */
 LogMessageCallback::~LogMessageCallback()
 {
-    // The m_callback does not need to be destroyed, because it is the
-    // passed in parameter to the Java SVNClient.log method.
+    // The m_callback does not need to be destroyed because it is the
+    // passed in parameter to the Java SVNClientInterface.logMessages
+    // method.
 }

 svn_error_t *


filesystem_snapshot_tests: explicit volume name for macOS 11 Big Sur

--- prosoft/core/tests/src/filesystem_snapshot_tests.cpp
+++ prosoft/core/tests/src/filesystem_snapshot_tests.cpp
@@ -115,7 +115,9 @@
         static const auto mount_path = PS_TEXT("S:\\");
         static const auto system_root = PS_TEXT("Windows");
 #else
-        static const auto root = "/";
+        // attach_snapshot in macOS uses mount_apfs, which on Big Sur requires explicit
+        // volume name ("/System/Volumes/Data" instead of "/"). It also works in 10.15.
+        const auto root = "/System/Volumes/Data";
         const auto mount_path = temp_directory_path() / path{std::string{"snap"}.append(std::to_string(getpid()))};
         static const auto system_root = "System";
 #endif
@@ -127,7 +129,8 @@
             const path mount{mount_path};
             REQUIRE_FALSE(exists(mount, ec));
             attach_snapshot(snap, mount, ec);
-            CHECK(!ec);
+            CHECK(!ec); // attach_snapshot() on macOS uses mount_apfs, which requires "Full Disk Access"
+                        // (error: "mount_apfs: volume could not be mounted: Operation not permitted")
             CHECK_THROWS(delete_snapshot(snap));

             CHECK(exists(mount / system_root, ec));


Add comment explaining why identity check is sufficient.

--- searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
+++ searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
@@ -96,6 +96,11 @@
         }
         return;
     }
+    /*
+     * Check if document type repos are equal. DocumentTypeRepoFactory::make
+     * returns the same document type repo if document type configs are equal,
+     * thus we can just perform a cheaper identity check here.
+     */
     if (_repo != op.getDocument()->getRepo()) {
         op.deserializeDocument(*_repo);
     }


Modify the original algorithm in TF1::Moment and TF1::CentralMoment to use
the new C functions TF1_ExpValHelperx and TF1_ExpValHelper instead
of the interpreted functions. This removes several limitations.
Also initialize the parameters for the helper functions.

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

--- hist/src/TF1.cxx
+++ hist/src/TF1.cxx
@@ -1,4 +1,4 @@
-// @(#)root/hist:$Name:  $:$Id: TF1.cxx,v 1.80 2004/06/16 09:51:28 brun Exp $
+// @(#)root/hist:$Name:  $:$Id: TF1.cxx,v 1.81 2004/06/22 15:36:42 brun Exp $
 // Author: Rene Brun   18/08/95

 /*************************************************************************
@@ -24,6 +24,7 @@

 Bool_t TF1::fgAbsValue    = kFALSE;
 Bool_t TF1::fgRejectPoint = kFALSE;
+static TF1 *gHelper = 0;

 ClassImp(TF1)

@@ -2492,6 +2493,20 @@
 }

 //______________________________________________________________________________
+Double_t TF1_ExpValHelperx(Double_t *x, Double_t *par) {
+   return x[0]*gHelper->EvalPar(x,par);
+}
+
+//______________________________________________________________________________
+Double_t TF1_ExpValHelper(Double_t *x, Double_t *par) {
+   Int_t npar    = gHelper->GetNpar();
+   Double_t xbar = par[npar];
+   Double_t n    = par[npar+1];
+   return TMath::Power(x[0]-xbar,n)*gHelper->EvalPar(x,par);
+}
+
+
+//______________________________________________________________________________
 Double_t TF1::Moment(Double_t n, Double_t a, Double_t b, const Double_t *params, Double_t epsilon)
 {
 // Return nth moment of function between a and b
@@ -2507,7 +2522,15 @@
       return 0;
    }

-   TF1 fnc("TF1_ExpValHelper",Form("%s*pow(x,%f)",GetName(),n));
+   gHelper = this;
+   //TF1 fnc("TF1_ExpValHelper",Form("%s*pow(x,%f)",GetName(),n));
+   TF1 fnc("TF1_ExpValHelper",TF1_ExpValHelper,fXmin,fXmax,fNpar+2);
+   for (Int_t i=0;i<fNpar;i++) {
+      if(params) fnc.SetParameter(i,params[i]);
+      else       fnc.SetParameter(i,fParams[i]);
+   }
+   fnc.SetParameter(fNpar,0);
+   fnc.SetParameter(fNpar+1,n);
    Double_t res = fnc.Integral(a,b,params,epsilon)/norm;
    fgAbsValue = kFALSE;
    return res;
@@ -2529,10 +2552,26 @@
       return 0;
    }

-   TF1 fncx("TF1_ExpValHelperx",Form("%s*x",GetName()));
+   gHelper = this;
+   //TF1 fncx("TF1_ExpValHelperx",Form("%s*x",GetName()));
+   TF1 fncx("TF1_ExpValHelperx",TF1_ExpValHelperx,fXmin,fXmax,fNpar);
+   Int_t i;
+   for (i=0;i<fNpar;i++) {
+      if(params) fncx.SetParameter(i,params[i]);
+      else       fncx.SetParameter(i,fParams[i]);
+   }
    Double_t xbar = fncx.Integral(a,b,params,epsilon)/norm;

-   TF1 fnc("TF1_ExpValHelper",Form("%s*pow(x-%f,%f)",GetName(),xbar,n));
+   //TF1 fnc("TF1_ExpValHelper",Form("%s*pow(x-%f,%f)",GetName(),xbar,n));
+   TF1 fnc("TF1_ExpValHelper",TF1_ExpValHelper,fXmin,fXmax,fNpar+2);
+   for (i=0;i<fNpar;i++) {
+      if(params) fnc.SetParameter(i,params[i]);
+      else       fnc.SetParameter(i,fParams[i]);
+   }
+   fnc.SetParameter(fNpar,0);
+   fnc.SetParameter(fNpar+1,n);
+   fnc.SetParameter(fNpar,xbar);
+   fnc.SetParameter(fNpar+1,n);
    Double_t res = fnc.Integral(a,b,params,epsilon)/norm;
    fgAbsValue = kFALSE;
    return res;


Add comment explaining why we check identity instead of equality.

--- searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
+++ searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp
@@ -496,6 +496,11 @@
 {
     const auto *repo = _activeFeedView->getDocumentTypeRepo().get();
     const auto &update = *op.getUpdate();
+    /*
+     * Check if document types are equal. DocumentTypeRepoFactory::make returns
+     * the same document type repo if document type configs are equal, thus we
+     * can just perform a cheaper identity check here.
+     */
     if (repo->getDocumentType(_docTypeName.getName()) != &update.getType()) {
         try {
             vespalib::nbostream stream;


Fix a bug in TH1::Merge (thanks to Maarten Ballintijn for reporting it).
If one merges into an empty histogram the result
is correct, but if you merge/add into an existing
histogram the statistics are (displayed) wrong.

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


Fix test for Visual C++.

Fix test for Visual C++.

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

--- test/PCH/chain-openmp-threadprivate.cpp
+++ test/PCH/chain-openmp-threadprivate.cpp
@@ -3,9 +3,11 @@
 // with PCH
 // RUN: %clang_cc1 -fopenmp -fnoopenmp-use-tls -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s
 // no PCH
-// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS
+// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
+// RUN: %clang_cc1 -fopenmp -emit-llvm -include %s -include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2
 // with PCH
-// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS
+// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-1
+// RUN: %clang_cc1 -fopenmp -emit-llvm -chain-include %s -chain-include %s %s -o - | FileCheck %s -check-prefix=CHECK-TLS-2

 // REQUIRES: tls

@@ -23,7 +25,7 @@
 #else

 // CHECK: call {{.*}} @__kmpc_threadprivate_register(
-// CHECK-TLS: @a = {{.*}}thread_local {{.*}}global {{.*}}i32*
+// CHECK-TLS-1: @{{a|\"\\01\?a@@3PEAHEA\"}} = {{.*}}thread_local {{.*}}global {{.*}}i32*

 // CHECK-LABEL: foo
 // CHECK-TLS-LABEL: foo
@@ -31,9 +33,9 @@
   return *a;
   // CHECK: call {{.*}} @__kmpc_global_thread_num(
   // CHECK: call {{.*}} @__kmpc_threadprivate_cached(
-  // CHECK-TLS: call {{.*}}i32** @_ZTW1a()
+  // CHECK-TLS-1: call {{.*}} @{{_ZTW1a|\"\\01\?\?__Ea@@YAXXZ\"}}()
 }

-// CHECK-TLS: define {{.*}}i32** @_ZTW1a()
+// CHECK-TLS-2: define {{.*}} @{{_ZTW1a|\"\\01\?\?__Ea@@YAXXZ\"}}()

 #endif


Protection added in TH2::Rebin2D (suggested by Gero Flucke)

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


wrd: feat: prints number of err

wrd: feat: prints number of err

--- mod/wrd/loader/err.hpp
+++ mod/wrd/loader/err.hpp
@@ -36,9 +36,9 @@
 	public:
 		virtual void log() const {
 			switch(fType) {
-				case ERR: WRD_E("%s", msg.c_str()); break;
-				case WARN: WRD_W("%s", msg.c_str()); break;
-				case INFO: WRD_I("%s", msg.c_str()); break;
+                case ERR: WRD_E("(%d): %s", code, msg.c_str()); break;
+                case WARN: WRD_W("(%d): %s", code, msg.c_str()); break;
+                case INFO: WRD_I("(%d): %s", code, msg.c_str()); break;
 			}
 		}
         void dbgLog() const {


Punktur

Punktur

--- classui.cpp
+++ classui.cpp
@@ -112,7 +112,7 @@
         }
         else
         {
-            cout << "Invalid input. Please enter a number between 1 - 3" << endl;
+            cout << "Invalid input. Please enter a number between 1 - 3." << endl;
             select("2");
         }
     }


dem_geoid: Sanity check for compatibility

--- src/asp/Tools/dem_geoid.cc
+++ src/asp/Tools/dem_geoid.cc
@@ -108,7 +108,9 @@
     return prerasterize_type( m_img.prerasterize(bbox), m_georef,
                               m_geoid, m_geoid_georef, m_reverse_adjustment, m_nodata_val );
   }
-  template <class DestT> inline void rasterize( DestT const& dest, BBox2i const& bbox ) const { vw::rasterize( prerasterize(bbox), dest, bbox ); }
+  template <class DestT> inline void rasterize( DestT const& dest, BBox2i const& bbox ) const {
+    vw::rasterize( prerasterize(bbox), dest, bbox );
+  }
   /// \endcond
 };

@@ -117,7 +119,8 @@
 dem_geoid( ImageViewBase<ImageT> const& img, GeoReference const& georef,
            ImageViewRef<PixelMask<double> > const& geoid,
            GeoReference const& geoid_georef, bool reverse_adjustment, double nodata_val) {
-  return DemGeoidView<ImageT>( img.impl(), georef, geoid, geoid_georef, reverse_adjustment, nodata_val );
+  return DemGeoidView<ImageT>( img.impl(), georef, geoid, geoid_georef,
+                               reverse_adjustment, nodata_val );
 }

 struct Options : asp::BaseOptions {
@@ -135,8 +138,11 @@
      "The value of no-data pixels, unless specified in the DEM.")
     ("geoid", po::value(&opt.geoid)->default_value("EGM96"), "The geoid to use [EGM96, NAVD88].")
     ("output-prefix,o", po::value(&opt.output_prefix), "Specify the output prefix.")
-    ("double", po::bool_switch(&opt.use_double)->default_value(false)->implicit_value(true), "Output using double precision (64 bit) instead of float (32 bit).")
-    ("reverse-adjustment", po::bool_switch(&opt.reverse_adjustment)->default_value(false)->implicit_value(true), "Go from DEM relative to the geoid to DEM relative to the ellipsoid.");
+    ("double", po::bool_switch(&opt.use_double)->default_value(false)->implicit_value(true),
+     "Output using double precision (64 bit) instead of float (32 bit).")
+    ("reverse-adjustment",
+     po::bool_switch(&opt.reverse_adjustment)->default_value(false)->implicit_value(true),
+     "Go from DEM relative to the geoid to DEM relative to the ellipsoid.");

   general_options.add( asp::BaseOptionsDescription(opt) );

@@ -161,11 +167,13 @@
   }else if(opt.geoid == "NAVD88"){
     opt.geoid_file = geoid_path + "/" + "NAVD88.tif";
   }else{
-    vw_throw( ArgumentErr() << "Unknown geoid: " << opt.geoid << ".\n\n" << usage << general_options );
+    vw_throw( ArgumentErr() << "Unknown geoid: " << opt.geoid << ".\n\n"
+              << usage << general_options );
   }

   if ( opt.dem_name.empty() )
-    vw_throw( ArgumentErr() << "Requires <dem> in order to proceed.\n\n" << usage << general_options );
+    vw_throw( ArgumentErr() << "Requires <dem> in order to proceed.\n\n"
+              << usage << general_options );

   if ( opt.output_prefix.empty() ) {
     opt.output_prefix = fs::path(opt.dem_name).stem().string();
@@ -195,7 +203,12 @@
 // EGM96  geoid height = -32.69
 // NAVD88 geoid height = -32.931

+// To do: Do another test with the web form for Alaska for NAVD88!
+// To do: Add Hawaii, etc.
+
 int main( int argc, char *argv[] ) {
+
+  std::cout << "see to do above!" << std::endl;

   Options opt;
   try {
@@ -208,15 +221,14 @@
     double dem_nodata_val = opt.nodata_value;
     if ( dem_rsrc.has_nodata_read() ) {
       dem_nodata_val = dem_rsrc.nodata_read();
-      vw_out() << "\tFound input nodata value for " << opt.dem_name << ": " << dem_nodata_val << endl;
+      vw_out() << "\tFound input nodata value for " << opt.dem_name << ": "
+               << dem_nodata_val << endl;
     }
     DiskImageView<double> dem_img(dem_rsrc);
     GeoReference dem_georef;
     bool has_georef = read_georeference(dem_georef, dem_rsrc);
     if (!has_georef)
       vw_throw( ArgumentErr() << "Missing georeference for DEM: " << opt.dem_name << "\n" );
-    if ( dem_georef.datum().name() != "WGS_1984" )
-      vw_throw( ArgumentErr() << "The datum is not WGS_1984 for DEM: " << opt.dem_name << "\n" );

     // Read the geoid containing the adjustments. Read it in memory
     // entirely to dramatically speed up the computations.
@@ -229,12 +241,22 @@
     ImageView<float> geoid_img = DiskImageView<float>(geoid_rsrc);
     GeoReference geoid_georef;
     read_georeference(geoid_georef, geoid_rsrc);
+
+    if ( dem_georef.datum().name() != geoid_georef.datum().name() ){
+      vw_throw( ArgumentErr() << "Datum mismatch."
+                << "\nDEM   datum: " << dem_georef.datum().name()
+                << "\nGeoid datum: " << geoid_georef.datum().name()
+                << "\n"
+                );
+    }
+
     ImageViewRef<PixelMask<double> > geoid
       = interpolate(create_mask( pixel_cast<double>(geoid_img), geoid_nodata_val ),
                     BicubicInterpolation(), ZeroEdgeExtension());

     ImageViewRef<double> adj_dem = dem_geoid(dem_img, dem_georef,
-                                             geoid, geoid_georef, reverse_adjustment, dem_nodata_val);
+                                             geoid, geoid_georef,
+                                             reverse_adjustment, dem_nodata_val);

     std::string adj_dem_file = opt.output_prefix + "-adj.tif";
     vw_out() << "Writing adjusted DEM: " << adj_dem_file << std::endl;


Made sure translational multi-port mass does not override start values. Resolvse #1012.

--- HOPSAN++/componentLibraries/defaultLibrary/Mechanic/Linear/MechanicMultiPortTranslationalMass.hpp
+++ HOPSAN++/componentLibraries/defaultLibrary/Mechanic/Linear/MechanicMultiPortTranslationalMass.hpp
@@ -157,7 +157,7 @@
                 }
             }

-            mIntegrator.initialize(mTimestep, 0, 0, 0, 0);
+            mIntegrator.initialize(mTimestep, 0, 0, x2[0], v2);

             //Print debug message if velocities do not match
             if(v1 != -v2)


- issue 2936: when checking for error location, allow windows paths

--- copasi/math/CJitCompiler.cpp
+++ copasi/math/CJitCompiler.cpp
@@ -125,13 +125,13 @@
         {
           std::string Where = where(e);

-          if (Where == "/Allocator.cpp")
+          if (Where == "/Allocator.cpp" || Where == "\\Allocator.cpp")
             {
               allocateFunctionBuffer(mFunctionBufferSize * 2);
               ReturnFunction = NULL;
               continue;
             }
-          else if (Where == "/CodeBuffer.h")
+          else if (Where == "/CodeBuffer.h" || Where == "\\CodeBuffer.h")
             {
               break;
             }
@@ -200,7 +200,7 @@
             {
               std::string Where = where(e);

-              if (Where == "/Allocator.cpp")
+              if (Where == "/Allocator.cpp" || Where == "\\Allocator.cpp")
                 {
                   allocateFunctionBuffer(mFunctionBufferSize * 2);
                   pNode = NULL;
@@ -243,13 +243,13 @@
         {
           std::string Where = where(e);

-          if (Where == "/Allocator.cpp")
+          if (Where == "/Allocator.cpp" || Where == "\\Allocator.cpp")
             {
               allocateFunctionBuffer(mFunctionBufferSize * 2);
               ReturnFunction = NULL;
               continue;
             }
-          else if (Where == "/CodeBuffer.h")
+          else if (Where == "/CodeBuffer.h" || Where == "\\CodeBuffer.h")
             {
               break;
             }


Chain up to XercesParserLiaison member.

Chain up to XercesParserLiaison member.

--- src/XalanSourceTree/XalanSourceTreeParserLiaison.cpp
+++ src/XalanSourceTree/XalanSourceTreeParserLiaison.cpp
@@ -271,13 +271,17 @@

 void
-XalanSourceTreeParserLiaison::destroyDocument(XalanDocument*		theDocument)
+XalanSourceTreeParserLiaison::destroyDocument(XalanDocument*	theDocument)
 {
 	if (mapDocument(theDocument) != 0)
 	{
 		m_documentMap.erase(theDocument);

 		delete theDocument;
+	}
+	else
+	{
+		m_xercesParserLiaison.destroyDocument(theDocument);
 	}
 }


git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@4192 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- simulation/src/camera.cpp
+++ simulation/src/camera.cpp
@@ -2,7 +2,6 @@
 #include "pcl/simulation/camera.hpp"

 using namespace Eigen;
-
 namespace pcl
 {


INTEGRATION: CWS sb8 (1.2.68); FILE MERGED 2003/09/03 10:37:17 sb 1.2.68.1: #112071# Fixed comparison of RTTypeClass with com.sun.star.uno.TypeClass.

--- stoc/source/registry_tdprovider/rdbtdp_tdenumeration.hxx
+++ stoc/source/registry_tdprovider/rdbtdp_tdenumeration.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: rdbtdp_tdenumeration.hxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.3 $
  *
- *  last change: $Author: kso $ $Date: 2002-11-13 16:01:19 $
+ *  last change: $Author: vg $ $Date: 2003-10-09 10:24:08 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -69,6 +69,9 @@
 #endif
 #ifndef _RTL_REF_HXX_
 #include <rtl/ref.hxx>
+#endif
+#ifndef _REGISTRY_REFLTYPE_HXX_
+#include <registry/refltype.hxx>
 #endif
 #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HPP_
 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
@@ -153,6 +156,8 @@
         ::com::sun::star::reflection::TypeDescriptionSearchDepth eDepth,
         const RegistryTypeReaderLoader & rLoader );

+    static bool match( ::RTTypeClass eType1,
+                       ::com::sun::star::uno::TypeClass eType2 );
     bool queryMore();
     ::com::sun::star::uno::Reference<
         ::com::sun::star::reflection::XTypeDescription > queryNext();


More unused code.

More unused code.

--- astronomy/date_time_body.hpp
+++ astronomy/date_time_body.hpp
@@ -864,7 +864,6 @@
  private:
   constexpr JulianDateParser(std::int64_t digits,
                              int digit_count,
-                             bool has_decimal_mark,
                              int decimal_mark_index);

   // Returns a |JulianDateParser| describing the given string. Fails if the
@@ -903,7 +902,6 @@

 constexpr JulianDateParser::JulianDateParser(std::int64_t const digits,
                                              int const digit_count,
-                                             bool const has_decimal_mark,
                                              int const decimal_mark_index)
     : digits_(digits),
       digit_count_(digit_count),
@@ -927,7 +925,6 @@
   if (str.at_end()) {
     return JulianDateParser(digits,
                             digit_count,
-                            has_decimal_mark,
                             decimal_mark_index);
   } else {
     switch (*str) {
@@ -949,7 +946,7 @@
                          decimal_mark_index);
       default:
         CONSTEXPR_CHECK(false);
-        return JulianDateParser{0, 0, false, 0};
+        return JulianDateParser{0, 0, 0};
     }
   }
 }


Fix documentation error in tf.reverse docstring (#1)

The first example in the tf.reverse docstring causes a ValueError:

```Python
In [1]: import tensorflow as tf
In [2]: t = tf.constant([[[[ 0,  1,  2,  3], [ 4,  5,  6,  7], [ 8,  9, 10, 11]], [[12, 13, 14, 15], [16, 17, 18, 19], [20, 21, 22, 23]]]])
In [3]: dims = -1
In [4]: sess = tf.InteractiveSession()
In [5]: tf.reverse(t, dims).eval()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-7752813cc8a9> in <module>()
----> 1 tf.reverse(t, dims).eval()

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.pyc in reverse(tensor, axis, name)
   2332
   2333 def reverse(tensor, axis, name=None):
-> 2334   return gen_array_ops.reverse_v2(tensor, axis, name)
   2335 reverse.__doc__ = gen_array_ops.reverse_v2.__doc__
   2336

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.pyc in reverse_v2(tensor, axis, name)
   2697   """
   2698   result = _op_def_lib.apply_op("ReverseV2", tensor=tensor, axis=axis,
-> 2699                                 name=name)
   2700   return result
   2701

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.pyc in apply_op(self, op_type_name, name, **keywords)
    765         op = g.create_op(op_type_name, inputs, output_types, name=scope,
    766                          input_types=input_types, attrs=attr_protos,
--> 767                          op_def=op_def)
    768         if output_structure:
    769           outputs = op.outputs

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/ops.pyc in create_op(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_shapes, compute_device)
   2506                     original_op=self._default_original_op, op_def=op_def)
   2507     if compute_shapes:
-> 2508       set_shapes_for_outputs(ret)
   2509     self._add_op(ret)
   2510     self._record_op_seen_by_control_dependencies(ret)

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/ops.pyc in set_shapes_for_outputs(op)
   1871       shape_func = _call_cpp_shape_fn_and_require_op
   1872
-> 1873   shapes = shape_func(op)
   1874   if shapes is None:
   1875     raise RuntimeError(

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/ops.pyc in call_with_requiring(op)
   1821
   1822   def call_with_requiring(op):
-> 1823     return call_cpp_shape_fn(op, require_shape_fn=True)
   1824
   1825   _call_cpp_shape_fn_and_require_op = call_with_requiring

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.pyc in call_cpp_shape_fn(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
    608     res = _call_cpp_shape_fn_impl(op, input_tensors_needed,
    609                                   input_tensors_as_shapes_needed,
--> 610                                   debug_python_shape_fn, require_shape_fn)
    611     if not isinstance(res, dict):
    612       # Handles the case where _call_cpp_shape_fn_impl calls unknown_shape(op).

/Users/craffel/.pyenv/versions/2.7.13/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.pyc in _call_cpp_shape_fn_impl(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
    674       missing_shape_fn = True
    675     else:
--> 676       raise ValueError(err.message)
    677
    678   if missing_shape_fn:

ValueError: Shape must be rank 1 but is rank 0 for 'ReverseV2' (op: 'ReverseV2') with input shapes: [1,2,3,4], [].
```


Reduce permissiveness of assertion.

Reduce permissiveness of assertion.

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

--- lib/Analysis/GRExprEngine.cpp
+++ lib/Analysis/GRExprEngine.cpp
@@ -1686,8 +1686,7 @@

     // Check for casts from array type to pointer type.
     if (ExTy->isArrayType()) {
-      assert(T->isPointerType() || T->isReferenceType());
-
+      assert(T->isPointerType());
       V = StateMgr.ArrayToPointer(V);
       MakeNode(Dst, CastE, N, BindExpr(St, CastE, V));
       continue;