raster.input: touchup error output

raster.input: touchup error output

git-svn-id: 5adfda8227e14e59fd47d5bd9925a30df16fed74@2766 d397654b-2ff0-0310-9e29-ba003691a0f9

--- plugins/input/raster/raster_datasource.cpp
+++ plugins/input/raster/raster_datasource.cpp
@@ -83,7 +83,7 @@
     }

     if (! extent_initialized_)
-        throw datasource_exception("Raster Plugin: valid <lox> <loy> <hix> <hiy>, or <extent> are required");
+        throw datasource_exception("Raster Plugin: valid <extent> or <lox> <loy> <hix> <hiy> are required");

     if (bind)
     {
@@ -113,7 +113,7 @@
     }
     catch (mapnik::image_reader_exception const& ex)
     {
-        std::cerr << "Raster Plugin: image reader exception caught:" << ex.what() << std::endl;
+        std::cerr << "Raster Plugin: image reader exception caught: " << ex.what() << std::endl;
         throw;
     }
     catch (...)


Update HPW Level for MSS API library

Update HPW Level for MSS API library

Change-Id: Ia2128471a5fbe3d48bada6a0cf7c61b6804712f6
Original-Change-Id: I33f36a6cc647d66c39ac46ba2922dcd1c49d86b5
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47150
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <7301c4b00f53e5772c2576cd0c5f485155c2ece1@us.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: HWSV CI <ae069ce3805842f4ed79e0ef7868baadb5df0a6b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H
+++ src/import/chips/p9/procedures/hwp/memory/lib/mss_utils.H
@@ -28,9 +28,9 @@
 /// @brief Main include file for the Memory Subsystem
 ///
 // *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
-// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
+// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
 // *HWP Team: Memory
-// *HWP Level: 2
+// *HWP Level: 3
 // *HWP Consumed by: HB:FSP

 #ifndef _MSS_P9_ATTR_UTILS_H_


Compile fix

Compile fix

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

--- plugins/video/canvas/wxgl/GLWXDriver2D.cpp
+++ plugins/video/canvas/wxgl/GLWXDriver2D.cpp
@@ -254,7 +254,7 @@
   {
     Display* dpy = (Display*) wxGetDisplay ();
     GLXContext active_GLContext = glXGetCurrentContext();
-    XVisualInfo *xvis = (XVisualInfo*)theCanvas->vi;
+    XVisualInfo *xvis = (XVisualInfo*)theCanvas->m_vi;

     Report (CS_REPORTER_SEVERITY_NOTIFY, "Video driver GL/X version %s",
       glXIsDirect (dpy, active_GLContext) ? "(direct renderer)" :


Remove further unneccesary 'this' statements.

--- creator/plugins/kparts/codeeditorpart/Interface/MainWindow.cpp
+++ creator/plugins/kparts/codeeditorpart/Interface/MainWindow.cpp
@@ -82,10 +82,10 @@
     _skipNextUpdate = false;
     _isGameObject = false;
     _isGameComponent = false;
-    connect( GluonEngine::Game::instance(), SIGNAL( currentSceneChanged( GluonEngine::Scene* ) ), this, SLOT( readTheScene() ) );
+    connect( GluonEngine::Game::instance(), SIGNAL( currentSceneChanged( GluonEngine::Scene* ) ), SLOT( readTheScene() ) );
     connect( GluonCreator::HistoryManager::instance(), SIGNAL( historyChanged( const QUndoCommand* ) ), SLOT( updateNodesFromModel( const QUndoCommand* ) ) );
-    connect( GluonCreator::ObjectManager::instance(), SIGNAL( newGameObject( GluonEngine::GameObject* ) ), this, SLOT( markAsGameObject() ) );
-    connect( GluonCreator::ObjectManager::instance(), SIGNAL( newComponent( GluonEngine::Component* ) ), this, SLOT( markAsGameComponent() ) );
+    connect( GluonCreator::ObjectManager::instance(), SIGNAL( newGameObject( GluonEngine::GameObject* ) ), SLOT( markAsGameObject() ) );
+    connect( GluonCreator::ObjectManager::instance(), SIGNAL( newComponent( GluonEngine::Component* ) ), SLOT( markAsGameComponent() ) );
 }

 GraphDocument* MainWindow::activeDocument() const


Now compiles with NextStep compiler.

Now compiles with NextStep compiler.

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

--- plugins/video/renderer/software/tcache.cpp
+++ plugins/video/renderer/software/tcache.cpp
@@ -254,7 +254,7 @@
   SoftwareCachedTexture *cached_texture = cache_texture (MipMap, pt);

   // Compute the rectangle on the lighted texture, if it is dirty
-  create_lighted_texture (pt, cached_texture, texman, u_min, v_min, u_max, v_max);
+  (this->*create_lighted_texture) (pt, cached_texture, texman, u_min, v_min, u_max, v_max);
 }

 #define SysPrintf iG3D->System->Printf


fixed bug #891

fixed bug #891

--- livesupport/products/gLiveSupport/src/GLiveSupport.cxx
+++ livesupport/products/gLiveSupport/src/GLiveSupport.cxx
@@ -22,7 +22,7 @@

     Author   : $Author: fgerlits $
-    Version  : $Revision: 1.33 $
+    Version  : $Revision: 1.34 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $

 ------------------------------------------------------------------------------*/
@@ -527,6 +527,15 @@
 GLiveSupport :: addToScratchPad(Ptr<Playable>::Ref  playable)
                                                             throw ()
 {
+    PlayableList::iterator  it;
+    for (it = scratchpadContents->begin(); it != scratchpadContents->end();
+                                                                     ++it) {
+        Ptr<Playable>::Ref  listElement = *it;
+        if (*listElement->getId() == *playable->getId()) {
+            scratchpadContents->erase(it);
+            break;
+        }
+    }
     scratchpadContents->push_front(playable);
     masterPanel->updateScratchpadWindow();
 }


fix: don't recalculate line distance in the engine (CURA-1317)

--- src/infill.cpp
+++ src/infill.cpp
@@ -78,15 +78,15 @@

 void Infill::generateGridInfill(Polygons& result)
 {
-    generateLineInfill(result, line_distance * 2, fill_angle);
-    generateLineInfill(result, line_distance * 2, fill_angle + 90);
+    generateLineInfill(result, line_distance, fill_angle);
+    generateLineInfill(result, line_distance, fill_angle + 90);
 }

 void Infill::generateTriangleInfill(Polygons& result)
 {
-    generateLineInfill(result, line_distance * 3, fill_angle);
-    generateLineInfill(result, line_distance * 3, fill_angle + 60);
-    generateLineInfill(result, line_distance * 3, fill_angle + 120);
+    generateLineInfill(result, line_distance, fill_angle);
+    generateLineInfill(result, line_distance, fill_angle + 60);
+    generateLineInfill(result, line_distance, fill_angle + 120);
 }

 void Infill::addLineInfill(Polygons& result, const PointMatrix& rotation_matrix, const int scanline_min_idx, const int line_distance, const AABB boundary, std::vector<std::vector<int64_t>>& cut_list)


Draw final infill lines to result

Draw final infill lines to result

This needs some complex traversal of a linked list of which the starting and ending points (next and previous) have unknown direction, which is unavoidable I'm afraid.

Contributes to issue CURA-4017.

--- src/infill.cpp
+++ src/infill.cpp
@@ -2,6 +2,7 @@
 //CuraEngine is released under the terms of the AGPLv3 or higher.

 #include <algorithm> //For std::sort.
+#include <unordered_set>

 #include "infill.h"
 #include "functional"
@@ -601,6 +602,43 @@
             vertex_before = vertex_after;
         }
     }
+
+    //Save all lines, now connected, to the output.
+    std::unordered_set<size_t> completed_groups;
+    for (InfillLineSegment* infill_line : connected_lines)
+    {
+        const size_t group = connected_lines.find(infill_line);
+        if (completed_groups.find(group) == completed_groups.end()) //We already completed this group.
+        {
+            continue;
+        }
+
+        //Find where the polyline ends by searching through previous and next lines.
+        //Note that the "previous" and "next" lines don't necessarily match up though, because the direction while connecting infill lines was not yet known.
+        Point previous_vertex = infill_line->start; //Take one side arbitrarily to start from. This variable indicates the vertex that connects to the previous line.
+        InfillLineSegment* current_infill_line = infill_line;
+        while (current_infill_line->next && current_infill_line->previous)
+        {
+            InfillLineSegment* next_infill_line = (previous_vertex == current_infill_line->start) ? current_infill_line->next : current_infill_line->previous;
+            previous_vertex =                     (previous_vertex == current_infill_line->start) ? next_infill_line->end : next_infill_line->start;
+            current_infill_line = next_infill_line;
+        }
+
+        //Now go along the linked list of infill lines and output the infill lines to the actual result.
+        Point first_vertex = previous_vertex;
+        previous_vertex = (previous_vertex == current_infill_line->start) ? current_infill_line->end : current_infill_line->start;
+        result_lines.addLine(first_vertex, previous_vertex);
+        current_infill_line = (previous_vertex == current_infill_line->start) ? current_infill_line->previous : current_infill_line->next;
+        while (current_infill_line)
+        {
+            Point other_vertex = previous_vertex;
+            previous_vertex = (other_vertex == current_infill_line->start) ? current_infill_line->end : current_infill_line->start; //Opposite side of the line.
+            result_lines.addLine(other_vertex, previous_vertex);
+            current_infill_line = (previous_vertex == current_infill_line->start) ? current_infill_line->previous : current_infill_line->next;
+        }
+
+        completed_groups.insert(group);
+    }
 }

 bool Infill::InfillLineSegment::operator ==(const InfillLineSegment& other) const


No more flkickering!

No more flkickering!

--- src/main/cpp/render/objects/resources/texture_manager.cpp
+++ src/main/cpp/render/objects/resources/texture_manager.cpp
@@ -93,6 +93,7 @@
             return atlases.at(texture_name);
         }

+        LOG(INFO) << "Checking if texture " << texture_name << " is in the dynamic textures. There's " << dynamic_tex_name_to_idx.size() << " dynamic textures, it should be one of them";
         if(dynamic_tex_name_to_idx.find(texture_name) != dynamic_tex_name_to_idx.end()) {
             auto idx = dynamic_tex_name_to_idx.at(texture_name);
             if(dynamic_textures.size() > idx) {
@@ -266,7 +267,7 @@
             }

             // We've found the first texture in this alias chain - let's create an actual texture for it if needed
-            if(dynamic_tex_name_to_idx.find(texture_name) != dynamic_tex_name_to_idx.end()) {
+            if(dynamic_tex_name_to_idx.find(texture_name) == dynamic_tex_name_to_idx.end()) {
                 LOG(INFO) << "Need to create it";
                 // The texture we're all aliasing doesn't have a real texture yet. Let's fix that
                 const texture_format& format = textures.at(texture_name).format;
@@ -287,7 +288,11 @@
                 auto new_tex_index = dynamic_textures.size();
                 dynamic_textures.push_back(tex);
                 dynamic_tex_name_to_idx[texture_name] = new_tex_index;
-                dynamic_tex_name_to_idx[named_texture.first] = new_tex_index;
+                //dynamic_tex_name_to_idx[named_texture.first] = new_tex_index;
+
+                LOG(INFO) << "Added texture " << tex.get_name() << " to the dynamic textures";
+                LOG(INFO) << "set dynamic_texture_to_idx[" << texture_name << "] = " << new_tex_index;
+                //LOG(INFO) << "dynamic_texture_to_idx[" << named_texture.first << "] = " << new_tex_index;

             } else {
                 LOG(INFO) << "The physical resource already exists, so we're just gonna use that";
@@ -298,6 +303,7 @@
     }

     void texture_manager::clear_dynamic_textures() {
+        LOG(INFO) << "Cleared dynamic textures";
         dynamic_textures.resize(0);
         dynamic_tex_name_to_idx.erase(dynamic_tex_name_to_idx.begin(), dynamic_tex_name_to_idx.end());
     }


strings all permutation

strings all permutation


This looks more sane than relying on the implicit sharing. Found by reading, no bug there.

svn path=/trunk/kdepim/; revision=357539

--- kmail/acljobs.cpp
+++ kmail/acljobs.cpp
@@ -209,7 +209,7 @@
 ACLJobs::MultiSetACLJob::MultiSetACLJob( KIO::Slave* slave, const KURL& url, const ACLList& acl, bool showProgressInfo )
   : KIO::Job( showProgressInfo ),
     mSlave( slave ),
-    mUrl( url ), mACLList( acl ), mACLListIterator( acl.begin() )
+    mUrl( url ), mACLList( acl ), mACLListIterator( mACLList.begin() )
 {
   QTimer::singleShot(0, this, SLOT(slotStart()));
 }


by default bin interrupts seperately from kernel code.

--HG--
extra : convert_revision : fb890907402b7c1e873a2ac32e72cb6e0ed73f13

--- kern/linux/linux_system.cc
+++ kern/linux/linux_system.cc
@@ -244,7 +244,7 @@
     INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10),
     INIT_PARAM_DFLT(bin, "is this system to be binned", false),
     INIT_PARAM(binned_fns, "functions to be broken down and binned"),
-    INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", false)
+    INIT_PARAM_DFLT(bin_int, "is interrupt code binned seperately?", true)

 END_INIT_SIM_OBJECT_PARAMS(LinuxSystem)


refactor

refactor

Change-Id: I784c4e5c0b18d69949bcbe6b93cfda435288fddf

--- cpucounters.cpp
+++ cpucounters.cpp
@@ -448,19 +448,18 @@
     if (MSR.empty()) return;
     const int ref_core = 0;
     TemporalThreadAffinity affinity(ref_core);
-    bool ucode_msr_exists = false;
     if (affinity.supported() && isCoreOnline(ref_core))
-    {   // see "Update Signature and Verification" section in Intel SDM how to read ucode level
-        ucode_msr_exists = (MSR[ref_core]->write(MSR_IA32_BIOS_SIGN_ID, 0) == sizeof(uint64));
-    }
-    PCM_CPUID_INFO cpuinfo;
-    pcm_cpuid(1, cpuinfo);
-    if (affinity.supported() && ucode_msr_exists)
-    {
-        uint64 result = 0;
-        if (MSR[ref_core]->read(MSR_IA32_BIOS_SIGN_ID, &result) == sizeof(uint64))
-        {
-            cpu_microcode_level = result>>32;
+    {   // see "Update Signature and Verification" and "Determining the Signature"
+        // sections in Intel SDM how to read ucode level
+        if (MSR[ref_core]->write(MSR_IA32_BIOS_SIGN_ID, 0) == sizeof(uint64))
+        {
+            PCM_CPUID_INFO cpuinfo;
+            pcm_cpuid(1, cpuinfo); // cpuid instructions updates MSR_IA32_BIOS_SIGN_ID
+            uint64 result = 0;
+            if (MSR[ref_core]->read(MSR_IA32_BIOS_SIGN_ID, &result) == sizeof(uint64))
+            {
+                cpu_microcode_level = result >> 32;
+            }
         }
     }
 }


Don't try to delete the job again if the error handling code already
killed all of them. Fixes a crash when copying a message into a
read-only folder before we know it actually is read-only and selecting
cancel in the subsequent error dialog.

Kolab issue 2850

svn path=/branches/kdepim/enterprise/kdepim/; revision=842659

--- kmail/imapjob.cpp
+++ kmail/imapjob.cpp
@@ -650,8 +650,8 @@
     QString errStr = i18n("Error while copying messages.");
     if ( (*it).progressItem )
       (*it).progressItem->setStatus( errStr );
-    account->handleJobError( job, errStr  );
-    deleteLater();
+    if ( account->handleJobError( job, errStr  ) )
+      deleteLater();
     return;
   } else {
     if ( !(*it).msgList.isEmpty() )


nm

nm

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@5045 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- filters/src/voxel_grid.cpp
+++ filters/src/voxel_grid.cpp
@@ -384,7 +384,8 @@
   output.row_step = output.point_step * output.width;
   output.data.resize (output.width * output.point_step);

-  if (save_leaf_layout_) {
+  if (save_leaf_layout_)
+  {
     try
     {
       leaf_layout_.resize (div_b_[0]*div_b_[1]*div_b_[2], -1);
@@ -394,7 +395,7 @@
       throw PCLException("VoxelGrid bin size is too low; impossible to allocate memory for layout",
         "voxel_grid.cpp", "applyFilter");
     }
-	catch (std::length_error&)
+    catch (std::length_error&)
     {
       throw PCLException("VoxelGrid bin size is too low; impossible to allocate memory for layout",
         "voxel_grid.cpp", "applyFilter");


Fixes autotests in QFileSystemWatcher: watchFileAndItsDirectory

dnotify is something from older linux kernels and cannot be trusted, therefore
we skip some tests. Also we cannot guarantee that 1 operation on the file give only
1 notification in general, so we relaxed the conditions.

Reviewed-by: paul

--- tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -399,6 +399,15 @@
     watcher.removePaths(paths);
 }

+#if 0
+class SignalTest : public QObject {
+    Q_OBJECT;
+    public slots:
+        void fileSlot(const QString &file) { qDebug() << "file " << file;}
+        void dirSlot(const QString &dir) { qDebug() << "dir" << dir;}
+};
+#endif
+
 void tst_QFileSystemWatcher::watchFileAndItsDirectory()
 {
     QFETCH(QString, backend);
@@ -422,6 +431,12 @@

     watcher.addPath(testDir.dirName());
     watcher.addPath(testFileName);
+
+    /*
+    SignalTest signalTest;
+    QObject::connect(&watcher, SIGNAL(fileChanged(const QString &)), &signalTest, SLOT(fileSlot(const QString &)));
+    QObject::connect(&watcher, SIGNAL(directoryChanged(const QString &)), &signalTest, SLOT(dirSlot(const QString &)));
+    */

     QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(const QString &)));
     QSignalSpy dirChangedSpy(&watcher, SIGNAL(directoryChanged(const QString &)));
@@ -440,8 +455,11 @@

     timer.start(3000);
     eventLoop.exec();
-    QCOMPARE(fileChangedSpy.count(), 1);
+    QVERIFY(fileChangedSpy.count() > 0);
     QCOMPARE(dirChangedSpy.count(), 0);
+
+    if (backend == "dnotify")
+        QSKIP("dnotify is broken, skipping the rest of the test.", SkipSingle);

     fileChangedSpy.clear();
     QFile secondFile(secondFileName);
@@ -460,7 +478,7 @@

     timer.start(3000);
     eventLoop.exec();
-    QCOMPARE(fileChangedSpy.count(), 1);
+    QVERIFY(fileChangedSpy.count() > 0);
     QCOMPARE(dirChangedSpy.count(), 1);

     fileChangedSpy.clear();


Fleshing out auto tests for QGeoBoundingCircle

Task-number: MOBILITY-2569

--- tests/auto/qgeoboundingcircle/tst_qgeoboundingcircle.cpp
+++ tests/auto/qgeoboundingcircle/tst_qgeoboundingcircle.cpp
@@ -45,10 +45,206 @@

 QTM_USE_NAMESPACE

+Q_DECLARE_METATYPE(QGeoCoordinate)
+
 class tst_QGeoBoundingCircle : public QObject
 {
     Q_OBJECT
+
+private slots:
+    void defaultConstructor();
+    void centerRadiusConstructor();
+
+    void comparison();
+    void type();
+
+    void radius();
+    void center();
+
+    void translate_data();
+    void translate();
+
+    void valid_data();
+    void valid();
+
+    void empty_data();
+    void empty();
+
+    void contains_data();
+    void contains();
 };
+
+void tst_QGeoBoundingCircle::defaultConstructor()
+{
+    QGeoBoundingCircle c;
+    QVERIFY(!c.center().isValid());
+    QCOMPARE(c.radius(), -1.0);
+}
+
+void tst_QGeoBoundingCircle::centerRadiusConstructor()
+{
+    QGeoBoundingCircle c(QGeoCoordinate(1,1), 50);
+    QCOMPARE(c.center(), QGeoCoordinate(1,1));
+    QCOMPARE(c.radius(), 50.0);
+}
+
+void tst_QGeoBoundingCircle::comparison()
+{
+    QGeoBoundingCircle c1(QGeoCoordinate(1,1), 50);
+    QGeoBoundingCircle c2(QGeoCoordinate(1,1), 50);
+    QGeoBoundingCircle c3(QGeoCoordinate(1,1), 35);
+    QGeoBoundingCircle c4(QGeoCoordinate(1,2), 50);
+
+    QVERIFY(c1 == c2);
+    QVERIFY(c1 != c3);
+    QVERIFY(c1 != c4);
+    QVERIFY(c2 != c3);
+}
+
+void tst_QGeoBoundingCircle::type()
+{
+    QGeoBoundingCircle c;
+    QCOMPARE(c.type(), QGeoBoundingArea::CircleType);
+}
+
+void tst_QGeoBoundingCircle::radius()
+{
+    QGeoBoundingCircle c;
+    c.setRadius(1.0);
+    QCOMPARE(c.radius(), 1.0);
+    c.setRadius(5.0);
+    QCOMPARE(c.radius(), 5.0);
+}
+
+void tst_QGeoBoundingCircle::center()
+{
+    QGeoBoundingCircle c;
+    c.setCenter(QGeoCoordinate(1,1));
+    QCOMPARE(c.center(), QGeoCoordinate(1,1));
+    c.setCenter(QGeoCoordinate(5,10));
+    QCOMPARE(c.center(), QGeoCoordinate(5,10));
+}
+
+void tst_QGeoBoundingCircle::translate_data()
+{
+    QTest::addColumn<QGeoCoordinate>("center");
+    QTest::addColumn<qreal>("radius");
+    QTest::addColumn<qreal>("lat");
+    QTest::addColumn<qreal>("lon");
+    QTest::addColumn<QGeoCoordinate>("newCenter");
+
+    QTest::newRow("from 0,0") << QGeoCoordinate(0,0) << 10.0 <<
+                                 5.0 << 5.0 << QGeoCoordinate(5.0, 5.0);
+    QTest::newRow("across 0,0") << QGeoCoordinate(-2, -2) << 20.0 <<
+                                   5.0 << 5.0 << QGeoCoordinate(3.0, 3.0);
+    QTest::newRow("backwards accross 0,0") << QGeoCoordinate(5,5) << 50.0
+                                              << -13.0 << 5.0
+                                              << QGeoCoordinate(-8.0, 10.0);
+}
+
+void tst_QGeoBoundingCircle::translate()
+{
+    QFETCH(QGeoCoordinate, center);
+    QFETCH(qreal, radius);
+    QFETCH(qreal, lat);
+    QFETCH(qreal, lon);
+    QFETCH(QGeoCoordinate, newCenter);
+
+    QGeoBoundingCircle c(center, radius);
+    QGeoBoundingCircle d = c;
+
+    c.translate(lat, lon);
+
+    QCOMPARE(c.radius(), radius);
+    QCOMPARE(c.center(), newCenter);
+
+    c = d.translated(lat, lon);
+    d.setRadius(1.0);
+
+    QCOMPARE(c.radius(), radius);
+    QCOMPARE(d.center(), center);
+    QCOMPARE(c.center(), newCenter);
+}
+
+void tst_QGeoBoundingCircle::valid_data()
+{
+    QTest::addColumn<QGeoCoordinate>("center");
+    QTest::addColumn<qreal>("radius");
+    QTest::addColumn<bool>("valid");
+
+    QTest::newRow("default") << QGeoCoordinate() << -1.0 << false;
+    QTest::newRow("empty coord") << QGeoCoordinate() << 5.0 << false;
+    QTest::newRow("NaN coord") << QGeoCoordinate(500, 500) << 5.0 << false;
+    QTest::newRow("bad radius") << QGeoCoordinate(10, 10) << -5.0 << false;
+    QTest::newRow("NaN radius") << QGeoCoordinate(10, 10) << qQNaN() << false;
+    QTest::newRow("zero radius") << QGeoCoordinate(10, 10) << 0.0 << true;
+    QTest::newRow("good") << QGeoCoordinate(10, 10) << 5.0 << true;
+}
+
+void tst_QGeoBoundingCircle::valid()
+{
+    QFETCH(QGeoCoordinate, center);
+    QFETCH(qreal, radius);
+    QFETCH(bool, valid);
+
+    QGeoBoundingCircle c(center, radius);
+    QCOMPARE(c.isValid(), valid);
+}
+
+void tst_QGeoBoundingCircle::empty_data()
+{
+    QTest::addColumn<QGeoCoordinate>("center");
+    QTest::addColumn<qreal>("radius");
+    QTest::addColumn<bool>("empty");
+
+    QTest::newRow("default") << QGeoCoordinate() << -1.0 << true;
+    QTest::newRow("empty coord") << QGeoCoordinate() << 5.0 << true;
+    QTest::newRow("NaN coord") << QGeoCoordinate(500, 500) << 5.0 << true;
+    QTest::newRow("bad radius") << QGeoCoordinate(10, 10) << -5.0 << true;
+    QTest::newRow("NaN radius") << QGeoCoordinate(10, 10) << qQNaN() << true;
+    QTest::newRow("zero radius") << QGeoCoordinate(10, 10) << 0.0 << true;
+    QTest::newRow("good") << QGeoCoordinate(10, 10) << 5.0 << false;
+}
+
+void tst_QGeoBoundingCircle::empty()
+{
+    QFETCH(QGeoCoordinate, center);
+    QFETCH(qreal, radius);
+    QFETCH(bool, empty);
+
+    QGeoBoundingCircle c(center, radius);
+    QCOMPARE(c.isEmpty(), empty);
+}
+
+void tst_QGeoBoundingCircle::contains_data()
+{
+    QTest::addColumn<QGeoCoordinate>("center");
+    QTest::addColumn<qreal>("radius");
+    QTest::addColumn<QGeoCoordinate>("probe");
+    QTest::addColumn<bool>("result");
+
+    QTest::newRow("own centre") << QGeoCoordinate(1,1) << 100.0 <<
+                                   QGeoCoordinate(1,1) << true;
+    QTest::newRow("over the hills") << QGeoCoordinate(1,1) << 100.0 <<
+                                       QGeoCoordinate(30, 40) << false;
+    QTest::newRow("at 0.5*radius") << QGeoCoordinate(1,1) << 100.0 <<
+                                      QGeoCoordinate(1.00015374,1.00015274) << true;
+    QTest::newRow("at 0.99*radius") << QGeoCoordinate(1,1) << 100.0 <<
+                                       QGeoCoordinate(1.00077538, 0.99955527) << true;
+    QTest::newRow("at 1.01*radius") << QGeoCoordinate(1,1) << 100.0 <<
+                                       QGeoCoordinate(1.00071413, 0.99943423) << false;
+}
+
+void tst_QGeoBoundingCircle::contains()
+{
+    QFETCH(QGeoCoordinate, center);
+    QFETCH(qreal, radius);
+    QFETCH(QGeoCoordinate, probe);
+    QFETCH(bool, result);
+
+    QGeoBoundingCircle c(center, radius);
+    QCOMPARE(c.contains(probe), result);
+}

 QTEST_MAIN(tst_QGeoBoundingCircle)
 #include "tst_qgeoboundingcircle.moc"


Skip test that crashes on win32-g++

Skip test that crashes on win32-g++

--- tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
+++ tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
@@ -245,6 +245,10 @@

     addTestExclusion("string-case", "V8-specific behavior? (Doesn't pass on SpiderMonkey either)");

+#ifdef Q_CC_MINGW
+    addTestExclusion("date$", "QTBUG-7698: Date.prototype.setMonth() crashes on win32-g++");
+#endif
+
 #ifdef Q_OS_WINCE
     addTestExclusion("deep-recursion", "Demands too much memory on WinCE");
     addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on WinCE");


Do not use kahansum, that was stupid. Include cuda runtime properly.

--- src/nvtt/tests/stress.cpp
+++ src/nvtt/tests/stress.cpp
@@ -26,7 +26,6 @@
 #include <nvimage/ImageIO.h>
 #include <nvimage/BlockDXT.h>
 #include <nvimage/ColorBlock.h>
-#include <nvmath/KahanSum.h>
 #include <nvcore/Ptr.h>
 #include <nvcore/Debug.h>
 #include <nvcore/StrLib.h>
@@ -167,7 +166,7 @@
 	nvCheck(a->width() == b->width());
 	nvCheck(a->height() == b->height());

-	KahanSum mse;
+	int mse = 0;

 	const uint count = a->width() * a->height();

@@ -181,12 +180,12 @@
 		int b = c0.b - c1.b;
 		//int a = c0.a - c1.a;

-		mse.add(r * r);
-		mse.add(g * g);
-		mse.add(b * b);
-	}
-
-	return sqrtf(mse.sum() / count);
+		mse += r * r;
+		mse += g * g;
+		mse += b * b;
+	}
+
+	return sqrtf(float(mse) / count);
 }

@@ -244,7 +243,7 @@
 		printf("  -out <path>    \tOutput directory.\n");

 		return 1;
-	}
+	}

 	nvtt::InputOptions inputOptions;
 	inputOptions.setMipmapGeneration(false);


passable for mesh faces

passable for mesh faces

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

--- src/obstacle/MeshFace.cxx
+++ src/obstacle/MeshFace.cxx
@@ -755,11 +755,16 @@
   if (smoothBounce && !mesh->useSmoothBounce()) {
     out << indent << "    smoothBounce" << std::endl;
   }
-  if (driveThrough && !mesh->isDriveThrough()) {
-    out << indent << "    driveThrough" << std::endl;
-  }
-  if (shootThrough && !mesh->isShootThrough()) {
-    out << indent << "    shootThrough" << std::endl;
+  if ((driveThrough && shootThrough) &&
+      !(mesh->isDriveThrough() && mesh->isShootThrough())) {
+    out << indent << "    passable" << std::endl;
+  } else {
+    if (driveThrough && !mesh->isDriveThrough()) {
+      out << indent << "    driveThrough" << std::endl;
+    }
+    if (shootThrough && !mesh->isShootThrough()) {
+      out << indent << "    shootThrough" << std::endl;
+    }
   }

   out << indent << "  endface" << std::endl;


`oiiotool -o:all=1` : don't crash outputting 0x0 subimages (#2171)

--- src/oiiotool/oiiotool.cpp
+++ src/oiiotool/oiiotool.cpp
@@ -4867,6 +4867,10 @@
             else
                 ot.curimg
                     = saved_curimg;  // note: last iteration also restores it!
+            // Skip 0x0 images. Yes, this can happen.
+            const ImageSpec* spec(ot.curimg->spec());
+            if (spec->width < 1 || spec->height < 1 || spec->depth < 1)
+                continue;
             // Use the filename as a pattern, format with the frame number
             new_argv[1]
                 = ustring::sprintf(filename.c_str(), i + startnumber).c_str();


add gps log change function names

add gps log
change function names

--- tinkerforge_laser_transform/src/laser_transform_core.cpp
+++ tinkerforge_laser_transform/src/laser_transform_core.cpp
@@ -1,4 +1,7 @@
 #include <iostream>
+#include <sstream>
+#include <fstream>
+#include <cmath>
 #include "ros/ros.h"
 #include "laser_transform_core.h"
 #include "pcl_ros/transforms.h"
@@ -6,6 +9,9 @@
 #include "sensor_msgs/NavSatFix.h"
 #include "sensor_msgs/Imu.h"
 #include "nav_msgs/Odometry.h"
+#include <geodesy/wgs84.h>
+#include <geodesy/utm.h>
+#include <geometry_msgs/Point.h>
 #include "ip_connection.h"
 #include "brick_imu.h"
 #include "bricklet_gps.h"
@@ -16,16 +22,19 @@
 //#define HOST 	"192.168.0.55"
 #define PORT 	4223

-#define M_PI	3.14159265358979323846  /* pi */
-#define DUAL_SENSOR 0
+#define DUAL_SENSOR1 0
+#define DUAL_SENSOR2 1
 #define DUAL_OPT INDUSTRIAL_DUAL_0_20MA_THRESHOLD_OPTION_GREATER
 #define DUAL_MIN 10 * 1000000
 #define DUAL_MAX 10 * 1000000
-#define DUAL_NUM_OF_MAGNETS 4
+#define DUAL_NUM_OF_MAGNETS 1
+
+#define GPS_LOGFILE true
+#define LOGFILE_PATH "/home/vmuser/logs/"

 /*----------------------------------------------------------------------
  * LaserTransform()
- * Constructor
+ * Constructor
  *--------------------------------------------------------------------*/

 LaserTransform::LaserTransform()
@@ -36,14 +45,38 @@
   is_dual020_connected = false;
   start_latitude = 0;
   start_longitude = 0;
-  dual020_trigger_cnt = 0;
-
-  laser_orientation.setEuler(0,0,-1.57079633);
+  velocity = 0.0;
+  dual020_trigger_cnt_c1 = 0;
+  dual020_trigger_cnt_c2 = 0;
+  imu_convergence_speed = 0;
+
+  xpos = ypos = 0;
+  // set laser scanner orientation to imu orientation
+  laser_orientation.setRPY(-90*M_PI/180.0,0,0);
+
+  // open gps log file
+  if (GPS_LOGFILE)
+  {
+    std::stringstream ss;
+
+    time_t t;
+    struct tm *ts;
+    char buff[80];
+
+    // build filename
+    t = time(NULL);
+    ts = localtime(&t);
+
+    strftime(buff, 80, "gps_log_%Y_%m_%d-%H_%M_%S.txt", ts);
+    ss << LOGFILE_PATH << buff;
+
+    gps_log.open(ss.str().c_str(), std::ios::out);
+  }
 }

 /*----------------------------------------------------------------------
  * ~LaserTransform
- * Destrucot
+ * Destructor
  *--------------------------------------------------------------------*/

 LaserTransform::~LaserTransform()
@@ -53,6 +86,9 @@
     imu_leds_off(&imu);
     ipcon_destroy(&ipcon);
   }
+  // close gps logfile
+  if (gps_log.is_open())
+    gps_log.close();
 }

 /*----------------------------------------------------------------------
@@ -86,15 +122,14 @@
 }

 /*----------------------------------------------------------------------
- * publishMessage()
- * Publish the message.
- *--------------------------------------------------------------------*/
-
-void LaserTransform::publishMessage(ros::Publisher *pub_message)
+ * publishPclMessage()
+ * Publish the transformed plc data.
+ *--------------------------------------------------------------------*/
+
+void LaserTransform::publishPclMessage(ros::Publisher *pub_message)
 {
   if (publish_new_pcl)
   {
-    ROS_INFO_STREAM("pcloud out");
     pub_message->publish(pcl_out);
     publish_new_pcl = false;
   }
@@ -106,6 +141,7 @@
  *--------------------------------------------------------------------*/
 void LaserTransform::odometryCallback(const nav_msgs::Odometry::ConstPtr& msg)
 {
+  //msg.pose.pose.point.x
   return;
 }

@@ -130,24 +166,41 @@

     imu_get_all_data(&imu, &acc_x, &acc_y, &acc_z, &mag_x, &mag_y,
       &mag_z, &ang_x, &ang_y, &ang_z, &temp);
-
+    /*
+    float yaw   =  atan2(2.0*(x*y + w*z), pow(w,2)+pow(x,2)-pow(y,2)-pow(z,2));
+    float pitch = -asin(2.0*(w*y - x*z));
+    float roll  = -atan2(2.0*(y*z + w*x), -(pow(w,2)-pow(x,2)-pow(y,2)+pow(z,2)));
+1
+    tf::Quaternion q;
+    q.setEuler(yaw, pitch, roll);
+    */
     // message header
     imu_msg.header.seq = seq;
     imu_msg.header.stamp = ros::Time::now();
-    imu_msg.header.frame_id = "world";
+    imu_msg.header.frame_id = "/world";
     // imu data
+    /*
+    imu_msg.orientation.x = q.getAxis()[0];
+    imu_msg.orientation.y = q.getAxis()[1];
+    imu_msg.orientation.z = q.getAxis()[2];
+    imu_msg.orientation.w = q.getW();
+    */
     imu_msg.orientation.x = x;
     imu_msg.orientation.y = y;
     imu_msg.orientation.z = z;
     imu_msg.orientation.w = w;

+    imu_msg.orientation_covariance[0] = -1;
+
     imu_msg.angular_velocity.x = ang_x;
     imu_msg.angular_velocity.y = ang_y;
     imu_msg.angular_velocity.z = ang_z;
+    imu_msg.angular_velocity_covariance[0] = -1;

     imu_msg.linear_acceleration.x = acc_x;
     imu_msg.linear_acceleration.y = acc_y;
     imu_msg.linear_acceleration.z = acc_z;
+    imu_msg.linear_acceleration_covariance[0] = -1;

     pub_message->publish(imu_msg);

@@ -173,7 +226,7 @@
     // get gps sensor status
     gps_get_status(&gps, &fix, &satellites_view, &satellites_used);

-    if (fix == GPS_FIX_NO_FIX)
+    if (fix != GPS_FIX_3D_FIX)
       return; // No valid data

     gps_get_coordinates(&gps, &latitude, &ns, &longitude, &ew, &pdop,
@@ -185,17 +238,47 @@
     // message header
     gps_msg.header.seq =  seq;
     gps_msg.header.stamp = ros::Time::now();
-    gps_msg.header.frame_id = "world";
+    gps_msg.header.frame_id = "/world";
     // gps status
     gps_msg.status.status = gps_msg.status.STATUS_SBAS_FIX;
     gps_msg.status.service = gps_msg.status.SERVICE_GPS;

     gps_msg.latitude = latitude/1000000.0;
     gps_msg.longitude = longitude/1000000.0;
-    //gps_msg.altitude = altitude/100.0;
-    gps_msg.altitude = 0.0;
+    gps_msg.altitude = altitude/100.0;
     gps_msg.position_covariance_type = gps_msg.COVARIANCE_TYPE_UNKNOWN;

+    if (gps_log.is_open() && GPS_LOGFILE)
+    {
+      std::string separator = "|";
+      gps_log << ros::Time::now().sec;
+      gps_log << gps_log << separator;
+      gps_log << gps_msg.latitude;
+      gps_log << separator;
+      gps_log << gps_msg.longitude;
+      gps_log << separator;
+      gps_log << gps_msg.altitude;
+      gps_log << std::endl;
+    }
+
+    geographic_msgs::GeoPoint ll;
+    // create UTM from point
+    ll = geodesy::toMsg(gps_msg);
+    geodesy::UTMPoint pt;
+    geodesy::fromMsg(ll,pt);
+    if (xpos == 0 && ypos == 0)
+    {
+      xpos = pt.easting;
+      ypos = pt.northing;
+    }
+    else
+    {
+      //ROS_INFO_STREAM("COORDS_1:" << pt.easting << "::" << pt.northing);
+      //ROS_INFO_STREAM("COORDS_2:" << xpos << "::" << ypos);
+
+      //std::cout << "COORDS_3:" << (int)(xpos-pt.easting) << "::" << (int)(ypos-pt.northing) << std::endl;
+      //ROS_INFO_STREAM("COORDS_3:" << (int)xpos-pt.easting << "::" << (int)ypos-pt.northing);
+    }
     pub_message->publish(gps_msg);

     seq++;
@@ -203,11 +286,11 @@
 }

 /*----------------------------------------------------------------------
- * messageCallback()
- * Callback function for subscriber.
- *--------------------------------------------------------------------*/
-
-void LaserTransform::messageCallback(const sensor_msgs::PointCloud2::ConstPtr& msg)
+ * pclCallback()
+ * Callback function for laser scanner pcl.
+ *--------------------------------------------------------------------*/
+
+void LaserTransform::pclCallback(const sensor_msgs::PointCloud2::ConstPtr& msg)
 {
   //ROS_INFO_STREAM("pcloud in");
   float xp, yp, zp;
@@ -215,23 +298,20 @@
   getPosition(&xp, &yp, &zp);
   transform.setOrigin( tf::Vector3(xp, yp, zp) );
   tf::Quaternion q = getQuaternion();
-  //tf::Quaternion q2;
-  //q2.setEulerZYX(0,0,-1.57079633);
-  //transform.setRotation(q2);
   transform.setRotation(laser_orientation);
   sensor_msgs::PointCloud2 pcl_tmp;
-  pcl_ros::transformPointCloud("/world2", transform,  *msg, pcl_tmp);
+  pcl_ros::transformPointCloud("/world2", transform,  *msg, pcl_tmp);
   transform.setRotation(q);
-  pcl_ros::transformPointCloud("/world", transform,  pcl_tmp, pcl_out);
+  pcl_ros::transformPointCloud("/world", transform,  pcl_tmp, pcl_out);
   publish_new_pcl = true;
 }

 /*----------------------------------------------------------------------
  * connectedCallback()
- * Callback function for Tinkerforge ip connected
- *--------------------------------------------------------------------*/
-
-void LaserTransform::connectedCallback(uint8_t connect_reason, void *user_data)
+ * Callback function for Tinkerforge ip connected
+ *--------------------------------------------------------------------*/
+
+void LaserTransform::connectedCallback(uint8_t connect_reason, void *user_data)
 {
   LaserTransform *lt = (LaserTransform*) user_data;
   if (lt->is_imu_connected == false)
@@ -262,7 +342,7 @@
     ROS_INFO_STREAM("found IMU with UID:" << uid);
     // Create IMU device object
     imu_create(&(lt->imu), uid, &(lt->ipcon));
-    imu_set_convergence_speed(&(lt->imu),0);
+    imu_set_convergence_speed(&(lt->imu),5);
     imu_leds_on(&(lt->imu));
     lt->is_imu_connected = true;
   }
@@ -278,20 +358,24 @@
     ROS_INFO_STREAM("found ID20MA with UID:" << uid);
     // Create IndustrialDual020mA device object
     industrial_dual_0_20ma_create(&(lt->dual020), uid, &(lt->ipcon));
-    // Get threshold callbacks with a debounce time of 10 seconds (10000ms)
-    industrial_dual_0_20ma_set_debounce_period(&(lt->dual020), 20);
+    // Get threshold callbacks with a debounce time of 20ms
+    industrial_dual_0_20ma_set_debounce_period(&(lt->dual020), lt->imu_convergence_speed);

     // Register threshold reached callback to function cb_reached

     industrial_dual_0_20ma_register_callback(&(lt->dual020),
       INDUSTRIAL_DUAL_0_20MA_CALLBACK_CURRENT_REACHED,
       (void*)dual020Callback,
-      NULL);
-
-    industrial_dual_0_20ma_set_debounce_period(&(lt->dual020),20);
+      lt);

     industrial_dual_0_20ma_set_current_callback_threshold(&(lt->dual020),
-      DUAL_SENSOR, DUAL_OPT, DUAL_MIN, DUAL_MAX);
+      DUAL_SENSOR1, DUAL_OPT, DUAL_MIN, DUAL_MAX);
+    industrial_dual_0_20ma_set_current_callback_threshold(&(lt->dual020),
+      DUAL_SENSOR2, DUAL_OPT, DUAL_MIN, DUAL_MAX);
+
+    // set sample rate for sensors
+    industrial_dual_0_20ma_set_sample_rate(&(lt->dual020),
+      INDUSTRIAL_DUAL_0_20MA_SAMPLE_RATE_240_SPS);
     lt->is_dual020_connected = true;
   }
 }
@@ -305,19 +389,30 @@
 {
   LaserTransform *lt = (LaserTransform*) user_data;
   static ros::Time begin = ros::Time::now();
-  static int cnt = 0;
-  ROS_INFO_STREAM(current);
-  //lt->dual020_trigger_cnt++;
-  cnt++;
+  static int cnt_c1 = 0, cnt_c2 = 0;
+  //ROS_INFO_STREAM(current);
+
+  if (sensor == 0)
+  {
+    cnt_c1++;
+    //lt->dual020_trigger_cnt_c1++;
+  }
+  else
+  {
+    cnt_c2++;
+    //lt->dual020_trigger_cnt_c2++;
+  }

   if ((ros::Time::now().sec - begin.sec) >= 1)
   {
     // calc rounds per minute
     //ROS_INFO_STREAM("Rounds per minute:" << lt->dual020_trigger_cnt / DUAL_NUM_OF_MAGNETS);
-    ROS_INFO_STREAM("Rounds per minute:" << cnt / DUAL_NUM_OF_MAGNETS);
-
-    //lt->dual020_trigger_cnt = 0;
-	cnt = 0;
+    ROS_INFO_STREAM("Sensor 1:" << cnt_c1 / DUAL_NUM_OF_MAGNETS << " U/Sek" << "::" << cnt_c1);
+    ROS_INFO_STREAM("Sensor 2:" << cnt_c2 / DUAL_NUM_OF_MAGNETS << " U/Sek" << "::" << cnt_c2);
+
+    //lt->dual020_trigger_cnt_c1 = 0;
+    //lt->dual020_trigger_cnt_c2 = 0;
+	cnt_c1 = cnt_c2 = 0;
     begin = ros::Time::now();
   }
   return;
@@ -331,11 +426,21 @@
 tf::Quaternion LaserTransform::getQuaternion()
 {
   float x = 0.0, y = 0.0, z = 0.0, w = 0.0;
-
+
   if (is_imu_connected)
     imu_get_quaternion(&imu, &x, &y, &z, &w);
-
-  tf::Quaternion q(x, y*-1, z, w);
+
+  //-------
+  float yaw   =  atan2(2.0*(x*y + w*z), pow(w,2)+pow(x,2)-pow(y,2)-pow(z,2));
+  float pitch = -asin(2.0*(w*y - x*z));
+  float roll  = -atan2(2.0*(y*z + w*x), -(pow(w,2)-pow(x,2)-pow(y,2)+pow(z,2)));
+  std::cout << "y:" << rad2deg(yaw) << ":: p:" << rad2deg(pitch) << ":: r:" << rad2deg(roll) << std::endl;
+  //-------
+
+  tf::Quaternion q;
+  q.setEuler(yaw, pitch, roll);
+  //tf::Quaternion q(x, y, z, w);
+  //tf::Quaternion q(x, y*-1, z, w);
   return q;
 }

@@ -354,7 +459,7 @@
  * getPosition()
  * get Position
  *--------------------------------------------------------------------*/
-
+
 int LaserTransform::getPosition(float *x_pos, float *y_pos, float *z_pos)
 {
   *x_pos = 0;


[Graph]: reenable vertical partitioning.

This requires the vertex index to be in memory and right now FlashGraph
always loads vertx index to memory.

--- flash-graph/graph_engine.cpp
+++ flash-graph/graph_engine.cpp
@@ -452,12 +452,10 @@
 	graph_index::ptr index;
 	graph_engine &graph;
 	int hpart_id;
-	file_io_factory::shared_ptr io_factory;
 public:
-	init_vpart_thread(graph_index::ptr index, file_io_factory::shared_ptr io_factory,
-			graph_engine &_graph, int hpart_id, int node_id): thread(
-				"index-init-thread", node_id), graph(_graph) {
-		this->io_factory = io_factory;
+	init_vpart_thread(graph_index::ptr index, graph_engine &_graph,
+			int hpart_id, int node_id): thread("index-init-thread",
+				node_id), graph(_graph) {
 		this->index = index;
 		this->hpart_id = hpart_id;
 	}
@@ -501,12 +499,9 @@
 void init_vpart_thread::run()
 {
 	vertex_index_reader::ptr index_reader;
-	if (graph.get_in_mem_index())
-		index_reader = vertex_index_reader::create(graph.get_in_mem_index(),
-				graph.is_directed());
-	else
-		index_reader = vertex_index_reader::create(
-				io_factory->create_io(this), graph.is_directed());
+	assert(graph.get_in_mem_index());
+	index_reader = vertex_index_reader::create(graph.get_in_mem_index(),
+			graph.is_directed());
 	std::vector<vertex_id_t> large_degree_ids;
 	std::unique_ptr<index_comp_allocator_impl> alloc
 		= std::unique_ptr<index_comp_allocator_impl>(
@@ -579,14 +574,11 @@
 		preload_graph();
 #endif

-	assert(graph_conf.get_num_vparts() == 1);
-#if 0
 	// If we need to perform vertical partitioning on the graph.
 	if (graph_conf.get_num_vparts() > 1) {
 		std::vector<init_vpart_thread *> threads(num_threads);
 		for (int i = 0; i < num_threads; i++) {
-			threads[i] = new init_vpart_thread(index, index_factory, *this,
-					i, i % num_nodes);
+			threads[i] = new init_vpart_thread(index, *this, i, i % num_nodes);
 			threads[i]->start();
 		}
 		for (int i = 0; i < num_threads; i++) {
@@ -594,7 +586,6 @@
 			delete threads[i];
 		}
 	}
-#endif
 }

 graph_engine::graph_engine(FG_graph &graph, graph_index::ptr index)


bug fixed; appears operational

bug fixed; appears operational

--- fastlib/u/rriegel/nbc/nbc.cc
+++ fastlib/u/rriegel/nbc/nbc.cc
@@ -162,7 +162,7 @@
       kernel_pos.Init(fx_param_double_req(module, "h_pos"));
       kernel_neg.Init(fx_param_double_req(module, "h_neg"));
       threshold = fx_param_double(module, "threshold", 0.5);
-      loo = !fx_param_exists(module, "q");
+      loo = false;
     }

     /**
@@ -173,17 +173,15 @@
     void SetDimensions(index_t vector_dimension, index_t n_points) {
       dim = vector_dimension; // last two cols already trimmed
       count_all = n_points;
-      peak_pos = kernel_pos.EvalUnnormOnSq(0)
-	/ kernel_pos.CalcNormConstant(dim);
-      peak_neg = kernel_neg.EvalUnnormOnSq(0)
-	/ kernel_neg.CalcNormConstant(dim);
+      peak_pos = kernel_pos.EvalUnnormOnSq(0);
+      peak_neg = kernel_neg.EvalUnnormOnSq(0);
     }

     /**
      * Finalize parameters (Not THOR).
      */
     void ComputeConsts(int count_pos_in, int count_neg_in) {
-      double epsilon = min(threshold, 1 - threshold) * 1e-4;
+      double epsilon = min(threshold, 1 - threshold) * 1e-6;

       count_pos = count_pos_in;
       count_neg = count_neg_in;
@@ -330,14 +328,12 @@
     /** Bounding box of the positive points. Similar for _neg. */
     Bound bound_pos;
     Bound bound_neg;
-    /** Number of positive ponits. Similar for _neg. */
+    /** Number of positive points. Similar for _neg. */
     index_t count_pos;
     index_t count_neg;
     /** Bounds for query priors. Similar for _neg. */
     DRange pi_pos;
     DRange pi_neg;
-    /** Bounds for query self-contrib (undone in LOO case). */
-    DRange loo_contrib;

     OT_DEF_BASIC(NbcStat) {
       OT_MY_OBJECT(moment_info_pos);
@@ -348,7 +344,6 @@
       OT_MY_OBJECT(count_neg);
       OT_MY_OBJECT(pi_pos);
       OT_MY_OBJECT(pi_neg);
-      OT_MY_OBJECT(loo_contrib);
     }

    public:
@@ -366,11 +361,6 @@
       count_neg = 0;
       pi_pos.InitEmptySet();
       pi_neg.InitEmptySet();
-      if (param.loo) {
-	loo_contrib.InitEmptySet();
-      } else {
-	loo_contrib.Init(0, 0);
-      }
     }

     /**
@@ -388,13 +378,6 @@
       }
       pi_pos |= point.pi_pos();
       pi_neg |= point.pi_neg();
-      if (param.loo) {
-	if (point.is_pos()) {
-	  loo_contrib |= param.peak_pos;
-	} else {
-	  loo_contrib |= param.peak_neg;
-	}
-      }
     }

     /**
@@ -410,7 +393,6 @@
       count_neg += stat.count_neg;
       pi_pos |= stat.pi_pos;
       pi_neg |= stat.pi_neg;
-      loo_contrib |= stat.loo_contrib;
     }

     /**
@@ -850,7 +832,7 @@
       if (param.loo) {
 	// Withhold contribution of q from density for its class
 	if (q.is_pos()) {
-	  DEBUG_ASSERT_MSG(total_density_pos.hi > param.peak_pos,
+	  DEBUG_ASSERT_MSG(total_density_pos.hi >= param.peak_pos,
 			   "$pos bd %g <= peak %g",
 			   total_density_pos.hi,
 			   param.peak_pos);
@@ -864,7 +846,7 @@
 	    q_result->label &= LAB_NEG;
 	  }
 	} else {
-	  DEBUG_ASSERT_MSG(total_density_neg.hi > param.peak_neg,
+	  DEBUG_ASSERT_MSG(total_density_neg.hi >= param.peak_neg,
 			   "$neg bd %g <= peak %g",
 			   total_density_neg.hi,
 			   param.peak_neg);
@@ -1144,6 +1126,7 @@
   } else {
     q_points_cache = r_points_cache;
     n_q_points = n_r_points;
+    param.loo = true;
   }
   fx_timer_stop(module, "read");


- change lots of "if (bx_dbg.apic) BX_INFO(...)" into "BX_DEBUG(...)".   This allows you to turn on debug msgs at runtime.  The old BX_INFOs   were created before BX_DEBUG existed.

--- cpu/apic.cc
+++ cpu/apic.cc
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////
-// $Id: apic.cc,v 1.10 2002/03/20 23:32:43 bdenney Exp $
+// $Id: apic.cc,v 1.11 2002/03/23 00:54:37 bdenney Exp $
 /////////////////////////////////////////////////////////////////////////
 //
 #define NEED_CPU_REG_SHORTCUTS 1
@@ -301,15 +301,13 @@
   value = ((value & 8) >> 1) | (value & 3);
   BX_ASSERT (value >= 0 && value <= 7);
   timer_divide_factor = (value==7)? 1 : (2 << value);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: set timer divide factor to %d", cpu->name, timer_divide_factor));
+  BX_DEBUG(("%s: set timer divide factor to %d", cpu->name, timer_divide_factor));
 }

 void bx_local_apic_c::write (Bit32u addr, Bit32u *data, unsigned len)
 {
   assert (len == 4);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: write %08x to APIC address %08x", cpu->name, *data, addr));
+  BX_DEBUG(("%s: write %08x to APIC address %08x", cpu->name, *data, addr));
   //assert (!(addr & 0xf));
   addr &= 0xff0;
   switch (addr) {
@@ -321,14 +319,12 @@
       break;
     case 0xb0: // EOI
       {
-	if (bx_dbg.apic)
-	  BX_INFO(("%s: Wrote 0x%04x to EOI", cpu->name, *data));
+	BX_DEBUG(("%s: Wrote 0x%04x to EOI", cpu->name, *data));
 	int vec = highest_priority_int (isr);
 	if (vec < 0) {
 	  BX_INFO(("EOI written without any bit in ISR"));
 	} else {
-	  if (bx_dbg.apic)
-	    BX_INFO(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
+	  BX_DEBUG(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
 	  isr[vec] = 0;
 	  service_local_apic ();
 	}
@@ -541,24 +537,21 @@
   // interrupt has appeared in irr.  raise INTR.  When the CPU
   // acknowledges, we will run highest_priority_int again and
   // return it.
-  if (bx_dbg.apic)
-    BX_INFO(("service_local_apic(): setting INTR=1 for vector 0x%02x", first_irr));
+  BX_DEBUG(("service_local_apic(): setting INTR=1 for vector 0x%02x", first_irr));
   cpu->set_INTR (1);
   cpu->int_from_local_apic = 1;
 }

 void bx_local_apic_c::trigger_irq (unsigned vector, unsigned from)
 {
-  if (bx_dbg.apic)
-    BX_INFO(("Local apic on %s: trigger interrupt vector=0x%x", cpu->name, vector));
+  BX_DEBUG(("Local apic on %s: trigger interrupt vector=0x%x", cpu->name, vector));
   irr[vector] = 1;
   service_local_apic ();
 }

 void bx_local_apic_c::untrigger_irq (unsigned vector, unsigned from)
 {
-  if (bx_dbg.apic)
-    BX_INFO(("Local apic on %s: untrigger interrupt vector=0x%x", cpu->name, vector));
+  BX_DEBUG(("Local apic on %s: untrigger interrupt vector=0x%x", cpu->name, vector));
   // hardware says "no more".  clear the bit.  If the CPU hasn't yet
   // acknowledged the interrupt, it will never be serviced.
   BX_ASSERT (irr[vector] == 1);
@@ -575,8 +568,7 @@
   BX_ASSERT (cpu->int_from_local_apic);
   int vector = highest_priority_int (irr);
   BX_ASSERT (irr[vector] == 1);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: acknowledge_int returning vector 0x%x", cpu->name, vector));
+  BX_DEBUG(("%s: acknowledge_int returning vector 0x%x", cpu->name, vector));
   // currently isr never gets cleared, so no point
   //BX_ASSERT (isr[vector] == 0);
   irr[vector] = 0;
@@ -608,14 +600,12 @@
   }
   // if all address bits are 1, send to all local APICs. SDG3:7-27.
   if (address == 0xff) {
-    if (bx_dbg.apic) BX_INFO(("%s: MDA=0xff matches everybody", cpu->name));
+    BX_DEBUG (("%s: MDA=0xff matches everybody", cpu->name));
     return true;
   }
   Boolean match = ((address & log_dest) != 0);
-  if (bx_dbg.apic) {
-    BX_INFO(("%s: comparing MDA %02x to my LDR %02x -> %s", cpu->name,
-      address, log_dest, match? "Match" : "Not a match"));
-  }
+  BX_DEBUG (("%s: comparing MDA %02x to my LDR %02x -> %s", cpu->name,
+    address, log_dest, match? "Match" : "Not a match"));
   return match;
 }

@@ -641,15 +631,13 @@
 	|| (apic_index[bit]->get_type () != APIC_TYPE_LOCAL_APIC))
       mask &= ~(1<<bit);
   }
-  if (bx_dbg.apic)
-    BX_INFO(("local::get_delivery_bitmask returning 0x%04x", mask));
+  BX_DEBUG (("local::get_delivery_bitmask returning 0x%04x", mask));
   return mask;
 }

 Bit8u bx_local_apic_c::get_ppr ()
 {
-  if (bx_dbg.apic)
-		BX_INFO(("WARNING: Local APIC Processor Priority not implemented, returning 0"));
+  BX_ERROR(("WARNING: Local APIC Processor Priority not implemented, returning 0"));
   // should look at TPR, vector of highest priority isr, etc.
   return 0;
 }
@@ -657,8 +645,7 @@

 Bit8u bx_local_apic_c::get_apr ()
 {
-  if (bx_dbg.apic)
-		BX_INFO(("WARNING: Local APIC Arbitration Priority not implemented, returning 0"));
+  BX_ERROR (("WARNING: Local APIC Arbitration Priority not implemented, returning 0"));
   // should look at TPR, vector of highest priority isr, etc.
   return 0;
 }
@@ -668,9 +655,8 @@
 bx_local_apic_c::periodic (Bit32u usec_delta)
 {
   if (!timer_active) return;
-  if (bx_dbg.apic)
-    BX_INFO(("%s: bx_local_apic_c::periodic called with %d usec",
-      cpu->name, usec_delta));
+  BX_DEBUG(("%s: bx_local_apic_c::periodic called with %d usec",
+    cpu->name, usec_delta));
   // unless usec_delta is guaranteed to be a multiple of 128, I can't
   // just divide usec_delta by the divide-down value.  Instead, it will
   // have a similar effect to implement the divide-down by ignoring
@@ -701,16 +687,14 @@
       // negative timer_current.
       BX_ASSERT ((timer_current + timer_initial) >= usec_delta);
     }
-    if (bx_dbg.apic)
-      BX_INFO(("%s: local apic timer (periodic) triggered int, reset counter to 0x%08x", cpu->name, timer_current));
+    BX_DEBUG(("%s: local apic timer (periodic) triggered int, reset counter to 0x%08x", cpu->name, timer_current));
   } else {
     // one-shot mode
     timer_current = 0;
     if (timer_active) {
       trigger_irq (timervec & 0xff, id);
       timer_active = false;
-      if (bx_dbg.apic)
-        BX_INFO(("%s: local apic timer (one-shot) triggered int", cpu->name));
+      BX_DEBUG (("%s: local apic timer (one-shot) triggered int", cpu->name));
     }
   }
 }


Fix deallocation of sources to use free instead of delete

Memory is over-taken from C code which uses malloc/strdup!

--- context.cpp
+++ context.cpp
@@ -118,8 +118,10 @@
   Context::~Context()
   {
     // everything that gets put into sources will be freed by us
-    for (size_t i = 0; i < sources.size(); ++i) delete[] sources[i];
     for (size_t n = 0; n < import_stack.size(); ++n) sass_delete_import(import_stack[n]);
+    // sources are allocated by strdup or malloc (overtaken from C code)
+    for (size_t i = 0; i < sources.size(); ++i) free((void*)sources[i]);
+    // clear inner structures (vectors)
     sources.clear(); import_stack.clear();
   }


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

--- src/plugins/miscellaneous/Core/src/usermessagewidget.cpp
+++ src/plugins/miscellaneous/Core/src/usermessagewidget.cpp
@@ -147,38 +147,38 @@
         //       our resized icon...

         if (mExtraMessage.isEmpty())
-            setText(QString("
"
-                            "
"
-                            "
"
-                            "            "
-                            "                "
-                            "            	"
-                            "            "
-                            "
"
-                            "                    %2"
-                            "
"
-                            "            	"
-                            "
"
-                            "
"
-                            "
").arg(iconDataUri(mIcon, 32, 32), mMessage));
+            setText(QString("
\n"
+                            "
\n"
+                            "
\n"
+                            "            \n"
+                            "                \n"
+                            "            	\n"
+                            "            \n"
+                            "
\n"
+                            "                    %2\n"
+                            "
\n"
+                            "            	\n"
+                            "
\n"
+                            "
\n"
+                            "
\n").arg(iconDataUri(mIcon, 32, 32), mMessage));
         else
-            setText(QString("
"
-                            "
"
-                            "
"
-                            "            "
-                            "                "
-                            "            	"
-                            "            "
-                            "
"
-                            "                    %2"
-                            "
"
-                            "
"
-                            "                    (%3)"
-                            "
"
-                            "            	"
-                            "
"
-                            "
"
-                            "
").arg(iconDataUri(mIcon, 32, 32), mMessage, mExtraMessage));
+            setText(QString("
\n"
+                            "
\n"
+                            "
\n"
+                            "            \n"
+                            "                \n"
+                            "            	\n"
+                            "            \n"
+                            "
\n"
+                            "                    %2\n"
+                            "
\n"
+                            "
\n"
+                            "                    (%3)\n"
+                            "
\n"
+                            "            	\n"
+                            "
\n"
+                            "
\n"
+                            "
\n").arg(iconDataUri(mIcon, 32, 32), mMessage, mExtraMessage));
     }
 }


cbflush: Use std::string

cbflush: Use std::string

Change-Id: I37b725c9db514e25752c94d63cad1b83c13c8d20
Reviewed-on: http://review.couchbase.org/71373
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>

--- src/operations/cbflush.cc
+++ src/operations/cbflush.cc
@@ -15,11 +15,10 @@
  */

 #include "internal.h"
-#include "simplestring.h"
 #include <http/http.h>

 static void
-flush_cb(lcb_t instance, int cbtype, const lcb_RESPBASE *rb)
+flush_cb(lcb_t instance, int, const lcb_RESPBASE *rb)
 {
     const lcb_RESPHTTP *resp = (const lcb_RESPHTTP *)rb;
     lcb_RESPCBFLUSH fresp = { 0 };
@@ -35,33 +34,26 @@
     if (callback) {
         callback(instance, LCB_CALLBACK_CBFLUSH, (lcb_RESPBASE*)&fresp);
     }
-    (void)cbtype;
 }

 LIBCOUCHBASE_API
 lcb_error_t
-lcb_cbflush3(lcb_t instance, const void *cookie, const lcb_CMDBASE *cmd)
+lcb_cbflush3(lcb_t instance, const void *cookie, const lcb_CMDBASE *)
 {
     lcb_http_request_t htr;
     lcb_CMDHTTP htcmd = { 0 };
-    lcb_string urlpath;
     lcb_error_t rc;

-    (void)cmd;
-
-    lcb_string_init(&urlpath);
-    lcb_string_appendz(&urlpath, "/pools/default/buckets/");
-    lcb_string_appendz(&urlpath, LCBT_SETTING(instance, bucket));
-    lcb_string_appendz(&urlpath, "/controller/doFlush");
-
+    std::string urlpath("/pools/default/buckets/");
+    urlpath.append(LCBT_SETTING(instance, bucket));
+    urlpath.append("/controller/doFlush");

     htcmd.type = LCB_HTTP_TYPE_MANAGEMENT;
     htcmd.method = LCB_HTTP_METHOD_POST;
     htcmd.reqhandle = &htr;
-    LCB_CMD_SET_KEY(&htcmd, urlpath.base, urlpath.nused);
+    LCB_CMD_SET_KEY(&htcmd, urlpath.c_str(), urlpath.size());

     rc = lcb_http3(instance, cookie, &htcmd);
-    lcb_string_release(&urlpath);

     if (rc != LCB_SUCCESS) {
         return rc;


--- cpu/apic.cc
+++ cpu/apic.cc
@@ -301,15 +301,13 @@
   value = ((value & 8) >> 1) | (value & 3);
   BX_ASSERT (value >= 0 && value <= 7);
   timer_divide_factor = (value==7)? 1 : (2 << value);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: set timer divide factor to %d", cpu->name, timer_divide_factor));
+  BX_DEBUG(("%s: set timer divide factor to %d", cpu->name, timer_divide_factor));
 }

 void bx_local_apic_c::write (Bit32u addr, Bit32u *data, unsigned len)
 {
   assert (len == 4);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: write %08x to APIC address %08x", cpu->name, *data, addr));
+  BX_DEBUG(("%s: write %08x to APIC address %08x", cpu->name, *data, addr));
   //assert (!(addr & 0xf));
   addr &= 0xff0;
   switch (addr) {
@@ -321,14 +319,12 @@
       break;
     case 0xb0: // EOI
       {
-	if (bx_dbg.apic)
-	  BX_INFO(("%s: Wrote 0x%04x to EOI", cpu->name, *data));
+	BX_DEBUG(("%s: Wrote 0x%04x to EOI", cpu->name, *data));
 	int vec = highest_priority_int (isr);
 	if (vec < 0) {
 	  BX_INFO(("EOI written without any bit in ISR"));
 	} else {
-	  if (bx_dbg.apic)
-	    BX_INFO(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
+	  BX_DEBUG(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
 	  isr[vec] = 0;
 	  service_local_apic ();
 	}
@@ -541,24 +537,21 @@
   // interrupt has appeared in irr.  raise INTR.  When the CPU
   // acknowledges, we will run highest_priority_int again and
   // return it.
-  if (bx_dbg.apic)
-    BX_INFO(("service_local_apic(): setting INTR=1 for vector 0x%02x", first_irr));
+  BX_DEBUG(("service_local_apic(): setting INTR=1 for vector 0x%02x", first_irr));
   cpu->set_INTR (1);
   cpu->int_from_local_apic = 1;
 }

 void bx_local_apic_c::trigger_irq (unsigned vector, unsigned from)
 {
-  if (bx_dbg.apic)
-    BX_INFO(("Local apic on %s: trigger interrupt vector=0x%x", cpu->name, vector));
+  BX_DEBUG(("Local apic on %s: trigger interrupt vector=0x%x", cpu->name, vector));
   irr[vector] = 1;
   service_local_apic ();
 }

 void bx_local_apic_c::untrigger_irq (unsigned vector, unsigned from)
 {
-  if (bx_dbg.apic)
-    BX_INFO(("Local apic on %s: untrigger interrupt vector=0x%x", cpu->name, vector));
+  BX_DEBUG(("Local apic on %s: untrigger interrupt vector=0x%x", cpu->name, vector));
   // hardware says "no more".  clear the bit.  If the CPU hasn't yet
   // acknowledged the interrupt, it will never be serviced.
   BX_ASSERT (irr[vector] == 1);
@@ -575,8 +568,7 @@
   BX_ASSERT (cpu->int_from_local_apic);
   int vector = highest_priority_int (irr);
   BX_ASSERT (irr[vector] == 1);
-  if (bx_dbg.apic)
-    BX_INFO(("%s: acknowledge_int returning vector 0x%x", cpu->name, vector));
+  BX_DEBUG(("%s: acknowledge_int returning vector 0x%x", cpu->name, vector));
   // currently isr never gets cleared, so no point
   //BX_ASSERT (isr[vector] == 0);
   irr[vector] = 0;
@@ -608,14 +600,12 @@
   }
   // if all address bits are 1, send to all local APICs. SDG3:7-27.
   if (address == 0xff) {
-    if (bx_dbg.apic) BX_INFO(("%s: MDA=0xff matches everybody", cpu->name));
+    BX_DEBUG (("%s: MDA=0xff matches everybody", cpu->name));
     return true;
   }
   Boolean match = ((address & log_dest) != 0);
-  if (bx_dbg.apic) {
-    BX_INFO(("%s: comparing MDA %02x to my LDR %02x -> %s", cpu->name,
-      address, log_dest, match? "Match" : "Not a match"));
-  }
+  BX_DEBUG (("%s: comparing MDA %02x to my LDR %02x -> %s", cpu->name,
+    address, log_dest, match? "Match" : "Not a match"));
   return match;
 }

@@ -641,15 +631,13 @@
 	|| (apic_index[bit]->get_type () != APIC_TYPE_LOCAL_APIC))
       mask &= ~(1<<bit);
   }
-  if (bx_dbg.apic)
-    BX_INFO(("local::get_delivery_bitmask returning 0x%04x", mask));
+  BX_DEBUG (("local::get_delivery_bitmask returning 0x%04x", mask));
   return mask;
 }

 Bit8u bx_local_apic_c::get_ppr ()
 {
-  if (bx_dbg.apic)
-		BX_INFO(("WARNING: Local APIC Processor Priority not implemented, returning 0"));
+  BX_ERROR(("WARNING: Local APIC Processor Priority not implemented, returning 0"));
   // should look at TPR, vector of highest priority isr, etc.
   return 0;
 }
@@ -657,8 +645,7 @@

 Bit8u bx_local_apic_c::get_apr ()
 {
-  if (bx_dbg.apic)
-		BX_INFO(("WARNING: Local APIC Arbitration Priority not implemented, returning 0"));
+  BX_ERROR (("WARNING: Local APIC Arbitration Priority not implemented, returning 0"));
   // should look at TPR, vector of highest priority isr, etc.
   return 0;
 }
@@ -668,9 +655,8 @@
 bx_local_apic_c::periodic (Bit32u usec_delta)
 {
   if (!timer_active) return;
-  if (bx_dbg.apic)
-    BX_INFO(("%s: bx_local_apic_c::periodic called with %d usec",
-      cpu->name, usec_delta));
+  BX_DEBUG(("%s: bx_local_apic_c::periodic called with %d usec",
+    cpu->name, usec_delta));
   // unless usec_delta is guaranteed to be a multiple of 128, I can't
   // just divide usec_delta by the divide-down value.  Instead, it will
   // have a similar effect to implement the divide-down by ignoring
@@ -701,16 +687,14 @@
       // negative timer_current.
       BX_ASSERT ((timer_current + timer_initial) >= usec_delta);
     }
-    if (bx_dbg.apic)
-      BX_INFO(("%s: local apic timer (periodic) triggered int, reset counter to 0x%08x", cpu->name, timer_current));
+    BX_DEBUG(("%s: local apic timer (periodic) triggered int, reset counter to 0x%08x", cpu->name, timer_current));
   } else {
     // one-shot mode
     timer_current = 0;
     if (timer_active) {
       trigger_irq (timervec & 0xff, id);
       timer_active = false;
-      if (bx_dbg.apic)
-        BX_INFO(("%s: local apic timer (one-shot) triggered int", cpu->name));
+      BX_DEBUG (("%s: local apic timer (one-shot) triggered int", cpu->name));
     }
   }
 }


Fix operator instantiation/selection

Fix operator instantiation/selection

--- src/operators/operator.cc
+++ src/operators/operator.cc
@@ -128,7 +128,9 @@
     std::string op_ = op;
     if (op_.length() > 2) {
         op_.erase(0, 1);
-        op_.pop_back();
+        if (op_.back() == ' ') {
+            op_.pop_back();
+        }
     }

     IF_MATCH(beginswith) { return new BeginsWith(op, param, negation); }
@@ -139,7 +141,7 @@
     IF_MATCH(endswith) { return new EndsWith(op, param, negation); }
     IF_MATCH(eq) { return new Eq(op, param, negation); }
     IF_MATCH(fuzzyhash) { return new FuzzyHash(op, param, negation); }
-    IF_MATCH(geolooku) { return new GeoLookup(op, param, negation); }
+    IF_MATCH(geolookup) { return new GeoLookup(op, param, negation); }
     IF_MATCH(ge) { return new Ge(op, param, negation); }
     IF_MATCH(gsblookup) { return new GsbLookup(op, param, negation); }
     IF_MATCH(gt) { return new Gt(op, param, negation); }


save restore for new var

save restore for new var

--- cpu/init.cc
+++ cpu/init.cc
@@ -542,6 +542,10 @@
   BXRS_PARAM_BOOL(cpu, disable_INIT, disable_INIT);
   BXRS_PARAM_BOOL(cpu, pending_INIT, pending_INIT);
   BXRS_PARAM_BOOL(cpu, trace, trace);
+
+#if BX_CPU_LEVEL >= 5
+  BXRS_PARAM_BOOL(cpu, ignore_bad_msrs, ignore_bad_msrs);
+#endif
 }

 Bit64s BX_CPU_C::param_save_handler(void *devptr, bx_param_c *param)


Render kernel performance improvements

Render kernel performance improvements

--- src/kernel.cpp
+++ src/kernel.cpp
@@ -325,7 +325,7 @@
 		sfloat1 rm = sint1::trueI();
 		sfloat1 zr = sint1::falseI();

-		sfloat4 rc = ro;
+		sfloat1 td = sfloat1::zero();
 		for(uint i = 0;; ++i){
 			dintN leafcount;
 			for(uint j = 0; j < BLCLOUD_VSIZE; ++j)
@@ -336,33 +336,23 @@
 			if(qm.AllFalse())
 				break;

-			/*sfloat4 ce = sfloat4::zero();
-			for(uint j = 0; j < BLCLOUD_VSIZE; ++j)
-				if(i < ls.GetLeafCount(r,j))
-					ce.set(j,float4::load(&pkernel->pscene->ob[ls.GetLeaf(r,j,i)].ce));
-
-			sfloat4 lo = rc; //local origin
-
-			sfloat1 tr0, tr1;
-			sfloat4 ee = ce.swizzle<3,3,3,3>(); //splat w (extent)
-			IntersectCube(lo,rd,ce-ee,ce+ee,tr0,tr1);*/
-
-			sfloat4 lo = rc, ce = sfloat4::zero();
-			sfloat1 rr = sfloat4::length3(lo-ro);
-
-			dfloatN tra, trb;
+			sfloat4 ce = sfloat4::zero();
+			sfloat1 lo = td;
+
+			dfloatN TRA, TRB;
 			for(uint j = 0; j < BLCLOUD_VSIZE; ++j)
 				if(i < ls.GetLeafCount(r,j)){
-					ls.GetHit(r,j,i,&tra.v[j],&trb.v[j]);
+					ls.GetHit(r,j,i,&TRA.v[j],&TRB.v[j]);
 					ce.set(j,float4::load(&pkernel->pscene->ob[ls.GetLeaf(r,j,i)].ce));
 				}
-			sfloat1 tr0 = sfloat1::load(&tra)-rr;
-			sfloat1 tr1 = sfloat1::load(&trb)-rr;
-
-			sfloat4 r0 = lo+rd*tr0;
-			sfloat4 r1 = lo+rd*tr1;
-
-			sint1 sm = sfloat1::Greater(tr0,zr);
+			sfloat1 tra = sfloat1::load(&TRA); //leaf distance from the ray origin
+			sfloat1 trb = sfloat1::load(&TRB);
+			sfloat1 tr0 = tra-td; //leaf distance from the current pointer
+			sfloat1 tr1 = trb-td;
+
+			sfloat4 r0 = ro+rd*tra;
+
+			sint1 sm = sfloat1::Greater(tra,td);
 			dintN SM = dintN(sm);

 			dfloatN smax1, dist1, rho1;
@@ -391,10 +381,7 @@
 			sm = sfloat1::Or(sm,vm); //skip if the next leaf is a sole fog

 			sm = sfloat1::And(sm,qm); //can't allow any further changes in 'rc' if qm == 0
-
-			rc.v[0] = sfloat1::Or(sfloat1::And(sm,r0.v[0]),sfloat1::AndNot(sm,rc.v[0]));
-			rc.v[1] = sfloat1::Or(sfloat1::And(sm,r0.v[1]),sfloat1::AndNot(sm,rc.v[1]));
-			rc.v[2] = sfloat1::Or(sfloat1::And(sm,r0.v[2]),sfloat1::AndNot(sm,rc.v[2]));
+			td = sfloat1::Or(sfloat1::And(sm,tra),sfloat1::AndNot(sm,td));

 			sfloat1 s0 = sfloat1::Or(sfloat1::And(sm,tr0),sfloat1::AndNot(sm,zr)); //positive distance skipped (moving to next leaf)

@@ -406,24 +393,17 @@
 				if(sfloat1(sm).AllFalse())
 					break;
 				sc = s0+sr;
-
-				/*rc.v[0] = sfloat1::Or(sfloat1::And(sm,lo.v[0]+rd.v[0]*sc),sfloat1::AndNot(sm,rc.v[0]));
-				rc.v[1] = sfloat1::Or(sfloat1::And(sm,lo.v[1]+rd.v[1]*sc),sfloat1::AndNot(sm,rc.v[1]));
-				rc.v[2] = sfloat1::Or(sfloat1::And(sm,lo.v[2]+rd.v[2]*sc),sfloat1::AndNot(sm,rc.v[2]));*/
-				rc.v[0] = sfloat1::Or(sfloat1::And(sm,rd.v[0].madd(sc,lo.v[0])),sfloat1::AndNot(sm,rc.v[0]));
-				rc.v[1] = sfloat1::Or(sfloat1::And(sm,rd.v[1].madd(sc,lo.v[1])),sfloat1::AndNot(sm,rc.v[1]));
-				rc.v[2] = sfloat1::Or(sfloat1::And(sm,rd.v[2].madd(sc,lo.v[2])),sfloat1::AndNot(sm,rc.v[2]));
+				td = sfloat1::Or(sfloat1::And(sm,lo+sc),sfloat1::AndNot(sm,td));

 				sm = sfloat1::And(sm,sfloat1::Less(sc,tr1)); //check if out of extents
 				sh = sfloat1::Or(sm,sfloat1::AndNot(rm,sint1::trueI())); //prevent modifications if rm == false
-
-				rc.v[0] = sfloat1::Or(sfloat1::AndNot(sh,r1.v[0]),sfloat1::And(sh,rc.v[0])); //rc = tr1[i]
-				rc.v[1] = sfloat1::Or(sfloat1::AndNot(sh,r1.v[1]),sfloat1::And(sh,rc.v[1]));
-				rc.v[2] = sfloat1::Or(sfloat1::AndNot(sh,r1.v[2]),sfloat1::And(sh,rc.v[2]));
+				td = sfloat1::Or(sfloat1::AndNot(sh,trb),sfloat1::And(sh,td));

 				//if sm == false, this is always true (so rm won't be changed)
 				//-> unless the ray has run out of leafs
 				rm = sfloat1::Or(sfloat1::And(sm,sfloat1::Greater(sc,tr0)),sfloat1::AndNot(sm,rm));
+
+				sfloat4 rc = ro+rd*td;

 				sh = sfloat1::And(sm,rm);
 				dintN SH = dintN(sh);
@@ -499,11 +479,6 @@
 				ca.v[i] = 0.00035f*sfloat1::pow(ca.v[i],2.2f); //convert to linear and adjust exposure
 			}

-			/*sfloat1 rg = sfloat1::Greater(rdz,sfloat1::zero());
-			ca.v[0] = sfloat1::Or(sfloat1::And(rg,ca.v[0]),sfloat1::AndNot(rg,0.3f*ca.v[0]));
-			ca.v[1] = sfloat1::Or(sfloat1::And(rg,ca.v[1]),sfloat1::AndNot(rg,0.3f*ca.v[1]));
-			ca.v[2] = sfloat1::Or(sfloat1::And(rg,ca.v[2]),sfloat1::AndNot(rg,0.3f*ca.v[2]));*/
-
 			ll = lc+ca;
 			ll.v[3] = sfloat1::one(); //alpha doesn't matter when r > 0
 		}else{
@@ -529,6 +504,8 @@
 			//need two samples - with the phase sampling keep on the recursion while for the light do only single scattering
 			sfloat1 gm1 = sfloat1::AndNot(rm,sint1::trueI());
 			sfloat1 rq;
+
+			sfloat4 rc = ro+rd*td;

 			//estimator S(1)*f1*w1/p1+S(2)*f2*w2/p2 /= woodcock pdf
 			sfloat4 s1 = SampleVolume(rc,srd,gm1,pkernel,prs,ls,r+1,1,&rq);
@@ -657,8 +634,6 @@
 	this->scattevs = scattevs;
 	this->msigmas = msigmas;
 	this->msigmaa = msigmaa;
-	//this->tilex = tilex;
-	//this->tiley = tiley;
 	this->w = w;
 	this->h = h;
 	this->flags = flags;
@@ -683,13 +658,7 @@
 }

 void RenderKernel::Render(uint x0, uint y0, uint tilex, uint tiley, uint samples){
-	/*dim3 db = dim3(8,8,1); //[numthreads(...)]
-	dim3 dg = dim3(rx/8,ry/8,1); //Dispatch
-	K_Render<<<db,dg>>>(*(matrix*)&viewi,*(matrix*)&proji,ob,x0,y0,w,h,prt);
-
-	if(cudaMemcpy(phb,prt,rx*ry*16,cudaMemcpyDeviceToHost) != cudaSuccess)
-		printf("cudaMemcpy() failure\n");*/
-
+	//
 	K_Render(&viewi,&proji,this,x0,y0,tilex,tiley,w,h,samples,phb);
 }


Update kernel.cpp

Update kernel.cpp

--- src/kernel.cpp
+++ src/kernel.cpp
@@ -21,6 +21,8 @@
 static std::map<int, unsigned int> mapStakeModifierCheckpoints =
     boost::assign::map_list_of
     ( 0, 0x0e00670bu )
+    ( 500000, 0x683d6393 )
+    ( 767799, 0x84fcaad1 )
     ;

 // Get time weight


fix unstoppable bug with gzh

fix unstoppable bug with gzh

--- core/proxy.hpp
+++ core/proxy.hpp
@@ -391,6 +391,7 @@

 		// recieve all replies to calculate the tail latency
 		while (recv_cnt < send_cnt) {
+			sweep_msgs();
 			request_or_reply r;
 			if (tryrecv_reply(r)) {
 				recv_cnt ++;


Correct whitespace

Correct whitespace

--- src/keymap.cpp
+++ src/keymap.cpp
@@ -603,7 +603,7 @@
 				ActionHandlerStatus::TOO_FEW_PARAMS);
 		}
 		std::string context = "all";
-		if (params.size() >= 2){
+		if (params.size() >= 2) {
 			context = params[1];
 		}
 		if (params[0] == "-a") {


*** empty log message ***

*** empty log message ***

--- src/ktrace.cpp
+++ src/ktrace.cpp
@@ -458,6 +458,9 @@
     : fileName( whichFile )
 {
   string tmpstr;
+  myTraceInfo.cutterOffset = 0;
+  myTraceInfo.cutterBeginTime = 0;
+  myTraceInfo.cutterEndTime = 0;

   ready = false;
   TraceStream *file = TraceStream::openFile( fileName );


minor fix: removed debugging code

minor fix: removed debugging code

--- sample/barnes-hut/bh.cc
+++ sample/barnes-hut/bh.cc
@@ -182,30 +182,8 @@
       attr.x /= attr.w;
       attr.y /= attr.w;
       attr.z /= attr.w;
-#if 0
-      // <debug>
-      if (parent.data().mpi_rank_ == 0) {
-        std::cout << "BH Non-Leaf Cell [" << child.key() << "] "
-                  << "w = " << attr.w << " "
-                  << "x = " << attr.x << " "
-                  << "y = " << attr.y << " "
-                  << "z = " << attr.z << " "
-                  << std::endl;
-        // </debug>
-      }
-#endif
       child.attr() = attr;
     }
-
-    if (parent.key() == 2089670227099910146 && child.data().mpi_rank_ == 0) {
-      std::cout << "Approximate(): Non-Leaf Cell [" << parent.key() << "] "
-                << "w = " << parent.attr().w << " "
-                << "x = " << parent.attr().x << " "
-                << "y = " << parent.attr().y << " "
-                << "z = " << parent.attr().z << " "
-                << std::endl;
-    }
-
     TapasBH::Reduce(parent, parent.attr().w, child.attr().w, Sum);
     TapasBH::Reduce(parent, parent.attr().x, child.attr().x * child.attr().w, Sum);
     TapasBH::Reduce(parent, parent.attr().y, child.attr().y * child.attr().w, Sum);


Bugfix: two separate Functor traits classes force both operator arguments to inherit Functor

--- src/lambda.hpp
+++ src/lambda.hpp
@@ -7,6 +7,16 @@

 	struct Functor {};

+
+	template<typename _Type>
+	struct IsFree {
+		static bool constexpr s_f = is_base_of<
+			Functor,
+			typename remove_cv<
+				typename remove_reference<_Type>::type
+				>::type
+			>::value;
+	};

 	template<typename _Type>
 	struct IsBound {
@@ -19,15 +29,47 @@
 	};

-	template<typename _Type, bool _fBound = IsBound<_Type>::s_f>
+	template<typename _Type, bool _fFree = IsFree<_Type>::s_f>
 	struct FunctorTraits;

 	template<typename _Type>
-	struct FunctorTraits<_Type, true> {};
+	struct FunctorTraits<_Type, false> {
+		static inline _Type Pass(_Type &&rr) {
+			return rr;
+		}
+	};
+
+
+	template<typename _Left, typename _Right, bool _fLeftFree = IsFree<_Left>::s_f, bool _fRightFree = IsFree<_Right>::s_f>
+	struct FunctorTraits2;
+
+	template<typename _Left, typename _Right>
+	struct FunctorTraits2<_Left, _Right, true, false> {
+		template<typename _FunctorClass>
+		static inline _FunctorClass Build(_Left &&rrLeft, _Right &&rrRight) {
+			return _FunctorClass((_Left&&)rrLeft, (_Right&&)rrRight);
+		}
+	};
+
+	template<typename _Left, typename _Right>
+	struct FunctorTraits2<_Left, _Right, false, true> {
+		template<typename _FunctorClass>
+		static inline _FunctorClass Build(_Left &&rrLeft, _Right &&rrRight) {
+			return _FunctorClass((_Left&&)rrLeft, (_Right&&)rrRight);
+		}
+	};
+
+	template<typename _Left, typename _Right>
+	struct FunctorTraits2<_Left, _Right, true, true> {
+		template<typename _FunctorClass>
+		static inline _FunctorClass Build(_Left &&rrLeft, _Right &&rrRight) {
+			return _FunctorClass((_Left&&)rrLeft, (_Right&&)rrRight);
+		}
+	};

 	template<typename _Type>
-	inline _Type &&Pass(_Type &&rr) {
+	inline _Type Pass(_Type &&rr) {
 		return rr;
 	}

@@ -245,7 +287,7 @@
 #define LAMBDA_PREFIX_UNARY_OPERATOR(Operator, FunctorClass) \
 	template<typename _Operand, typename _Traits = Lambda::FunctorTraits<_Operand>> \
 	inline Lambda::FunctorClass<_Operand> operator Operator (_Operand &&rrOperand) { \
-		return Lambda::FunctorClass<_Operand>((_Operand&&)rrOperand); \
+		return Lambda::FunctorClass<_Operand>(_Traits::Pass(rrOperand)); \
 	}

 LAMBDA_PREFIX_UNARY_OPERATOR(+, UnaryPlus)
@@ -257,9 +299,9 @@

 #define LAMBDA_BINARY_OPERATOR(Operator, FunctorClass) \
-	template<typename _Left, typename _Right, typename _LeftTraits = Lambda::FunctorTraits<_Left>, typename _RightTraits = Lambda::FunctorTraits<_Right>> \
+	template<typename _Left, typename _Right, typename _Traits = Lambda::FunctorTraits2<_Left, _Right>> \
 	inline Lambda::FunctorClass<_Left, _Right> operator Operator (_Left &&rrLeft, _Right &&rrRight) { \
-		return Lambda::FunctorClass<_Left, _Right>((_Left&&)rrLeft, (_Right&&)rrRight); \
+		return _Traits::Build<typename Lambda::FunctorClass<_Left, _Right>>((_Left&&)rrLeft, (_Right&&)rrRight); \
 	}

 LAMBDA_BINARY_OPERATOR(+, BinaryPlus)


minor version increment (also for turning on 'native LAS 1.4 extension' by default

--- src/laszip.hpp
+++ src/laszip.hpp
@@ -25,6 +25,7 @@

   CHANGE HISTORY:

+    23 August 2017 -- minor version increment for C++ stream-based read/write API
     28 May 2017 -- support for "LAS 1.4 selective decompression" added into DLL API
     8 April 2017 -- new check for whether point size and total size of items match
     30 March 2017 -- support for "native LAS 1.4 extension" added into main branch
@@ -62,9 +63,9 @@
 #endif

 #define LASZIP_VERSION_MAJOR                3
-#define LASZIP_VERSION_MINOR                0
-#define LASZIP_VERSION_REVISION             4
-#define LASZIP_VERSION_BUILD_DATE      170804
+#define LASZIP_VERSION_MINOR                1
+#define LASZIP_VERSION_REVISION             0
+#define LASZIP_VERSION_BUILD_DATE      170823

 #define LASZIP_COMPRESSOR_NONE              0
 #define LASZIP_COMPRESSOR_POINTWISE         1


changed unsigned int's to unsigned longs so 64 bit build would work.

--- src/osg/MemoryManager.cpp
+++ src/osg/MemoryManager.cpp
@@ -377,7 +377,7 @@
         // addresses will be on four-, eight- or even sixteen-byte boundaries. If we didn't do this, the hash index would not have
         // very good coverage.

-        unsigned int    hashIndex = ((unsigned int) reportedAddress >> 4) & (hashSize - 1);
+        unsigned long    hashIndex = ((unsigned long) reportedAddress >> 4) & (hashSize - 1);
         sAllocUnit    *ptr = hashTable[hashIndex];
         while(ptr)
         {
@@ -577,10 +577,14 @@
             sAllocUnit *ptr = hashTable[i];
             while(ptr)
             {
+#ifdef ARCH64
+                fprintf(fp, "%06d 0x%08lX 0x%08lX 0x%08lX 0x%08lX 0x%08X %-8s    %c       %c    %s\r\n",
+#else
                 fprintf(fp, "%06d 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X %-8s    %c       %c    %s\r\n",
+#endif
                     ptr->allocationNumber,
-                    (unsigned int) ptr->reportedAddress, ptr->reportedSize,
-                    (unsigned int) ptr->actualAddress, ptr->actualSize,
+                    (unsigned long) ptr->reportedAddress, ptr->reportedSize,
+                    (unsigned long) ptr->actualAddress, ptr->actualSize,
                     m_calcUnused(ptr),
                     allocationTypes[ptr->allocationType],
                     ptr->breakOnDealloc ? 'Y':'N',
@@ -1126,7 +1130,7 @@

             // Insert the new allocation into the hash table

-            unsigned int    hashIndex = ((unsigned int) au->reportedAddress >> 4) & (hashSize - 1);
+            unsigned long    hashIndex = ((unsigned long) au->reportedAddress >> 4) & (hashSize - 1);
             if (hashTable[hashIndex]) hashTable[hashIndex]->prev = au;
             au->next = hashTable[hashIndex];
             au->prev = NULL;
@@ -1308,7 +1312,7 @@
                 // Remove this allocation unit from the hash table

                 {
-                    unsigned int    hashIndex = ((unsigned int) oldReportedAddress >> 4) & (hashSize - 1);
+                    unsigned long    hashIndex = ((unsigned long) oldReportedAddress >> 4) & (hashSize - 1);
                     if (hashTable[hashIndex] == au)
                     {
                         hashTable[hashIndex] = hashTable[hashIndex]->next;
@@ -1322,7 +1326,7 @@

                 // Re-insert it back into the hash table

-                hashIndex = ((unsigned int) au->reportedAddress >> 4) & (hashSize - 1);
+                hashIndex = ((unsigned long) au->reportedAddress >> 4) & (hashSize - 1);
                 if (hashTable[hashIndex]) hashTable[hashIndex]->prev = au;
                 au->next = hashTable[hashIndex];
                 au->prev = NULL;
@@ -1446,7 +1450,7 @@

             // Remove this allocation unit from the hash table

-            unsigned int    hashIndex = ((unsigned int) au->reportedAddress >> 4) & (hashSize - 1);
+            unsigned long    hashIndex = ((unsigned long) au->reportedAddress >> 4) & (hashSize - 1);
             if (hashTable[hashIndex] == au)
             {
                 hashTable[hashIndex] = au->next;


[software] fix command line argument name

--- src/software/SfM/main_ComputeStructureFromKnownPoses.cpp
+++ src/software/SfM/main_ComputeStructureFromKnownPoses.cpp
@@ -42,7 +42,7 @@
        "[-i|--input_file] path to a SfM_Data scene\n"
        "[-o|--output_file] file where the output data will be stored "
           "(i.e. path/sfm_data_structure.bin)\n"
-       "[-m|--feat_dir] path to the features and descriptors that "
+       "[-f|--feat_dir] path to the features and descriptors that "
           "corresponds to the provided SfM_Data scene\n"
        "\n[Optional]\n"
        "[-m|--match_dir] path to the matches files "


Added missing osg:: infront of Referenced() contructor.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@2033 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgGL2/Extensions.cpp
+++ src/osgGL2/Extensions.cpp
@@ -33,7 +33,7 @@
     setupGLExtensions();
 }

-Extensions::Extensions(const Extensions& rhs) : Referenced()
+Extensions::Extensions(const Extensions& rhs) : osg::Referenced()
 {
     _isShaderObjectsSupported = rhs._isShaderObjectsSupported;
     _isVertexShaderSupported = rhs._isVertexShaderSupported;


Removed 12 year old workaround that is no longer required and was causing a misleading info message  "OpenGL extension '' is not supported." to be reported.

--- src/osgUtil/SceneView.cpp
+++ src/osgUtil/SceneView.cpp
@@ -313,10 +313,6 @@
 {
     _initCalled = true;

-    // force the initialization of the OpenGL extension string
-    // to try and work around a Windows NVidia driver bug circa Oct 2006.
-    osg::isGLExtensionSupported(_renderInfo.getState()->getContextID(),"");
-
     if (_camera.valid() && _initVisitor.valid())
     {
         _initVisitor->reset();


*** empty log message ***

*** empty log message ***

--- src/lib/io.cpp
+++ src/lib/io.cpp
@@ -214,8 +214,8 @@
 	check_target();
 	//min_val=0.0 ;

-	fprintf(stderr, "min_val=%f\n", min_val) ;
-	fprintf(stderr, "max_val=%f\n", max_val) ;
+	//fprintf(stderr, "min_val=%f\n", min_val) ;
+	//fprintf(stderr, "max_val=%f\n", max_val) ;

 	if (max_val-min_val>0.0)
 		v=100*(current_val-min_val+1)/(max_val-min_val+1);


fix function names in parallel_fann_cpp to match header

--- src/parallel_fann_cpp.cpp
+++ src/parallel_fann_cpp.cpp
@@ -9,7 +9,7 @@
 namespace parallel_fann {
 // TODO rewrite all these functions in c++ using fann_cpp interface

-float fann_train_epoch_batch_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
+float train_epoch_batch_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
 {
 	fann_reset_MSE(ann);
 	vector<struct fann *> ann_vect(threadnumb);
@@ -78,7 +78,7 @@
 }

-float fann_train_epoch_irpropm_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
+float train_epoch_irpropm_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
 {

 	if(ann->prev_train_slopes == NULL)
@@ -196,7 +196,7 @@
 }

-float fann_train_epoch_quickprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
+float train_epoch_quickprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
 {

 	if(ann->prev_train_slopes == NULL)
@@ -330,7 +330,7 @@
 }

-float fann_train_epoch_sarprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
+float train_epoch_sarprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
 {
 	if(ann->prev_train_slopes == NULL)
 	{
@@ -485,7 +485,7 @@
 	return fann_get_MSE(ann);
 }

-float fann_train_epoch_incremental_mod(struct fann *ann, struct fann_train_data *data)
+float train_epoch_incremental_mod(struct fann *ann, struct fann_train_data *data)
 {
 	unsigned int i;

@@ -501,7 +501,7 @@

 //the following versions returns also the outputs via the predicted_outputs parameter

-float fann_train_epoch_batch_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb,vector< vector<fann_type> >& predicted_outputs)
+float train_epoch_batch_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb,vector< vector<fann_type> >& predicted_outputs)
 {
 	fann_reset_MSE(ann);
 	predicted_outputs.resize(data->num_data,vector<fann_type> (data->num_output));
@@ -577,7 +577,7 @@
 }

-float fann_train_epoch_irpropm_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
+float train_epoch_irpropm_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
 {

 	if(ann->prev_train_slopes == NULL)
@@ -699,7 +699,7 @@
 }

-float fann_train_epoch_quickprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
+float train_epoch_quickprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
 {

 	if(ann->prev_train_slopes == NULL)
@@ -838,7 +838,7 @@
 }

-float fann_train_epoch_sarprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
+float train_epoch_sarprop_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
 {

 	if(ann->prev_train_slopes == NULL)
@@ -1000,7 +1000,7 @@
 }

-float fann_train_epoch_incremental_mod(struct fann *ann, struct fann_train_data *data, vector< vector<fann_type> >& predicted_outputs)
+float train_epoch_incremental_mod(struct fann *ann, struct fann_train_data *data, vector< vector<fann_type> >& predicted_outputs)
 {

 	predicted_outputs.resize(data->num_data,vector<fann_type> (data->num_output));
@@ -1024,7 +1024,7 @@
 	return fann_get_MSE(ann);
 }

-float fann_test_data_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
+float test_data_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb)
 {
 	if(fann_check_input_output_sizes(ann, data) == -1)
 		return 0;
@@ -1064,7 +1064,7 @@
 	return fann_get_MSE(ann);
 }

-float fann_test_data_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
+float test_data_parallel(struct fann *ann, struct fann_train_data *data, const unsigned int threadnumb, vector< vector<fann_type> >& predicted_outputs)
 {
 	if(fann_check_input_output_sizes(ann, data) == -1)
 		return 0;


add some comments

add some comments

--- planner/planner_commander.cpp
+++ planner/planner_commander.cpp
@@ -46,6 +46,7 @@
 pair<int, int> prev_commanded_grid_cell;			// the index of the previously commanded grid cell
 pair<int, int> commanded_grid_cell;				// the index of the commanded grid cell

+// TODO: put additional global variables here needed to keep track of any styate information desired

 pair<float, float> get_next_pomdp_action(double &bearing, int &rssi) {
@@ -66,6 +67,8 @@

 void update_observations(double &bearing, int &rssi) {
+
+	// TODO: add any additional update information that would be required

 	// note that we have just visited the commanded grid cell
 	cells_visited.push_back(commanded_grid_cell);


Added fix for many crashes related to uncleared initiative list

--- TemplePlus/gamesystems/legacysystems.cpp
+++ TemplePlus/gamesystems/legacysystems.cpp
@@ -27,6 +27,7 @@
 #include "infrastructure/mesparser.h"
 #include "legacymapsystems.h"
 #include "infrastructure/meshes.h"
+#include "turn_based.h"

 //*****************************************************************************
@@ -171,6 +172,8 @@

 	auto &teleportProcessActive = temple::GetRef<BOOL>(0x10AB74B8);
 	teleportProcessActive = 1;
+
+	tbSys.groupInitiativeList->Clear(); // fix for common crash - sometimes initiative list isn't cleared and then some other processes get invalid crap

 	auto teleportProcess = temple::GetRef<void(__cdecl)(FadeAndTeleportArgs&)>(0x10085AA0);
 	auto &teleportPacket = temple::GetRef<FadeAndTeleportArgs>(0x10AB74C8);


bug-fix of command line parameters parsing procedure

--- platform/wm/rhodes/Rhodes.cpp
+++ platform/wm/rhodes/Rhodes.cpp
@@ -80,7 +80,7 @@
                 char* path = parseToken( token.c_str(), token.length() );
 				if (path) {
 					int len = strlen(path);
-					if (!(path[len]=='\\' || path[len]=='/')) {
+					if (!(path[len-1]=='\\' || path[len-1]=='/')) {
 						path[len] = '\\';
 						path[len+1]  = 0;
 					}


updated inline var but it seems uncompilable (due to c++17 and insufficient g++ version)

--- kwd/inline_var.cc
+++ kwd/inline_var.cc
@@ -9,13 +9,43 @@
  *  *one* of them.
  *
  *  Note: Compile with -std=c++17.
+ *
+ *  XXX: This seems not compilable on my g++ 5.4.0.
  */

 #include <iostream>

+/// Until C++17, it can be done via this trick with template.
+template<class Dummy>
+struct _Foo {
+    static std::string hi;
+};
+
+/// Static member variable should be initialized outside the class.
+template<class Dummy>
+std::string _Foo<Dummy>::hi = "Hi! I'm Foo.";
+
+/// Type alias via using was introduced since C++11.
+using Foo = _Foo<void>; // `Foo::hi' is now allowed
+
+/// Use the inline variable outside the class.
+struct Bar {
+    static std::string const hi = "Hi! I'm Bar.";
+};
+
+inline std::string Bar::hi = "Hi! I'm Bar.";
+
+/// It can also be defined in the class definition.
+struct Baz {
+    static inline std::string hi = "Hi! I'm Baz.";
+};
+
 int
 main(int argc, const char *argv[])
 {
-    // TODO
+    std::cout << Foo::hi << std::endl;
+    std::cout << Bar::hi << std::endl;
+    std::cout << Baz::hi << std::endl;
+
     return 0;
 }


Removed redundant debug output from trace benchmark.

--- tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp
+++ tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp
@@ -199,7 +199,6 @@
     }

     in >> buffer >> updates;
-    printf("Read paint buffer version %d with %d frames\n", version, buffer.numFrames());

     resize(buffer.boundingRect().size().toSize());


Coverty: don't use rand() (weak crypto)

Coverty: don't use rand() (weak crypto)

"rand" should not be used for security related applications,
as linear congruential algorithms are too easy to break.

This isn't very critical as we're only producing random data
to our unit test, and not to a piece used in production.

Change-Id: I08e45d426c5ddb932f0beded06112e27f39989b9
Reviewed-on: http://review.couchbase.org/68800
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>

--- tests/cbsasl_password_database_test/password_database_test.cc
+++ tests/cbsasl_password_database_test/password_database_test.cc
@@ -29,6 +29,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <platform/random.h>

 class PasswordMetaTest : public ::testing::Test {
 public:
@@ -331,15 +332,17 @@
         cJSON_AddStringToObject(meta.get(), "cipher", "AES_256_cbc");
         std::string blob;
         blob.resize(EVP_CIPHER_key_length(EVP_aes_256_cbc()));
-        for (auto &a : blob) {
-            a = (char)rand();
-        }
+
+        Couchbase::RandomGenerator randomGenerator(true);
+        ASSERT_TRUE(randomGenerator.getBytes(const_cast<char*>(blob.data()),
+                                             blob.size()));
         cJSON_AddStringToObject(meta.get(), "key",
                                 Couchbase::Base64::encode(blob).c_str());
+
         blob.resize(EVP_CIPHER_iv_length(EVP_aes_256_cbc()));
-        for (auto &a : blob) {
-            a = (char)rand();
-        }
+        ASSERT_TRUE(randomGenerator.getBytes(const_cast<char*>(blob.data()),
+                                             blob.size()));
+
         cJSON_AddStringToObject(meta.get(), "iv",
                                 Couchbase::Base64::encode(blob).c_str());


More debugging traces.

More debugging traces.

	* src/parser/parser-impl.cc: Here.

--- src/parser/parser-impl.cc
+++ src/parser/parser-impl.cc
@@ -46,9 +46,12 @@
     scanner.switch_streams(&source, 0);
     parser_type p(*this, scanner);
     p.set_debug_level (!!getenv ("YYDEBUG"));
-    ECHO("====================== Parse begin");
+    if (p.debug_level())
+      LIBPORT_ECHO("====================== Parse begin");
     result_->status = p.parse();
-    ECHO("====================== Parse end: " << res);
+    if (p.debug_level())
+      LIBPORT_ECHO("====================== Parse end:" << std::endl
+                   << *result_);
     TIMER_POP("parse");
   }


- More logging

- More logging

--- src/library.cc
+++ src/library.cc
@@ -7,10 +7,8 @@
 #include <vector>

 #include "base/files/file_enumerator.h"
+#include "base/logging.h"
 #include "base/strings/utf_string_conversions.h"
-
-#include <QtCore/QDebug>
-#include <iostream>

 static std::vector<Track*> tracks_;
@@ -66,9 +64,9 @@
        ++it) {
     Track* track = *it;
 #if defined(OS_WIN)
-    std::cout << base::WideToUTF8(track->file_path_.value()) << std::endl;
+    LOG(INFO) << base::WideToUTF8(track->file_path_.value());
 #elif defined(OS_POSIX)
-    std::cout << track->file_path_.value() << std::endl;
+    LOG(INFO) << track->file_path_.value();
 #endif
   }
 }