Prediction: added some comments.

Prediction: added some comments.

--- modules/prediction/container/obstacles/obstacles_container.cc
+++ modules/prediction/container/obstacles/obstacles_container.cc
@@ -32,16 +32,25 @@
 using apollo::perception::PerceptionObstacles;
 using ::google::protobuf::Message;

+
 ObstaclesContainer::ObstaclesContainer()
     : obstacles_(FLAGS_max_num_obstacles) {}

-void ObstaclesContainer::Insert(const Message& message) {
+// This is called by Perception module at every frame to insert all
+// detected obstacles.
+void ObstaclesContainer::Insert(const ::google::protobuf::Message& message) {
+  // Clean up the history and get the PerceptionObstacles
   curr_frame_predictable_obstacle_ids_.clear();
   PerceptionObstacles perception_obstacles;
   perception_obstacles.CopyFrom(
       dynamic_cast<const PerceptionObstacles&>(message));

-  // Update the timestamp_ of the ObstaclesContainer
+  // Get the new timestamp and update it in the class
+  // - If it's more than 10sec later than the most recent one, clear the
+  //   obstacle history.
+  // - If it's not a valid time (earlier than history), continue.
+  // - Also consider the offline_mode case.
+
   double timestamp = 0.0;
   if (perception_obstacles.has_header() &&
       perception_obstacles.header().has_timestamp_sec()) {
@@ -92,19 +101,23 @@
   }
 }

+
 Obstacle* ObstaclesContainer::GetObstacle(const int id) {
   return obstacles_.GetSilently(id);
 }
+

 const std::vector<int>&
 ObstaclesContainer::GetCurrentFramePredictableObstacleIds() const {
   return curr_frame_predictable_obstacle_ids_;
 }

+
 void ObstaclesContainer::Clear() {
   obstacles_.Clear();
   timestamp_ = -1.0;
 }
+

 void ObstaclesContainer::InsertPerceptionObstacle(
     const PerceptionObstacle& perception_obstacle, const double timestamp) {
@@ -133,7 +146,10 @@
   }
 }

+
 void ObstaclesContainer::BuildLaneGraph() {
+  // Go through every obstacle in the current frame, after some
+  // sanity checks, build lane graph for non-junction cases.
   for (const int id : curr_frame_predictable_obstacle_ids_) {
     Obstacle* obstacle_ptr = obstacles_.GetSilently(id);
     if (obstacle_ptr == nullptr) {
@@ -148,7 +164,10 @@
   }
 }

+
 void ObstaclesContainer::BuildJunctionFeature() {
+  // Go through every obstacle in the current frame, after some
+  // sanit checks, build junction features for those that are in junction.
   for (const int id : curr_frame_predictable_obstacle_ids_) {
     Obstacle* obstacle_ptr = obstacles_.GetSilently(id);
     if (obstacle_ptr == nullptr) {
@@ -168,6 +187,7 @@
   }
 }

+
 bool ObstaclesContainer::IsPredictable(
     const PerceptionObstacle& perception_obstacle) {
   if (!perception_obstacle.has_type() ||


Fixed compilation error of Clang plugins on Ubuntu/Mint

Change-Id: Ib08c5075034e0e16c5541f05425ef15d2cc3a6f6
Reviewed-on: https://gerrit.libreoffice.org/2045
Reviewed-by: Luboš Luňák <b5c5550b076ca5e3b0f00f104f523b73456d8824@suse.cz>
Tested-by: Luboš Luňák <b5c5550b076ca5e3b0f00f104f523b73456d8824@suse.cz>

--- compilerplugins/clang/plugin.hxx
+++ compilerplugins/clang/plugin.hxx
@@ -15,6 +15,8 @@

 #include <clang/AST/ASTContext.h>
 #include <clang/AST/RecursiveASTVisitor.h>
+#include <clang/Basic/FileManager.h>
+#include <clang/Basic/SourceManager.h>

 #if __clang_major__ < 3 || __clang_major__ == 3 && __clang_minor__ < 2
 #include <clang/Rewrite/Rewriter.h>


fixed typo in help

fixed typo in help

--- bin/sqs.cpp
+++ bin/sqs.cpp
@@ -207,7 +207,7 @@
           std::cout << "             list-message: Receive messages" << std::endl;
           std::cout << "             delete-message: Delete messages" << std::endl;
           std::cout << "             delete-all-messages: Delete all messages retrieved" << std::endl;
-          std::cout << "  -o: host name"  << std::endl;
+          std::cout << "  -o host name"  << std::endl;
           std::cout << "  -n name: A Queue Name/URL"  << std::endl;
           std::cout << "  -p prefix: Prefix for listing queues"  << std::endl;
           std::cout << "  -x #messages: Number of messages to return"  << std::endl;


Eliminate C++'s #include.

Eliminate C++'s #include.

--- library/longnum_engine.cpp
+++ library/longnum_engine.cpp
@@ -2,12 +2,6 @@
 #include <stdlib.h>
 #include "longnum_engine.h"
 #define alloc(type) (type*)malloc(sizeof(type))
-
-#ifdef __cplusplus
-#include <queue>
-//using namespace std;
-#endif // __cplusplus
-

 longnum longnum_duplicate(longnum num) {
     longnum_digit * num_curr=NULL, *new_curr=NULL, *new_tail=NULL;


Capitalize themes' names

Capitalize themes' names

--- lxqt-config-appearance/lxqtthemeconfig.cpp
+++ lxqt-config-appearance/lxqtthemeconfig.cpp
@@ -45,7 +45,9 @@
     QList<LxQt::LxQtTheme> themes = LxQt::LxQtTheme::allThemes();
     foreach(LxQt::LxQtTheme theme, themes)
     {
-        QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(theme.name()));
+        QString themeName = theme.name();
+        themeName[0] = themeName[0].toTitleCase();
+        QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(themeName));
         if (!theme.previewImage().isEmpty())
         {
             item->setIcon(0, QIcon(theme.previewImage()));


Do a round of cleanup around NULL pointers.

--- cpp/log/cert.cc
+++ cpp/log/cert.cc
@@ -95,15 +95,15 @@
   // A read-only bio.
   BIO* bio_in = BIO_new_mem_buf(const_cast<char*>(pem_string.data()),
                                 pem_string.length());
-  if (bio_in == NULL) {
+  if (!bio_in) {
     LOG_OPENSSL_ERRORS(ERROR);
     return;
   }

-  x509_ = PEM_read_bio_X509(bio_in, NULL, NULL, NULL);
+  x509_ = PEM_read_bio_X509(bio_in, nullptr, nullptr, nullptr);
   BIO_free(bio_in);

-  if (x509_ == NULL) {
+  if (!x509_) {
     // At this point most likely the input was just corrupt. There are a few
     // real errors that may have happened (a malloc failure is one) and it is
     // virtually impossible to fish them out.
@@ -114,32 +114,31 @@

 Cert::~Cert() {
-  if (x509_ != NULL)
+  if (x509_)
     X509_free(x509_);
 }

 Cert* Cert::Clone() const {
-  X509* x509 = NULL;
+  X509* x509(nullptr);
   if (x509_) {
     x509 = X509_dup(x509_);
-    if (x509 == NULL)
+    if (!x509)
       LOG_OPENSSL_ERRORS(ERROR);
   }
-  Cert* clone = new Cert(x509);
-  return clone;
+  return new Cert(x509);
 }

 Cert::Status Cert::LoadFromDerString(const string& der_string) {
-  if (x509_ != NULL) {
+  if (x509_) {
     X509_free(x509_);
-    x509_ = NULL;
+    x509_ = nullptr;
   }
   const unsigned char* start =
       reinterpret_cast<const unsigned char*>(der_string.data());
-  x509_ = d2i_X509(NULL, &start, der_string.size());
-  if (x509_ == NULL) {
+  x509_ = d2i_X509(nullptr, &start, der_string.size());
+  if (!x509_) {
     LOG(WARNING) << "Input is not a valid DER-encoded certificate";
     LOG_OPENSSL_ERRORS(WARNING);
     return Cert::FALSE;
@@ -192,10 +191,10 @@

 // static
 string Cert::PrintName(X509_NAME* name) {
-  if (name == NULL)
+  if (!name)
     return string();
   BIO* bio = BIO_new(BIO_s_mem());
-  if (bio == NULL) {
+  if (!bio) {
     LOG_OPENSSL_ERRORS(ERROR);
     return string();
   }
@@ -234,7 +233,7 @@

 string Cert::PrintSignatureAlgorithm() const {
   const char* sigalg = OBJ_nid2ln(X509_get_signature_nid(x509_));
-  if (sigalg == NULL)
+  if (!sigalg)
     return "NULL";
   return string(sigalg);
 }
@@ -242,11 +241,11 @@

 // static
 string Cert::PrintTime(ASN1_TIME* when) {
-  if (when == NULL)
+  if (!when)
     return string();

   BIO* bio = BIO_new(BIO_s_mem());
-  if (bio == NULL) {
+  if (!bio) {
     LOG_OPENSSL_ERRORS(ERROR);
     return string();
   }
@@ -312,7 +311,7 @@
     return CertStatusToStatusOrBool(status);
   }

-  // |constraints| is never NULL upon success.
+  // |constraints| is never null upon success.
   BASIC_CONSTRAINTS* constraints = static_cast<BASIC_CONSTRAINTS*>(ext_struct);
   bool is_ca = constraints->ca;
   BASIC_CONSTRAINTS_free(constraints);
@@ -327,7 +326,7 @@
   }

   const ASN1_OBJECT* key_usage_obj = OBJ_nid2obj(key_usage_nid);
-  if (key_usage_obj == NULL) {
+  if (!key_usage_obj) {
     LOG(ERROR) << "OpenSSL OBJ_nid2obj returned NULL for NID " << key_usage_nid
                << ". Is the NID not recognised?";
     LOG_OPENSSL_ERRORS(WARNING);
@@ -346,7 +345,7 @@
     return CertStatusToStatusOrBool(status);
   }

-  // |eku| is never NULL upon success.
+  // |eku| is never null upon success.
   EXTENDED_KEY_USAGE* eku = static_cast<EXTENDED_KEY_USAGE*>(ext_struct);
   bool ext_key_usage_found = false;
   for (int i = 0; i < sk_ASN1_OBJECT_num(eku); ++i) {
@@ -379,7 +378,7 @@
   }

   EVP_PKEY* issuer_key = X509_get_pubkey(issuer.x509_);
-  if (issuer_key == NULL) {
+  if (!issuer_key) {
     LOG(WARNING) << "NULL issuer key";
     LOG_OPENSSL_ERRORS(WARNING);
     return FALSE;
@@ -412,7 +411,7 @@
     return ERROR;
   }

-  unsigned char* der_buf = NULL;
+  unsigned char* der_buf(nullptr);
   int der_length = i2d_X509(x509_, &der_buf);

   if (der_length < 0) {
@@ -480,7 +479,7 @@
     return ERROR;
   }

-  unsigned char* der_buf = NULL;
+  unsigned char* der_buf(nullptr);
   int der_length = i2d_re_X509_tbs(x509_, &der_buf);
   if (der_length < 0) {
     // What does this return value mean? Let's assume it means the cert
@@ -515,7 +514,7 @@

 // static
 Cert::Status Cert::DerEncodedName(X509_NAME* name, string* result) {
-  unsigned char* der_buf = NULL;
+  unsigned char* der_buf(nullptr);
   int der_length = i2d_X509_NAME(name, &der_buf);
   if (der_length < 0) {
     // What does this return value mean? Let's assume it means the cert
@@ -556,7 +555,7 @@
     return ERROR;
   }

-  unsigned char* der_buf = NULL;
+  unsigned char* der_buf(nullptr);
   int der_length = i2d_X509_PUBKEY(X509_get_X509_PUBKEY(x509_), &der_buf);
   if (der_length < 0) {
     // What does this return value mean? Let's assume it means the cert
@@ -587,7 +586,7 @@
   if (status != TRUE)
     return status;

-  // |octet| is never NULL upon success. Caller is responsible for the
+  // |octet| is never null upon success. Caller is responsible for the
   // correctness of this cast.
   ASN1_OCTET_STRING* octet = static_cast<ASN1_OCTET_STRING*>(ext_data);
   result->assign(reinterpret_cast<const char*>(octet->data), octet->length);
@@ -624,7 +623,7 @@
   }

   *ext = X509_get_ext(x509_, extension_index);
-  if (*ext == NULL) {
+  if (!*ext) {
     LOG(ERROR) << "Failed to retrieve extension for NID " << extension_nid
                << ", at index " << extension_index;
     LOG_OPENSSL_ERRORS(ERROR);
@@ -646,9 +645,9 @@

   int crit;

-  *ext_struct = X509_get_ext_d2i(x509_, extension_nid, &crit, NULL);
-
-  if (*ext_struct == NULL) {
+  *ext_struct = X509_get_ext_d2i(x509_, extension_nid, &crit, nullptr);
+
+  if (!*ext_struct) {
     if (crit != -1) {
       LOG(WARNING) << "Corrupt extension data";
       LOG_OPENSSL_ERRORS(WARNING);
@@ -761,7 +760,7 @@

   STACK_OF(GENERAL_NAME)* subject_alt_names =
       static_cast<STACK_OF(GENERAL_NAME)*>(
-          X509_get_ext_d2i(x509_, NID_subject_alt_name, NULL, NULL));
+          X509_get_ext_d2i(x509_, NID_subject_alt_name, nullptr, nullptr));

   // Apply validation rules for subject alt names, if this returns true
   // status is already final.
@@ -1009,7 +1008,7 @@
 }

-TbsCertificate::TbsCertificate(const Cert& cert) : x509_(NULL) {
+TbsCertificate::TbsCertificate(const Cert& cert) : x509_(nullptr) {
   if (!cert.IsLoaded()) {
     LOG(ERROR) << "Cert not loaded";
     return;
@@ -1017,13 +1016,13 @@

   x509_ = X509_dup(cert.x509_);

-  if (x509_ == NULL)
+  if (!x509_)
     LOG_OPENSSL_ERRORS(ERROR);
 }

 TbsCertificate::~TbsCertificate() {
-  if (x509_ != NULL)
+  if (x509_)
     X509_free(x509_);
 }

@@ -1034,7 +1033,7 @@
     return Cert::ERROR;
   }

-  unsigned char* der_buf = NULL;
+  unsigned char* der_buf(nullptr);
   int der_length = i2d_re_X509_tbs(x509_, &der_buf);
   if (der_length < 0) {
     // What does this return value mean? Let's assume it means the cert
@@ -1062,7 +1061,7 @@

   X509_EXTENSION* ext = X509_delete_ext(x509_, extension_index);

-  if (ext == NULL) {
+  if (!ext) {
     // Truly odd.
     LOG(ERROR) << "Failed to delete the extension";
     LOG_OPENSSL_ERRORS(ERROR);
@@ -1104,7 +1103,7 @@
   // This just looks up the relevant pointer so there shouldn't
   // be any errors to clear.
   X509_NAME* ca_name = X509_get_issuer_name(from.x509_);
-  if (ca_name == NULL) {
+  if (!ca_name) {
     LOG(WARNING) << "Issuer certificate has NULL name";
     return Cert::FALSE;
   }
@@ -1149,7 +1148,7 @@
   X509_EXTENSION* to_ext = X509_get_ext(x509_, extension_index);
   X509_EXTENSION* from_ext = X509_get_ext(from.x509_, from_extension_index);

-  if (to_ext == NULL || from_ext == NULL) {
+  if (!to_ext || !from_ext) {
     // Should not happen.
     LOG(ERROR) << "Failed to retrive extension";
     LOG_OPENSSL_ERRORS(ERROR);
@@ -1190,15 +1189,14 @@
   // A read-only BIO.
   BIO* const bio_in(BIO_new_mem_buf(const_cast<char*>(pem_string.data()),
                                     pem_string.length()));
-  if (bio_in == NULL) {
+  if (!bio_in) {
     LOG_OPENSSL_ERRORS(ERROR);
     return;
   }

-  X509* x509 = NULL;
-  while ((x509 = PEM_read_bio_X509(bio_in, NULL, NULL, NULL)) != NULL) {
-    Cert* cert = new Cert(x509);
-    chain_.push_back(cert);
+  X509* x509(nullptr);
+  while ((x509 = PEM_read_bio_X509(bio_in, nullptr, nullptr, nullptr))) {
+    chain_.push_back(new Cert(x509));
   }

   BIO_free(bio_in);
@@ -1218,9 +1216,9 @@

 Cert::Status CertChain::AddCert(Cert* cert) {
-  if (cert == NULL || !cert->IsLoaded()) {
+  if (!cert || !cert->IsLoaded()) {
     LOG(ERROR) << "Attempting to add an invalid cert";
-    if (cert != NULL)
+    if (cert)
       delete cert;
     return Cert::ERROR;
   }
@@ -1337,7 +1335,7 @@

 Cert::Status PreCertChain::UsesPrecertSigningCertificate() const {
   const Cert* issuer = PrecertIssuingCert();
-  if (issuer == NULL) {
+  if (!issuer) {
     // No issuer, so it must be a real root CA from the store.
     return Cert::FALSE;
   }


use localpath to delete temporary webdav file

--- src/megaapi_impl.cpp
+++ src/megaapi_impl.cpp
@@ -21369,7 +21369,9 @@

     if (tmpFileAccess)
     {
-        server->fsAccess->unlinklocal(&tmpFileName);
+        string localPath;
+        server->fsAccess->path2local(&tmpFileName, &localPath);
+        server->fsAccess->unlinklocal(&localPath);
         delete tmpFileAccess;
     }
     delete [] messageBody;


change event names

change event names

Change-Id: I26bf30609ef30b4361dc30af8852deb9ff216a4b

--- cpucounters.cpp
+++ cpucounters.cpp
@@ -4281,9 +4281,9 @@
     {
         // monitor TxL0_POWER_CYCLES
         event[0] = Q_P_PCI_PMON_CTL_EVENT(0x26);
-        // monitor RxL_FLITS.DATA on counter 1
+        // monitor RxL_FLITS.ALL_DATA on counter 1
         event[1] = Q_P_PCI_PMON_CTL_EVENT(0x03) + Q_P_PCI_PMON_CTL_UMASK(0xF);
-        // monitor TxL_FLITS.NON_DATA+DATA on counter 2
+        // monitor TxL_FLITS.NON_DATA+ALL_DATA on counter 2
         event[2] = Q_P_PCI_PMON_CTL_EVENT(0x02) + Q_P_PCI_PMON_CTL_UMASK((0x97|0x0F));
         // monitor UPI CLOCKTICKS
         event[3] = Q_P_PCI_PMON_CTL_EVENT(0x01);


dbeug

dbeug

--- object_recognition/camera.cpp
+++ object_recognition/camera.cpp
@@ -79,7 +79,7 @@
 	cv::inRange(hsv, cv::Scalar(0, 70, 60), cv::Scalar(2, 255, MAX_VALUE), hsv_filtered15);
 	cv::inRange(hsv, cv::Scalar(160, 70, 60), cv::Scalar(180, 255, MAX_VALUE), hsv_filtered180);
 	cv::add(hsv_filtered15,hsv_filtered180,hsv);
-	output = rmNoise(hsv);
+	output = Camera::rmNoise(hsv);
 	imwrite(timePath+"BINARY"+FILE_EXTENTION,output);
 	return 0;
 }


Changed Key.something into GetKeyState (something)

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

--- libs/cssys/djgpp/djgpp.cpp
+++ libs/cssys/djgpp/djgpp.cpp
@@ -127,8 +127,10 @@
           if (Button == 0)
             Mouse->do_mousemotion (time, x, y);
           else if (Down)
-            Mouse->do_buttonpress (time, Button, x, y, Keyboard->Key.shift,
-              Keyboard->Key.alt, Keyboard->Key.ctrl);
+            Mouse->do_buttonpress (time, Button, x, y,
+              Keyboard->GetKeyState (CSKEY_SHIFT),
+              Keyboard->GetKeyState (CSKEY_ALT),
+              Keyboard->GetKeyState (CSKEY_CTRL));
           else
             Mouse->do_buttonrelease (time, Button, x, y);
           break;


Improve the gradient test by adding test for multi-threads. Add also possibility to control output via command line by adding verbose options (-v,-vv,-vvv)

--- math/mathcore/test/testGradientFitting.cxx
+++ math/mathcore/test/testGradientFitting.cxx
@@ -111,6 +111,8 @@
 using VectorialUnBinned = GradientFittingTestTraits<ROOT::Double_v, ROOT::Fit::UnBinData, LikelihoodFitType>;
 #endif

+int printLevel = 0;
+
 template <class T>
 class GradientFittingTest : public ::testing::Test {
 protected:
@@ -159,14 +161,17 @@
       fFitter.SetFunction(function);
       //fFitter.SetFunction(function,false);
       fFitter.Config().SetMinimizer("Minuit2");
-      //fFitter.Config().MinimizerOptions().SetPrintLevel(3);

       // Fill the binned or unbinned data
       FillData();

-      Fit();
-   }
+
+      if (printLevel>1) fFitter.Config().MinimizerOptions().SetPrintLevel(printLevel);
+
+
+   }
+

    // Fill binned data
    template <class U = typename T::FittingDataType>
@@ -208,8 +213,10 @@
                            std::is_same<F, LikelihoodFitType>::value>::type
    Fit()
    {
-      std::cout << "Doing a likelihood Fit " << std::endl;
-      fFitter.LikelihoodFit(*fData);
+      std::cout << "Doing a binned likelihood Fit " << std::endl;
+      // the fit is extended in case of bin data types
+      bool extended = std::is_same<ROOT::Fit::BinData,typename T::FittingDataType>::value;
+      fFitter.LikelihoodFit(*fData, extended,  fExecutionPolicy);
    }

    template <class F = typename T::FitType>
@@ -218,14 +225,35 @@
    Fit()
    {
       std::cout << "Doing a chi2 Fit " << std::endl;
-      fFitter.Fit(*fData);
-   }
+      fFitter.Fit(*fData, fExecutionPolicy );
+   }
+
+   // function actually running the test.
+   // We define here the condition to say that the test is valid
+   bool RunFit(ROOT::Fit::ExecutionPolicy executionPolicy) {
+      fExecutionPolicy = executionPolicy;
+      if (printLevel>0) {
+         std::cout << "**************************************\n";
+         if (fExecutionPolicy == ROOT::Fit::ExecutionPolicy::kSerial)
+            std::cout << "   RUN SEQUENTIAL \n";
+         else if (fExecutionPolicy == ROOT::Fit::ExecutionPolicy::kMultithread)
+            std::cout << "   RUN MULTI-THREAD \n";
+         else if (fExecutionPolicy == ROOT::Fit::ExecutionPolicy::kMultiprocess)
+            std::cout << "   RUN MULTI-PROCESS \n";
+
+         std::cout << "**************************************\n";
+      }
+      Fit();
+      if (printLevel>0) fFitter.Result().Print(std::cout);
+      return (fFitter.Result().IsValid() && fFitter.Result().Edm() < 0.001);
+   }
+

    TF2 *fFunction;
    typename T::FittingDataType *fData;
    TH2D *fHistogram;
    ROOT::Fit::Fitter fFitter;
-
+   ROOT::Fit::ExecutionPolicy fExecutionPolicy = ROOT::Fit::ExecutionPolicy::kSerial;
    static const unsigned fNumPoints = 401;
 };

@@ -238,15 +266,48 @@
 typedef ::testing::Types<ScalarChi2, ScalarBinned, ScalarUnBinned> TestTypes;
 #endif

+
+
 // Declare that the GradientFittingTest class should be instantiated with the types defined by TestTypes
-TYPED_TEST_CASE(GradientFittingTest, TestTypes);
+TYPED_TEST_CASE_P(GradientFittingTest);

 // Test the fitting using the gradient is successful
-TYPED_TEST(GradientFittingTest, GradientFitting)
+TYPED_TEST_P(GradientFittingTest, Sequential)
 {
-   // TestFixture::fFitter.Config().MinimizerOptions().SetPrintLevel(3);
-   EXPECT_TRUE(TestFixture::fFitter.Result().IsValid() && TestFixture::fFitter.Result().Edm() < 0.001);
-   TestFixture::fFitter.Result().Print(std::cout);
+   EXPECT_TRUE(TestFixture::RunFit(ROOT::Fit::ExecutionPolicy::kSerial));
 }

-
+TYPED_TEST_P(GradientFittingTest, Multithread)
+{
+   EXPECT_TRUE(TestFixture::RunFit(ROOT::Fit::ExecutionPolicy::kMultithread));
+}
+
+REGISTER_TYPED_TEST_CASE_P(GradientFittingTest,Sequential,Multithread);
+
+INSTANTIATE_TYPED_TEST_CASE_P(GradientFitting, GradientFittingTest, TestTypes);
+
+int main(int argc, char** argv) {
+
+// Disables elapsed time by default.
+  //::testing::GTEST_FLAG(print_time) = false;
+
+   // Parse command line arguments
+   for (Int_t i = 1 ;  i < argc ; i++) {
+      std::string arg = argv[i] ;
+      if (arg == "-v") {
+         std::cout << "---running in verbose mode" << std::endl;
+         printLevel = 1;
+      } else if (arg == "-vv") {
+         std::cout << "---running in very verbose mode" << std::endl;
+         printLevel = 2;
+      } else if (arg == "-vvv") {
+         std::cout << "---running in very very verbose mode" << std::endl;
+         printLevel = 3;
+      }
+   }
+
+  // This allows the user to override the flag on the command line.
+  ::testing::InitGoogleTest(&argc, argv);
+
+  return RUN_ALL_TESTS();
+}


Updated the login message to reflect yet another year gone by in sneezy history

--- code/connect.cc
+++ code/connect.cc
@@ -4933,7 +4933,7 @@
       sprintf(buf2 + strlen(buf2), "\n\r\n\rWelcome to %s:\n\r%s :\n\r", MUD_NAME_VERS, buf);
       fclose(fp);
     }
-    sprintf(buf2 + strlen(buf2), "Celebrating TEN years of quality mudding (est. 5-1-1992)\n\r\n\r");
+    sprintf(buf2 + strlen(buf2), "Celebrating ELEVEN years of quality mudding (est. 5-1-1992)\n\r\n\r");
     sprintf(buf2 + strlen(buf2), "Please type NEW (case sensitive) for a new account, or ? for help.\n\r\n\r");
     sprintf(buf2 + strlen(buf2), "\n\rLogin: ");
     output.putInQ(buf2);


implement first part of #1367

implement first part of #1367

--- ortools/flatzinc/fz.cc
+++ ortools/flatzinc/fz.cc
@@ -70,6 +70,8 @@
   char seed_param[] = "--fz_seed";
   char verbose_param[] = "--fz_verbose";
   char debug_param[] = "--fz_debug";
+  char time_param[] = "--time_limit";
+  bool use_time_param = false;
   for (int i = 1; i < *argc; ++i) {
     if (strcmp((*argv)[i], "-a") == 0) {
       (*argv)[i] = all_param;
@@ -98,13 +100,21 @@
     if (strcmp((*argv)[i], "-d") == 0) {
       (*argv)[i] = debug_param;
     }
-  }
+     if (strcmp((*argv)[i], "-t") == 0) {
+      (*argv)[i] = time_param;
+      use_time_param = true;
+    } }
   const char kUsage[] =
       "Usage: see flags.\nThis program parses and solve a flatzinc problem.";

   gflags::SetUsageMessage(kUsage);
   gflags::ParseCommandLineFlags(argc, argv, true);
   google::InitGoogleLogging((*argv)[0]);
+
+  // Fix time limit if -t was used.
+  if (use_time_param) {
+    FLAGS_time_limit /= 1000.0;
+  }
 }

 Model ParseFlatzincModel(const std::string& input, bool input_is_filename) {


Remove unnecessary reset

Remove unnecessary reset

--- src/megaapi_impl.cpp
+++ src/megaapi_impl.cpp
@@ -6447,24 +6447,20 @@
     {
         if (!client->fsaccess->mkdirlocal(localPath))
         {
-            da.reset();
             LOG_err << "Unable to create folder: " << localPath.toPath(*client->fsaccess);
             return API_EWRITE;
         }
     }
     else if (da->type == FILENODE)
     {
-        da.reset();
         LOG_err << "Local file detected where there should be a folder: " << localPath.toPath(*client->fsaccess);
         return API_EARGS;
     }
     else
     {
-        da.reset();
         LOG_debug << "Already existing folder detected: " << localPath.toPath(*client->fsaccess);
         return API_EEXIST;
     }
-    da.reset();
     return API_OK;
 }


[session] allow users to update own session;

--- Core/src/sources/sessions/SessionManagerComponent.cpp
+++ Core/src/sources/sessions/SessionManagerComponent.cpp
@@ -64,10 +64,16 @@
 }
 void Susi::Sessions::SessionManagerComponent::handleUpdate( Susi::Events::EventPtr event ) {
     try {
-        std::string sessionID = event->payload["id"];
+        std::string sessionID = event->sessionID;
+        if(event->payload["id"].isString()){
+            std::string sessionID = event->payload["id"];
+        }
         std::chrono::seconds secs;

-        int seconds = event->payload["seconds"];
+        int seconds = 0;
+        if(event->payload["seconds"].isInteger()){
+            seconds = event->payload["seconds"];
+        }

         if( seconds > 0 ) {
             secs = std::chrono::seconds( seconds );


Comment out tran checking while jacobian building

- because with this checking in transmissibility matrix we got holes

--- bs_mesh/src/mesh_grdecl.cpp
+++ bs_mesh/src/mesh_grdecl.cpp
@@ -1329,10 +1329,15 @@
         tran = mesh->calc_tran (ext_index, ext_index2, plane1, center1, center2, along_dim1, &plane2);
       }

-    if (tran != 0)
+    // FIXME: uncomment
+    //if (tran != 0)
       {
         change_jac_and_flux_conn (ext_index, ext_index2, tran);
       }
+    //else
+    //  {
+    //    BS_ASSERT (false) (tran) (i) (j) (k) (ext_index) (ext_index2);
+    //  }

     #ifdef BS_MESH_WRITE_TRANSMISS_MATRIX
         if (ext_index < 1000)
@@ -1363,10 +1368,16 @@
         tran = mesh->calc_tran (ext_index, ext_index2, plane1, center1, center2, along_dim2, &plane2);
       }

-    if (tran != 0)
+    // FIXME: uncomment
+    //if (tran != 0)
       {
         change_jac_and_flux_conn (ext_index, ext_index2, tran);
       }
+    //else
+    //  {
+    //    BS_ASSERT (false) (tran) (i) (j) (k) (ext_index) (ext_index2);
+    //  }
+
     #ifdef BS_MESH_WRITE_TRANSMISS_MATRIX
         if (ext_index < 1000)
           fprintf (fp, " %d [%d;%d;%d] (%lf)", ext_index2, i, j, k, tran);
@@ -1387,10 +1398,16 @@

     tran = mesh->calc_tran (ext_index, ext_index2, plane1, center1, center2, along_dim3);

-    if (tran != 0)
+    // FIXME: uncomment
+    //if (tran != 0)
       {
         change_jac_and_flux_conn (ext_index, ext_index2, tran);
       }
+    //else
+    //  {
+    //    BS_ASSERT (false) (tran) (i) (j) (k) (ext_index) (ext_index2);
+    //  }
+
     #ifdef BS_MESH_WRITE_TRANSMISS_MATRIX
         if (ext_index < 1000)
           fprintf (fp, " %d [%d;%d;%d] (%lf)", ext_index2, i, j, k, tran);


Disable most Leptonica messages for tesseract by default

They were disabled in earlier builds which used NDEBUG, too.

Allow manual setting of the Leptonica message level
with environment variable LEPT_MSG_SEVERITY.

Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>

--- src/api/tesseractmain.cpp
+++ src/api/tesseractmain.cpp
@@ -25,6 +25,7 @@
 #if defined(__USE_GNU)
 #  include <cfenv> // for feenableexcept
 #endif
+#include <cstdlib> // for std::getenv
 #include <iostream>

 #include <allheaders.h>
@@ -619,10 +620,13 @@
   std::vector<std::string> vars_vec;
   std::vector<std::string> vars_values;

-#if defined(NDEBUG)
-  // Disable debugging and informational messages from Leptonica.
-  setMsgSeverity(L_SEVERITY_ERROR);
-#endif
+  if (std::getenv("LEPT_MSG_SEVERITY")) {
+    // Get Leptonica message level from environment variable.
+    setMsgSeverity(L_SEVERITY_EXTERNAL);
+  } else {
+    // Disable debugging and informational messages from Leptonica.
+    setMsgSeverity(L_SEVERITY_ERROR);
+  }

 #if defined(HAVE_TIFFIO_H) && defined(_WIN32)
   /* Show libtiff errors and warnings on console (not in GUI). */


address compiler warning

address compiler warning

Change-Id: I6fc76f9adc036548029a86dd56a10372c1d0ce2c

--- cpucounters.cpp
+++ cpucounters.cpp
@@ -5043,7 +5043,7 @@
         {
             if (num_sockets == 2)
             {
-                uint32 SCore[2] = { socketRefCore[0], socketRefCore[1] };
+                uint32 SCore[2] = { (uint32)socketRefCore[0], (uint32)socketRefCore[1] };
                 uint64 Total_Reads[2] = { 0, 0 };
                 uint64 Total_Writes[2] = { 0, 0 };
                 uint64 IOH_Reads[2] = { 0, 0 };


gamma.6 - corrected logical error in api-server.cpp

--- libs/server/api-server.cpp
+++ libs/server/api-server.cpp
@@ -99,8 +99,8 @@
 {
 	int null_file = open(null_device, O_RDWR);
 	if (null_file < 0) return false;
-	if (null_file < dup2(null_file, execute_input) < 0) return false;
-	if (null_file < dup2(null_file, execute_output) < 0) return false;
+	if (dup2(null_file, execute_input)  < 0) return false;
+	if (dup2(null_file, execute_output) < 0) return false;

 	if (null_file != execute_input && null_file != execute_output)
 	close(null_file);


Reapplied the trimesh enabling change from #1374 which got caught up in the GIMPACT/double rollback of #1379. dTRIMESH_ENABLED is not publicly available since the build reorganisation changes (and no other demo uses it) and so the demo would never work properly.

--- ode/demo/demo_heightfield.cpp
+++ ode/demo/demo_heightfield.cpp
@@ -254,11 +254,8 @@
 	// Geom Creation
 	//

-	if ( cmd == 'b' || cmd == 's' || cmd == 'c' ||
-                #ifdef dTRIMESH_ENABLED
-		cmd == 'm' ||
-                #endif
-		cmd == 'x' || cmd == 'y' || cmd == 'v' )
+	if ( cmd == 'b' || cmd == 's' || cmd == 'c' || cmd == 'm' ||
+		 cmd == 'x' || cmd == 'y' || cmd == 'v' )
 	{
 		if ( num < NUM )
 		{
@@ -338,7 +335,6 @@
 			dMassSetSphere (&m,DENSITY,sides[0]);
 			obj[i].geom[0] = dCreateSphere (space,sides[0]);
 		}
-		#ifdef dTRIMESH_ENABLED
 		else if (cmd == 'm')
 		{
 			dTriMeshDataID new_tmdata = dGeomTriMeshDataCreate();
@@ -352,7 +348,6 @@
 			dGeomSetPosition(obj[i].geom[0], -m.c[0], -m.c[1], -m.c[2]);
 			dMassTranslate(&m, -m.c[0], -m.c[1], -m.c[2]);
 		}
-		#endif
 		else if (cmd == 'x')
 		{
 			dGeomID g2[GPB];		// encapsulated geometries
@@ -615,7 +610,6 @@
 				dsSetColor (1,1,0);
 			}

-                        #ifdef dTRIMESH_ENABLED
 			if ( obj[i].geom[j] && dGeomGetClass(obj[i].geom[j]) == dTriMeshClass )
 			{
 				dTriIndex* Indices = (dTriIndex*)::Indices;
@@ -658,9 +652,6 @@
 				dGeomTriMeshSetLastTransform( obj[i].geom[j],
 					*(dMatrix4*)( obj[i].matrix_dblbuff + ( obj[i].last_matrix_index * 16 ) ) );
 			}
-			#else
-			if (0) {}
-			#endif
 			else
 			{
 				drawGeom (obj[i].geom[j],0,0,show_aabb);


Make sure that a TBranch that was first created in an in-memory TTree and is later is attach to a file, does not inadvertently default to be not-compressed but instead default to the compression level of the file (as intended)

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

--- tree/tree/src/TBranch.cxx
+++ tree/tree/src/TBranch.cxx
@@ -2156,6 +2156,10 @@
    if (file == fTree->GetCurrentFile()) fFileName = "";
    else                                 fFileName = file->GetName();

+   if (file && fCompress == -1) {
+      fCompress = file->GetCompressionLevel();
+   }
+
    // Apply to all existing baskets.
    TIter nextb(GetListOfBaskets());
    TBasket *basket;


Fix shift state to index calculation in dummy keyboard processor.

--- common/engine/keyboardprocessor/src/keyboardprocessor.cpp
+++ common/engine/keyboardprocessor/src/keyboardprocessor.cpp
@@ -87,7 +87,7 @@

       default:
       {
-        auto shift_state = modifier_state & KM_KBP_MODIFIER_SHIFT;
+        auto shift_state = bool(modifier_state & KM_KBP_MODIFIER_SHIFT);
         // Only process further one of the shift states has something to output.
         if (table[0][vk][0] || table[1][vk][0])
         {


support GL_INVALID_FRAMEBUFFER_OPERAION and default error pattern.

--- include/wonder_rabbit_project/wonderland.renderer.detail/glew.detail/error.hxx
+++ include/wonder_rabbit_project/wonderland.renderer.detail/glew.detail/error.hxx
@@ -2,6 +2,7 @@

 #include <stdexcept>
 #include <sstream>
+#include <iostream>

 #include "c.hxx"
 #include "gl_type.hxx"
@@ -35,7 +36,9 @@
           if ( is_error( e ) )
           {
             std::stringstream message;
+
             message << "glGetError ( from " << file << " +" << line << " ) : " << e << " ";
+
             switch ( e )
             {
               case GL_INVALID_ENUM     : message << "GL_INVALID_ENUM";      break;
@@ -44,10 +47,20 @@
               case GL_STACK_OVERFLOW   : message << "GL_STACK_OVERFLOW";    break;
               case GL_STACK_UNDERFLOW  : message << "GL_STACK_UNDERFLOW";   break;
               case GL_OUT_OF_MEMORY    : message << "GL_OUT_OF_MEMORY";     break;
+#ifdef GL_VERSION_3_0
+              case GL_INVALID_FRAMEBUFFER_OPERATION: message << "GL_INVALID_FRAMEBUFFER_OPERATION"; break;
+#endif
+              default                  : message << std::to_string( e );
             }
+
             throw std::runtime_error( message.str() );
           }
         }
+#ifndef _NDEBUG
+  #define WRP_GLEW_TEST_ERROR wonder_rabbit_project::wonderland::renderer::glew::test_error( __FILE__, __LINE__ );
+#else
+  #define WRP_GLEW_TEST_ERROR
+#endif

       }
     }


updated helloworldoverlay to latest sdk

updated helloworldoverlay to latest sdk

#335

[git-p4: depot-paths = "//vr/steamvr/sdk_release/": change = 3739956]

--- samples/helloworldoverlay/openvroverlaycontroller.cpp
+++ samples/helloworldoverlay/openvroverlaycontroller.cpp
@@ -188,7 +188,7 @@
 	GLuint unTexture = m_pFbo->texture();
 	if( unTexture != 0 )
 	{
-        vr::Texture_t texture = {(void*)unTexture, vr::API_OpenGL, vr::ColorSpace_Auto };
+        vr::Texture_t texture = {(void*)unTexture, vr::TextureType_OpenGL, vr::ColorSpace_Auto };
         vr::VROverlay()->SetOverlayTexture( m_ulOverlayHandle, &texture );
 	}
 }


Initialize Audio Stream when playing a stream.

--- engine/source/audio/audio.cc
+++ engine/source/audio/audio.cc
@@ -579,6 +579,8 @@
 {
    ALuint source = streamSource->mSource;
    Audio::Description& desc = streamSource->mDescription;
+
+   bool ret = streamSource->initStream();

    alSourcef(source, AL_GAIN, Audio::linearToDB(desc.mVolume * mAudioChannelVolumes[desc.mVolumeChannel] * mMasterVolume));
 //   alSourcei(source, AL_LOOPING, AL_FALSE);


MIR Gen - Some sanity checks on casts (incomplete)

--- src/mir/from_hir.cpp
+++ src/mir/from_hir.cpp
@@ -219,9 +219,10 @@
             this->visit_node_ptr(node.m_code);
             m_loop_stack.pop_back();

-            // If there's a stray result, drop i
+            // If there's a stray result, drop it
             if( m_builder.has_result() ) {
                 assert( m_builder.block_active() );
+                // TODO: Does this result have to be dropped? Ideally this should always be ()
                 //::MIR::RValue res = m_builder.get_result(node.span());
                 //if( res.is_Use() ) {
                 //    m_builder.push_stmt_drop( mv$(res.as_Use()) );
@@ -634,18 +635,104 @@
             this->visit_node_ptr(node.m_value);
             auto val = m_builder.lvalue_or_temp( node.m_value->m_res_type, m_builder.get_result(node.m_value->span()) );

-            #if 0
-            TU_MATCH_DEF( ::HIR::TypeRef::Data, (node.m_res_type->m_data), (de),
+            const auto& ty_out = node.m_res_type;
+            const auto& ty_in = node.m_value->m_res_type;
+
+            TU_MATCH_DEF( ::HIR::TypeRef::Data, (ty_out.m_data), (de),
             (
+                BUG(node.span(), "Invalid cast to " << ty_out);
+                ),
+            (Pointer,
+                if( ty_in.m_data.is_Primitive() && ty_in.m_data.as_Primitive() == ::HIR::CoreType::Usize ) {
+                    // TODO: Only valid if T: Sized in *{const/mut/move} T
+                }
+                else TU_IFLET( ::HIR::TypeRef::Data, ty_in.m_data, Borrow, se,
+                    if( *de.inner != *se.inner ) {
+                        BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                    }
+                    // Valid
+                )
+                else TU_IFLET( ::HIR::TypeRef::Data, ty_in.m_data, Function, se,
+                    if( *de.inner != ::HIR::TypeRef::new_unit() ) {
+                        BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                    }
+                    // Valid
+                )
+                else TU_IFLET( ::HIR::TypeRef::Data, ty_in.m_data, Pointer, se,
+                    // Valid
+                )
+                else {
+                    BUG(node.span(), "Cannot cast to pointer from " << ty_in);
+                }
                 ),
             (Primitive,
                 switch(de)
                 {
-
+                case ::HIR::CoreType::Str:
+                    BUG(node.span(), "Cannot cast to str");
+                    break;
+                case ::HIR::CoreType::Char:
+                    if( ty_in.m_data.is_Primitive() && ty_in.m_data.as_Primitive() == ::HIR::CoreType::U8 ) {
+                        // Valid
+                    }
+                    else {
+                        BUG(node.span(), "Cannot cast to char from " << ty_in);
+                    }
+                    break;
+                case ::HIR::CoreType::Bool:
+                    BUG(node.span(), "Cannot cast to bool");
+                    break;
+                case ::HIR::CoreType::F32:
+                case ::HIR::CoreType::F64:
+                    TU_IFLET(::HIR::TypeRef::Data, ty_in.m_data, Primitive, se,
+                        switch(de)
+                        {
+                        case ::HIR::CoreType::Str:
+                        case ::HIR::CoreType::Char:
+                        case ::HIR::CoreType::Bool:
+                            BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                            break;
+                        default:
+                            // Valid
+                            break;
+                        }
+                    )
+                    else {
+                        BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                    }
+                    break;
+                default:
+                    TU_IFLET(::HIR::TypeRef::Data, ty_in.m_data, Primitive, se,
+                        switch(de)
+                        {
+                        case ::HIR::CoreType::Str:
+                            BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                        default:
+                            // Valid
+                            break;
+                        }
+                    )
+                    else TU_IFLET(::HIR::TypeRef::Data, ty_in.m_data, Path, se,
+                        TU_IFLET(::HIR::TypeRef::TypePathBinding, se.binding, Enum, pbe,
+                            // TODO: Check if it's a repr(ty/C) enum - and if the type matches
+                        )
+                        else {
+                            BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                        }
+                    )
+                    else if( de == ::HIR::CoreType::Usize && ty_in.m_data.is_Pointer() ) {
+                        // TODO: Only valid for T: Sized?
+                    }
+                    else if( de == ::HIR::CoreType::Usize && ty_in.m_data.is_Function() ) {
+                        // TODO: Always valid?
+                    }
+                    else {
+                        BUG(node.span(), "Cannot cast to " << ty_out << " from " << ty_in);
+                    }
+                    break;
                 }
                 )
             )
-            #endif
             auto res = m_builder.new_temporary(node.m_res_type);
             m_builder.push_stmt_assign(res.clone(), ::MIR::RValue::make_Cast({ mv$(val), node.m_res_type.clone() }));
             m_builder.set_result( node.span(), mv$(res) );
@@ -879,7 +966,7 @@
         }
         void visit(::HIR::ExprNode_CallMethod& node) override
         {
-            // TODO: Allow use on trait objects.
+            // TODO: Allow use on trait objects? May not be needed, depends.
             BUG(node.span(), "Leftover _CallMethod");
         }
         void visit(::HIR::ExprNode_Field& node) override


Remove ModelBox preview timeout.

Remove ModelBox preview timeout.

--- src/app/ModuleBrowser.cpp
+++ src/app/ModuleBrowser.cpp
@@ -141,8 +141,6 @@
 	ui::Tooltip* tooltip = NULL;
 	/** Lazily created */
 	widget::FramebufferWidget* previewFb = NULL;
-	/** Number of frames since draw() has been called */
-	int visibleFrames = 0;

 	ModelBox() {
 		// Approximate size as 10HP before we know the actual size.
@@ -189,16 +187,7 @@
 		previewFb = NULL;
 	}

-	void step() override {
-		if (previewFb && ++visibleFrames >= 60) {
-			deletePreview();
-		}
-		OpaqueWidget::step();
-	}
-
 	void draw(const DrawArgs& args) override {
-		visibleFrames = 0;
-
 		// Lazily create preview when drawn
 		if (!previewFb) {
 			createPreview();


fix SelectedRows rows() method gpu runtime error

--- paddle/pybind/pybind.cc
+++ paddle/pybind/pybind.cc
@@ -153,7 +153,17 @@
       .def("set_height", &SelectedRows::set_height)
       .def("height", &SelectedRows::height)
       .def("set_rows", &SelectedRows::set_rows)
-      .def("rows", &SelectedRows::rows, py::return_value_policy::reference);
+      .def("rows", [](SelectedRows &self) {
+#ifndef PADDLE_WITH_CUDA
+        return self.rows();
+#else
+         auto rows = self.rows();
+         std::vector<int64_t> new_rows;
+         new_rows.reserve(rows.size());
+         std::copy(rows.begin(), rows.end(), std::back_inserter(new_rows));
+         return new_rows;
+#endif
+      });

   py::class_<Variable>(m, "Variable", R"DOC(Variable Class.


fix crazy parameter

fix crazy parameter

--- ofxWebUIExample/src/ofApp.cpp
+++ ofxWebUIExample/src/ofApp.cpp
@@ -5,7 +5,7 @@
     ofxWebUI &ui = ofxWebUI::ui();
     ui.setup("ofxWebUI Example");

-    ofxWebUIOption o1 = ofxWebUIOption::createRangeOption(250, 1000, 2500);
+    ofxWebUIOption o1 = ofxWebUIOption::createRangeOption(100, 2500, 250);
     ui.bindParameter("x", ofxWebUITypeSlider, x, o1);

     ofxWebUIOption o2 = ofxWebUIOption::createRangeOption(-10000, 10000, 0);


MB-36301: Prefer O(n) expelled list iterations

This commit is no way a fix for any observed performance issue,
but during the bulk of reverts for MB-36301 it was noted that
expelItems performs O(2n) iterations of the expelled items for
open checkpoints.

Change-Id: I03828b8883fdaed16758da4bf4d443d984911732
Reviewed-on: http://review.couchbase.org/116075
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>

--- engines/ep/src/checkpoint.cc
+++ engines/ep/src/checkpoint.cc
@@ -375,7 +375,7 @@
                          iterator.getUnderlyingIterator());

     if (getState() == CHECKPOINT_OPEN) {
-        // Whilst cp is open invalidate item
+        // Whilst cp is open invalidate item and reduce queuedItemsMemUsage
         for (const auto& expelled : expelledItems) {
             if (!expelled->isCheckPointMetaItem()) {
                 auto itr = keyIndex.find(
@@ -386,18 +386,19 @@
                 Expects(itr != keyIndex.end());
                 itr->second.invalidate(end());
             }
-        }
-    }
-
-    /*
-     * Reduce the queuedItems memory usage by the size of the items
-     * being expelled from memory.
-     */
-    const auto addSize = [](size_t a, queued_item qi) {
-        return a + qi->size();
-    };
-    queuedItemsMemUsage -= std::accumulate(
-            expelledItems.begin(), expelledItems.end(), 0, addSize);
+            queuedItemsMemUsage -= expelled->size();
+        }
+    } else {
+        /*
+         * Reduce the queuedItems memory usage by the size of the items
+         * being expelled from memory.
+         */
+        const auto addSize = [](size_t a, queued_item qi) {
+            return a + qi->size();
+        };
+        queuedItemsMemUsage -= std::accumulate(
+                expelledItems.begin(), expelledItems.end(), 0, addSize);
+    }

     // Return the items that have been expelled in a separate queue.
     return expelledItems;


Fixed another merge failure.

Fixed another merge failure.

--- src/mon/MonClient.cc
+++ src/mon/MonClient.cc
@@ -481,23 +481,16 @@
   while (state != MC_STATE_HAVE_SESSION && !authenticate_err) {
     if (timeout > 0.0) {
       printf("4.4\n");
+      printf("%d\n", until);
       int r = auth_cond.WaitUntil(monc_lock, until);
-
-      printf("%d\n", until);
+      printf("MonClient::authenticate auth_cond.WaitUntil(monc_lock, until) -> %d\n", r);
       printf("4.5\n");
       if (r == ETIMEDOUT) {
         printf("4.6\n");
-	ldout(cct, 0) << "authenticate timed out after " << timeout << dendl;
-	authenticate_err = -r;
-    printf("5\n");
-
-      printf("MonClient::authenticate auth_cond.WaitUntil(monc_lock, until) -> %d\n", r);
-      if (r == ETIMEDOUT) {
       	ldout(cct, 0) << "authenticate timed out after " << timeout << dendl;
         std::cout << "authenticate timed out after " << timeout << std::endl;
       	authenticate_err = -r;
         printf("5\n");
-
       }
     } else {
       printf("4.7\n");


Fix an issue where the context menu could not be opened.

--- Dev/Cpp/Viewer/3rdParty/imgui_addon/fcurve/fcurve.cpp
+++ Dev/Cpp/Viewer/3rdParty/imgui_addon/fcurve/fcurve.cpp
@@ -384,11 +384,6 @@
 			}
 		}

-		if (tangent)
-		{
-			*tangent = transform_s2f(*tangent);
-		}
-
 		return isLineHovered;
 	}

@@ -745,6 +740,128 @@
 		context.AreaStartingY = fpos.y;
 		context.Store(window);
 		return true;
+	}
+
+	bool AddFCurvePoint(ImVec2 v,
+		float* keys, float* values,
+		float* leftHandleKeys, float* leftHandleValues,
+		float* rightHandleKeys, float* rightHandleValues,
+		ImFCurveInterporationType* interporations,
+		bool* kv_selected, int count, int* newCount)
+	{
+		bool result = false;
+
+		v.x = (int32_t)(v.x + 0.5);
+
+		if (v.x < keys[0])
+		{
+			for (int j = count; j > 0; j--)
+			{
+				keys[j] = keys[j - 1];
+				values[j] = values[j - 1];
+				leftHandleKeys[j] = leftHandleKeys[j - 1];
+				leftHandleValues[j] = leftHandleValues[j - 1];
+				rightHandleKeys[j] = rightHandleKeys[j - 1];
+				rightHandleValues[j] = rightHandleValues[j - 1];
+				kv_selected[j] = kv_selected[j - 1];
+				interporations[j] = interporations[j - 1];
+			}
+
+			keys[0] = v.x;
+			values[0] = v.y;
+			leftHandleKeys[0] = v.x;
+			leftHandleValues[0] = v.y;
+			rightHandleKeys[0] = v.x;
+			rightHandleValues[0] = v.y;
+			kv_selected[0] = false;
+			interporations[0] = ImFCurveInterporationType::Linear;
+
+			(*newCount) = count + 1;
+			result = true;
+		}
+		else if (v.x >= keys[count - 1])
+		{
+			keys[count] = v.x;
+			values[count] = v.y;
+			leftHandleKeys[count] = v.x;
+			leftHandleValues[count] = v.y;
+			rightHandleKeys[count] = v.x;
+			rightHandleValues[count] = v.y;
+			kv_selected[count] = false;
+			interporations[count] = ImFCurveInterporationType::Linear;
+
+			(*newCount) = count + 1;
+			result = true;
+		}
+		else
+		{
+			for (int i = 0; i < count - 1; i++)
+			{
+				if (keys[i] <= v.x && v.x < keys[i + 1])
+				{
+					for (int j = count; j > i; j--)
+					{
+						keys[j] = keys[j - 1];
+						values[j] = values[j - 1];
+						leftHandleKeys[j] = leftHandleKeys[j - 1];
+						leftHandleValues[j] = leftHandleValues[j - 1];
+						rightHandleKeys[j] = rightHandleKeys[j - 1];
+						rightHandleValues[j] = rightHandleValues[j - 1];
+						kv_selected[j] = kv_selected[j - 1];
+						interporations[j] = interporations[j - 1];
+					}
+
+					keys[i + 1] = v.x;
+					values[i + 1] = v.y;
+					leftHandleKeys[i + 1] = v.x;
+					leftHandleValues[i + 1] = v.y;
+					rightHandleKeys[i + 1] = v.x;
+					rightHandleValues[i + 1] = v.y;
+					kv_selected[i + 1] = false;
+					interporations[i + 1] = ImFCurveInterporationType::Linear;
+
+					(*newCount) = count + 1;
+					result = true;
+					break;
+				}
+			}
+		}
+
+		ClampHandles(keys, values, leftHandleKeys, leftHandleValues, rightHandleKeys, rightHandleValues, count);
+
+		return result;
+	}
+
+	bool RemoveFCurvePoint(ImVec2 v,
+		float* keys, float* values,
+		float* leftHandleKeys, float* leftHandleValues,
+		float* rightHandleKeys, float* rightHandleValues,
+		ImFCurveInterporationType* interporations,
+		bool* kv_selected, int count, int* newCount)
+	{
+		bool result = false;
+
+		for (int i = 0; i < count; i++)
+		{
+			if (!IsHovered(v, ImVec2(keys[i], values[i]), 3))
+				continue;
+
+			for (int j = i; j < count; j++)
+			{
+				keys[j] = keys[j + 1];
+				values[j] = values[j + 1];
+				leftHandleKeys[j] = leftHandleKeys[j + 1];
+				leftHandleValues[j] = leftHandleValues[j + 1];
+				rightHandleKeys[j] = rightHandleKeys[j + 1];
+				rightHandleValues[j] = rightHandleValues[j + 1];
+				kv_selected[j] = kv_selected[j + 1];
+				interporations[j] = interporations[j + 1];
+			}
+
+			(*newCount) = count - 1;
+
+			return true;
+		}
 	}

 	bool NoPointFCurve(
@@ -795,6 +912,7 @@
 			hasControlled = true;
 		}

+		ImVec2 lineHoveredPos = {};
 		bool isLineHovered = false;
 		{
 			auto v1 = ImVec2(transform_s2f(innerRect.Min).x, defaultValue);
@@ -804,8 +922,8 @@
 				GetMousePos(), window,
 				transform_f2s(v1),
 				transform_f2s(v2),
-				col,
-				2);
+				col, 2, &lineHoveredPos);
+			lineHoveredPos = transform_s2f(lineHoveredPos);
 		}

 		// Add point
@@ -828,6 +946,27 @@
 				(*newCount) = count + 1;
 				hasControlled = true;
 			}
+
+			if (isLineHovered && IsMouseReleased(1))
+			{
+				ImGui::OpenPopup("FCurveMenu_Add");
+				window->StateStorage.SetFloat((ImGuiID)FCurveStorageValues::CONTEXT_MENU_ORIGIN_X, lineHoveredPos.x);
+				window->StateStorage.SetFloat((ImGuiID)FCurveStorageValues::CONTEXT_MENU_ORIGIN_Y, lineHoveredPos.y);
+			}
+			if (ImGui::BeginPopup("FCurveMenu_Add"))
+			{
+				if (ImGui::Selectable("Add"))
+				{
+					float x = window->StateStorage.GetFloat((ImGuiID)FCurveStorageValues::CONTEXT_MENU_ORIGIN_X, 0.0f);
+					float y = window->StateStorage.GetFloat((ImGuiID)FCurveStorageValues::CONTEXT_MENU_ORIGIN_Y, 0.0f);
+					hasControlled = AddFCurvePoint({x, y},
+						keys, values, leftHandleKeys, leftHandleValues,
+						rightHandleKeys, rightHandleValues, interporations,
+						kv_selected, count, newCount);
+					count = *newCount;
+				}
+				ImGui::EndPopup();
+			}
 		}

 		// is line selected
@@ -861,128 +1000,6 @@
 		PopID();

 		return hasControlled;
-	}
-
-	bool AddFCurvePoint(ImVec2 v,
-		float* keys, float* values,
-		float* leftHandleKeys, float* leftHandleValues,
-		float* rightHandleKeys, float* rightHandleValues,
-		ImFCurveInterporationType* interporations,
-		bool* kv_selected, int count, int* newCount)
-	{
-		bool result = false;
-
-		v.x = (int32_t)(v.x + 0.5);
-
-		if (v.x < keys[0])
-		{
-			for (int j = count; j > 0; j--)
-			{
-				keys[j] = keys[j - 1];
-				values[j] = values[j - 1];
-				leftHandleKeys[j] = leftHandleKeys[j - 1];
-				leftHandleValues[j] = leftHandleValues[j - 1];
-				rightHandleKeys[j] = rightHandleKeys[j - 1];
-				rightHandleValues[j] = rightHandleValues[j - 1];
-				kv_selected[j] = kv_selected[j - 1];
-				interporations[j] = interporations[j - 1];
-			}
-
-			keys[0] = v.x;
-			values[0] = v.y;
-			leftHandleKeys[0] = v.x;
-			leftHandleValues[0] = v.y;
-			rightHandleKeys[0] = v.x;
-			rightHandleValues[0] = v.y;
-			kv_selected[0] = false;
-			interporations[0] = ImFCurveInterporationType::Linear;
-
-			(*newCount) = count + 1;
-			result = true;
-		}
-		else if (v.x >= keys[count - 1])
-		{
-			keys[count] = v.x;
-			values[count] = v.y;
-			leftHandleKeys[count] = v.x;
-			leftHandleValues[count] = v.y;
-			rightHandleKeys[count] = v.x;
-			rightHandleValues[count] = v.y;
-			kv_selected[count] = false;
-			interporations[count] = ImFCurveInterporationType::Linear;
-
-			(*newCount) = count + 1;
-			result = true;
-		}
-		else
-		{
-			for (int i = 0; i < count - 1; i++)
-			{
-				if (keys[i] <= v.x && v.x < keys[i + 1])
-				{
-					for (int j = count; j > i; j--)
-					{
-						keys[j] = keys[j - 1];
-						values[j] = values[j - 1];
-						leftHandleKeys[j] = leftHandleKeys[j - 1];
-						leftHandleValues[j] = leftHandleValues[j - 1];
-						rightHandleKeys[j] = rightHandleKeys[j - 1];
-						rightHandleValues[j] = rightHandleValues[j - 1];
-						kv_selected[j] = kv_selected[j - 1];
-						interporations[j] = interporations[j - 1];
-					}
-
-					keys[i + 1] = v.x;
-					values[i + 1] = v.y;
-					leftHandleKeys[i + 1] = v.x;
-					leftHandleValues[i + 1] = v.y;
-					rightHandleKeys[i + 1] = v.x;
-					rightHandleValues[i + 1] = v.y;
-					kv_selected[i + 1] = false;
-					interporations[i + 1] = ImFCurveInterporationType::Linear;
-
-					(*newCount) = count + 1;
-					result = true;
-					break;
-				}
-			}
-		}
-
-		ClampHandles(keys, values, leftHandleKeys, leftHandleValues, rightHandleKeys, rightHandleValues, count);
-
-		return result;
-	}
-
-	bool RemoveFCurvePoint(ImVec2 v,
-		float* keys, float* values,
-		float* leftHandleKeys, float* leftHandleValues,
-		float* rightHandleKeys, float* rightHandleValues,
-		ImFCurveInterporationType* interporations,
-		bool* kv_selected, int count, int* newCount)
-	{
-		bool result = false;
-
-		for (int i = 0; i < count; i++)
-		{
-			if (!IsHovered(v, ImVec2(keys[i], values[i]), 3))
-				continue;
-
-			for (int j = i; j < count; j++)
-			{
-				keys[j] = keys[j + 1];
-				values[j] = values[j + 1];
-				leftHandleKeys[j] = leftHandleKeys[j + 1];
-				leftHandleValues[j] = leftHandleValues[j + 1];
-				rightHandleKeys[j] = rightHandleKeys[j + 1];
-				rightHandleValues[j] = rightHandleValues[j + 1];
-				kv_selected[j] = kv_selected[j + 1];
-				interporations[j] = interporations[j + 1];
-			}
-
-			(*newCount) = count - 1;
-
-			return true;
-		}
 	}

 	bool FCurve(
@@ -1110,6 +1127,7 @@
 			leftHandleKeys, leftHandleValues,
 			rightHandleKeys, rightHandleValues,
 			interporations, startEdge, endEdge, col, count, &lineHoveredPos);
+		lineHoveredPos = transform_s2f(lineHoveredPos);

 		auto lineThiness = 1.5f;
 		if (selected) lineThiness++;


[SAFS]: print error msg when slab allocator fails to alloc memory.

--- libsafs/slab_allocator.cpp
+++ libsafs/slab_allocator.cpp
@@ -199,6 +199,8 @@
 			// If we can't allocate all objects, then free all objects that
 			// have been allocated, and return 0.
 			free(objs, num);
+			fprintf(stderr, "the slab allocator %s uses %ld bytes\n",
+					name.c_str(), get_curr_size());
 			return 0;
 		}
 	}


comment out code that relies on app_private.  this field is not portable across different versions of db3.

--- sfsrodb/dbfe.C
+++ sfsrodb/dbfe.C
@@ -262,11 +262,13 @@
  if (create == 0) flags |= DB_EXCL;

+#if 0
  if (compare) {
    db->app_private = this;
    r =  db->set_bt_compare (db, IMPL_compare_fcn_sleepycat);
    if (r != 0) return r;
  }
+#endif

  r = db->open(db, (const char *)filename, NULL, DB_BTREE, flags, mode);
  return r;
@@ -360,12 +362,17 @@
 int
 dbfe::IMPL_compare_fcn_sleepycat (DB *db, const DBT *a, const DBT *b)
 {
+#if 0
   dbfe *dbf = (dbfe *)db->app_private;

   ref<dbrec> arec = New refcounted<dbrec>(a->data, a->size);
   ref<dbrec> brec = New refcounted<dbrec>(b->data, b->size);

   return dbf->compare (arec, brec);
+#else
+  assert (0);
+  return -1;
+#endif
 }


Get rid of unnecessary header.

Get rid of unnecessary header.

--- entity-system/ESCoreBase.cpp
+++ entity-system/ESCoreBase.cpp
@@ -1,34 +1,3 @@
-/*
-   For more information, please see: http://software.sci.utah.edu
-
-   The MIT License
-
-   Copyright (c) 2014 Scientific Computing and Imaging Institute,
-   University of Utah.
-
-
-   Permission is hereby granted, free of charge, to any person obtaining a
-   copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-*/
-
-/// \author James Hughes
-/// \date   February 2014
-
 #include "ESCoreBase.hpp"

 namespace CPM_ES_NS {


Show color-space name

Show color-space name

Signed-off-by: janus_wel <0d0ff7a9d29f0ddfdd011e7431e322b0a35fda8c@gmail.com>

--- src/apps/avsinfo/main.cpp
+++ src/apps/avsinfo/main.cpp
@@ -123,7 +123,7 @@
             }
             if (video_flags[VIDEO_TIME])        print_video_items(VIDEO_TIME, vi.time);
             if (video_flags[FRAMES])            print_video_items(FRAMES, vi.numof_frames);
-            if (video_flags[COLOR_SPACE])       print_video_items(COLOR_SPACE, vi.color_space);
+            if (video_flags[COLOR_SPACE])       print_video_items(COLOR_SPACE, VideoInfo::fourcc_name(vi.color_space));
             if (video_flags[BPP])               print_video_items(BPP, vi.bpp);
             if (video_flags[INTERLACE_TYPE]) {
                 if (machine_flag) print_video_items(INTERLACE_TYPE, vi.is_fieldbased);


removed implicit checkconfig calls

removed implicit checkconfig calls

--- coast/wdbase/Application.cpp
+++ coast/wdbase/Application.cpp
@@ -42,10 +42,6 @@
 int Application::Init()
 {
 	StartTrace(Application.Init);
-
-	CheckConfig("Application", true);
-	TraceAny(fConfig, "Application config");
-
 	return 0;
 }

@@ -72,15 +68,6 @@
 bool Application::DoLookup(const char *key, ROAnything &result, char delim, char indexdelim) const
 {
 	StartTrace(Application.Lookup);
-	// lookup the application store
-//	{
-//		MutexEntry me((Mutex&)fStoreMutex);
-//		ROAnything store(fStore);
-//		if ( store.LookupPath(result, key, delim, indexdelim) )
-//		{
-//			return true;
-//		}
-//	}

 	// have a lookup in the application config
 	if ( HierarchConfNamed::DoLookup(key, result, delim, indexdelim) ) {
@@ -153,7 +140,6 @@
 int Application::GlobalInit(int argc, char *argv[], const ROAnything config)
 {
 	StartTrace(Application.GlobalInit);
-
 	return Init();	// Call instance init
 }

@@ -170,18 +156,6 @@

 	return Terminate(val);
 }
-//
-//void Application::PutInStore(const char *key, const Anything &a)
-//{
-//	MutexEntry me(fStoreMutex);me.Use();
-//	fStore[key]= a;
-//}
-//
-//void Application::RemoveFromStore(const char *key)
-//{
-//	MutexEntry me(fStoreMutex);me.Use();
-//	fStore.Remove(key);
-//}
-//
+
 //---- registry api
 RegCacheImpl(Application);	// FindApplication()


- reply with NACK (resend) to unknown/unsupported keyboard mouse commands - unnecessary return statements removed - some messages changed

--- iodev/keyboard.cc
+++ iodev/keyboard.cc
@@ -320,8 +320,7 @@

       DEV_pic_lower_irq(12);
       activate_timer();
-      BX_DEBUG(("READ(%02x) (from mouse) = %02x", (unsigned) address,
-          (unsigned) val));
+      BX_DEBUG(("[mouse] read from 0x%02x returns 0x%02x", address, val));
       return val;
       }
     else if (BX_KEY_THIS s.kbd_controller.outb) { /* kbd byte available */
@@ -937,7 +936,7 @@
   BX_DEBUG(("mouse_enQ(%02x)", (unsigned) mouse_data));

   if (BX_KEY_THIS s.mouse_internal_buffer.num_elements >= BX_MOUSE_BUFF_SIZE) {
-    BX_ERROR(("mouse: internal mouse buffer full, ignoring mouse data.(%02x)",
+    BX_ERROR(("[mouse] internal mouse buffer full, ignoring mouse data.(%02x)",
       (unsigned) mouse_data));
     return;
   }
@@ -1012,32 +1011,27 @@
   switch (value) {
     case 0x00: // ??? ignore and let OS timeout with no response
       kbd_enQ(0xFA); // send ACK %%%
-      return;
       break;

     case 0x05: // ???
       // (mch) trying to get this to work...
       BX_KEY_THIS s.kbd_controller.sysf = 1;
       kbd_enQ_imm(0xfe);
-      return;
       break;

     case 0xed: // LED Write
       BX_KEY_THIS s.kbd_internal_buffer.expecting_led_write = 1;
       kbd_enQ_imm(0xFA); // send ACK %%%
-      return;
       break;

     case 0xee: // echo
       kbd_enQ(0xEE); // return same byte (EEh) as echo diagnostic
-      return;
       break;

     case 0xf0: // Select alternate scan code set
       BX_KEY_THIS s.kbd_controller.expecting_scancodes_set = 1;
       BX_DEBUG(("Expecting scancode set info..."));
       kbd_enQ(0xFA); // send ACK
-      return;
       break;

     case 0xf2:  // identify keyboard
@@ -1057,20 +1051,17 @@
             kbd_enQ(0x83);
         }
       }
-      return;
       break;

     case 0xf3:  // typematic info
       BX_KEY_THIS s.kbd_internal_buffer.expecting_typematic = 1;
       BX_INFO(("setting typematic info"));
       kbd_enQ(0xFA); // send ACK
-      return;
       break;

     case 0xf4:  // enable keyboard
       BX_KEY_THIS s.kbd_internal_buffer.scanning_enabled = 1;
       kbd_enQ(0xFA); // send ACK
-      return;
       break;

     case 0xf5:  // reset keyboard to power-up settings and disable scanning
@@ -1078,7 +1069,6 @@
       kbd_enQ(0xFA); // send ACK
       BX_KEY_THIS s.kbd_internal_buffer.scanning_enabled = 0;
       BX_INFO(("reset-disable command received"));
-      return;
       break;

     case 0xf6:  // reset keyboard to power-up settings and enable scanning
@@ -1086,7 +1076,22 @@
       kbd_enQ(0xFA); // send ACK
       BX_KEY_THIS s.kbd_internal_buffer.scanning_enabled = 1;
       BX_INFO(("reset-enable command received"));
-      return;
+      break;
+
+    case 0xfe:  // resend. aiiee.
+      BX_PANIC( ("got 0xFE (resend)"));
+      break;
+
+    case 0xff:  // reset: internal keyboard reset and afterwards the BAT
+      BX_DEBUG(("reset command received"));
+      resetinternals(1);
+      kbd_enQ(0xFA); // send ACK
+      BX_KEY_THIS s.kbd_controller.bat_in_progress = 1;
+      kbd_enQ(0xAA); // BAT test passed
+      break;
+
+    case 0xd3:
+      kbd_enQ(0xfa);
       break;

     case 0xf7:  // PS/2 Set All Keys To Typematic
@@ -1096,39 +1101,9 @@
     case 0xfb:  // PS/2 Set Key Type to Typematic
     case 0xfc:  // PS/2 Set Key Type to Make/Break
     case 0xfd:  // PS/2 Set Key Type to Make
-      // Silently ignore and let the OS timeout, for now.
-      // If anyone has code around that makes use of that, I can
-      // provide documentation on their behavior (ask core@ggi-project.org)
-      return;
-      break;
-
-    case 0xfe:  // resend. aiiee.
-      BX_PANIC( ("got 0xFE (resend)"));
-      return;
-      break;
-
-    case 0xff:  // reset: internal keyboard reset and afterwards the BAT
-      BX_DEBUG(("reset command received"));
-      resetinternals(1);
-      kbd_enQ(0xFA); // send ACK
-      BX_KEY_THIS s.kbd_controller.bat_in_progress = 1;
-      kbd_enQ(0xAA); // BAT test passed
-      return;
-      break;
-
-    case 0xd3:
-      kbd_enQ(0xfa);
-      return;
-
     default:
-     /* XXX fix this properly:
-        http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/mouse/mouse.html
-        http://sourceforge.net/tracker/index.php?func=detail&aid=422457&group_id=12580&atid=112580
-      */
-      BX_ERROR(("kbd_ctrl_to_kbd(): got value of %02x",
-        (unsigned) value));
-      kbd_enQ(0xFA); /* send ACK ??? */
-      return;
+      BX_ERROR(("kbd_ctrl_to_kbd(): got value of 0x%02x", value));
+      kbd_enQ(0xFE); /* send NACK */
       break;
   }
 }
@@ -1461,8 +1436,11 @@
        break;

       default:
-        //FEh Resend
-        BX_PANIC(("MOUSE: kbd_ctrl_to_mouse(%02xh)", (unsigned) value));
+        // If PS/2 mouse present, send NACK for unknown commands, otherwise ignore
+        if (is_ps2) {
+          BX_ERROR(("[mouse] kbd_ctrl_to_mouse(): got value of 0x%02x", value));
+          kbd_enQ(0xFE); /* send NACK */
+        }
     }
   }
 }


debuglevels: removed conflicting fix for a leaking WorkWindow - both changes together cause a crash

--- sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -50,7 +50,6 @@
 #include <sfx2/viewfrm.hxx>
 #include <vcl/wrkwin.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
-#include <tools/diagnose_ex.h>

 #include <boost/bind.hpp>

@@ -154,20 +153,6 @@

 BasicViewFactory::~BasicViewFactory (void)
 {
-    mpViewCache.reset();
-
-    Reference< awt::XWindow > xLocalPaneWindow( mxLocalPane->getWindow() );
-    try
-    {
-        const Reference< XComponent > xLocalPaneComponent( mxLocalPane, UNO_QUERY_THROW );
-        xLocalPaneComponent->dispose();
-        const Reference< XComponent > xWindowComponent( xLocalPaneWindow, UNO_QUERY_THROW );
-        xWindowComponent->dispose();
-    }
-    catch( const Exception& )
-    {
-        DBG_UNHANDLED_EXCEPTION();
-    }
 }


Adds two features to the javascript binding: - avoids resetting event state to zero at startup. - queries all event states upon startup. - allows javascript to toggle the bit by producing the necessary event.

--- applications/js_client/client.cxx
+++ applications/js_client/client.cxx
@@ -38,12 +38,14 @@
 #include <emscripten/val.h>

 #include <memory>
+#include <set>

 #include "os/os.h"
 #include "can_frame.h"
 #include "nmranet_config.h"

 #include "os/TempFile.hxx"
+#include "nmranet/Defs.hxx"
 #include "nmranet/SimpleStack.hxx"
 #include "nmranet/SimpleNodeInfoMockUserFile.hxx"
 #include "nmranet/EventHandlerTemplates.hxx"
@@ -53,8 +55,8 @@

 nmranet::SimpleCanStack stack(NODE_ID);

-nmranet::MockSNIPUserFile snip_user_file("Default user name",
-                                         "Default user description");
+nmranet::MockSNIPUserFile snip_user_file(
+    "Default user name", "Default user description");
 const char *const nmranet::SNIP_DYNAMIC_FILENAME =
     nmranet::MockSNIPUserFile::snip_user_file_path;

@@ -69,16 +71,103 @@
 {
 }

+class QueryFlow : public StateFlowBase
+{
+public:
+    QueryFlow()
+        : StateFlowBase(stack.service())
+    {
+        start_flow(STATE(wait_for_initialized));
+    }
+
+    void add_event(uint64_t event_id)
+    {
+        /// @TODO (balazs.racz) handle the case when events are insnerted after
+        /// the iteration has begun.
+        events_.insert(event_id);
+    }
+
+private:
+    Action wait_for_initialized()
+    {
+        if (!stack.node()->is_initialized())
+        {
+            return sleep_and_call(
+                &timer_, SEC_TO_NSEC(1), STATE(wait_for_initialized));
+        }
+        return call_immediately(STATE(start_iteration));
+    }
+
+    Action start_iteration()
+    {
+        nextEvent_ = events_.begin();
+        return call_immediately(STATE(iterate));
+    }
+
+    Action iterate()
+    {
+        if (nextEvent_ == events_.end())
+        {
+            return exit();
+        }
+        return allocate_and_call(
+            stack.node()->interface()->global_message_write_flow(),
+            STATE(send_query));
+    }
+
+    Action send_query()
+    {
+        auto *f = stack.node()->interface()->global_message_write_flow();
+        auto *b = get_allocation_result(f);
+        b->data()->reset(nmranet::Defs::MTI_PRODUCER_IDENTIFY, stack.node()->node_id(),
+                         nmranet::eventid_to_buffer(*nextEvent_));
+        b->data()->set_flag_dst(nmranet::NMRAnetMessage::WAIT_FOR_LOCAL_LOOPBACK);
+        b->set_done(n_.reset(this));
+        f->send(b);
+        nextEvent_++;
+        return wait_and_call(STATE(delay_before_iterate));
+    }
+
+    Action delay_before_iterate() {
+        return sleep_and_call(&timer_, MSEC_TO_NSEC(5), STATE(iterate));
+    }
+
+    using EventList = std::set<uint64_t>;
+    EventList events_;
+    EventList::iterator nextEvent_;
+    BarrierNotifiable n_;
+    StateFlowTimer timer_{this};
+} g_query_flow;
+
 class JSBitEventPC : private nmranet::BitEventInterface
 {
 public:
     JSBitEventPC(std::string event_on, emscripten::val fn_on_cb,
-                 std::string event_off, emscripten::val fn_off_cb)
+        std::string event_off, emscripten::val fn_off_cb)
         : BitEventInterface(parse_event_id(event_on), parse_event_id(event_off))
         , eventOnCallback_(fn_on_cb)
         , eventOffCallback_(fn_off_cb)
         , consumer_(this)
     {
+        g_query_flow.add_event(BitEventInterface::event_on());
+    }
+
+    void toggleState()
+    {
+        if (!hasValue_)
+        {
+            return;
+        }
+        /// @TODO(balazs.racz) ideally we should be able to just call
+        /// SendEventReport. However, that requires a WriteHelper and there is
+        /// no option to allocate a buffer dynamically.
+        lastValue_ = !lastValue_;
+        auto *f = stack.node()->interface()->global_message_write_flow();
+        auto *b = f->alloc();
+        b->data()->reset(nmranet::Defs::MTI_EVENT_REPORT,
+            stack.node()->node_id(),
+            nmranet::eventid_to_buffer(lastValue_ ? event_on() : event_off()));
+        f->send(b);
     }

 private:
@@ -92,19 +181,29 @@
         return stack.node();
     }

-    void SetState(bool new_value) OVERRIDE {
+    void SetState(bool new_value) OVERRIDE
+    {
         lastValue_ = new_value;
-        if (new_value) {
+        hasValue_ = true;
+        if (new_value)
+        {
             eventOnCallback_();
-        } else {
+        }
+        else
+        {
             eventOffCallback_();
         }
     }

-    bool GetCurrentState() OVERRIDE {
-        return lastValue_;
-    }
-
+    nmranet::EventState GetCurrentState() OVERRIDE
+    {
+        using nmranet::EventState;
+        if (!hasValue_)
+            return EventState::UNKNOWN;
+        return lastValue_ ? EventState::VALID : EventState::INVALID;
+    }
+
+    bool hasValue_{false};
     bool lastValue_{false};
     emscripten::val eventOnCallback_;
     emscripten::val eventOffCallback_;
@@ -130,5 +229,6 @@
     emscripten::function("startStack", &start_stack);
     emscripten::class_<JSBitEventPC>("BitEventPC")
         .constructor<std::string, emscripten::val, std::string,
-                     emscripten::val>();
-}
+            emscripten::val>()
+        .function("toggleState", &JSBitEventPC::toggleState);
+}


Marking ExtensionApiTest.Infobars as FAILS until 10.5 issue is resolved.
BUG=60990

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

--- chrome/browser/extensions/extension_infobar_apitest.cc
+++ chrome/browser/extensions/extension_infobar_apitest.cc
@@ -6,8 +6,11 @@
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/common/chrome_switches.h"

-#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
+#if defined(TOOLKIT_VIEWS)
 #define MAYBE_Infobars Infobars
+#elif defined(OS_MACOSX)
+// Temporarily marking as FAILS. See http://crbug.com/60990 for details.
+#define MAYBE_Infobars FAILS_Infobars
 #else
 // Need to finish port to Linux. See http://crbug.com/39916 for details.
 #define MAYBE_Infobars DISABLED_Infobars


added some conversion tests

added some conversion tests

--- trunk/tests/TestArray.cpp
+++ trunk/tests/TestArray.cpp
@@ -274,11 +274,36 @@
     cout << "oa=" << oa << endl;
 }

+static void toArray(const Array_<int>& a) {
+    cout << "toArray=     "  << a  << "  &a[0]="  << &a[0] << endl;
+}
+static void toArrayView(const ArrayView_<int>& av) {
+    cout << "toArrayView= "  << av  << " &av[0]="  << &av[0] << endl;
+}
+static void toConstArray(const ConstArray_<int>& ca) {
+    cout << "toConstArray="  << ca  << " &ca[0]="  << &ca[0] << endl;
+}
+void testConversion() {
+    const int p[] = {1,2,3,4,5,6};
+    std::vector<int> v(p,p+6);
+    cout << "v=" << v << " &v[0]=" << &v[0] << endl;
+    Array_<int> a(v);
+    ArrayView_<int> av(v);
+    ConstArray_<int> ca(v);
+    cout << "a= "  << a  << "  &a[0]="  << &a[0] << endl;
+    cout << "av=" << av << " &av[0]=" << &av[0] << endl;
+    cout << "ca=" << ca << " &ca[0]=" << &ca[0] << endl;
+
+    toArray(ArrayView_<int>(v));
+    toArrayView(v);
+    toConstArray(v);
+}

 int main() {
     SimTK_START_TEST("TestArray");

         SimTK_SUBTEST(testConstruction);
+        SimTK_SUBTEST(testConversion);

     SimTK_END_TEST();
 }


Bug fix

Bug fix

--- opencog/atoms/core/PutLink.cc
+++ opencog/atoms/core/PutLink.cc
@@ -191,7 +191,7 @@
 				throw InvalidParamException(TRACE_INFO,
 					"PutLink expected value list!");

-			if (not _varlist.is_type(lval->getOutgoingSet()))
+			if (not _varlist.is_type(lse->getOutgoingSet()))
 				throw InvalidParamException(TRACE_INFO,
 					"PutLink bad value list!");
 		}


Write more of this new C/C++ runtime code

--- compiler_source/4_runtime_cpp/c_language_runtime_test.cpp
+++ compiler_source/4_runtime_cpp/c_language_runtime_test.cpp
@@ -38,12 +38,21 @@

 const int global_length_of_lists_for_text = 20000 ;

+int global_text_category_for_item[ 20005 ] ;
 int global_text_pointer_allocation_end_for_item[ 20005 ] ;
 int global_text_status_available_or_read_only_for_item[ 20005 ] ;
 int global_text_pointer_begin_for_item[ 20005 ] ;
 int global_text_pointer_end_for_item[ 20005 ] ;
 int global_text_length_for_item[ 20005 ] ;
-int global_text_category_for_item[ 20005 ] ;
+
+
+// -----------------------------------------------
+//  Declare the values stored in:
+//  global_text_status_available_or_read_only_for_item
+
+const int global_text_status_available = 1 ;
+const int global_text_status_read_only = 2 ;
+const int global_text_status_changeable = 2 ;

 // -----------------------------------------------
@@ -58,6 +67,7 @@

 int global_category_number_for_character_number[ 260 ] ;

+const int global_category_empty = 0 ;
 const int global_category_other = 1 ;
 const int global_category_hyphen = 2 ;  // also used as minus sign
 const int global_category_space = 3 ;
@@ -184,6 +194,7 @@
 {

     int pointer ;
+    int character_number ;

 // -----------------------------------------------
@@ -198,24 +209,51 @@

     for ( pointer = 0 ; pointer <= global_length_of_list_of_character_numbers ; pointer ++ )
     {
-        global_category_number_for_character_number[ pointer ] = 0 ;
-    }
-    global_category_number_for_character_number[ 123 ] = global_category_other ;
-    global_category_number_for_character_number[ 123 ] = global_category_hyphen ;
-    global_category_number_for_character_number[ 123 ] = global_category_space ;
-    global_category_number_for_character_number[ 123 ] = global_category_underscore ;
-    global_category_number_for_character_number[ 123 ] = global_category_newline ;
-    global_category_number_for_character_number[ 123 ] = global_category_tab ;
-    global_category_number_for_character_number[ 123 ] = global_category_slash ;
-    global_category_number_for_character_number[ 123 ] = global_category_open_angle_bracket ;
-    global_category_number_for_character_number[ 123 ] = global_category_close_angle_bracket ;
-    global_category_number_for_character_number[ 123 ] = global_category_quotation_mark ;
-    global_category_number_for_character_number[ 123 ] = global_category_apostrophe ;
-    global_category_number_for_character_number[ 123 ] = global_category_period ;
-    global_category_number_for_character_number[ 123 ] = global_category_plus_sign ;
-    global_category_number_for_character_number[ 123 ] = global_category_digit ;
-    global_category_number_for_character_number[ 123 ] = global_category_formfeed ;
-    global_category_number_for_character_number[ 123 ] = global_category_carriage_return ;
+        global_category_number_for_character_number[ pointer ] = global_category_other ;
+    }
+    global_category_number_for_character_number[ 9 ] = global_category_tab ;
+    global_category_number_for_character_number[ 10 ] = global_category_newline ;
+    global_category_number_for_character_number[ 12 ] = global_category_formfeed ;
+    global_category_number_for_character_number[ 13 ] = global_category_carriage_return ;
+    global_category_number_for_character_number[ 34 ] = global_category_quotation_mark ;
+    global_category_number_for_character_number[ 39 ] = global_category_apostrophe ;
+
+    character_number = ' ' ;
+    global_category_number_for_character_number[ character_number ] = global_category_space ;
+    character_number = '-' ;
+    global_category_number_for_character_number[ character_number ] = global_category_hyphen ;
+    character_number = '_' ;
+    global_category_number_for_character_number[ character_number ] = global_category_underscore ;
+    character_number = '/' ;
+    global_category_number_for_character_number[ character_number ] = global_category_slash ;
+    character_number = '<' ;
+    global_category_number_for_character_number[ character_number ] = global_category_open_angle_bracket ;
+    character_number = '>' ;
+    global_category_number_for_character_number[ character_number ] = global_category_close_angle_bracket ;
+    character_number = '.' ;
+    global_category_number_for_character_number[ character_number ] = global_category_period ;
+    character_number = '+' ;
+    global_category_number_for_character_number[ character_number ] = global_category_plus_sign ;
+    character_number = '0' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '1' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '2' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '3' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '4' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '5' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '6' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '7' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '8' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;
+    character_number = '9' ;
+    global_category_number_for_character_number[ character_number ] = global_category_digit ;

 // -----------------------------------------------
@@ -228,22 +266,111 @@

 // -----------------------------------------------
 // -----------------------------------------------
+//  Function text_item_clear
+//
+//  Changes text item to point to nothing, but
+//  keeps bottom-level text items.
+
+void text_item_clear( int text_item_id_number )
+{
+    if ( global_text_status_available_or_read_only_for_item[ text_item_id_number ] == global_text_status_changeable )
+    {
+        global_text_category_for_item[ text_item_id_number ] = global_category_empty ;
+        global_text_pointer_end_for_item[ text_item_id_number ] = global_text_pointer_begin_for_item[ text_item_id_number ] ;
+        global_text_length_for_item[ text_item_id_number ] = 0 ;
+    } else
+    {
+        log_out << "Error: Attempt to clear text item that is not changeable" << std::endl ;
+    }
+    return ;
+}
+
+
+// -----------------------------------------------
+// -----------------------------------------------
+//  Function get_text_by_character_offset_and_length
+//
+//  Gets text for specified text item, using
+//  character offset and length.  Equivalent to
+//  standard "substr" function but uses Dashrep
+//  runtime text storage conventions.
+
+void get_text_by_character_offset_and_length( int text_item_id_number , int character_offset , int characters_length )
+{
+    log_out << "get_text_by_character_offset_and_length not yet written" << std::endl ;
+    return ;
+}
+
+
+// -----------------------------------------------
+// -----------------------------------------------
+//  Function get_next_text_item
+//
+//  Gets next text item within specified text
+//  item.  Keeps track of nested pointers.
+
+void get_next_text_item_within_text_item( int text_item_id_number , int pointer_to_within_text_item )
+{
+    if ( ( global_text_category_for_item[ text_item_id_number ] == global_category_empty ) || ( global_text_length_for_item[ text_item_id_number ] == 0 ) )
+    {
+        pointer_to_within_text_item ++ ;
+        if ( pointer_to_within_text_item >= global_text_pointer_allocation_end_for_item[ text_item_id_number ] )
+        {
+            log_out << "get_next_text_item code not yet written" << std::endl ;
+            return ;
+        }
+    }
+
+    global_text_pointer_begin_for_item[ text_item_id_number ] = 0 ;
+
+    global_text_pointer_end_for_item[ text_item_id_number ] = 0 ;
+
+    global_text_category_for_item[ text_item_id_number ] = 0 ;
+
+    global_text_length_for_item[ text_item_id_number ] = 0 ;
+
+    log_out << "get_next_text_item code not yet written" << std::endl ;
+    return ;
+}
+
+
+// -----------------------------------------------
+// -----------------------------------------------
 //  Function text_append
+//
+//  Overwrite char storage if fits, else abandons
+//  that storage and marks that storage area as
+//  available, and creates new storage area that
+//  holds text.
+//
+//  Do not do trash collection; if runs out of
+//  space, programmer should split large task
+//  into smaller tasks.

 void text_append( int from_text_item_id_number , int to_text_item_id_number )
 {
-    log_out << "function text_append (overwrites char storage if fits, else abandons that storage and marks that storage area as available, and creates new storage area that holds text, but do not do trash collection; if runs out of space, programmer should split large task into smaller tasks)" << std::endl ;
-    return ;
-}
-
-
-// -----------------------------------------------
-// -----------------------------------------------
-//  Function text_item_clear
-
-void text_item_clear( int text_item_id_number )
-{
-    log_out << "function text_item_clear (changes text item to point to nothing, but keeps bottom-level text items)" << std::endl ;
+    if ( global_text_status_available_or_read_only_for_item[ to_text_item_id_number ] == global_text_status_changeable )
+    {
+        if ( ( global_text_category_for_item[ from_text_item_id_number ] == global_category_empty ) || ( global_text_length_for_item[ from_text_item_id_number ] == 0 ) )
+        {
+            return ;
+        }
+
+        global_text_pointer_allocation_end_for_item[ to_text_item_id_number ] = 0 ;
+
+        global_text_pointer_begin_for_item[ to_text_item_id_number ] = 0 ;
+
+        global_text_pointer_end_for_item[ to_text_item_id_number ] = 0 ;
+
+        global_text_category_for_item[ to_text_item_id_number ] = 0 ;
+
+        global_text_length_for_item[ to_text_item_id_number ] = 0 ;
+
+    } else
+    {
+        log_out << "Error: Attempt to append to text item that is not changeable" << std::endl ;
+    }
+
     return ;
 }

@@ -254,18 +381,8 @@

 void text_copy( int from_text_item_id_number , int to_text_item_id_number )
 {
-    log_out << "function text_copy (use text_append after clearing prior contents)" << std::endl ;
-    return ;
-}
-
-
-// -----------------------------------------------
-// -----------------------------------------------
-//  Function store_text_item
-
-void store_text_item( int from_text_item_id_number , int to_text_item_id_number )
-{
-    log_out << "function store_text_item" << std::endl ;
+    text_item_clear( to_text_item_id_number ) ;
+    text_append( from_text_item_id_number , to_text_item_id_number ) ;
     return ;
 }

@@ -277,28 +394,6 @@
 void phrase_name_lookup( int text_item_id_number )
 {
     log_out << "function phrase_name_lookup (and creates text item if phrase is new)" << std::endl ;
-    return ;
-}
-
-
-// -----------------------------------------------
-// -----------------------------------------------
-//  Function get_next_text_item
-
-void get_next_text_item_within_text_item( int text_item_id_number , int pointer_to_within_text_item )
-{
-    log_out << "function get_next_text_item_within_text_item (and keep track of nested pointers)" << std::endl ;
-    return ;
-}
-
-
-// -----------------------------------------------
-// -----------------------------------------------
-//  Function get_text_by_character_offset_and_length
-
-void get_text_by_character_offset_and_length( int text_item_id_number , int character_offset , int characters_length )
-{
-    log_out << "function get_text_by_character_offset_and_length (equivalent to standard substr function)" << std::endl ;
     return ;
 }

@@ -428,15 +523,6 @@

 // -----------------------------------------------
-
-
-    find_matching_text( ) ;
-
-
-    log_out << std::endl << "[doing testing]" << std::endl ;
-
-
-// -----------------------------------------------
 //  End of function do_testing.

     return ;
@@ -450,6 +536,9 @@

 int main() {

+    int from_text_item_id_number ;
+    int to_text_item_id_number ;
+

 // -----------------------------------------------
 //  Initialization.
@@ -458,20 +547,15 @@

 // -----------------------------------------------
-//  Test the functions in this file.
-
-    get_next_text_item( ) ;
-    do_testing( ) ;
-    get_text_by_offset_and_length( ) ;
-    find_matching_text( ) ;
-    yes_or_no_matching_text( ) ;
-    text_append( ) ;
-    text_copy( ) ;
-    text_replace( ) ;
-    point_to_pattern_matching_text( ) ;
-    point_to_pattern_matching_text_backwards( ) ;
-
-    std::cout << "done testing" << std::endl ;
+//  Test basic text handling functionality.
+
+    log_out << std::endl ;
+    log_out << "doing testing" << std::endl ;
+    from_text_item_id_number = 1 ;
+    to_text_item_id_number = 2 ;
+    text_copy( from_text_item_id_number , to_text_item_id_number ) ;
+    log_out << "done testing" << std::endl ;
+    std::cout << "program done" << std::endl ;

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


Sanitise []s out of vertex attribute names when opening buffer viewer

--- qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp
+++ qrenderdoc/Windows/PipelineState/PipelineStateViewer.cpp
@@ -1362,8 +1362,17 @@
       format += QString::number(fmt.compCount);
     }

-    format +=
-        QFormatStr(" %1;\n").arg(QString(attrs[i].name).replace(QLatin1Char('.'), QLatin1Char('_')));
+    QString real_name = QString(attrs[i].name);
+    QString sanitised_name = real_name;
+
+    sanitised_name.replace(QLatin1Char('.'), QLatin1Char('_'))
+        .replace(QLatin1Char('['), QLatin1Char('_'))
+        .replace(QLatin1Char(']'), QLatin1Char('_'));
+
+    if(real_name == sanitised_name)
+      format += QFormatStr(" %1;\n").arg(sanitised_name);
+    else
+      format += QFormatStr(" %1; // %2\n").arg(sanitised_name).arg(real_name);
   }

   if(stride > 0)


use _batchLoader->objectCount instead of _manifest->getSize

--- loader/src/pyLoader.hpp
+++ loader/src/pyLoader.hpp
@@ -165,7 +165,7 @@
     PyObject* next(int bufIdx);

     std::shared_ptr<BatchIterator> getBatchIterator() { return _batch_iterator; }
-    int itemCount() { return _manifest->getSize(); }
+    int itemCount() { return _batchLoader->objectCount(); }

 private:
     void drain();


ERR: Render method had un index mismach

ERR: Render method had un index mismach

--- imaging/vtkImageMapper.cxx
+++ imaging/vtkImageMapper.cxx
@@ -179,7 +179,7 @@
   if (pos[1] < 0)
     {
     this->PositionAdjustment[1] = -1*pos[1];
-    displayExtent[2] -= pos[0];
+    displayExtent[2] -= pos[1];
     }
   if ((pos[1] + wholeExtent[3] - wholeExtent[2] + 1) >
       (winSize[1] - 1)*(vpt[YMAX]-vpt[YMIN]))


Update muParserBase.cpp

Update muParserBase.cpp

--- src/muParserBase.cpp
+++ src/muParserBase.cpp
@@ -1032,13 +1032,13 @@
 		case 0:
 			switch (tok->Cmd)
 			{
-			case cmVAL:
+			case cmVAL:
 				return tok->Val.data2;

-			case cmVAR:
+			case cmVAR:
 				return *tok->Val.ptr;

-			case cmVARMUL:
+			case cmVARMUL:
 				return *tok->Val.ptr * tok->Val.data + tok->Val.data2;

 			case  cmVARPOW2:
@@ -1064,6 +1064,7 @@
 			default:
 				Error(ecINTERNAL_ERROR);
 			}
+			break;

 		case 1:
 			break;


fix InterruptLevel code to return the correct level
(the bit positition that is set in softint)

--HG--
extra : convert_revision : ba0e1f4ec1f74aac64c3f9bb7eb1b771e17b013a

--- src/arch/sparc/regfile.cc
+++ src/arch/sparc/regfile.cc
@@ -189,10 +189,10 @@
     if (softint & 0x10000 || softint & 0x1)
         return 14;

-    int level = 14;
-    while (level >= 0 && !(1 << (level + 1) & softint))
+    int level = 15;
+    while (level > 0 && !(1 << level & softint))
         level--;
-    if (1 << (level + 1) & softint)
+    if (1 << level & softint)
         return level;
     return 0;
 }


Fixed compilation warnings

Fixed compilation warnings

git-svn-id: 33bf1455041ebe448dbaea643fd5b4b7ce02239d@2506 63c20433-aa62-49bd-875c-5a186b69a8fb

--- applications/osmo4_wx/wxOsmo4.cpp
+++ applications/osmo4_wx/wxOsmo4.cpp
@@ -2175,7 +2175,7 @@
 	wxMenu *popup = new wxMenu();

 	for (u32 i=0; i<10; i++) {
-		if (start - i < 0) break;
+		if (i > start) break;
 		if (start - i >= count) break;
 		PLEntry *ple = (PLEntry *) gf_list_get(m_pPlayList->m_entries, start - i);
 		popup->Append(ID_NAV_PREV_0 + i, wxString(ple->m_disp_name, wxConvUTF8) );
@@ -2297,18 +2297,18 @@
 		switch (info.od_type) {
 		case GF_STREAM_AUDIO:
 			pMenu = sel_menu->FindItemByPosition(0)->GetSubMenu();
-			if (!info.owns_service) sprintf(szLabel, "Audio #%ld", pMenu->GetMenuItemCount() + 1);
+			if (!info.owns_service) sprintf(szLabel, "Audio #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
 			pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
 			break;
 		case GF_STREAM_VISUAL:
 			pMenu = sel_menu->FindItemByPosition(1)->GetSubMenu();
-			if (!info.owns_service) sprintf(szLabel, "Video #%ld", pMenu->GetMenuItemCount() + 1);
+			if (!info.owns_service) sprintf(szLabel, "Video #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
 			pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
 			break;
 		case GF_STREAM_TEXT:
 			nb_subs ++;
 			pMenu = sel_menu->FindItemByPosition(2)->GetSubMenu();
-			if (!info.owns_service) sprintf(szLabel, "Subtitle #%ld", pMenu->GetMenuItemCount() + 1);
+			if (!info.owns_service) sprintf(szLabel, "Subtitle #"LLU, (u64)pMenu->GetMenuItemCount() + 1);
 			pMenu->AppendCheckItem(ID_SELSTREAM_0 +i, wxString(szLabel, wxConvUTF8));
 			break;
 		}


Fix bug with transient pages where they would stay alive permanently due to a
mismatched keepalive count, caused by network requests from other views being
attributed to the transient page.

BUG=124502
TEST=no

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

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

--- chrome/browser/extensions/extension_process_manager.cc
+++ chrome/browser/extensions/extension_process_manager.cc
@@ -454,7 +454,7 @@
     RenderViewHost* render_view_host) {
   ExtensionHost* host = GetBackgroundHostForExtension(
       GetExtensionID(render_view_host));
-  if (host)
+  if (host && host->render_view_host() == render_view_host)
     IncrementLazyKeepaliveCount(host->extension());
 }

@@ -462,7 +462,7 @@
     RenderViewHost* render_view_host) {
   ExtensionHost* host = GetBackgroundHostForExtension(
       GetExtensionID(render_view_host));
-  if (host)
+  if (host && host->render_view_host() == render_view_host)
     DecrementLazyKeepaliveCount(host->extension());
 }


Disable a long running test.
Review URL: http://codereview.chromium.org/8177

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

--- chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -640,7 +640,7 @@
 // Counts the IO needed for the initial update of a database.
 // test\data\safe_browsing\download_update.py was used to fetch the add/sub
 // chunks that are read, in order to get repeatable runs.
-TEST(SafeBrowsingDatabase, DatabaseInitialIO) {
+TEST(SafeBrowsingDatabase, DISABLED_DatabaseInitialIO) {
   UpdateDatabase(L"", L"", L"initial");
 }


limit added to pistol

limit added to pistol

--- GameEngine/Demos/DemoSceneV0/Systems/PistolSystem.hpp
+++ GameEngine/Demos/DemoSceneV0/Systems/PistolSystem.hpp
@@ -13,7 +13,6 @@
 public:
 	PistolSystem(std::weak_ptr<AScene> scene)
 		: System(scene)
-		, _bullets(scene)
 		, _characterController(scene)
 	{}

@@ -21,8 +20,8 @@
 	{}

 private:
-	EntityFilter _bullets;
 	EntityFilter _characterController;
+	std::queue<Entity> _shots;
 	std::shared_ptr<Input> _inputs;

 	virtual void updateBegin(double time)
@@ -53,16 +52,22 @@
 				rigidBody->getBody().setFriction(1.0f);
 				rigidBody->getBody().setRestitution(0.9f);
 				e->addTag(MyTags::BULLET_TAG);
+				_shots.push(e);
 			}
 			delay = 0.1f;
 		}
 		if (delay >= 0.0f)
 			delay -= ftime;
+
+		while (_shots.size() > 50)
+		{
+			scene->destroy(_shots.front());
+			_shots.pop();
+		}
 	}

 	virtual bool initialize()
 	{
-		_bullets.requireTag(MyTags::BULLET_TAG);
 		_characterController.requireTag(MyTags::HEROS_TAG);
 		_inputs = _scene.lock()->getInstance<Input>();
 		if (!_inputs)
@@ -77,13 +82,11 @@

 	virtual bool deactivate()
 	{
-		auto collection = _bullets.getCollection();
 		auto scene = _scene.lock();
-		for (auto &it = std::begin(collection); it != std::end(collection);)
+		while (_shots.size() > 0)
 		{
-			auto e = *it;
-			++it;
-			scene->destroy(e);
+			scene->destroy(_shots.front());
+			_shots.pop();
 		}
 		return true;
 	}


Adjust flakiness settings to match the adjustments I made to the tests.

TBR=jorlow
BUG=none
TEST=these

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

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

--- chrome/browser/in_process_webkit/dom_storage_uitest.cc
+++ chrome/browser/in_process_webkit/dom_storage_uitest.cc
@@ -102,19 +102,23 @@
   FilePath test_dir_;
 };

-TEST_F(DOMStorageTest, DOMStorageLayoutTests) {
+// http://code.google.com/p/chromium/issues/detail?id=24145
+// Remove build_config.h include when this is removed.
+#if defined(OS_WIN)
+#define MAYBE_LocalStorageLayoutTests FLAKY_LocalStorageLayoutTests
+#define MAYBE_DOMStorageLayoutTests FLAKY_DOMStorageLayoutTests
+#else
+#define MAYBE_LocalStorageLayoutTests LocalStorageLayoutTests
+#define MAYBE_DOMStorageLayoutTests DOMStorageLayoutTests
+#endif  // defined(OS_WIN)
+
+
+TEST_F(DOMStorageTest, MAYBE_DOMStorageLayoutTests) {
   InitializeForLayoutTest(test_dir_, FilePath(), false);
   AddResources();
   RunTests(kTopLevelFiles);
 }

-// http://code.google.com/p/chromium/issues/detail?id=24145
-// Remove build_config.h include when this is removed.
-#if defined(OS_WIN)
-#define MAYBE_LocalStorageLayoutTests FLAKY_LocalStorageLayoutTests
-#else
-#define MAYBE_LocalStorageLayoutTests LocalStorageLayoutTests
-#endif  // defined(OS_WIN)

 TEST_F(DOMStorageTest, MAYBE_LocalStorageLayoutTests) {
   InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("localstorage"),


TBR: chron@chromium.org

TBR: chron@chromium.org

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

--- chrome/browser/sync/notifier/listener/talk_mediator_unittest.cc
+++ chrome/browser/sync/notifier/listener/talk_mediator_unittest.cc
@@ -123,16 +123,16 @@
   talk1->OnSubscriptionSuccess();
   ASSERT_TRUE(talk1->state_.subscribed == 1);
   ASSERT_TRUE(talk1->SendNotification() == true);
-  ASSERT_TRUE(mock->send_calls == 1);
+  ASSERT_TRUE(mock->send_calls == 2);
   ASSERT_TRUE(talk1->SendNotification() == true);
-  ASSERT_TRUE(mock->send_calls == 2);
+  ASSERT_TRUE(mock->send_calls == 3);

   ASSERT_TRUE(talk1->Logout() == true);
   ASSERT_TRUE(mock->logout_calls == 1);

   // Failure due to being logged out.
   ASSERT_TRUE(talk1->SendNotification() == false);
-  ASSERT_TRUE(mock->send_calls == 2);
+  ASSERT_TRUE(mock->send_calls == 3);
 }

 TEST_F(TalkMediatorImplTest, MediatorThreadCallbacks) {
@@ -162,7 +162,7 @@
   // After subscription success is receieved, the talk mediator will allow
   // sending of notifications.
   ASSERT_TRUE(talk1->SendNotification() == true);
-  ASSERT_TRUE(mock->send_calls == 1);
+  ASSERT_TRUE(mock->send_calls == 2);

   // |MSG_NOTIFICATION_RECEIVED| from the MediatorThread triggers a callback
   // of type |NOTIFICATION_RECEIVED|.


BUG: Conditional jump or move depends on uninitialised value

The 1D test needed
  mapper1d->SetScalarModeToUseCellData();

Change-Id: I98ed718ccbbb63312a8226338024c566c24b9da2

--- Graphics/Testing/Cxx/TestHyperOctreeContourFilter.cxx
+++ Graphics/Testing/Cxx/TestHyperOctreeContourFilter.cxx
@@ -243,6 +243,7 @@
   vtkPolyDataMapper *mapper1d = vtkPolyDataMapper::New();
   mapper1d->SetInputConnection(0,contour1d->GetOutputPort(0));
   mapper1d->SetLookupTable(lut1d);
+  mapper1d->SetScalarModeToUseCellData();

   if(contour1d->GetOutput()->GetCellData()!=0)
     {