FAR patch 01063.SubstPluginPrefix Дата              : 19.11.2001 Сделал            : Ivan Sintyurin Описание          : - Баг: подставлялись префиксы плагинов при добавлении                       пути в командную строку даже, если панель содержала                       реальные файлы. Измененные файлы  : filelist.cpp Новые файлы       : Удаленные файлы   : Состав            : 01063.SubstPluginPrefix.txt                     filelist.cpp.1063.diff Основан на патче  : 1062 Дополнение        :

--- far/filelist.cpp
+++ far/filelist.cpp
@@ -5,10 +5,13 @@

 */

-/* Revision: 1.104 19.11.2001 $ */
+/* Revision: 1.105 19.11.2001 $ */

 /*
 Modify:
+  19.11.2001 IS
+    - :
+       ,     .
   19.11.2001 OT
     !
       (118 )
@@ -948,8 +951,13 @@
         if(PanelMode==PLUGIN_PANEL && Opt.SubstPluginPrefix)
         {
           char Prefix[NM*2];
-          strcat(AddPluginPrefix((FileList *)CtrlObject->Cp()->ActivePanel,Prefix),FileName);
-          strncpy(FileName,Prefix,sizeof(FileName)-1);
+          /* $ 19.11.2001 IS    :) */
+          if(*AddPluginPrefix((FileList *)CtrlObject->Cp()->ActivePanel,Prefix))
+          {
+            strcat(Prefix,FileName);
+            strncpy(FileName,Prefix,sizeof(FileName)-1);
+          }
+          /* IS $ */
         }

         QuoteSpace(FileName);
@@ -2933,8 +2941,13 @@
         if(PanelMode==PLUGIN_PANEL && Opt.SubstPluginPrefix)
         {
           char Prefix[NM*2];
-          strcat(AddPluginPrefix((FileList *)CtrlObject->Cp()->ActivePanel,Prefix),QuotedName);
-          strncpy(QuotedName,Prefix,sizeof(QuotedName)-1);
+          /* $ 19.11.2001 IS    :) */
+          if(*AddPluginPrefix((FileList *)CtrlObject->Cp()->ActivePanel,Prefix))
+          {
+            strcat(Prefix,QuotedName);
+            strncpy(QuotedName,Prefix,sizeof(QuotedName)-1);
+          }
+          /* IS $ */
         }
       }
     }
@@ -3662,19 +3675,29 @@
   return(TRUE);
 }

+/* $ 19.11.2001 IS
+
+*/
 char* FileList::AddPluginPrefix(FileList *SrcPanel,char *Prefix)
 {
   Prefix[0]=0;
-  if(Opt.SubstPluginPrefix)
-  {
-    struct PluginInfo PInfo;
-    CtrlObject->Plugins.GetPluginInfo(((struct PluginHandle *)SrcPanel->hPlugin)->PluginNumber,&PInfo);
-    if(PInfo.CommandPrefix && *PInfo.CommandPrefix)
-    {
-      strcpy(Prefix,PInfo.CommandPrefix);
-      char *Ptr=strchr(Prefix,':');
-      if(Ptr) *++Ptr=0; else strcat(Prefix,":");
+  if(Opt.SubstPluginPrefix && SrcPanel->GetMode()==PLUGIN_PANEL)
+  {
+    OpenPluginInfo Info;
+    PluginHandle *plugin=static_cast<PluginHandle*>(SrcPanel->hPlugin);
+    CtrlObject->Plugins.GetOpenPluginInfo(plugin,&Info);
+    if(!(Info.Flags & OPIF_REALNAMES))
+    {
+      PluginInfo PInfo;
+      CtrlObject->Plugins.GetPluginInfo(plugin->PluginNumber,&PInfo);
+      if(PInfo.CommandPrefix && *PInfo.CommandPrefix)
+      {
+        strcpy(Prefix,PInfo.CommandPrefix);
+        char *Ptr=strchr(Prefix,':');
+        if(Ptr) *++Ptr=0; else strcat(Prefix,":");
+      }
     }
   }
   return Prefix;
 }
+/* IS $ */


FAR patch 00080.fileview_ctrlo
Дата              : 21.07.2000
Сделал            : andrey tretjakov
Описание          : убирает глюк во Viewer при CtrlO с выключенным кейбаром
Измененные файлы  : fileview.cpp
Состав            : 00080.fileview_ctrlo.txt
                    fileview.cpp.80.diff
Основан на патче  : 79
Дополнение        :

    так, рутина.
    дифф говорит сам за себя

--- far/fileview.cpp
+++ far/fileview.cpp
@@ -5,12 +5,14 @@

 */

-/* Revision: 1.04 15.07.2000 $ */
+/* Revision: 1.05 21.07.2000 $ */

 /*
 Modify:
+  21.07.2000 tran 1.05
+      - 䠪  CtrlO  몫祭
   15.07.2000 tran
-    + CtrlB 몫砥/砥 keybar
+      + CtrlB 몫砥/砥 keybar
   04.07.2000 tran
     +  뢠 ᠣ     䠩
   29.06.2000 tran
@@ -177,7 +179,13 @@
         ViewKeyBar.Hide();
         WaitKey();
       }
-      ViewKeyBar.Show();
+      /* $ 21.07.2000 tran
+         - 䠪  Ctrl-O*/
+      if ( Opt.ShowKeyBarViewer )
+        ViewKeyBar.Show();
+      else
+        ViewKeyBar.Hide0(); // 0 mean - Don't purge saved screen
+      /* tran 21.07.2000 $ */
       Show();
       return(TRUE);
     case KEY_CTRLTAB:


Enable validation for floating point input widgets

--- src/appleseed.studio/mainwindow/project/entityeditor.cpp
+++ src/appleseed.studio/mainwindow/project/entityeditor.cpp
@@ -55,6 +55,7 @@
 #include <QColorDialog>
 #include <QComboBox>
 #include <QDialogButtonBox>
+#include <QDoubleValidator>
 #include <QFileDialog>
 #include <QFont>
 #include <QFormLayout>
@@ -288,12 +289,14 @@

 auto_ptr<IInputWidgetProxy> EntityEditor::create_numeric_input_widgets(const Dictionary& metadata, const bool input_widget_visible)
 {
+    const double min_value = metadata.get<double>("min_value");
+    const double max_value = metadata.get<double>("max_value");
+
     QLineEdit* line_edit = new QLineEdit(m_parent);
     line_edit->setMaximumWidth(60);
+    line_edit->setValidator(new QDoubleValidator(min_value, max_value, 16, line_edit));

     DoubleSlider* slider = new DoubleSlider(Qt::Horizontal, m_parent);
-    const double min_value = metadata.get<double>("min_value");
-    const double max_value = metadata.get<double>("max_value");
     slider->setRange(min_value, max_value);
     slider->setPageStep((max_value - min_value) / 10.0);
     new MouseWheelFocusEventFilter(slider);


fixed typos

fixed typos

--- student_manager.cpp
+++ student_manager.cpp
@@ -61,11 +61,11 @@
               std::ostream_iterator<float>{std::cout, ", "});

     std::cout << "\n"
-              << "min mark: " << *std::rbegin(group) << "\n"
-              << "max mark: " << *std::begin(group)  << "\n";
+              << "min mark: " << *std::begin(group) << "\n"
+              << "max mark: " << *std::rbegin(group)  << "\n";

     auto mid = std::lower_bound(std::begin(group), std::end(group), 50.0);
     std::cout << "failed: "    << std::distance(std::begin(group), mid)   << "\n"
-              << "succeeded: " << std::distance(mid - 1, std::end(group)) << "\n";
+              << "succeeded: " << std::distance(mid, std::end(group)) << "\n";
   }
 }


inti order fixed

inti order fixed

--- stuff/datawriter.hh
+++ stuff/datawriter.hh
@@ -101,9 +101,6 @@

 			template <class VTKOut>
 			class VTKOutputter {
-					const std::string path_;
-					const bool parallel_;
-					const int step_;
 				public:
 				//! Constructor
 					VTKOutputter(VTKOut& vtkOut,std::string path, bool parallel,int step)
@@ -179,6 +176,9 @@

 				private:
 					VTKOut & vtkOut_;
+					const std::string path_;
+					const bool parallel_;
+					const int step_;
 			};

 	#if USE_VTKWRITER


IVGCVSW-3561 Use absolute path of unit tests

 * Using the absolute path of the unit tests executable so that
   the unit tests can be run from anywhere and the relative path
   to the test shared objects would still work

Signed-off-by: Matteo Martincigh <c6d77cbcee86d63acbf5236b8a439153c50030ae@arm.com>
Change-Id: I57401daa162570e9ab1717d28a54a19f421afb0e

--- src/backends/backendsCommon/test/DynamicBackendTests.hpp
+++ src/backends/backendsCommon/test/DynamicBackendTests.hpp
@@ -15,6 +15,7 @@

 #include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
+#include <boost/dll.hpp>

 static std::string g_TestSharedObjectSubDir                 = "src/backends/backendsCommon/test/";
 static std::string g_TestSharedObjectFileName               = "libarmnnTestSharedObject.so";
@@ -31,8 +32,8 @@
 {
     using namespace boost::filesystem;

-    path currentPath(current_path());
-    path sharedObjectPath = currentPath.append(g_TestSharedObjectSubDir);
+    path programLocation = boost::dll::program_location().parent_path();
+    path sharedObjectPath = programLocation.append(g_TestSharedObjectSubDir);
     path sharedObjectFile = sharedObjectPath.append(fileName);
     BOOST_TEST(exists(sharedObjectFile));


Correcting two nits in InputAudioFile

Correcting two nits in InputAudioFile

First, the fread function returns number of elements read, not
necessarily the number of bytes. In this case, it is the number
of samples. Second, a spelling mistake was corrected.

R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2161004

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@4658 4adac7df-926f-26a2-2b94-8c16560cd09d

--- modules/audio_coding/neteq4/tools/input_audio_file.cc
+++ modules/audio_coding/neteq4/tools/input_audio_file.cc
@@ -23,11 +23,11 @@
   if (!fp_) {
     return false;
   }
-  size_t bytes_read = fread(destination, sizeof(int16_t), samples, fp_);
-  if (bytes_read < samples) {
-    // Rewind and read the missing sampels.
+  size_t samples_read = fread(destination, sizeof(int16_t), samples, fp_);
+  if (samples_read < samples) {
+    // Rewind and read the missing samples.
     rewind(fp_);
-    size_t missing_samples = samples - bytes_read;
+    size_t missing_samples = samples - samples_read;
     if (fread(destination, sizeof(int16_t), missing_samples, fp_) <
         missing_samples) {
       // Could not read enough even after rewinding the file.


more diagnostics

more diagnostics

--- src/global.cpp
+++ src/global.cpp
@@ -1150,7 +1150,7 @@
     colors[0] = 'k'; colors[1] = 'g'; colors[2] = 'r'; colors[3] = 'b'; colors[4] = 'm'; colors[5] = 'y'; colors[6] = 'w'; colors[7] = 'c';
     polygon pol;
     PosP posp(3,3);
-    printf("before suborder");
+    printf("before suborder\n");
     std::cout.flush();
     int j=A.suborder[jused];
     printf(" jused  %d  j  %d \n",jused,j);
@@ -1158,6 +1158,8 @@
     for (int k=0; k<F.Nfiber; k++) {
         dpair O = pp.coords(k);
         int g = A.TF[j][k];
+        printf( "j = %d  k= %d g = d% \n",j,k,g);
+        std::cout.flush;
         if (g!=-1) {
             dpair Ga = projection(g,j,M,P);
             polygon fh = F.fh;


Minor refactoring for block_scan_warp_scan

--- library/rocprim/include/block/detail/block_scan_warp_scan.hpp
+++ library/rocprim/include/block/detail/block_scan_warp_scan.hpp
@@ -83,7 +83,7 @@
                         storage_type& storage,
                         BinaryFunction scan_op) [[hc]]
     {
-        this->inclusive_scan_(
+        this->inclusive_scan_impl(
             ::rocprim::flat_block_thread_id(),
             input, output, storage, scan_op
         );
@@ -129,7 +129,7 @@
     {
         const auto flat_tid = ::rocprim::flat_block_thread_id();
         const auto warp_id = ::rocprim::warp_id();
-        this->inclusive_scan_(flat_tid, input, output, storage, scan_op);
+        this->inclusive_scan_impl(flat_tid, input, output, storage, scan_op);
         // Include block prefix (this operation overwrites storage.warp_prefixes[0])
         this->include_block_prefix(
             flat_tid, warp_id,
@@ -155,7 +155,7 @@

         // Scan of reduced values to get prefixes
         const auto flat_tid = ::rocprim::flat_block_thread_id();
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             flat_tid,
             thread_input, thread_input, // input, output
             storage,
@@ -224,7 +224,7 @@

         // Scan of reduced values to get prefixes
         const auto flat_tid = ::rocprim::flat_block_thread_id();
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             flat_tid,
             thread_input, thread_input, // input, output
             storage,
@@ -257,7 +257,7 @@
                         storage_type& storage,
                         BinaryFunction scan_op) [[hc]]
     {
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             ::rocprim::flat_block_thread_id(),
             input, output, init, storage, scan_op
         );
@@ -313,7 +313,7 @@
     {
         const auto flat_tid = ::rocprim::flat_block_thread_id();
         const auto warp_id = ::rocprim::warp_id();
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             flat_tid, input, output, init, storage, scan_op
         );
         // Include block prefix (this operation overwrites storage.warp_prefixes[0])
@@ -342,7 +342,7 @@

         // Scan of reduced values to get prefixes
         const auto flat_tid = ::rocprim::flat_block_thread_id();
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             flat_tid,
             thread_input, thread_input, // input, output
             init,
@@ -419,7 +419,7 @@

         // Scan of reduced values to get prefixes
         const auto flat_tid = ::rocprim::flat_block_thread_id();
-        this->exclusive_scan_(
+        this->exclusive_scan_impl(
             flat_tid,
             thread_input, thread_input, // input, output
             init,
@@ -450,11 +450,11 @@

 private:
     template<class BinaryFunction>
-    void inclusive_scan_(const unsigned int flat_tid,
-                         T input,
-                         T& output,
-                         storage_type& storage,
-                         BinaryFunction scan_op) [[hc]]
+    void inclusive_scan_impl(const unsigned int flat_tid,
+                             T input,
+                             T& output,
+                             storage_type& storage,
+                             BinaryFunction scan_op) [[hc]]
     {
         // Perform warp scan
         warp_scan_input_type().inclusive_scan(
@@ -464,7 +464,7 @@

         // i-th warp will have its prefix stored in storage.warp_prefixes[i-1]
         const auto warp_id = ::rocprim::warp_id();
-        this->calculate_warp_prefixes_(flat_tid, warp_id, output, storage, scan_op);
+        this->calculate_warp_prefixes(flat_tid, warp_id, output, storage, scan_op);

         // Use warp prefix to calculate the final scan results for every thread
         if(warp_id != 0)
@@ -475,12 +475,12 @@
     }

     template<class BinaryFunction>
-    void exclusive_scan_(const unsigned int flat_tid,
-                         T input,
-                         T& output,
-                         T init,
-                         storage_type& storage,
-                         BinaryFunction scan_op) [[hc]]
+    void exclusive_scan_impl(const unsigned int flat_tid,
+                             T input,
+                             T& output,
+                             T init,
+                             storage_type& storage,
+                             BinaryFunction scan_op) [[hc]]
     {
         // Perform warp scan on input values
         warp_scan_input_type().inclusive_scan(
@@ -491,7 +491,7 @@
         // i-th warp will have its prefix stored in storage.warp_prefixes[i-1]
         const auto warp_id = ::rocprim::warp_id();
         const auto lane_id = ::rocprim::lane_id();
-        this->calculate_warp_prefixes_(flat_tid, warp_id, output, storage, scan_op);
+        this->calculate_warp_prefixes(flat_tid, warp_id, output, storage, scan_op);

         // Include initial value in warp prefixes, and fix warp prefixes
         // for exclusive scan (first warp prefix is init)
@@ -509,11 +509,11 @@

     // Exclusive scan with unknown initial value
     template<class BinaryFunction>
-    void exclusive_scan_(const unsigned int flat_tid,
-                         T input,
-                         T& output,
-                         storage_type& storage,
-                         BinaryFunction scan_op) [[hc]]
+    void exclusive_scan_impl(const unsigned int flat_tid,
+                             T input,
+                             T& output,
+                             storage_type& storage,
+                             BinaryFunction scan_op) [[hc]]
     {
         // Perform warp scan on input values
         warp_scan_input_type().inclusive_scan(
@@ -524,7 +524,7 @@
         // i-th warp will have its prefix stored in storage.warp_prefixes[i-1]
         const auto warp_id = ::rocprim::warp_id();
         const auto lane_id = ::rocprim::lane_id();
-        this->calculate_warp_prefixes_(flat_tid, warp_id, output, storage, scan_op);
+        this->calculate_warp_prefixes(flat_tid, warp_id, output, storage, scan_op);

         // Use warp prefix to calculate the final scan results for every thread
         T warp_prefix;
@@ -539,11 +539,11 @@

     // i-th warp will have its prefix stored in storage.warp_prefixes[i-1]
     template<class BinaryFunction>
-    void calculate_warp_prefixes_(const unsigned int flat_tid,
-                                  const unsigned int warp_id,
-                                  T inclusive_input,
-                                  storage_type& storage,
-                                  BinaryFunction scan_op) [[hc]]
+    void calculate_warp_prefixes(const unsigned int flat_tid,
+                                 const unsigned int warp_id,
+                                 T inclusive_input,
+                                 storage_type& storage,
+                                 BinaryFunction scan_op) [[hc]]
     {
         // Save the warp reduction result, that is the scan result
         // for last element in each warp


Prevent waking up threads that haven't gone to sleep yet.

svn path=/trunk/KDE/kdepim/akonadi/server/; revision=590592

--- server/src/dbusthread.cpp
+++ server/src/dbusthread.cpp
@@ -18,6 +18,7 @@
  ***************************************************************************/

 #include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
 #include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusMessage>

@@ -74,9 +75,10 @@

   DBusThreadManager *manager = DBusThreadManager::self();

+  mMutex.lock();
+
   QCoreApplication::instance()->postEvent( manager, event );

-  mMutex.lock();
   mCondition.wait( &mMutex );
   mMutex.unlock();

@@ -87,7 +89,9 @@
 {
   mData = result;

+  mMutex.lock();
   mCondition.wakeAll();
+  mMutex.unlock();
 }

 DBusThreadManager* DBusThreadManager::mSelf = 0;
@@ -134,7 +138,8 @@
 DBusThreadProxy::DBusThreadProxy( DBusThread *thread, const QDBusMessage &message )
   : mThread( thread )
 {
-  QDBusConnection::sessionBus().callWithCallback( message, this, SLOT( dbusReply( const QDBusMessage& ) ) );
+  if ( !QDBusConnection::sessionBus().callWithCallback( message, this, SLOT( dbusReply( const QDBusMessage& ) ) ) )
+    emit dbusReply( message.createError( QLatin1String("Call Error"), QLatin1String("callWithCallback() failed in DBusThreadProxy") ) );
 }

 void DBusThreadProxy::dbusReply( const QDBusMessage &message )


Don't ever bring main trace window in front of floating windows

--- src/gpuvis.cpp
+++ src/gpuvis.cpp
@@ -29,7 +29,6 @@
 #include <unordered_set>
 #include <functional>
 #include <sys/stat.h>
-
 #define SDL_MAIN_HANDLED
 #include <SDL.h>

@@ -2597,7 +2596,12 @@
     uint32_t count = 0;
     TraceEvents::tracestatus_t status = m_trace_events.get_load_status( &count );

-    ImGui::Begin( m_title.c_str(), &m_open, ImGuiWindowFlags_MenuBar );
+    ImGui::Begin( m_title.c_str(), &m_open,
+                  ImGuiWindowFlags_MenuBar |
+                  ImGuiWindowFlags_NoResize |
+                  ImGuiWindowFlags_NoCollapse |
+                  ImGuiWindowFlags_NoTitleBar |
+                  ImGuiWindowFlags_NoBringToFrontOnFocus );

     s_app().render_menu( "menu_tracewin" );


uavcan_linux::makeApplicationID() - instance_id made optional

--- libuavcan_drivers/linux/include/uavcan_linux/system_utils.hpp
+++ libuavcan_drivers/linux/include/uavcan_linux/system_utils.hpp
@@ -138,11 +138,11 @@
  * It takes the following inputs:
  *  - Unique machine ID
  *  - Node name string (e.g. "org.uavcan.linux_app.dynamic_node_id_server")
- *  - Instance ID byte, e.g. node ID
+ *  - Instance ID byte, e.g. node ID (optional)
  */
 std::array<std::uint8_t, 16> makeApplicationID(const MachineIDReader::MachineID& machine_id,
                                                const std::string& node_name,
-                                               const std::uint8_t instance_id)
+                                               const std::uint8_t instance_id = 0)
 {
     union HalfID
     {


From Ilka:
- call fEditor->DeleteEditors() to clean up all attribute editors connected
  to the canvas before to delete the real canvas (TCanvas)

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

--- gui/src/TRootCanvas.cxx
+++ gui/src/TRootCanvas.cxx
@@ -1,4 +1,4 @@
-// @(#)root/gui:$Name:  $:$Id: TRootCanvas.cxx,v 1.44 2004/05/11 12:01:10 brun Exp $
+// @(#)root/gui:$Name:  $:$Id: TRootCanvas.cxx,v 1.45 2004/06/08 10:49:02 rdm Exp $
 // Author: Fons Rademakers   15/01/98

 /*************************************************************************
@@ -778,9 +778,11 @@
                      fCanvas->Print();
                      break;
                   case kFileCloseCanvas:
+                     if (fEditor) fEditor->DeleteEditors();
                      SendCloseMessage();
                      break;
                   case kFileQuit:
+                     if (fEditor) fEditor->DeleteEditors();
                      delete this;
                      gApplication->Terminate(0);
                      break;
@@ -1172,7 +1174,7 @@
 //______________________________________________________________________________
 void TRootCanvas::CreateEditor()
 {
-   // Create editor
+   // Create editor.

    fEditorFrame->SetEditable();
    gPad = Canvas();


Now reads from the directory structure rather than the single file structure.

--- applications/printThetas.cxx
+++ applications/printThetas.cxx
@@ -35,9 +35,10 @@

 const char useage [] =
   "Usage:\n"
-  "    printThetas ModelSnapshotFile\n"
+  "    printThetas TopDirectory\n"
   "\n"
-  "ModelSnapshotFile can be \"-\" or read from standard input.\n";
+  "TopDirectory is the directory containing the model_output/, experimental_results/\n"
+  "and statistical_analysis/directories. It can also be \"-\" to read from standard input.\n";

 #include <iostream> // cout, cin
 #include <fstream> // ifstream, ofstream
@@ -45,9 +46,9 @@
 #include "GaussianProcessEmulator.h"

 int main(int argc, char ** argv) {
-  char const * inputFile = NULL;
+  char const * TopDirectory = NULL;
   if (argc > 1) {
-    inputFile = argv[1];
+    TopDirectory = argv[1];
   } else {
     std::cerr << useage << '\n';
     return EXIT_FAILURE;
@@ -56,19 +57,20 @@
   madai::GaussianProcessEmulator gpe;
   std::ostream & output = std::cout;

-  std::istream * input = & std::cin;
-  std::ifstream inputFileStream;
-
-  if (0 != strcmp(inputFile, "-")) {
-    inputFileStream.open(inputFile);
-    if (! inputFileStream.good())
-      std::cerr << "Error (1) loading file " << inputFile << '\n';
-    input = & inputFileStream;
+  if (0 == strcmp(TopDirectory, "-")) {
+    if (! gpe.Load( std::cin ) ){
+      std::cerr << "Error (2) loading emulator from cin\n";
+      return EXIT_FAILURE;
+    }
+  } else {
+    std::string PCAFile(TopDirectory);
+    PCAFile += "/statistical_analysis/PCADecomposition.dat";
+    if ( gpe.LoadConfiguration() != madai::Model::NO_ERROR) {
+      std::cerr << "Error (2) loading file " << PCAFile << '\n';
+      return EXIT_FAILURE;
+    }
   }
-  if (! gpe.Load(* input)) {
-    std::cerr << "Error (2) loading file " << inputFile << '\n';
-    return EXIT_FAILURE;
-  }
+
   if (gpe.GetStatus() != madai::GaussianProcessEmulator::READY) {
     std::cerr << "Error (3) loading file " << inputFile << '\n';
     return EXIT_FAILURE;


Do not mark 3C.2a and 3C.2a1 on H1 geo epi ts, it must have lower priority.

--- cc/geographic-settings.cc
+++ cc/geographic-settings.cc
@@ -45,8 +45,8 @@

     "?": "========== H3",
     "3C.3":           {"fill": "cornflowerblue",  "outline": "black", "outline_width": 0},
-    "3C.2A":             {"fill": "red",             "outline": "black", "outline_width": 0},
-    "3C.2A1":            {"fill": "#ffab91",         "outline": "black", "outline_width": 0},
+    "x 3C.2A":             {"fill": "red",             "outline": "black", "outline_width": 0},
+    "x 3C.2A1":            {"fill": "#ffab91",         "outline": "black", "outline_width": 0},
     "3C.2A1A":           {"fill": "#E040FB",         "outline": "black", "outline_width": 0},
     "3C.2A1B":           {"fill": "#CD5C5C",         "outline": "black", "outline_width": 0},
     "3C.2A2":            {"fill": "#EEB422",         "outline": "black", "outline_width": 0},


[functions.l2] group traits

[functions.l2] group traits

--- dune/gdt/functionals/l2.hh
+++ dune/gdt/functionals/l2.hh
@@ -21,9 +21,13 @@
 namespace Functionals {

+// forwards
 template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp = typename SpaceImp::GridViewType,
           class LocalEvaluationType                                              = LocalEvaluation::Product<FunctionType>>
 class L2Volume;
+
+template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp = typename SpaceImp::GridViewType>
+class L2Face;

 namespace internal {
@@ -52,94 +56,12 @@
 }; // class L2VolumeTraits

-} // namespace internal
-
-
-template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp, class LocalEvaluationType>
-class L2Volume : public Functionals::VectorBased<internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp,
-                                                                          GridViewImp, LocalEvaluationType>>,
-                 public SystemAssembler<SpaceImp, GridViewImp, SpaceImp>
-{
-  typedef Functionals::VectorBased<internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp, GridViewImp,
-                                                            LocalEvaluationType>> FunctionalBaseType;
-  typedef SystemAssembler<SpaceImp, GridViewImp, SpaceImp> AssemblerBaseType;
-
-  typedef LocalFunctional::Codim0Integral<LocalEvaluationType> LocalFunctionalType;
-  typedef LocalAssembler::Codim0Vector<LocalFunctionalType> LocalAssemblerType;
-
-public:
-  typedef internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp, GridViewImp, LocalEvaluationType> Traits;
-  typedef typename Traits::VectorType VectorType;
-  typedef typename Traits::SpaceType SpaceType;
-  typedef typename Traits::GridViewType GridViewType;
-
-  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc, const GridViewType& grd_vw)
-    : FunctionalBaseType(vec, spc, grd_vw)
-    , AssemblerBaseType(spc, grd_vw)
-    , function_(function)
-    , local_functional_(function_)
-    , local_assembler_(local_functional_)
-  {
-    setup();
-  }
-
-  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc)
-    : FunctionalBaseType(vec, spc)
-    , AssemblerBaseType(spc)
-    , function_(function)
-    , local_functional_(function_)
-    , local_assembler_(local_functional_)
-  {
-    setup();
-  }
-
-  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc,
-           const LocalFunctionalType localFunctional)
-    : FunctionalBaseType(vec, spc)
-    , AssemblerBaseType(spc)
-    , function_(function)
-    , local_functional_(localFunctional)
-    , local_assembler_(local_functional_)
-  {
-    setup();
-  }
-  virtual void assemble() override final
-  {
-    AssemblerBaseType::assemble();
-  }
-
-private:
-  void setup()
-  {
-    this->add(local_assembler_, this->vector());
-  }
-
-  const FunctionType& function_;
-  const LocalFunctionalType local_functional_;
-  const LocalAssemblerType local_assembler_;
-}; // class L2Volume
-
-
-template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp = typename SpaceImp::GridViewType>
-class L2Face;
-
-
-namespace internal {
-
-
 template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp>
 class L2FaceTraits
 {
-  static_assert(std::is_base_of<Stuff::LocalizableFunctionInterface<
-                                    typename FunctionType::EntityType, typename FunctionType::DomainFieldType,
-                                    FunctionType::dimDomain, typename FunctionType::RangeFieldType,
-                                    FunctionType::dimRange, FunctionType::dimRangeCols>,
-                                FunctionType>::value,
+  static_assert(Stuff::is_localizable_function<FunctionType>::value,
                 "FunctionType has to be derived from Stuff::LocalizableFunctionInterface!");
-  static_assert(std::is_base_of<SpaceInterface<typename SpaceImp::Traits, SpaceImp::dimDomain, SpaceImp::dimRange,
-                                               SpaceImp::dimRangeCols>,
-                                SpaceImp>::value,
-                "SpaceImp has to be derived from SpaceInterface!");
+  static_assert(is_space<SpaceImp>::value, "SpaceImp has to be derived from SpaceInterface!");

 public:
   typedef L2Face<FunctionType, VectorImp, SpaceImp, GridViewImp> derived_type;
@@ -153,6 +75,71 @@
 } // namespace internal

+template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp, class LocalEvaluationType>
+class L2Volume : public Functionals::VectorBased<internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp,
+                                                                          GridViewImp, LocalEvaluationType>>,
+                 public SystemAssembler<SpaceImp, GridViewImp, SpaceImp>
+{
+  typedef Functionals::VectorBased<internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp, GridViewImp,
+                                                            LocalEvaluationType>> FunctionalBaseType;
+  typedef SystemAssembler<SpaceImp, GridViewImp, SpaceImp> AssemblerBaseType;
+
+  typedef LocalFunctional::Codim0Integral<LocalEvaluationType> LocalFunctionalType;
+  typedef LocalAssembler::Codim0Vector<LocalFunctionalType> LocalAssemblerType;
+
+public:
+  typedef internal::L2VolumeTraits<FunctionType, VectorImp, SpaceImp, GridViewImp, LocalEvaluationType> Traits;
+  typedef typename Traits::VectorType VectorType;
+  typedef typename Traits::SpaceType SpaceType;
+  typedef typename Traits::GridViewType GridViewType;
+
+  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc, const GridViewType& grd_vw)
+    : FunctionalBaseType(vec, spc, grd_vw)
+    , AssemblerBaseType(spc, grd_vw)
+    , function_(function)
+    , local_functional_(function_)
+    , local_assembler_(local_functional_)
+  {
+    setup();
+  }
+
+  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc)
+    : FunctionalBaseType(vec, spc)
+    , AssemblerBaseType(spc)
+    , function_(function)
+    , local_functional_(function_)
+    , local_assembler_(local_functional_)
+  {
+    setup();
+  }
+
+  L2Volume(const FunctionType& function, VectorType& vec, const SpaceType& spc,
+           const LocalFunctionalType localFunctional)
+    : FunctionalBaseType(vec, spc)
+    , AssemblerBaseType(spc)
+    , function_(function)
+    , local_functional_(localFunctional)
+    , local_assembler_(local_functional_)
+  {
+    setup();
+  }
+  virtual void assemble() override final
+  {
+    AssemblerBaseType::assemble();
+  }
+
+private:
+  void setup()
+  {
+    this->add(local_assembler_, this->vector());
+  }
+
+  const FunctionType& function_;
+  const LocalFunctionalType local_functional_;
+  const LocalAssemblerType local_assembler_;
+}; // class L2Volume
+
+
 template <class FunctionType, class VectorImp, class SpaceImp, class GridViewImp>
 class L2Face : public Functionals::VectorBased<internal::L2FaceTraits<FunctionType, VectorImp, SpaceImp, GridViewImp>>,
                public SystemAssembler<SpaceImp, GridViewImp, SpaceImp>


[operators.base] MatrixBasedBase -> MatrixBased

--- dune/gdt/operators/base.hh
+++ dune/gdt/operators/base.hh
@@ -6,8 +6,7 @@
 #ifndef DUNE_GDT_OPERATORS_BASE_HH
 #define DUNE_GDT_OPERATORS_BASE_HH

-#include <dune/gdt/assembler/system.hh>
-#include <dune/gdt/assembler/local/codim0.hh>
+#include <dune/stuff/la/solver.hh>

 #include "interfaces.hh"

@@ -17,26 +16,22 @@

 template <class Traits>
-class MatrixBasedBase : public AssemblableOperatorInterface<Traits>
+class MatrixBased : public AssemblableOperatorInterface<Traits>
 {
-  typedef AssemblableOperatorInterface<Traits> InterfaceType;
+  typedef AssemblableOperatorInterface<Traits> BaseType;

 public:
-  typedef typename Traits::GridViewType GridViewType;
-  typedef typename Traits::SourceSpaceType SourceSpaceType;
-  typedef typename Traits::RangeSpaceType RangeSpaceType;
-  typedef typename Traits::MatrixType MatrixType;
-
-  typedef typename MatrixType::ScalarType FieldType;
+  using typename BaseType::GridViewType;
+  using typename BaseType::SourceSpaceType;
+  using typename BaseType::RangeSpaceType;
+  using typename BaseType::MatrixType;

 private:
   typedef Stuff::LA::Solver<MatrixType> LinearSolverType;

 public:
-  using typename InterfaceType::EntityType;
-
-  MatrixBasedBase(MatrixType& matrix, const SourceSpaceType& source_space, const RangeSpaceType& range_space,
-                  const GridViewType& grid_view)
+  MatrixBased(MatrixType& matrix, const SourceSpaceType& source_space, const RangeSpaceType& range_space,
+              const GridViewType& grid_view)
     : matrix_(matrix)
     , source_space_(source_space)
     , range_space_(range_space)
@@ -45,7 +40,7 @@
   {
   }

-  MatrixBasedBase(MatrixType& matrix, const SourceSpaceType& source_space, const RangeSpaceType& range_space)
+  MatrixBased(MatrixType& matrix, const SourceSpaceType& source_space, const RangeSpaceType& range_space)
     : matrix_(matrix)
     , source_space_(source_space)
     , range_space_(range_space)
@@ -54,7 +49,7 @@
   {
   }

-  MatrixBasedBase(MatrixType& matrix, const SourceSpaceType& source_space)
+  MatrixBased(MatrixType& matrix, const SourceSpaceType& source_space)
     : matrix_(matrix)
     , source_space_(source_space)
     , range_space_(source_space_)
@@ -121,7 +116,7 @@
   const RangeSpaceType& range_space_;
   const GridViewType& grid_view_;
   bool assembled_;
-}; // class MatrixBasedBase
+}; // class MatrixBased

 } // namespace Operators


Use ThinU and ThinV when computing SVD - this significantly speeds up computation time without impacting the result.

--- compressor/src/Optimizer.cpp
+++ compressor/src/Optimizer.cpp
@@ -156,8 +156,8 @@
     }

     /* Solve for the best colors */
-    Eigen::JacobiSVD<Eigen::MatrixXf> svd(a, Eigen::ComputeFullU |
-                                          Eigen::ComputeFullV);
+    Eigen::JacobiSVD<Eigen::MatrixXf> svd(a, Eigen::ComputeThinU |
+                                          Eigen::ComputeThinV);
     Eigen::VectorXf optimal_red = svd.solve(red);
     Eigen::VectorXf optimal_green = svd.solve(green);
     Eigen::VectorXf optimal_blue = svd.solve(blue);


v3dView better supports v3dDataImage

v3dView better supports v3dDataImage

--- v3dView/v3dView.cpp
+++ v3dView/v3dView.cpp
@@ -646,14 +646,20 @@
     }
     else
 #endif
-    if(vtkImageData *dataset = dynamic_cast<vtkImageData*>((vtkDataObject *)(data->data()))) {
-        d->collection->SyncSetInput(dataset);
-    }
-    else {
+      if (data->description()=="v3dDataImage") {
+	  if(vtkImageData *dataset = dynamic_cast<vtkImageData*>((vtkDataObject *)(data->data()))) {
+	    //d->collection->SyncSetInput(dataset);
+	    d->view2DAxial->SetInput(dataset);
+	    d->view2DSagittal->SetInput(dataset);
+	    d->view2DCoronal->SetInput(dataset);
+	    d->view3D->SetInput(dataset);
+	  }
+      }
+      else {
         dtkAbstractView::setData(data);
         return;
-    }
-
+      }
+
     d->data = data;

     if (data->hasMetaData("PatientName")){


Fix for issue in 'mouse clicked' event generation introduced by Window doing input propagation.

--- cegui/src/CEGUISystem.cpp
+++ cegui/src/CEGUISystem.cpp
@@ -837,10 +837,16 @@
     if (!ma.window)
         return false;

+    // store original window becase we re-use the event args.
+    Window* const tgt_wnd = ma.window;
+
     // send 'up' input to the window
     ma.window->onMouseButtonUp(ma);
     // store whether the 'up' part was handled so we may reuse the EventArgs
     const uint upHandled = ma.handled;
+
+    // restore target window (because Window::on* may have propagated input)
+    ma.window = tgt_wnd;

     // send MouseClicked event if the requirements for that were met
     if (d_generateMouseClickEvents &&


Additional fix to the issue of setting coefficient of friction for a deformable tire

--- src/chrono_vehicle/wheeled_vehicle/tire/ChDeformableTire.cpp
+++ src/chrono_vehicle/wheeled_vehicle/tire/ChDeformableTire.cpp
@@ -94,10 +94,11 @@

     // Create the contact material
     m_contact_mat = std::make_shared<ChMaterialSurfaceDEM>();
+    m_contact_mat->SetFriction(m_friction);
+    m_contact_mat->SetRestitution(m_restitution);
+
     if (m_use_mat_props) {
         m_contact_mat->SetYoungModulus(m_young_modulus);
-        m_contact_mat->SetFriction(m_friction);
-        m_contact_mat->SetRestitution(m_restitution);
         m_contact_mat->SetPoissonRatio(m_poisson_ratio);

         system->UseMaterialProperties(true);


`Universe::activate`: cleaning up code.

`Universe::activate`: cleaning up code.

--- code/ylikuutio/ontology/universe.cpp
+++ code/ylikuutio/ontology/universe.cpp
@@ -681,18 +681,24 @@
                 yli::ontology::Camera* const camera = dynamic_cast<yli::ontology::Camera*>(entity);
                 yli::ontology::Console* const console = dynamic_cast<yli::ontology::Console*>(entity);

-                if (world == nullptr && scene == nullptr && camera == nullptr && console == nullptr)
+                uint32_t number_of_entity_types = 0;
+                number_of_entity_types += world != nullptr ? 1 : 0;
+                number_of_entity_types += scene != nullptr ? 1 : 0;
+                number_of_entity_types += camera != nullptr ? 1 : 0;
+                number_of_entity_types += console != nullptr ? 1 : 0;
+
+                if (number_of_entity_types != 1)
                 {
                     // The named `Entity` is neither a `World`, a `Scene`, a `Camera`, nor a `Console`.
                     return nullptr;
                 }

-                if (world != nullptr && scene == nullptr && camera == nullptr && console == nullptr)
+                if (world != nullptr)
                 {
                     // The named `Entity` is a `World`.
                     universe->set_active_world(world);
                 }
-                else if (scene != nullptr && world == nullptr && camera == nullptr && console == nullptr)
+                else if (scene != nullptr)
                 {
                     // The named `Entity` is a `Scene`.
                     yli::ontology::World* const world_parent_of_scene = scene->get_world_parent();
@@ -703,12 +709,12 @@
                         universe->set_active_scene(scene);
                     }
                 }
-                else if (camera != nullptr && world == nullptr && scene == nullptr && console == nullptr)
+                else if (camera != nullptr)
                 {
                     // The named `Entity` is a `Camera`.
                     universe->set_active_camera(camera);
                 }
-                else if (console != nullptr && world == nullptr && scene == nullptr && camera == nullptr)
+                else if (console != nullptr)
                 {
                     // The named `Entity` is a `Console`.
                     if (universe->get_active_console() != nullptr)


Fix shader paths

Fix shader paths

--- src/Rendering/renderer.cpp
+++ src/Rendering/renderer.cpp
@@ -9,7 +9,7 @@
     glewInit();

     //Create programs
-    create_program("shaders/triangles.vert","shaders/triangles.frag","triangles");
+    create_program("../shaders/triangles.vert","../shaders/triangles.frag","triangles");

 }


compileBroker: remove unnecessary code in initialization of compilers

--- src/share/vm/compiler/compileBroker.cpp
+++ src/share/vm/compiler/compileBroker.cpp
@@ -795,11 +795,6 @@
 #ifdef GRAAL
   GraalCompiler* graal = new GraalCompiler();
 #endif
-#if defined(COMPILERGRAAL) && !defined(TIERED)
-  _compilers[0] = graal;
-  c1_count = 0;
-  c2_count = 0;
-#endif // COMPILERGRAAL && !TIERED

 #ifdef COMPILER1
   if (c1_count > 0) {


Fix incorrect uname usage.

Fix incorrect uname usage.

The POSIX function uname() can return any non-negative value for success.
- Example: Solaris 10 returns 1 on success.
See: http://pubs.opengroup.org/onlinepubs/009695399/functions/uname.html

Change-Id: Ic3d51f94a31d8b562b28a2d09df3d31b04c77dc8
Reviewed-by: Oswald Buddenhagen <6a8868beda3e139b5ac22b2534a23d3e6ba81819@digia.com>
(cherry picked from qtbase/e97c37a37ac27f9ab901e974f0a882e81ffd571d)
Reviewed-by: Daniel Teske <d8a411aec9a206efedb4d45b75fe8d13f1e2b628@digia.com>

--- src/shared/proparser/qmakeevaluator.cpp
+++ src/shared/proparser/qmakeevaluator.cpp
@@ -1026,7 +1026,7 @@
 # endif
 #elif defined(Q_OS_UNIX)
     struct utsname name;
-    if (!uname(&name)) {
+    if (uname(&name) != -1) {
         vars[ProKey("QMAKE_HOST.os")] << ProString(name.sysname);
         vars[ProKey("QMAKE_HOST.name")] << ProString(QString::fromLocal8Bit(name.nodename));
         vars[ProKey("QMAKE_HOST.version")] << ProString(name.release);


Update rx-observable.hpp

Update rx-observable.hpp

--- Rx/v2/src/rxcpp/rx-observable.hpp
+++ Rx/v2/src/rxcpp/rx-observable.hpp
@@ -2925,7 +2925,7 @@
         \snippet output.txt range sample
     */
     template<class T>
-    static auto range(T first = 0, T last = std::numeric_limits<T>::max(), ptrdiff_t step = 1)
+    static auto range(T first = 0, T last = std::numeric_limits<T>::max(), std::ptrdiff_t step = 1)
         -> decltype(rxs::range<T>(first, last, step, identity_current_thread())) {
         return      rxs::range<T>(first, last, step, identity_current_thread());
     }
@@ -2952,13 +2952,13 @@
         \snippet output.txt subscribe_on range sample
     */
     template<class T, class Coordination>
-    static auto range(T first, T last, ptrdiff_t step, Coordination cn)
+    static auto range(T first, T last, std::ptrdiff_t step, Coordination cn)
         -> decltype(rxs::range<T>(first, last, step, std::move(cn))) {
         return      rxs::range<T>(first, last, step, std::move(cn));
     }
     /// Returns an observable that sends values in the range ```first```-```last``` by adding 1 to the previous value. The values are sent on the specified scheduler.
     ///
-    /// \see       rxcpp::observable<void,void>#range(T first, T last, ptrdiff_t step, Coordination cn)
+    /// \see       rxcpp::observable<void,void>#range(T first, T last, std::ptrdiff_t step, Coordination cn)
     template<class T, class Coordination>
     static auto range(T first, T last, Coordination cn)
         -> decltype(rxs::range<T>(first, last, std::move(cn))) {
@@ -2966,7 +2966,7 @@
     }
     /// Returns an observable that infinitely (until overflow) sends values starting from ```first```. The values are sent on the specified scheduler.
     ///
-    /// \see       rxcpp::observable<void,void>#range(T first, T last, ptrdiff_t step, Coordination cn)
+    /// \see       rxcpp::observable<void,void>#range(T first, T last, std::ptrdiff_t step, Coordination cn)
     template<class T, class Coordination>
     static auto range(T first, Coordination cn)
         -> decltype(rxs::range<T>(first, std::move(cn))) {


ProParser: Plug raw data leak

ProParser: Plug raw data leak

QProcessEnvironment caches keys, so we must not pass it QStrings created with
fromRawData()

Task-number: QTCREATORBUG-9142
Change-Id: I29fade02f3bc4110fafb1b04d44f2e653951a2ae
Reviewed-by: Oswald Buddenhagen <6a8868beda3e139b5ac22b2534a23d3e6ba81819@digia.com>

--- src/shared/proparser/qmakeevaluator.cpp
+++ src/shared/proparser/qmakeevaluator.cpp
@@ -453,7 +453,7 @@
             break; }
         case TokEnvVar: {
             const ProString &var = getStr(tokPtr);
-            const ProString &val = ProString(m_option->getEnv(var.toQString(m_tmp1)));
+            const ProString &val = ProString(m_option->getEnv(var.toQString()));
             debugMsg(2, "env var %s => %s", dbgStr(var), dbgStr(val));
             addStr(val, ret, pending, joined);
             break; }


fix: missing deinit of temporary BSON object

--- src/components/protocol_handler/src/protocol_handler_impl.cc
+++ src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -1537,6 +1537,7 @@
       bson_object_put_string(
           &start_session_ack_params, strings::video_codec, codec);
     }
+    bson_object_deinitialize(&req_param);
   }

 #ifdef ENABLE_SECURITY


Check that the return type of function definition matches its prototype.

Doesn't fix any testcases, but fixes a FINISHME.

--- ast_to_hir.cpp
+++ ast_to_hir.cpp
@@ -1864,7 +1864,14 @@
 	       iter_b.next();
 	    }

-	    /* FINISHME: Compare return types. */
+	    if (sig->return_type != return_type) {
+	       YYLTYPE loc = this->get_location();
+
+	       _mesa_glsl_error(& loc, state,
+				"function `%s' return type doesn't match "
+				"prototype",
+				name);
+	    }

 	    if (is_definition && (sig->definition != NULL)) {
 	       YYLTYPE loc = this->get_location();


Throw an exception when reducing an empty blocking_observable.

--- Rx/v2/src/rxcpp/rx-observable.hpp
+++ Rx/v2/src/rxcpp/rx-observable.hpp
@@ -281,19 +281,23 @@
         rxu::maybe<T> result;
         composite_subscription cs;
         subscribe(cs, [&](T v){result.reset(v); cs.unsubscribe();});
-        if (result.empty()) abort();
+        if (result.empty()) throw std::runtime_error("No elements");
         return result.get();
     }

     T last() const {
         rxu::maybe<T> result;
         subscribe([&](T v){result.reset(v);});
-        if (result.empty()) abort();
+        if (result.empty()) throw std::runtime_error("No elements");
         return result.get();
     }

     int count() const {
-        return source.count().as_blocking().last();
+        rxu::maybe<T> result;
+        source.count().as_blocking().subscribe(
+            [&](T v){result.reset(v);},
+            [](std::exception_ptr){result.reset(0);});
+        return result.get();
     }
     T sum() const {
         return source.sum().as_blocking().last();


[Android] LoopVolume is affected by GlobalVolume. Default LoopVolume to 1.0. Respect SoundOn(false).

--- src/sharksound/android/android_sound.cc
+++ src/sharksound/android/android_sound.cc
@@ -16,6 +16,7 @@
 AndroidSound::AndroidSound(SoundController *sound_controller)
     : Sound(sound_controller),
       loop_instance_(NULL),
+      loop_volume_(1.f),
       sl_engine_itf_(NULL) {
 }

@@ -58,6 +59,9 @@
 #pragma mark - Sound

 bool AndroidSound::Play(float volume, float position) {
+  if (!on_) {
+    return false;
+  }
   AndroidSoundInstance *instance = NULL;
   for (auto i = sound_instances_.begin(); i != sound_instances_.end(); i++) {
     if (!(*i)->is_busy()) {
@@ -72,13 +76,16 @@
     }
   }
   if (instance) {
-    instance->Play(volume, position);
+    instance->Play(volume * global_volume_, position);
     return true;
   }
   return false;
 }

 bool AndroidSound::PlayLoop() {
+  if (!on_) {
+    return false;
+  }
   if (!loop_instance_) {
     loop_instance_ = CreateNewInstance();
   }
@@ -111,7 +118,7 @@
   if (!loop_instance_) {
     return;
   }
-  loop_instance_->SetVolume(volume);
+  loop_instance_->SetVolume(volume * global_volume_);
 }

 float AndroidSound::LoopVolume() {


shrpx: Lowercase x-forwarded-proto

shrpx: Lowercase x-forwarded-proto

--- src/shrpx_http_downstream_connection.cc
+++ src/shrpx_http_downstream_connection.cc
@@ -128,7 +128,7 @@
       if(util::strifind((*i).second.c_str(), "upgrade")) {
         connection_upgrade = true;
       }
-    } else if(util::strieq((*i).first.c_str(), "X-Forwarded-Proto") ||
+    } else if(util::strieq((*i).first.c_str(), "x-forwarded-proto") ||
        util::strieq((*i).first.c_str(), "keep-alive") ||
        util::strieq((*i).first.c_str(), "proxy-connection")) {
       continue;


adapted main to use FrameSelectorFactory

--- src/StreamDecoder/main.cpp
+++ src/StreamDecoder/main.cpp
@@ -23,7 +23,8 @@

 #include <iostream>
 #include <sstream>
-#include "frame_selector.h"
+#include "hdf5_frame_selector.h"
+#include "frame_selector_factory.h"
 #include "image_view.h"
 #include <vector>
 #include "../ProcessControl/controller.h"
@@ -48,12 +49,13 @@

     } else if(argc == 3){

-        FrameSelector pipeline(argv[1]);
+        FrameSelectorFactory frame_selector_factory(argv[1]);
+        FrameSelector* pipeline = frame_selector_factory.GetFrameSelector();
         // read one image
         unsigned int index = 0;
         stringstream string_index(argv[2]);
         string_index >> index;
-        Image result_image = pipeline.ReadImage(index);
+        Image result_image = pipeline->ReadImage(index);

         ImageView image_viewer;
         image_viewer.ShowImage(result_image, 0);


small test changes

small test changes

--- Rx/v2/test/operators/flat_map.cpp
+++ Rx/v2/test/operators/flat_map.cpp
@@ -105,9 +105,8 @@
             std::mutex lock;
             std::condition_variable wake;

-            rx::composite_subscription lifetime;
-
             auto sc = rxsc::make_event_loop();
+            //auto sc = rxsc::make_new_thread();
             auto so = rxsub::synchronize_observable(sc);

             int c = 0;
@@ -122,7 +121,12 @@
                                 .flat_map(
                                     [&c, sc, z](int x){
                                         return rxs::range(x, z, 1, sc)
-                                            .filter([&c, z, x](int y){++c; return x*x + y*y == z*z;})
+                                            .filter([&c, z, x](int y){
+                                                ++c;
+                                                if (x*x + y*y == z*z) {
+                                                    return true;}
+                                                else {
+                                                    return false;}})
                                             .map([z, x](int y){return std::make_tuple(x, y, z);})
                                             // forget type to workaround lambda deduction bug on msvc 2013
                                             .as_dynamic();},
@@ -135,21 +139,19 @@
             triples
                 .take(tripletCount)
                 .subscribe(
-                    lifetime,
-                    rxu::apply_to([&ct](int x,int y,int z){++ct;}),
+                    rxu::apply_to([&ct](int x,int y,int z){
+                        ++ct;}),
                     [](std::exception_ptr){abort();},
                     [&](){
-                        lifetime.unsubscribe();
                         wake.notify_one();});

             std::unique_lock<std::mutex> guard(lock);
-            wake.wait(guard, [&](){return !lifetime.is_subscribed();});
+            wake.wait(guard);

             auto finish = clock::now();
             auto msElapsed = duration_cast<milliseconds>(finish.time_since_epoch()) -
                    duration_cast<milliseconds>(start.time_since_epoch());
             std::cout << "pythagorian range : " << n << " subscribed, " << c << " filtered to, " << ct << " triplets, " << msElapsed.count() << "ms elapsed " << std::endl;
-
         }
     }
 }


Fix assignment operators: *=, /=, +=, -=.

Basically, replace everything different from operator_assign other
than the creation of the rhs value from the lvalue and rvalue with the
contents of operator_assign.  Fixes a segfault in
CorrectSwizzle1.frag, and fixes parser10.frag.

--- ast_to_hir.cpp
+++ ast_to_hir.cpp
@@ -607,32 +607,56 @@
       temp_rhs = new ir_expression(operations[this->oper], type,
 				   op[0], op[1]);

-      /* FINISHME: Check that the LHS is assignable. */
-
-      /* We still have to test that the LHS and RHS have matching type.  For
-       * example, the following GLSL code should generate a type error:
-       *
-       *    mat4 m; vec4 v; m *= v;
-       *
-       * The type of (m*v) is a vec4, but the type of m is a mat4.
-       *
-       * FINISHME: Is multiplication between a matrix and a vector the only
-       * FINISHME: case that resuls in mismatched types?
-       */
-      /* FINISHME: Check that the LHS and RHS have matching types. */
+      /* FINISHME: This is copied from ast_assign above.  It should
+       * FINISHME: probably be consolidated.
+       */
+      error_emitted = ((op[0]->type == glsl_error_type)
+		       || (temp_rhs->type == glsl_error_type));
+
+      type = op[0]->type;
+      if (!error_emitted) {
+	 YYLTYPE loc;
+
+	 /* FINISHME: This does not handle 'foo.bar.a.b.c[5].d = 5' */
+	 loc = this->subexpressions[0]->get_location();
+	 if (op[0]->mode != ir_op_dereference) {
+	    _mesa_glsl_error(& loc, state, "invalid lvalue in assignment");
+	    error_emitted = true;
+
+	    type = glsl_error_type;
+	 } else {
+	    const struct ir_dereference *const ref =
+	       (struct ir_dereference *) op[0];
+	    const struct ir_variable *const var =
+	       (struct ir_variable *) ref->var;
+
+	    if ((var != NULL)
+		&& (var->mode == ir_op_var_decl)
+		&& (var->read_only)) {
+	       _mesa_glsl_error(& loc, state, "cannot assign to read-only "
+				"variable `%s'", var->name);
+	       error_emitted = true;
+
+	       type = glsl_error_type;
+	    }
+	 }
+      }
+
+      ir_instruction *rhs = validate_assignment(op[0]->type, temp_rhs);
+      if (rhs == NULL) {
+	 type = glsl_error_type;
+	 rhs = temp_rhs;
+      }
+
+      ir_instruction *tmp = new ir_assignment(op[0], rhs, NULL);
+      instructions->push_tail(tmp);

       /* GLSL 1.10 does not allow array assignment.  However, we don't have to
        * explicitly test for this because none of the binary expression
        * operators allow array operands either.
        */

-      /* FINISHME: This is wrong.  The operation should assign to a new
-       * FINISHME: temporary.  This assignment should then be added to the
-       * FINISHME: instruction list.  Another assignment to the real
-       * FINISHME: destination should be generated.  The temporary should then
-       * FINISHME: be returned as the r-value.
-       */
-      result = new ir_assignment(op[0], temp_rhs, NULL);
+      result = op[0];
       break;
    }


Fix PeerConnectionInterfaceTest.CloseAndTestStreamsAndStates
Increase delay for waiting for AudioSource state change to 10ms to hopefully fix flake that started happening on the 24th of Mars after landing https://codereview.webrtc.org/1816143002/.

TBR=deadbeef@webrtc.org
BUG=5692

Review URL: https://codereview.webrtc.org/1844503002 .

Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#12130}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 85e46a8f1369f5518e6f853f74076f6f1a5d648e

--- api/peerconnectioninterface_unittest.cc
+++ api/peerconnectioninterface_unittest.cc
@@ -1872,7 +1872,7 @@
             remote_stream->GetVideoTracks()[0]->state());
   // Audio source state changes are posted.
   EXPECT_EQ_WAIT(MediaStreamTrackInterface::kEnded,
-                 remote_stream->GetAudioTracks()[0]->state(), 1);
+                 remote_stream->GetAudioTracks()[0]->state(), 10);
 }

 // Test that PeerConnection methods fails gracefully after


ms4525_airspeed: change start_bus from bool to int

--- src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp
+++ src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp
@@ -389,7 +389,7 @@
 #define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0]))

 int start(int i2c_bus);
-bool start_bus(int i2c_bus);
+int start_bus(int i2c_bus);
 int stop();
 int reset();

@@ -412,7 +412,7 @@

 }

-bool
+int
 start_bus(int i2c_bus)
 {
 	int fd;


Address MSC16 warning

Address MSC16 warning

--- src/abc/io/file_binary.cxx
+++ src/abc/io/file_binary.cxx
@@ -877,7 +877,7 @@
       sizeof(ibOffset) == sizeof(LARGE_INTEGER),
       "abc::io::offset_t must be the same size as LARGE_INTEGER"
    );
-   int iWhence;
+   DWORD iWhence;
    switch (sfWhence.base()) {
       // default is here just to silence compiler warnings.
       default:


Update Camera.cpp

Update Camera.cpp

--- Cameras/Cyberpunk2077/InjectableGenericCameraSystem/Camera.cpp
+++ Cameras/Cyberpunk2077/InjectableGenericCameraSystem/Camera.cpp
@@ -30,6 +30,7 @@
 #include "Defaults.h"
 #include "GameConstants.h"
 #include "Globals.h"
+#include "MessageHandler.h"

 using namespace DirectX;


make style

make style

--- fem/gridfunc.cpp
+++ fem/gridfunc.cpp
@@ -836,7 +836,7 @@

    Array<int> vdofs;
    fes->GetElementVDofs(T.ElementNo, vdofs);
-
+
    Vector loc_data;
    GetSubVector(vdofs, loc_data);
    int nip = ir.GetNPoints();


Reordered initialization of member variables

--- fem/transfer.cpp
+++ fem/transfer.cpp
@@ -47,8 +47,8 @@

 OrderTransferOperator::OrderTransferOperator(
     const FiniteElementSpace &lFESpace_, const FiniteElementSpace &hFESpace_)
-    : Operator(hFESpace_.GetVSize(), lFESpace_.GetVSize()), hFESpace(hFESpace_),
-      lFESpace(lFESpace_)
+    : Operator(hFESpace_.GetVSize(), lFESpace_.GetVSize()), lFESpace(lFESpace_),
+      hFESpace(hFESpace_)
 {
 }


Fix missing code to store SSL context in socket driver

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- src/PAL/COM/sockets/ssl/mbedTLS/ssl_connect_internal.cpp
+++ src/PAL/COM/sockets/ssl/mbedTLS/ssl_connect_internal.cpp
@@ -49,6 +49,8 @@
         }
     }

+    SOCKET_DRIVER.SetSocketSslData(sd, (void*)context);
+
 error:
     return ret;
 }


set not listening as default

set not listening as default

--- code/src/SoundRenderer.cpp
+++ code/src/SoundRenderer.cpp
@@ -13,9 +13,11 @@
     result_ = system_->init(64, FMOD_INIT_NORMAL | FMOD_INIT_3D_RIGHTHANDED, 0); FMOD::check(result_);

     //  start listening
+    sound_ = createBuffer();
     shootsRecording_ = false;
-    shouldListen_ = false;
-    sound_ = createBuffer();
+    amplitude_ = 0;
+
+    shouldListen_ = true;
     toggleListening();

     //  add massive reverb
@@ -211,8 +213,8 @@
         channel_->setVolume(0);

         //  compute mean amplitude
-        const int nsamples = 1000;
-        const int thresh = -3;
+        const int nsamples = 100;
+        const int thresh = -4;

         float data[nsamples];
         channel_->getWaveData(data, nsamples, 0);


Fixed Linux compilation *without* experimental C++11 support.

--- DynamicAudioNormalizerAPI/src/DynamicAudioNormalizer.cpp
+++ DynamicAudioNormalizerAPI/src/DynamicAudioNormalizer.cpp
@@ -35,7 +35,7 @@
 #include <cassert>
 #include <stdexcept>
 #include <cfloat>
-#include <cinttypes>
+#include <inttypes.h>

 ///////////////////////////////////////////////////////////////////////////////
 // Utility Functions


extra debugging

extra debugging

--- src/masternode-budget.cpp
+++ src/masternode-budget.cpp
@@ -1810,6 +1810,8 @@

     std::string strError = "";
     if(budget.UpdateFinalizedBudget(vote, NULL, strError)){
+        LogPrintf("CFinalizedBudget::SubmitVote  - new finalized budget vote - %s\n", vote.GetHash().ToString());
+
         budget.mapSeenFinalizedBudgetVotes.insert(make_pair(vote.GetHash(), vote));
         vote.Relay();
     } else {


feat(TorchPolicy): Add include torch

feat(TorchPolicy): Add include torch

--- Extensions/HSppTorch/Includes/hspp_torch/TorchPolicy.hpp
+++ Extensions/HSppTorch/Includes/hspp_torch/TorchPolicy.hpp
@@ -8,6 +8,7 @@
 #define HEARTHSTONEPP_TORCH_POLICY_HPP

 #include <hspp/Policies/BasicPolicy.hpp>
+#include <torch/torch.h>

 namespace HSppTorch
 {


loplugin:cstylecast: deal with those that are (technically) const_cast

Change-Id: Ice7bbdea1d0df0a92f2e1b38f033adaff2fb8b07

--- compilerplugins/clang/cstylecast.cxx
+++ compilerplugins/clang/cstylecast.cxx
@@ -18,6 +18,63 @@

 namespace {

+bool areSimilar(QualType type1, QualType type2) {
+    auto t1 = type1.getCanonicalType().getTypePtr();
+    auto t2 = type2.getCanonicalType().getTypePtr();
+    for (;;) {
+        if (t1->isPointerType()) {
+            if (!t2->isPointerType()) {
+                return false;
+            }
+            auto t1a = t1->getAs<PointerType>();
+            auto t2a = t2->getAs<PointerType>();
+            t1 = t1a->getPointeeType().getTypePtr();
+            t2 = t2a->getPointeeType().getTypePtr();
+        } else if (t1->isMemberPointerType()) {
+            if (!t2->isMemberPointerType()) {
+                return false;
+            }
+            auto t1a = t1->getAs<MemberPointerType>();
+            auto t2a = t2->getAs<MemberPointerType>();
+            if (t1a->getClass()->getCanonicalTypeInternal()
+                != t2a->getClass()->getCanonicalTypeInternal())
+            {
+                return false;
+            }
+            t1 = t1a->getPointeeType().getTypePtr();
+            t2 = t2a->getPointeeType().getTypePtr();
+        } else if (t1->isConstantArrayType()) {
+            if (!t2->isConstantArrayType()) {
+                return false;
+            }
+            auto t1a = static_cast<ConstantArrayType const *>(
+                t1->getAsArrayTypeUnsafe());
+            auto t2a = static_cast<ConstantArrayType const *>(
+                t2->getAsArrayTypeUnsafe());
+            if (t1a->getSize() != t2a->getSize()) {
+                return false;
+            }
+            t1 = t1a->getElementType().getTypePtr();
+            t2 = t2a->getElementType().getTypePtr();
+        } else if (t1->isIncompleteArrayType()) {
+            if (!t2->isIncompleteArrayType()) {
+                return false;
+            }
+            auto t1a = static_cast<IncompleteArrayType const *>(
+                t1->getAsArrayTypeUnsafe());
+            auto t2a = static_cast<IncompleteArrayType const *>(
+                t2->getAsArrayTypeUnsafe());
+            t1 = t1a->getElementType().getTypePtr();
+            t2 = t2a->getElementType().getTypePtr();
+        } else {
+            return false;
+        }
+        if (t1 == t2) {
+            return true;
+        }
+    }
+}
+
 bool hasCLanguageLinkageType(FunctionDecl const * decl) {
     return decl->isExternC() || compat::isInExternCContext(*decl);
 }
@@ -48,6 +105,8 @@
     bool VisitCStyleCastExpr(const CStyleCastExpr * expr);

 private:
+    bool isConstCast(QualType from, QualType to);
+
     bool externCFunction;
 };

@@ -56,7 +115,7 @@
         case CK_IntegralToPointer: return "reinterpret_cast";
         case CK_PointerToIntegral: return "reinterpret_cast";
         case CK_BaseToDerived: return "static_cast";
-        default: return "???";
+        default: return nullptr;
     }
 }

@@ -88,6 +147,7 @@
     if( expr->getCastKind() == CK_IntegralCast ) {
         return true;
     }
+    char const * perf = nullptr;
     if( expr->getCastKind() == CK_NoOp ) {
         QualType t1 = expr->getSubExpr()->getType();
         QualType t2 = expr->getType();
@@ -100,11 +160,17 @@
         } else {
             return true;
         }
-        if (expr->getSubExprAsWritten()->getType() != expr->getType()
-            && (!t1.isMoreQualifiedThan(t2)
-                || (t1.getUnqualifiedType().getCanonicalType().getTypePtr()
-                    != (t2.getUnqualifiedType().getCanonicalType()
-                        .getTypePtr()))))
+        if (isConstCast(
+                expr->getSubExprAsWritten()->getType(),
+                expr->getTypeAsWritten()))
+        {
+            perf = "const_cast";
+        } else if (expr->getSubExprAsWritten()->getType() != expr->getType()
+                   && (!t1.isMoreQualifiedThan(t2)
+                       || ((t1.getUnqualifiedType().getCanonicalType()
+                            .getTypePtr())
+                           != (t2.getUnqualifiedType().getCanonicalType()
+                               .getTypePtr()))))
         {
             return true;
         }
@@ -130,18 +196,43 @@
             return true;
         }
     }
+    if (perf == nullptr) {
+        perf = recommendedFix(expr->getCastKind());
+    }
+    std::string performs;
+    if (perf != nullptr) {
+        performs = std::string(" (performs: ") + perf + ")";
+    }
     report(
-        DiagnosticsEngine::Warning,
-        "c-style cast, type=%0, from=%1%2, to=%3%4, recommendedFix=%5",
+        DiagnosticsEngine::Warning, "%0 C-style cast from %1%2 to %3%4%5",
         expr->getSourceRange().getBegin())
-      << expr->getCastKind()
-      << incompFrom << expr->getSubExprAsWritten()->getType()
-      << incompTo << expr->getType()
-      << recommendedFix(expr->getCastKind())
-      << expr->getSourceRange();
+      << expr->getCastKindName() << incompFrom
+      << expr->getSubExprAsWritten()->getType() << incompTo << expr->getType()
+      << performs << expr->getSourceRange();
     return true;
 }

+bool CStyleCast::isConstCast(QualType from, QualType to) {
+    if (to->isReferenceType()
+        && to->getAs<ReferenceType>()->getPointeeType()->isObjectType())
+    {
+        if (!from->isObjectType()) {
+            return false;
+        }
+        from = compiler.getASTContext().getPointerType(from);
+        to = compiler.getASTContext().getPointerType(
+            to->getAs<ReferenceType>()->getPointeeType());
+    } else {
+        if (from->isArrayType()) {
+            from = compiler.getASTContext().getPointerType(
+                from->getAsArrayTypeUnsafe()->getElementType());
+        } else if (from->isFunctionType()) {
+            compiler.getASTContext().getPointerType(from);
+        }
+    }
+    return areSimilar(from, to);
+}
+
 loplugin::Plugin::Registration< CStyleCast > X("cstylecast");

 }


[important] Fixed memory leak on VuMeter

--- src/algorithms/VuMeter.cpp
+++ src/algorithms/VuMeter.cpp
@@ -65,6 +65,7 @@

   img_foreground.copyTo(img_output);
   img_background.copyTo(img_bgmodel);
+  cvReleaseImage(&frame);

   firstTime = false;
 }


WOF: HWP support for advanced function enablement

- Moved to "system disabled" paradigm (eg functions are ON but default)
- Moved p9_hcode_image_build to using HWP attributes from
  p9_pstate_parameter_block
- Added Pstate Auto Start to p9_pm_pstate_gpe_init to support advanced functions
  in Cronus
- Add p9_pstate_parameter_block_errors
- Added error points for #V validity.  One creates an information error log and
  disables WOF.  Others disable Pstates.
- Add error points for resonant clocking errors in p9_pstate_parameter_block
- Refactoring
- Subfunction API change for p9_setup_evid
- Added wof header verification and tested the code
- Corrected Jump value verification
- Removed the check for 0 values of N_S and N_L
- Address Gerrit comments on validation
- Added verification for VFRT header and fixed vfrt header members
- Rebase with VFRT fix (after merge)
- Added some checks in iac vdn calculation part
- IDDQ output formating updates
- Fixed VDM and WOF disable checks

Change-Id: Ia4e39e634da48742f7bf2c7740c5a2df09106ed7
Original-Change-Id: I3e62e04c7873bb6bb7c8d96e1e91d72fb044d81e
RTC: 173672
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40954
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: BRIAN D. VICTOR <b7917073e39d65dc28470b9836a55eb633564312@ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <95a9682e5bdc1ccf6e82d516bbb3db21526dc713@in.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
+++ src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
@@ -736,40 +736,34 @@
                            FAPI_SYSTEM,
                            attrVal),
              "Error from FAPI_ATTR_GET for attribute ATTR_STOP4_DISABLE");
-
     if( attrVal )
     {
         cmeFlag |= CME_STOP_4_TO_2_BIT_POS;
         sgpeFlag |= SGPE_STOP_4_TO_2_BIT_POS;
     }
-
-    FAPI_DBG("STOP_4_to_2           :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("STOP_4_to_2                   :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_STOP5_DISABLE,
                            FAPI_SYSTEM,
                            attrVal),
              "Error from FAPI_ATTR_GET for attribute ATTR_STOP5_DISABLE");
-
     if( attrVal )
     {
         cmeFlag |= CME_STOP_5_TO_4_BIT_POS;
         sgpeFlag |= SGPE_STOP_5_TO_4_BIT_POS;
     }
-
-    FAPI_DBG("STOP_5_to_4           :   %s", attrVal ? "TRUE" : "FALSE");
+    FAPI_DBG("STOP_5_to_4                   :   %s", attrVal ? "TRUE" : "FALSE");

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_STOP8_DISABLE,
                            FAPI_SYSTEM,
                            attrVal),
              "Error from FAPI_ATTR_GET for attribute ATTR_STOP8_DISABLE");
-
     if( attrVal )
     {
         cmeFlag |= CME_STOP_8_TO_5_BIT_POS;
         sgpeFlag |= SGPE_STOP_8_TO_5_BIT_POS;
     }
-
-    FAPI_DBG("STOP_8_to_5           :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("STOP_8_to_5                   :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_STOP11_DISABLE,
                            FAPI_SYSTEM,
@@ -806,7 +800,7 @@
         sgpeFlag |= SGPE_ENABLE_CHTM_TRACE_CME_BIT_POS;
     }

-    FAPI_DBG("CME CHTM Trace Enabled :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("CME CHTM Trace Enabled        :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CME_CHTM_TRACE_MEMORY_CONFIG,
                            i_procTgt,
@@ -818,12 +812,12 @@
         pSgpeHdr->g_sgpe_chtm_mem_cfg = SWIZZLE_8_BYTE(chtmVal);
     }

-    FAPI_DBG("CME CHTM Memory Config :   %016llx", chtmVal);
-
-    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SYSTEM_RESCLK_ENABLE,
-                           FAPI_SYSTEM,
+    FAPI_DBG("CME CHTM Memory Config        :   %016llx", chtmVal);
+
+    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_RESCLK_ENABLED,
+                           i_procTgt,
                            attrVal),
-             "Error from FAPI_ATTR_GET for attribute ATTR_SYSTEM_RESCLK_ENABLE" );
+             "Error from FAPI_ATTR_GET for attribute ATTR_RESCLK_ENABLED" );

     if( attrVal )
     {
@@ -831,12 +825,12 @@
         pgpeFlags.fields.resclk_enable = 1;
     }

-    FAPI_DBG("Resonant Clock Enable  :   %s", attrVal ? "TRUE" : "FALSE" );
-
-    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SYSTEM_IVRMS_ENABLED,
-                           FAPI_SYSTEM,
+    FAPI_DBG("Resonant Clock Enabled        :   %s", attrVal ? "TRUE" : "FALSE" );
+
+    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_IVRMS_ENABLED,
+                           i_procTgt,
                            attrVal),
-             "Error from FAPI_ATTR_GET for attribute ATTR_SYSTEM_IVRMS_ENABLED" );
+             "Error from FAPI_ATTR_GET for attribute ATTR_IVRMS_ENABLED" );

     if( attrVal )
     {
@@ -844,12 +838,12 @@
         pgpeFlags.fields.ivrm_enable = 1;
     }

-    FAPI_DBG("System IVRM Enable   :   %s", attrVal ? "TRUE" : "FALSE" );
-
-    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLE,
-                           FAPI_SYSTEM,
+    FAPI_DBG("IVRM Enabled                  :   %s", attrVal ? "TRUE" : "FALSE" );
+
+    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_VDM_ENABLED,
+                           i_procTgt,
                            attrVal),
-             "Error from FAPI_ATTR_GET for attribute ATTR_VDM_ENABLE" );
+             "Error from FAPI_ATTR_GET for attribute ATTR_VDM_ENABLED" );

     if( attrVal )
     {
@@ -858,33 +852,34 @@
         pgpeFlags.fields.vdm_enable = 1;
     }

-    FAPI_DBG("System VDM Enable   :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("VDM Enabled                   :   %s", attrVal ? "TRUE" : "FALSE" );
+
+    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_WOF_ENABLED,
+                           i_procTgt,
+                           attrVal),
+             "Error from FAPI_ATTR_GET for attribute ATTR_WOF_ENABLED" );
+
+    if( attrVal )
+    {
+        qmFlags |= CME_QM_FLAG_SYS_WOF_ENABLE;
+        pgpeFlags.fields.wof_enable = 1;
+    }
+
+    FAPI_DBG("WOF Enabled                   :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_FABRIC_PUMP_MODE,
                            FAPI_SYSTEM,
                            attrVal),
              "Error from FAPI_ATTR_GET for attribute ATTR_PROC_FABRIC_PUMP_MODE_MODE");
-
-    //Attribute set to 0x01 for CHIP_IS_NODE, 0x02 for CHIP_IS_GROUP
+    FAPI_DBG("Fabric Pump Attr Value :   %d", attrVal );
+    //Attribute set to 0x01 for CHIP_IS_NODE
     if( attrVal == fapi2::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_NODE )
     {
         sgpeFlag |= SGPE_PROC_FAB_PUMP_MODE_BIT_POS;
     }

-    FAPI_DBG("FAB_PUMP_MODE       :   %s", (attrVal == fapi2::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_NODE) ? "TRUE" : "FALSE" );
-
-    FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SYSTEM_WOF_ENABLED,
-                           FAPI_SYSTEM,
-                           attrVal),
-             "Error from FAPI_ATTR_GET for attribute ATTR_SYSTEM_WOF_ENABLED" );
-
-    if( attrVal )
-    {
-        qmFlags |= CME_QM_FLAG_SYS_WOF_ENABLE;
-        pgpeFlags.fields.wof_enable = 1;
-    }
-
-    FAPI_DBG("System WOF Enable   :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("Fabric Pump Mode              :   %s", (
+    attrVal == fapi2::ENUM_ATTR_PROC_FABRIC_PUMP_MODE_CHIP_IS_NODE) ? "TRUE" : "FALSE" );

     // Set PGPE Header Flags from Attributes
     FAPI_DBG(" -------------------- PGPE Flags -----------------");
@@ -899,7 +894,7 @@
         pgpeFlags.fields.occ_ipc_immed_response = 1;
     }

-    FAPI_DBG("PGPE Hcode Mode        :   %s", attrVal ? "PSTATES Enabled" : "OCC IPC Immediate Response Mode" );
+    FAPI_DBG("PGPE Hcode Mode               :   %s", attrVal ? "PSTATES Enabled" : "OCC IPC Immediate Response Mode" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_WOF_ENABLE_FRATIO,
                            FAPI_SYSTEM,
@@ -911,7 +906,7 @@
         pgpeFlags.fields.enable_fratio = 1;
     }

-    FAPI_DBG("System FRATIO ENABLE   :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("System Frequency Ratio Enable :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_WOF_ENABLE_VRATIO,
                            FAPI_SYSTEM,
@@ -923,7 +918,7 @@
         pgpeFlags.fields.enable_vratio = 1;
     }

-    FAPI_DBG("System VRATIO ENABLE   :   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("System Voltage Ratio Enable   :   %s", attrVal ? "TRUE" : "FALSE" );

     FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_WOF_VRATIO_SELECT,
                            FAPI_SYSTEM,
@@ -935,7 +930,7 @@
         pgpeFlags.fields.vratio_modifier = 1;
     }

-    FAPI_DBG("System VRATIO SELECT:   %s", attrVal ? "TRUE" : "FALSE" );
+    FAPI_DBG("System Voltage Ratio Select   :   %s", attrVal ? "FULL" : "ACTIVE CORES" );

@@ -945,12 +940,12 @@
     pSgpeHdr->g_sgpe_reserve_flags  =   SWIZZLE_4_BYTE(sgpeFlag);
     pPgpeHdr->g_pgpe_flags          =   SWIZZLE_2_BYTE(pgpeFlags.value);

-    FAPI_INF("CME Flag Value        : 0x%08x", SWIZZLE_4_BYTE(pCmeHdr->g_cme_mode_flags));
-    FAPI_INF("CME QM Flag Value     : 0x%08x", SWIZZLE_2_BYTE(pCmeHdr->g_cme_qm_mode_flags));
-    FAPI_INF("SGPE Flag Value       : 0x%08x", SWIZZLE_4_BYTE(pSgpeHdr->g_sgpe_reserve_flags));
-    FAPI_INF("SGPE Chtm Config      : 0x%016llx", SWIZZLE_8_BYTE(pSgpeHdr->g_sgpe_chtm_mem_cfg));
-    FAPI_INF("PGPE Flag Value       : 0x%08x", SWIZZLE_2_BYTE(pPgpeHdr->g_pgpe_flags));
-    FAPI_DBG(" -------------------- CME/SGPE Flags Ends ---------------==");
+    FAPI_INF("CME Flag Value                : 0x%08x", SWIZZLE_4_BYTE(pCmeHdr->g_cme_mode_flags));
+    FAPI_INF("CME QM Flag Value             : 0x%08x", SWIZZLE_2_BYTE(pCmeHdr->g_cme_qm_mode_flags));
+    FAPI_INF("SGPE Flag Value               : 0x%08x", SWIZZLE_4_BYTE(pSgpeHdr->g_sgpe_reserve_flags));
+    FAPI_INF("SGPE Chtm Config              : 0x%016llx", SWIZZLE_8_BYTE(pSgpeHdr->g_sgpe_chtm_mem_cfg));
+    FAPI_INF("PGPE Flag Value               : 0x%08x", SWIZZLE_2_BYTE(pPgpeHdr->g_pgpe_flags));
+    FAPI_DBG(" -------------------- CME/SGPE Flags Ends -----------------");

 fapi_try_exit:
     return fapi2::current_err;
@@ -1855,8 +1850,8 @@
     pPgpeHdr->g_quad_status_addr                  =     0;
     pPgpeHdr->g_pgpe_wof_state_address            =     0;
     pPgpeHdr->g_pgpe_req_active_quad_address      =     0;
-    pPgpeHdr->g_wof_table_addr                    =     0;
-    pPgpeHdr->g_wof_table_length                  =     0;
+    pPgpeHdr->g_wof_table_addr                    =     SWIZZLE_4_BYTE(pPpmrHdr->g_ppmr_wof_table_offset);
+    pPgpeHdr->g_wof_table_length                  =     SWIZZLE_4_BYTE(pPpmrHdr->g_ppmr_wof_table_length);

     //Finally handling the endianess
     pPgpeHdr->g_pgpe_gppb_sram_addr                 =   SWIZZLE_4_BYTE(pPgpeHdr->g_pgpe_gppb_sram_addr);
@@ -1949,6 +1944,7 @@
         Homerlayout_t* pHomerLayout = (Homerlayout_t*)i_pHomer;
         PPMRLayout_t*  pPpmr = (PPMRLayout_t*) &pHomerLayout->ppmrRegion;
         cmeHeader_t* pCmeHdr = (cmeHeader_t*) &pHomerLayout->cpmrRegion.cmeSramRegion[CME_INT_VECTOR_SIZE];
+        fapi2::ATTR_WOF_ENABLED_Type l_wof_enabled;

         uint32_t ppmrRunningOffset = SWIZZLE_4_BYTE(io_ppmrHdr.g_ppmr_hcode_offset) +
                                      SWIZZLE_4_BYTE(io_ppmrHdr.g_ppmr_hcode_length);
@@ -1972,7 +1968,9 @@
                        &pStateSupStruct, (uint8_t*)i_pBuf1, wofTableSize );
         FAPI_TRY(retCode);

-        //Check if WOF Table is copied properly
+        //Check if WOF Table is copied properly even if WOF is disabled.
+        //As this is memory range check, we don't want memory corruption
+        //issues to go unnoticed as this should not EVER happen.
         FAPI_ASSERT( ( wofTableSize <= OCC_WOF_TABLES_SIZE ),
                      fapi2::PARAM_WOF_TABLE_SIZE_ERR()
                      .set_ACTUAL_WOF_TABLE_SIZE(wofTableSize)
@@ -2073,8 +2071,11 @@
         io_ppmrHdr.g_ppmr_wof_table_offset  =   OCC_WOF_TABLES_PPMR_OFFSET;
         io_ppmrHdr.g_ppmr_wof_table_length  =   OCC_WOF_TABLES_SIZE;

-        memcpy( &pPpmr->wofTableSize, i_pBuf1, wofTableSize );
-
+        FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_WOF_ENABLED, i_procTgt, l_wof_enabled));
+        if (l_wof_enabled)
+        {
+            memcpy( &pPpmr->wofTableSize, i_pBuf1, wofTableSize );
+        }
         //------------------------------ Copying WOF Table ----------------------------------------------

         //------------------------------ Calculating total PGPE Image Size in SRAM ----------------------
@@ -2088,7 +2089,7 @@
         //Finally let us handle endianess
         //CME Header
         pCmeHdr->g_cme_pstate_region_length  =   SWIZZLE_4_BYTE(pCmeHdr->g_cme_pstate_region_length);
-        pCmeHdr->g_cme_common_ring_offset    = SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset);
+        pCmeHdr->g_cme_common_ring_offset    =   SWIZZLE_4_BYTE(pCmeHdr->g_cme_common_ring_offset);

         //PPMR Header
         io_ppmrHdr.g_ppmr_gppb_offset        =   SWIZZLE_4_BYTE(io_ppmrHdr.g_ppmr_gppb_offset);


When using Cocoa, it is not necessary to identify the configuration files
to load on the command line. One of the fun thinks (at least in my opinion)
about the way that I have put the Cocoa stuff together is that we can
leverage run-time reconfiguration of VR Juggler and load config files through
the application's built-in "File -> Open..." menu item.

git-svn-id: a341ccba1312b2efdbe34f40faf90581f48aa49f@19996 08b38cba-cd3b-11de-854e-f91c5b6e4272

--- modules/vrjuggler/test/PerfMon/collideApp/collide.cpp
+++ modules/vrjuggler/test/PerfMon/collideApp/collide.cpp
@@ -41,12 +41,14 @@
    Kernel* kernel = Kernel::instance();
    collideApp* application = new collideApp();

+#if ! defined(VRJ_USE_COCOA)
    if (argc <= 1)
    {
       std::cout << "\n\n";
       std::cout << "Usage: " << argv[0] << "vjconfigfile[0] vjconfigfile[1] ...  vjconfigfile[n] " << std::endl;
       exit(1);
    }
+#endif

    for (int i=1; i< argc; ++i)
    {


AudioDeviceAndroidOpenSLES: NULL variables might be referenced in StopPlayout()

BUG=1891
Test=ManualTest

R=fischman@webrtc.org, xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1622004

Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 83a062cc5feca7c50218cc8fd7099dc5bdd3f4f5

--- modules/audio_device/android/audio_device_opensles_android.cc
+++ modules/audio_device/android/audio_device_opensles_android.cc
@@ -1133,48 +1133,50 @@
 }

 int32_t AudioDeviceAndroidOpenSLES::StopPlayout() {
-  {
-    CriticalSectionScoped lock(&crit_sect_);
-    if (!is_play_initialized_) {
-      WEBRTC_OPENSL_TRACE(kTraceInfo, kTraceAudioDevice, id_,
-                          "  Playout is not initialized");
-      return 0;
+
+  CriticalSectionScoped lock(&crit_sect_);
+  if (!is_play_initialized_) {
+    WEBRTC_OPENSL_TRACE(kTraceInfo, kTraceAudioDevice, id_,
+                        "  Playout is not initialized");
+    return 0;
+  }
+
+  if (sles_player_itf_) {
+    // Make sure player is stopped
+    int32_t res = (*sles_player_itf_)->SetPlayState(sles_player_itf_,
+                                                    SL_PLAYSTATE_STOPPED);
+    if (res != SL_RESULT_SUCCESS) {
+      WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
+                          "  failed to stop playout");
     }
-
-    if (!sles_player_itf_ && !sles_output_mixer_ && !sles_player_) {
-      // Make sure player is stopped
-      int32_t res =
-          (*sles_player_itf_)->SetPlayState(sles_player_itf_,
-                                           SL_PLAYSTATE_STOPPED);
-      if (res != SL_RESULT_SUCCESS) {
-        WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
-                            "  failed to stop playout");
-        return -1;
-      }
-      res = (*sles_player_sbq_itf_)->Clear(sles_player_sbq_itf_);
-      if (res != SL_RESULT_SUCCESS) {
-        WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
-                            "  failed to clear player buffer queue");
-        return -1;
-      }
-
-      // Destroy the player
-      (*sles_player_)->Destroy(sles_player_);
-      // Destroy Output Mix object
-      (*sles_output_mixer_)->Destroy(sles_output_mixer_);
-      sles_player_ = NULL;
-      sles_player_itf_ = NULL;
-      sles_player_sbq_itf_ = NULL;
-      sles_output_mixer_ = NULL;
+  }
+
+  if (sles_player_sbq_itf_) {
+    int32_t res = (*sles_player_sbq_itf_)->Clear(sles_player_sbq_itf_);
+    if (res != SL_RESULT_SUCCESS) {
+      WEBRTC_OPENSL_TRACE(kTraceError, kTraceAudioDevice, id_,
+                          "  failed to clear player buffer queue");
     }
   }

-  CriticalSectionScoped lock(&crit_sect_);
+  if (sles_player_) {
+    // Destroy the player
+    (*sles_player_)->Destroy(sles_player_);
+  }
+
+  if (sles_output_mixer_) {
+    // Destroy Output Mix object
+    (*sles_output_mixer_)->Destroy(sles_output_mixer_);
+  }
+
   is_play_initialized_ = false;
   is_playing_ = false;
   play_warning_ = 0;
   play_error_ = 0;
-
+  sles_player_sbq_itf_ = NULL;
+  sles_player_itf_ = NULL;
+  sles_player_ = NULL;
+  sles_output_mixer_ = NULL;
   return 0;
 }


STOP: Port recent L2/L3/Ncu Initfile changes to scominits in stop

Change-Id: Ie6069a57ba9899afa5a786fd1cd8c821c7a2d625
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40526
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Michael S. Floyd <fe74c9a922ad1b821954b2cbd8912f02d8d2c303@us.ibm.com>
Reviewed-by: Juan R. Medina <5724fa490ce1df1ec90a5e60a6a61702faf8d28b@us.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40527
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
+++ src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
@@ -130,6 +130,8 @@
     EQ_INEX_BUCKET_2            =   1,
     EQ_INEX_BUCKET_3            =   2,
     EQ_INEX_BUCKET_4            =   3,
+    L3_EPS_DIVIDER              =   1,
+    L2_EPS_DIVIDER              =   1,
 };

 /**
@@ -3243,7 +3245,7 @@
                                attrValT0 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T0");

-        attrValT0 = attrValT0 / 8 + 1;
+        attrValT0 = attrValT0 / 8 / L2_EPS_DIVIDER + 1;
         epsilonValBuf.insert<0, 12, 20, uint32_t>( attrValT0 );

         //----------------------------- Tier1(T1)--------------------------------------
@@ -3253,7 +3255,7 @@
                                attrValT1 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T1");

-        attrValT1 = attrValT1 / 8 + 1;
+        attrValT1 = attrValT1 / 8 / L2_EPS_DIVIDER + 1;
         epsilonValBuf.insert<12, 12, 20, uint32_t>( attrValT1 );

         //----------------------------- Tier2(T2)--------------------------------------
@@ -3264,7 +3266,7 @@
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T2");

-        attrValT2 = attrValT2 / 8 + 1;
+        attrValT2 = attrValT2 / 8 / L2_EPS_DIVIDER + 1;
         epsilonValBuf.insert<24, 12, 20, uint32_t>( attrValT2 );

         epsilonValBuf.extract<0, 64>(l_epsilonScomVal);
@@ -3314,7 +3316,7 @@
                                attrValT1 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_WRITE_CYCLES_T1");

-        attrValT1 = attrValT1 / 8 + 1;
+        attrValT1 = attrValT1 / 8 / L2_EPS_DIVIDER + 1;
         epsilonValBuf.insert< 0, 12, 20, uint32_t >(attrValT1);

         //----------------------------- Tier2(T2)--------------------------------------
@@ -3324,15 +3326,15 @@
                                attrValT2 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_WRITE_CYCLES_T2");

-        attrValT2 = attrValT2 / 8 + 1;
+        attrValT2 = attrValT2 / 8 / L2_EPS_DIVIDER + 1;
         epsilonValBuf.insert< 12, 12, 20, uint32_t >(attrValT2);

         // p9.l2.scom.inifile:
-        // EPS_DIVIDER_MODE          = 0001
+        // EPS_DIVIDER_MODE          = L2_EPS_DIVIDER
         // EPS_MODE_SEL              = 0
         // EPS_CNT_USE_L2_DIVIDER_EN = 0
         // L2_EPS_STEP_MODE          = 0000
-        epsilonValBuf.setBit<27>();
+        epsilonValBuf.insert<24, 4, 28, uint32_t>(L2_EPS_DIVIDER);

         epsilonValBuf.extract<0, 64>(l_epsilonScomVal);

@@ -3422,7 +3424,7 @@
                                attrValT0 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T0");

-        attrValT0 = attrValT0 / 8 + 1;
+        attrValT0 = attrValT0 / 8 / L3_EPS_DIVIDER + 1;
         epsilonValBuf.insert<0, 12, 20, uint32_t>( attrValT0 );

         //----------------------------- Tier1(T1)--------------------------------------
@@ -3432,7 +3434,7 @@
                                attrValT1 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T1");

-        attrValT1 = attrValT1 / 8 + 1;
+        attrValT1 = attrValT1 / 8 / L3_EPS_DIVIDER + 1;
         epsilonValBuf.insert<12, 12, 20, uint32_t>( attrValT1 );

         //----------------------------- Tier2(T2)--------------------------------------
@@ -3442,7 +3444,7 @@
                                attrValT2 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_READ_CYCLES_T2");

-        attrValT2 = attrValT2 / 8 + 1;
+        attrValT2 = attrValT2 / 8 / L3_EPS_DIVIDER + 1;
         epsilonValBuf.insert<24, 12, 20, uint32_t>( attrValT2 );

         epsilonValBuf.extract<0, 64>(l_epsilonScomVal);
@@ -3499,7 +3501,7 @@
                                attrValT1 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_WRITE_CYCLES_T1");

-        attrValT1 = attrValT1 / 8 + 1;
+        attrValT1 = attrValT1 / 8 / L3_EPS_DIVIDER + 1;
         epsilonValBuf.insert< 0, 12, 20, uint32_t >(attrValT1);

         //----------------------------- Tier2(T2)--------------------------------------
@@ -3509,14 +3511,14 @@
                                attrValT2 ),
                  "Error from FAPI_ATTR_GET for attribute ATTR_PROC_EPS_WRITE_CYCLES_T2");

-        attrValT2 = attrValT2 / 8 + 1;
+        attrValT2 = attrValT2 / 8 / L3_EPS_DIVIDER + 1;
         epsilonValBuf.insert< 12, 12, 20, uint32_t >(attrValT2);

         // p9.l3.scom.initfile:
         // L3_EPS_STEP_MODE          = 0000
-        // L3_EPS_DIVIDER_MODE       = 0001
+        // L3_EPS_DIVIDER_MODE       = L3_EPS_DIVIDER
         // EPS_CNT_USE_L3_DIVIDER_EN = 0
-        epsilonValBuf.setBit<33>();
+        epsilonValBuf.insert<30, 4, 28, uint32_t>(L3_EPS_DIVIDER);

         epsilonValBuf.extract<0, 64>(l_epsilonScomVal);


mapbench: Perform a proper warmup

mapbench: Perform a proper warmup

--- bin/mapbench.cc
+++ bin/mapbench.cc
@@ -33,6 +33,7 @@
 #define STR(x) XSTR(x)

 enum { verbose = 0 };
+enum { warmup_secs = 1 };
 enum { duration = 5 };
 enum { fault = 1 };
 enum { pipeline_width = 1 };
@@ -86,6 +87,7 @@
 static pthread_barrier_t bar;

 static volatile bool stop __mpalign__;
+static volatile bool warmup;
 static __padout__ __attribute__((unused));

 // For PIPELINE mode
@@ -156,7 +158,10 @@
 void*
 timer_thread(void *)
 {
+  warmup = true;
   pthread_barrier_wait(&bar);
+  sleep(warmup_secs);
+  warmup = false;
   sleep(duration);
   stop = true;
   return NULL;
@@ -203,17 +208,29 @@
   if (setaffinity(get_cpu_order(cpu)) < 0)
     die("setaffinity err");

-  pthread_barrier_wait(&bar);
-
-  start_tscs[cpu] = rdtsc();
+  bool mywarmup = true;
+  uint64_t tsc1 = 0;
   uint64_t myiters = 0, mypages = 0, myunderflows = 0;
 #ifdef RECORD_PMC
-  uint64_t pmc1 = rdpmc(PMCNO);
-#endif
+  uint64_t pmc1 = 0;
+# define CHECK_STAGE_PMC() pmc1 = rdpmc(PMCNO)
+#else
+# define CHECK_STAGE_PMC()
+#endif
+#define CHECK_STAGE()                                   \
+  if (__builtin_expect(mywarmup, 0) && !warmup) {       \
+    mywarmup = false;                                   \
+    myiters = mypages = myunderflows = 0;               \
+    tsc1 = rdtsc();                                     \
+    CHECK_STAGE_PMC();                                  \
+  }
+
+  pthread_barrier_wait(&bar);

   switch (mode) {
   case bench_mode::LOCAL:
     while (!stop) {
+      CHECK_STAGE();
       volatile char *p = base + cpu * npg * 0x100000;
       if (mmap((void *) p, npg * PGSIZE, PROT_READ|PROT_WRITE,
                MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) == MAP_FAILED)
@@ -233,6 +250,8 @@

   case bench_mode::PIPELINE: {
     while (!stop) {
+      CHECK_STAGE();
+
       bool underflow = true;

       // Fill the outgoing pipeline
@@ -276,6 +295,8 @@

   case bench_mode::GLOBAL: {
     while (!stop) {
+      CHECK_STAGE();
+
       // Map my part of the "hash table".  After the first iteration,
       // this will also clear the old mapping.
       volatile char *p = (base + cpu * npg * PGSIZE);
@@ -314,6 +335,8 @@
       p2 = base + npg * PGSIZE;

     while (!stop) {
+      CHECK_STAGE();
+
       // Map my part of the "hash table".
       if (mmap((void *) p, p2 - p, PROT_READ|PROT_WRITE,
                MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) == MAP_FAILED)
@@ -350,6 +373,7 @@
   }
   }
   stop_tscs[cpu] = rdtsc();
+  start_tscs[cpu] = tsc1;
 #ifdef RECORD_PMC
   pmcs[cpu] = rdpmc(PMCNO) - pmc1;
 #endif
@@ -410,8 +434,8 @@
   else
     npg = 1;

-  printf("# --cores=%d --duration=%ds --mode=%s --fault=%s",
-         nthread, duration,
+  printf("# --cores=%d --duration=%ds --warmup=%ds --mode=%s --fault=%s",
+         nthread, duration, warmup_secs,
          mode == bench_mode::LOCAL ? "local" :
          mode == bench_mode::PIPELINE ? "pipeline" :
          mode == bench_mode::GLOBAL ? "global" :