Remove the XFAIL for the C++ EH test

Remove the XFAIL for the C++ EH test

It works on Windows now.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@249799 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/asan/TestCases/contiguous_container.cc
+++ test/asan/TestCases/contiguous_container.cc
@@ -1,7 +1,4 @@
 // RUN: %clangxx_asan -fexceptions -O %s -o %t && %run %t
-//
-// FIXME: Needs better C++ exception support
-// XFAIL: win32
 //
 // Test __sanitizer_annotate_contiguous_container.


watermark_buffer_test: Break up contiguous memory allocation to avoid bad alloc exception (#12417)

Running this test in CI on Windows we have seen bad alloc exceptions, to
combat this and reduce memory overhead, break up large string allocation
into smaller segments.

Signed-off-by: William A Rowe Jr <6b594a7cef7896b2a5c8742c6f375a4f1966bff1@vmware.com>
Co-authored-by: Sunjay Bhatia <8e0b7e202dd9796d43bda501fc1c3ad47f18345b@vmware.com>

--- test/common/buffer/watermark_buffer_test.cc
+++ test/common/buffer/watermark_buffer_test.cc
@@ -431,19 +431,22 @@

   // Make sure the overflow threshold will be above std::numeric_limits<uint32_t>::max()
   Runtime::LoaderSingleton::getExisting()->mergeValues({{"envoy.buffer.overflow_multiplier", "3"}});
-  buffer1.setWatermarks((std::numeric_limits<uint32_t>::max() / 3) + 4);
-
-  // Add 2 halves instead of full uint32_t::max to get around std::bad_alloc exception
-  const uint32_t half_max = std::numeric_limits<uint32_t>::max() / 2;
-  const std::string half_max_str = std::string(half_max, 'a');
-  buffer1.add(half_max_str.data(), half_max);
-  buffer1.add(half_max_str.data(), half_max);
-  EXPECT_EQ(1, high_watermark_buffer1);
-  EXPECT_EQ(0, overflow_watermark_buffer1);
-  buffer1.add(TEN_BYTES, 10);
-  EXPECT_EQ(1, high_watermark_buffer1);
-  EXPECT_EQ(0, overflow_watermark_buffer1);
-  EXPECT_EQ(2 * half_max + static_cast<uint64_t>(10), buffer1.length());
+  buffer1.setWatermarks((std::numeric_limits<uint32_t>::max() / 3) + 1);
+
+  // Add many segments instead of full uint32_t::max to get around std::bad_alloc exception
+  const uint32_t segment_denominator = 128;
+  const uint32_t big_segment_len = std::numeric_limits<uint32_t>::max() / segment_denominator + 1;
+  const std::string big_segment_str = std::string(big_segment_len, 'a');
+  for (uint32_t i = 0; i < segment_denominator; ++i) {
+    buffer1.add(big_segment_str.data(), big_segment_len);
+  }
+  EXPECT_EQ(1, high_watermark_buffer1);
+  EXPECT_EQ(0, overflow_watermark_buffer1);
+  buffer1.add(TEN_BYTES, 10);
+  EXPECT_EQ(1, high_watermark_buffer1);
+  EXPECT_EQ(0, overflow_watermark_buffer1);
+  EXPECT_EQ(static_cast<uint64_t>(segment_denominator) * big_segment_len + 10, buffer1.length());
+  EXPECT_GT(buffer1.length(), std::numeric_limits<uint32_t>::max());
 #endif
 }


Check the format and return JSON or HTML

--- MQWeb/src/QueueManagerController.cpp
+++ MQWeb/src/QueueManagerController.cpp
@@ -49,7 +49,14 @@
 	if ( jsonQueueManagers->size() > 0 )
 	{
 		set("qmgr", jsonQueueManagers->get(0));
-		render("home.tpl");
+		if ( format().compare("html") == 0 )
+		{
+			render("home.tpl");
+		}
+		else if ( format().compare("json") == 0 )
+		{
+			data().stringify(response().send());
+		}
 	}
 }


Fixed uninitialized variable in ePiano, reported by Brad Robinson (http://www.cantabilesoftware.com/)

git-svn-id: 729a6b22076b142da7d21a1dac60000e38bd2fc5@5 4640a675-794f-0410-98ff-f2e477bc0685

--- src/mdaEPiano.cpp
+++ src/mdaEPiano.cpp
@@ -494,7 +494,7 @@
     if(note > 60) l += stretch * (float)k; //stretch

     s = size;
-    if(velocity > 40) s += (VstInt32)(sizevel * (float)(velocity - 40));
+    //if(velocity > 40) s += (VstInt32)(sizevel * (float)(velocity - 40));  - no velocity to hardness in ePiano

     k = 0;
     while(note > (kgrp[k].high + s)) k += 3;  //find keygroup


mds: only file_eval on xlock_finish if stable

--- src/mds/Locker.cc
+++ src/mds/Locker.cc
@@ -3331,7 +3331,8 @@
 		       SimpleLock::WAIT_WR |
 		       SimpleLock::WAIT_RD, 0);

-  if (lock->get_parent()->is_auth())
+  if (lock->get_parent()->is_auth() &&
+      lock->is_stable())
     file_eval(lock);
 }


Re-enable multithread test

Re-enable multithread test

--- src/HQPerformance/MutithreadPerformaceTest.cpp
+++ src/HQPerformance/MutithreadPerformaceTest.cpp
@@ -49,7 +49,7 @@
     static const size_t messageSize = sizeof(ActualMessage);

     static const uint64_t targetMessageCount = 1000000 * 100; // runs about 5 to 10 seconds in release/optimized build
-    static const size_t producerLimit = 2;//10; // running on 8 core system.  Once we go over 7 producers it slows down.  That's one thing we want to see.
+    static const size_t producerLimit = 8; // running on 8 core system.  Once we go over 7 producers it slows down.  That's one thing we want to see.
     static const size_t consumerLimit = 1;  // Just for documentation
     static const size_t messageCount = entryCount + consumerLimit +  producerLimit;

@@ -65,7 +65,7 @@
     HighQueue::Message consumerMessage;
     BOOST_REQUIRE(connection.allocate(consumerMessage));

-    for(size_t producerCount = 1; producerCount < producerLimit; ++producerCount)
+    for(size_t producerCount = 1; producerCount <= producerLimit; ++producerCount)
     {
         std::cerr << "Test " << producerCount << " producer";


Memorder

Memorder

--- paddle/fluid/framework/parallel_executor.cc
+++ paddle/fluid/framework/parallel_executor.cc
@@ -643,14 +643,16 @@
   for (auto &place_pair : member_->vars_) {
     for (auto &name_pair : place_pair.second) {
       for (auto &version_pair : name_pair.second) {
-        pending_vars[&version_pair.second] =
-            version_pair.second.generated_op_ == nullptr;
+        pending_vars[&version_pair.second].store(
+            version_pair.second.generated_op_ == nullptr,
+            std::memory_order_relaxed);
       }
     }
   }

   for (auto &var : member_->dep_vars_) {
-    pending_vars[var.get()] = var->generated_op_ == nullptr;
+    pending_vars[var.get()].store(var->generated_op_ == nullptr,
+                                  std::memory_order_relaxed);
   }

   std::vector<OpHandle *> to_run;
@@ -700,14 +702,12 @@
   }

   while (!pending_ops.empty()) {
-    VLOG(1) << "1";
     VarHandleBase *ready_var = nullptr;
     for (auto &pair : pending_vars) {
       if (pair.second.load(std::memory_order_acquire)) {
         ready_var = pair.first;
       }
     }
-    VLOG(1) << "1";
     if (ready_var == nullptr) {
       // FIXME use conditional var instead of busy wait.

@@ -717,11 +717,8 @@

       continue;
     }
-    VLOG(1) << "1";
     pending_vars.erase(ready_var);
-    VLOG(1) << "1";
     to_run.clear();
-    VLOG(1) << "1";
     for (auto *op : ready_var->pending_ops_) {
       auto &deps = pending_ops[op];
       --deps;
@@ -729,16 +726,12 @@
         to_run.emplace_back(op);
       }
     }
-    VLOG(1) << "1";
     for (auto *op : to_run) {
       pending_ops.erase(op);
       RunOp(pending_vars, op);
     }
-    VLOG(1) << "1";
-  }
-  VLOG(1) << "1";
+  }
   fetch_ops.clear();
-  VLOG(1) << "1";
   *member_->global_scope_->Var(fetched_var_name)->GetMutable<LoDTensorArray>() =
       fetched_data->tensors_;
 }


mds: include max mds in mdsmap summary

mds: include max mds in mdsmap summary

--- src/mds/MDSMap.cc
+++ src/mds/MDSMap.cc
@@ -72,7 +72,7 @@
        p++)
     by_state[p->second.state]++;

-  out << "e" << get_epoch() << ": " << up.size() << "/" << in.size() << " up";
+  out << "e" << get_epoch() << ": " << up.size() << "/" << in.size() << "/" << max_mds << " up";

   for (map<int,int>::reverse_iterator p = by_state.rbegin(); p != by_state.rend(); p++)
     out << ", " << p->second << " " << get_state_name(p->first);


fix temporal_shift OP PADDLE_ENFORCE. test=develop (#19161)

* fix temporal_shift OP PADDLE_ENFORCE. test=develop

* fix HasInput/HasOutpu ENFORECE. test=develop

--- paddle/fluid/operators/temporal_shift_op.cc
+++ paddle/fluid/operators/temporal_shift_op.cc
@@ -26,10 +26,10 @@

  protected:
   void InferShape(framework::InferShapeContext* ctx) const override {
-    PADDLE_ENFORCE(ctx->HasInput("X"),
-                   "Input(X) of TemporalShiftOp should not be null.");
-    PADDLE_ENFORCE(ctx->HasOutput("Out"),
-                   "Output(Out) of TemporalShiftOp should not be null.");
+    PADDLE_ENFORCE_EQ(ctx->HasInput("X"), true,
+                      "Input(X) of TemporalShiftOp should not be null.");
+    PADDLE_ENFORCE_EQ(ctx->HasOutput("Out"), true,
+                      "Output(Out) of TemporalShiftOp should not be null.");

     auto dim_x = ctx->GetInputDim("X");
     PADDLE_ENFORCE_EQ(dim_x.size(), 4,
@@ -38,9 +38,10 @@
     int seg_num = ctx->Attrs().Get<int>("seg_num");
     float shift_ratio = ctx->Attrs().Get<float>("shift_ratio");
     PADDLE_ENFORCE_GT(seg_num, 0, "Attr(seg_num) should be greater than 0.");
-    PADDLE_ENFORCE(shift_ratio > 0 || shift_ratio < .5,
-                   "Attr(shift_ratio) should be greater than 0 and less "
-                   "than 0.5.");
+    PADDLE_ENFORCE_GT(shift_ratio, 0.,
+                      "Attr(shift_ratio) should be greater than 0");
+    PADDLE_ENFORCE_LT(shift_ratio, 0.5,
+                      "Attr(shift_ratio) should be less than 0.5");

     if (ctx->IsRuntime()) {
       PADDLE_ENFORCE_EQ(


mds: fix one rename dentry linkage projection case

There are more.  :(

Signed-off-by: Sage Weil <c5b6ff1fd4f0bde10db63d7a3e07166cf6c4229f@dreamhost.com>

--- src/mds/Server.cc
+++ src/mds/Server.cc
@@ -4916,8 +4916,10 @@
   // dest
   if (srcdnl->is_remote()) {
     if (!linkmerge) {
-      if (destdn->is_auth())
+      if (destdn->is_auth()) {
 	mdr->more()->pvmap[destdn] = destdn->pre_dirty();
+        destdn->push_projected_linkage(srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
+      }
       if (srcdnl->get_inode()->is_auth()) {
 	pi = srcdnl->get_inode()->project_inode();
 	pi->version = srcdnl->get_inode()->pre_dirty();


Don't abuse ERR_NO_CONTENT, use ERR_SLAVE_DEFINED for slave-defined error codes.
Posted to kmail-devel (Saturday iirc), assuming that no comment == ok.

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

--- kioslaves/imap4/imap4.cc
+++ kioslaves/imap4/imap4.cc
@@ -1159,8 +1159,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientUnsubscribe(aBox));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Unsubscribe of folder %1 "
-                                 "failed. The server returned: %2")
+      error(ERR_SLAVE_DEFINED, i18n("Unsubscribe of folder %1 "
+                                    "failed. The server returned: %2")
             .arg(_url.prettyURL())
             .arg(cmd->resultInfo()));
       return;
@@ -1179,8 +1179,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientSubscribe(aBox));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Subscribe of folder %1 "
-                                 "failed. The server returned: %2")
+      error(ERR_SLAVE_DEFINED, i18n("Subscribe of folder %1 "
+                                    "failed. The server returned: %2")
             .arg(_url.prettyURL())
             .arg(cmd->resultInfo()));
       return;
@@ -1215,8 +1215,8 @@
                                                "\\SEEN \\ANSWERED \\FLAGGED \\DRAFT"));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Changing the flags of message %1 "
-                                 "failed.").arg(_url.prettyURL()));
+      error(ERR_COULD_NOT_WRITE, i18n("Changing the flags of message %1 "
+                                      "failed.").arg(_url.prettyURL()));
       return;
     }
     completeQueue.removeRef (cmd);
@@ -1226,8 +1226,8 @@
                        clientStore (aSequence, "+FLAGS.SILENT", newFlags));
       if (cmd->result () != "OK")
       {
-        error(ERR_NO_CONTENT, i18n("Changing the flags of message %1 "
-                                   "failed.").arg(_url.prettyURL()));
+        error(ERR_COULD_NOT_WRITE, i18n("Changing the flags of message %1 "
+                                        "failed.").arg(_url.prettyURL()));
         return;
       }
       completeQueue.removeRef (cmd);
@@ -1259,8 +1259,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientSetACL(aBox, user, acl));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Setting the Access Control List on folder %1 "
-                                 "for user %2 failed. The server returned: %3")
+      error(ERR_SLAVE_DEFINED, i18n("Setting the Access Control List on folder %1 "
+                                      "for user %2 failed. The server returned: %3")
             .arg(_url.prettyURL())
             .arg(user)
             .arg(cmd->resultInfo()));
@@ -1277,8 +1277,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientDeleteACL(aBox, user));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Deleting the Access Control List on folder %1 "
-                                 "for user %2 failed. The server returned: %3")
+      error(ERR_SLAVE_DEFINED, i18n("Deleting the Access Control List on folder %1 "
+                                    "for user %2 failed. The server returned: %3")
             .arg(_url.prettyURL())
             .arg(user)
             .arg(cmd->resultInfo()));
@@ -1293,8 +1293,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientGetACL(aBox));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Retrieving the Access Control List on folder %1 "
-                                 "failed. The server returned: %2")
+      error(ERR_SLAVE_DEFINED, i18n("Retrieving the Access Control List on folder %1 "
+                                     "failed. The server returned: %2")
             .arg(_url.prettyURL())
             .arg(cmd->resultInfo()));
       return;
@@ -1318,8 +1318,8 @@
     imapCommand *cmd = doCommand(imapCommand::clientMyRights(aBox));
     if (cmd->result () != "OK")
     {
-      error(ERR_NO_CONTENT, i18n("Retrieving the Access Control List on folder %1 "
-                                 "failed. The server returned: %2")
+      error(ERR_SLAVE_DEFINED, i18n("Retrieving the Access Control List on folder %1 "
+                                    "failed. The server returned: %2")
             .arg(_url.prettyURL())
             .arg(cmd->resultInfo()));
       return;
@@ -1417,7 +1417,7 @@
       completeQueue.removeRef(cmd);
       if (!ok)
       {
-        error(ERR_NO_CONTENT, i18n("Unable to close mailbox."));
+        error(ERR_COULD_NOT_STAT, i18n("Unable to close mailbox."));
         return;
       }
       setState(ISTATE_LOGIN);
@@ -1447,7 +1447,7 @@
       }
       completeQueue.removeRef (cmd);
       if (found)
-        error(ERR_NO_CONTENT, i18n("Unable to get information about folder %1. The server replied: %2").arg(aBox).arg(cmdInfo));
+        error(ERR_COULD_NOT_STAT, i18n("Unable to get information about folder %1. The server replied: %2").arg(aBox).arg(cmdInfo));
       else
         error(KIO::ERR_DOES_NOT_EXIST, aBox);
       return;
@@ -2165,7 +2165,7 @@
       }
       completeQueue.removeRef (cmd);
       if (found)
-        error(ERR_NO_CONTENT, i18n("Unable to open folder %1. The server replied: %2").arg(aBox).arg(cmdInfo));
+        error(ERR_SLAVE_DEFINED, i18n("Unable to open folder %1. The server replied: %2").arg(aBox).arg(cmdInfo));
       else
         error(KIO::ERR_DOES_NOT_EXIST, aBox);
       return false;


adding some changes

adding some changes

--- problem3/problem3.cpp
+++ problem3/problem3.cpp
@@ -12,3 +12,41 @@

+#include <iostream>
+#include <vector>
+#include <cmath>
+
+// Initializing
+Number::Number(int n)
+: mNumber(n)
+{
+}
+
+// Get the factors of a number
+std::vector<int> problem3::getFactors()
+{
+   double squareRootValue = floor(sqrt(mNumber));
+
+   // Cheching if
+   if(squareRootValue >= 2)
+   {
+       for(int i = 2; i <= squareRootValue; i++)
+       {
+           if(mNumber % i == 0)
+               mFactors = push(i);
+           else
+               getFactors();
+       }
+   }
+}
+
+int problem3::getLargestPrimeFactor()
+{
+
+}
+
+
+int main() {
+
+	return 0;
+}


test/run_was: print the status to stderr

--- test/run_was.cxx
+++ test/run_was.cxx
@@ -129,10 +129,12 @@
  */

 void
-Context::OnHttpResponse(gcc_unused http_status_t status,
+Context::OnHttpResponse(http_status_t status,
                         gcc_unused StringMap &&headers,
                         UnusedIstreamPtr _body) noexcept
 {
+    fprintf(stderr, "status: %s\n", http_status_to_string(status));
+
     if (_body)
         body.Set(std::move(_body), *this);
 }


Revert "mds: rip out rename linkmerge support"

This reverts commit d467fbfd1714ef04faf41e604d6a78e33ef7fa10.

The linkmerge stuff _is_ needed for reintegrating multi-linked stray
inodes back into the hierarchy.  E.g.,

 touch a
 ln a b
 rm a

The MDS will want to renamed the stray inode to the b dentry.

Conflicts:

	src/mds/Server.cc

Signed-off-by: Sage Weil <6dd34506bbd5e58221bbb3e4732d97c91f02277b@newdream.net>

--- src/mds/Server.cc
+++ src/mds/Server.cc
@@ -4699,14 +4699,14 @@
     return;
   }

-  if (srcdnl->get_inode() == destdnl->get_inode()) {
-    reply_request(mdr, 0);  // no-op.  POSIX makes no sense.
-    return;
-  }
+  bool linkmerge = (srcdnl->get_inode() == destdnl->get_inode() &&
+		    (srcdnl->is_primary() || destdnl->is_primary()));
+  if (linkmerge)
+    dout(10) << " this is a link merge" << dendl;

   // -- create stray dentry? --
   CDentry *straydn = mdr->straydn;
-  if (destdnl->is_primary() && !straydn) {
+  if (destdnl->is_primary() && !linkmerge && !straydn) {
     straydn = mdcache->get_or_create_stray_dentry(destdnl->get_inode());
     mdr->pin(straydn);
     mdr->straydn = straydn;
@@ -4869,41 +4869,43 @@
     assert(g_conf.mds_kill_rename_at != 3);

   // -- prepare anchor updates --
-  C_Gather *anchorgather = 0;
-
-  if (srcdnl->is_primary() &&
-      (srcdnl->get_inode()->is_anchored() ||
-       (srcdnl->get_inode()->is_dir() && (srcdnl->get_inode()->inode.rstat.ranchors ||
-					  srcdnl->get_inode()->nested_anchors ||
-					  !mdcache->is_leaf_subtree(mdcache->get_projected_subtree_root(srcdn->get_dir()))))) &&
-      !mdr->more()->src_reanchor_atid) {
-    dout(10) << "reanchoring src->dst " << *srcdnl->get_inode() << dendl;
-    vector<Anchor> trace;
-    destdn->make_anchor_trace(trace, srcdnl->get_inode());
-
-    anchorgather = new C_Gather(new C_MDS_RetryRequest(mdcache, mdr));
-    mds->anchorclient->prepare_update(srcdnl->get_inode()->ino(), trace, &mdr->more()->src_reanchor_atid,
-				      anchorgather->new_sub());
-  }
-  if (destdnl->is_primary() &&
-      destdnl->get_inode()->is_anchored() &&
-      !mdr->more()->dst_reanchor_atid) {
-    dout(10) << "reanchoring dst->stray " << *destdnl->get_inode() << dendl;
-
-    assert(straydn);
-    vector<Anchor> trace;
-    straydn->make_anchor_trace(trace, destdnl->get_inode());
-
-    if (!anchorgather)
+  if (!linkmerge || srcdnl->is_primary()) {
+    C_Gather *anchorgather = 0;
+
+    if (srcdnl->is_primary() &&
+	(srcdnl->get_inode()->is_anchored() ||
+	 (srcdnl->get_inode()->is_dir() && (srcdnl->get_inode()->inode.rstat.ranchors ||
+					    srcdnl->get_inode()->nested_anchors ||
+					    !mdcache->is_leaf_subtree(mdcache->get_projected_subtree_root(srcdn->get_dir()))))) &&
+	!mdr->more()->src_reanchor_atid) {
+      dout(10) << "reanchoring src->dst " << *srcdnl->get_inode() << dendl;
+      vector<Anchor> trace;
+      destdn->make_anchor_trace(trace, srcdnl->get_inode());
+
       anchorgather = new C_Gather(new C_MDS_RetryRequest(mdcache, mdr));
-    mds->anchorclient->prepare_update(destdnl->get_inode()->ino(), trace, &mdr->more()->dst_reanchor_atid,
-				      anchorgather->new_sub());
-  }
-
-  if (anchorgather)
-    return;  // waiting for anchor prepares
-
-  assert(g_conf.mds_kill_rename_at != 4);
+      mds->anchorclient->prepare_update(srcdnl->get_inode()->ino(), trace, &mdr->more()->src_reanchor_atid,
+					anchorgather->new_sub());
+    }
+    if (destdnl->is_primary() &&
+	destdnl->get_inode()->is_anchored() &&
+	!mdr->more()->dst_reanchor_atid) {
+      dout(10) << "reanchoring dst->stray " << *destdnl->get_inode() << dendl;
+
+      assert(straydn);
+      vector<Anchor> trace;
+      straydn->make_anchor_trace(trace, destdnl->get_inode());
+
+      if (!anchorgather)
+	anchorgather = new C_Gather(new C_MDS_RetryRequest(mdcache, mdr));
+      mds->anchorclient->prepare_update(destdnl->get_inode()->ino(), trace, &mdr->more()->dst_reanchor_atid,
+					anchorgather->new_sub());
+    }
+
+    if (anchorgather)
+      return;  // waiting for anchor prepares
+
+    assert(g_conf.mds_kill_rename_at != 4);
+  }

   // -- prepare journal entry --
   mdr->ls = mdlog->get_current_segment();
@@ -5036,7 +5038,16 @@
   CDentry::linkage_t *srcdnl = srcdn->get_projected_linkage();
   CDentry::linkage_t *destdnl = destdn->get_projected_linkage();

+  // primary+remote link merge?
+  bool linkmerge = (srcdnl->get_inode() == destdnl->get_inode() &&
+		    (srcdnl->is_primary() || destdnl->is_primary()));
   bool silent = srcdn->get_dir()->inode->is_stray();
+  if (linkmerge && !silent) {
+    reply_request(mdr, 0);  // no-op.  POSIX makes no sense.
+    return;
+  }
+  if (linkmerge)
+    dout(10) << " merging remote and primary links to the same inode" << dendl;
   if (silent)
     dout(10) << " reintegrating stray; will avoid changing nlink or dir mtime" << dendl;

@@ -5045,31 +5056,41 @@
   inode_t *tpi = 0, *tji = 0;  // target/overwritten inode

   // target inode
-  if (destdnl->is_primary()) {
-    assert(straydn);  // moving to straydn.
-    // link--, and move.
-    if (destdn->is_auth()) {
-      tpi = destdnl->get_inode()->project_inode(); //project_snaprealm
-      tpi->version = straydn->pre_dirty(tpi->version);
-    }
-    straydn->push_projected_linkage(destdnl->get_inode());
-  } else if (destdnl->is_remote()) {
-    // nlink-- targeti
-    if (destdnl->get_inode()->is_auth()) {
-      tpi = destdnl->get_inode()->project_inode();
-      tpi->version = destdnl->get_inode()->pre_dirty();
+  if (!linkmerge) {
+    if (destdnl->is_primary()) {
+      assert(straydn);  // moving to straydn.
+      // link--, and move.
+      if (destdn->is_auth()) {
+	tpi = destdnl->get_inode()->project_inode(); //project_snaprealm
+	tpi->version = straydn->pre_dirty(tpi->version);
+      }
+      straydn->push_projected_linkage(destdnl->get_inode());
+    } else if (destdnl->is_remote()) {
+      // nlink-- targeti
+      if (destdnl->get_inode()->is_auth()) {
+	tpi = destdnl->get_inode()->project_inode();
+	tpi->version = destdnl->get_inode()->pre_dirty();
+      }
     }
   }

   // dest
   if (srcdnl->is_remote()) {
-    if (destdn->is_auth()) {
-      mdr->more()->pvmap[destdn] = destdn->pre_dirty();
-      destdn->push_projected_linkage(srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
-    }
-    if (srcdnl->get_inode()->is_auth()) {
-      pi = srcdnl->get_inode()->project_inode();
-      pi->version = srcdnl->get_inode()->pre_dirty();
+    if (!linkmerge) {
+      if (destdn->is_auth()) {
+	mdr->more()->pvmap[destdn] = destdn->pre_dirty();
+        destdn->push_projected_linkage(srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
+      }
+      if (srcdnl->get_inode()->is_auth()) {
+	pi = srcdnl->get_inode()->project_inode();
+	pi->version = srcdnl->get_inode()->pre_dirty();
+      }
+    } else {
+      dout(10) << " will merge remote onto primary link" << dendl;
+      if (destdn->is_auth()) {
+	pi = destdnl->get_inode()->project_inode();
+	pi->version = mdr->more()->pvmap[destdn] = destdn->pre_dirty(destdnl->get_inode()->inode.version);
+      }
     }
   } else {
     if (destdn->is_auth()) {
@@ -5095,6 +5116,8 @@
     if (pi) {
       pi->last_renamed_version = pi->version;
       pi->ctime = mdr->now;
+      if (linkmerge)
+	pi->nlink--;
     }
     if (tpi) {
       tpi->nlink--;
@@ -5128,28 +5151,38 @@

   // add it all to the metablob
   // target inode
-  if (destdnl->is_primary()) {
-    // project snaprealm, too
-    bufferlist snapbl;
-    if (destdn->is_auth())
-      destdnl->get_inode()->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm(), snapbl);
-    straydn->first = MAX(destdnl->get_inode()->first, next_dest_snap);
-    tji = metablob->add_primary_dentry(straydn, true, destdnl->get_inode(), 0, &snapbl);
-  } else if (destdnl->is_remote()) {
-    metablob->add_dir_context(destdnl->get_inode()->get_parent_dir());
-    mdcache->journal_cow_dentry(mdr, metablob, destdnl->get_inode()->parent, CEPH_NOSNAP, 0, destdnl);
-    tji = metablob->add_primary_dentry(destdnl->get_inode()->parent, true, destdnl->get_inode());
+  if (!linkmerge) {
+    if (destdnl->is_primary()) {
+      // project snaprealm, too
+      bufferlist snapbl;
+      if (destdn->is_auth())
+        destdnl->get_inode()->project_past_snaprealm_parent(straydn->get_dir()->inode->find_snaprealm(), snapbl);
+      straydn->first = MAX(destdnl->get_inode()->first, next_dest_snap);
+      tji = metablob->add_primary_dentry(straydn, true, destdnl->get_inode(), 0, &snapbl);
+    } else if (destdnl->is_remote()) {
+      metablob->add_dir_context(destdnl->get_inode()->get_parent_dir());
+      mdcache->journal_cow_dentry(mdr, metablob, destdnl->get_inode()->parent, CEPH_NOSNAP, 0, destdnl);
+      tji = metablob->add_primary_dentry(destdnl->get_inode()->parent, true, destdnl->get_inode());
+    }
   }

   // dest
   if (srcdnl->is_remote()) {
-    if (!destdnl->is_null())
-      mdcache->journal_cow_dentry(mdr, metablob, destdn, CEPH_NOSNAP, 0, destdnl);
-    else
-      destdn->first = MAX(destdn->first, next_dest_snap);
-    metablob->add_remote_dentry(destdn, true, srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
-    mdcache->journal_cow_dentry(mdr, metablob, srcdnl->get_inode()->get_parent_dn(), CEPH_NOSNAP, 0, srcdnl);
-    ji = metablob->add_primary_dentry(srcdnl->get_inode()->get_parent_dn(), true, srcdnl->get_inode());
+    if (!linkmerge) {
+      if (!destdnl->is_null())
+	mdcache->journal_cow_dentry(mdr, metablob, destdn, CEPH_NOSNAP, 0, destdnl);
+      else
+	destdn->first = MAX(destdn->first, next_dest_snap);
+      metablob->add_remote_dentry(destdn, true, srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
+      mdcache->journal_cow_dentry(mdr, metablob, srcdnl->get_inode()->get_parent_dn(), CEPH_NOSNAP, 0, srcdnl);
+      ji = metablob->add_primary_dentry(srcdnl->get_inode()->get_parent_dn(), true, srcdnl->get_inode());
+    } else {
+      if (!destdnl->is_null())
+	mdcache->journal_cow_dentry(mdr, metablob, destdn, CEPH_NOSNAP, 0, destdnl);
+      else
+	destdn->first = MAX(destdn->first, next_dest_snap);
+      metablob->add_primary_dentry(destdn, true, destdnl->get_inode());
+    }
   } else if (srcdnl->is_primary()) {
     // project snap parent update?
     bufferlist snapbl;
@@ -5175,6 +5208,8 @@
   if (!silent) {
     if (ji && !pi) {
       ji->ctime = mdr->now;
+      if (linkmerge)
+	ji->nlink--;
     }
     if (tji && !tpi) {
       tji->nlink--;
@@ -5201,8 +5236,12 @@

   CInode *oldin = destdnl->get_inode();

+  // primary+remote link merge?
+  bool linkmerge = (srcdnl->get_inode() == destdnl->get_inode() &&
+		    (srcdnl->is_primary() || destdnl->is_primary()));
+
   // target inode
-  if (oldin) {
+  if (!linkmerge && oldin) {
     if (destdnl->is_primary()) {
       assert(straydn);
       dout(10) << "straydn is " << *straydn << dendl;
@@ -5234,17 +5273,26 @@
   CInode *in = srcdnl->get_inode();
   assert(in);
   if (srcdnl->is_remote()) {
-    srcdn->get_dir()->unlink_inode(srcdn);
-    if (destdn->is_auth())
-      destdnl = destdn->pop_projected_linkage();
-    else
-      destdn->get_dir()->link_remote_inode(destdn, in);
-    destdn->link_remote(destdnl, in);
-    if (destdn->is_auth())
-      destdn->mark_dirty(mdr->more()->pvmap[destdn], mdr->ls);
+    if (!linkmerge) {
+      srcdn->get_dir()->unlink_inode(srcdn);
+      if (destdn->is_auth())
+	destdnl = destdn->pop_projected_linkage();
+      else
+	destdn->get_dir()->link_remote_inode(destdn, in);
+      destdn->link_remote(destdnl, in);
+      if (destdn->is_auth())
+	destdn->mark_dirty(mdr->more()->pvmap[destdn], mdr->ls);
+    } else {
+      dout(10) << "merging remote onto primary link" << dendl;
+      srcdn->get_dir()->unlink_inode(srcdn);
+    }
     if (destdnl->get_inode()->is_auth())
       destdnl->get_inode()->pop_and_dirty_projected_inode(mdr->ls);
   } else {
+    if (linkmerge) {
+      dout(10) << "merging primary onto remote link" << dendl;
+      destdn->get_dir()->unlink_inode(destdn);
+    }
     srcdn->get_dir()->unlink_inode(srcdn);
     if (destdn->is_auth())
       destdnl = destdn->pop_projected_linkage();
@@ -5364,8 +5412,10 @@
   mdr->pin(srci);

   // stray?
+  bool linkmerge = (srcdnl->get_inode() == destdnl->get_inode() &&
+		    (srcdnl->is_primary() || destdnl->is_primary()));
   CDentry *straydn = 0;
-  if (destdnl->is_primary()) {
+  if (destdnl->is_primary() && !linkmerge) {
     assert(mdr->slave_request->stray.length() > 0);
     straydn = mdcache->add_replica_stray(mdr->slave_request->stray, mdr->slave_to_mds);
     assert(straydn);
@@ -5710,6 +5760,11 @@
   if (straydn)
     straydir->unlink_inode(straydn);

+  bool linkmerge = ((rollback.orig_src.ino &&
+		     rollback.orig_src.ino == rollback.orig_dest.remote_ino) ||
+		    (rollback.orig_dest.ino &&
+		     rollback.orig_dest.ino == rollback.orig_src.remote_ino));
+
   // repair src
   if (rollback.orig_src.ino)
     srcdir->link_primary_inode(srcdn, in);
@@ -5734,7 +5789,7 @@
   if (rollback.orig_dest.ino) {
     target = mds->mdcache->get_inode(rollback.orig_dest.ino);
     destdir->link_primary_inode(destdn, target);
-    assert(straydn);
+    assert(linkmerge || straydn);
   } else if (rollback.orig_dest.remote_ino) {
     target = mds->mdcache->get_inode(rollback.orig_dest.remote_ino);
     destdir->link_remote_inode(destdn, rollback.orig_dest.remote_ino,


Update SRInterface.cc

Update SRInterface.cc

--- src/Interface/Modules/Render/ES/SRInterface.cc
+++ src/Interface/Modules/Render/ES/SRInterface.cc
@@ -28,6 +28,7 @@

 // Needed for OpenGL include files on Travis:
 #include <gl-platform/GLPlatform.hpp>
+#include <Interface/Modules/Render/UndefiningX11Cruft.h>
 #include <QtOpenGL/QGLWidget>

 #include <Interface/Modules/Render/namespaces.h>


Fix BatchNorm for nullptr upstream gradients

--- chainerx_cc/chainerx/routines/normalization.cc
+++ chainerx_cc/chainerx/routines/normalization.cc
@@ -3,6 +3,8 @@
 #include <cstdint>
 #include <memory>
 #include <utility>
+
+#include <nonstd/optional.hpp>

 #include "chainerx/array.h"
 #include "chainerx/axes.h"
@@ -14,6 +16,7 @@
 #include "chainerx/error.h"
 #include "chainerx/graph.h"
 #include "chainerx/macro.h"
+#include "chainerx/routines/creation.h"
 #include "chainerx/routines/math.h"
 #include "chainerx/routines/routines_util.h"
 #include "chainerx/routines/statistics.h"
@@ -83,6 +86,13 @@
     CHAINERX_ASSERT(var_reshaped.data() == var.data());

     return {std::move(gamma_reshaped), std::move(beta_reshaped), std::move(mean_reshaped), std::move(var_reshaped), sorted_axis};
+}
+
+Array ArrayOrZeros(const nonstd::optional<Array>& array, const Array& zeros_template) {
+    if (array.has_value()) {
+        return *array;
+    }
+    return ZerosLike(zeros_template, zeros_template.device());
 }

 }  // namespace
@@ -145,9 +155,9 @@
                         const Array& gamma_reshaped = bctx2.GetRetainedInput(gamma2_tok);
                         const Array& gout = bctx2.GetRetainedInput(gout_tok);

-                        const Array& ggx = *bctx2.output_grad(0);
-                        const Array& gggamma = *bctx2.output_grad(1);
-                        const Array& ggbeta = *bctx2.output_grad(2);
+                        Array ggx = ArrayOrZeros(bctx2.output_grad(0), x);
+                        Array gggamma = ArrayOrZeros(bctx2.output_grad(1), gamma_reshaped);
+                        Array ggbeta = ArrayOrZeros(bctx2.output_grad(2), gamma_reshaped);

                         const Array& x_mean = Mean(x, sorted_axis, true);
                         const Array& x_var = Var(x, sorted_axis, true);
@@ -159,17 +169,17 @@
                         // Auxiliary values
                         int64_t n = x.GetTotalSize() / gamma_reshaped.GetTotalSize();
                         double inv_n = 1.0 / n;
-                        Array r = (gx * ggx).Sum(sorted_axis);
+                        Array r = (gx * ggx).Sum(sorted_axis, true);
                         Array coeff = gamma_reshaped * x_inv_std;
                         Array coeff_m = coeff * inv_n;
                         Array x_hat = (x - x_mean) * x_inv_std;

-                        Array gggamma2 = gggamma - coeff_m * (x_hat * ggx).Sum(sorted_axis);
-                        Array ggbeta2 = ggbeta - coeff_m * ggx.Sum(sorted_axis);
+                        Array gggamma2 = gggamma - coeff_m * (x_hat * ggx).Sum(sorted_axis, true);
+                        Array ggbeta2 = ggbeta - coeff_m * ggx.Sum(sorted_axis, true);

                         Array gx_hat2 = gggamma2 * gout - coeff_m * ggamma * ggx;
-                        Array gstd2 = -x_inv_std * (r + (x_hat * gx_hat2).Sum(sorted_axis));
-                        Array gmean2 = -x_inv_std * gx_hat2.Sum(sorted_axis);
+                        Array gstd2 = -x_inv_std * (r + (x_hat * gx_hat2).Sum(sorted_axis, true));
+                        Array gmean2 = -x_inv_std * gx_hat2.Sum(sorted_axis, true);
                         Array gx2 = x_inv_std * gx_hat2 + inv_n * (gmean2 + x_hat * gstd2);
                         Array ggout2 = gggamma2 * x_hat + ggbeta2 + coeff * ggx;


mem: Revert requirement on packet addr/size always valid

This patch reverts part of (842f56345a42), as apparently there are
use-cases outside the main repository relying on the late setting of
the physical address.

--- src/mem/packet.hh
+++ src/mem/packet.hh
@@ -255,6 +255,10 @@
         // Snoop response flags
         MEM_INHIBIT            = 0x00000008,

+        /// Are the 'addr' and 'size' fields valid?
+        VALID_ADDR             = 0x00000100,
+        VALID_SIZE             = 0x00000200,
+
         /// Is the data pointer set to a value that shouldn't be freed
         /// when the packet is destroyed?
         STATIC_DATA            = 0x00001000,
@@ -519,7 +523,7 @@

     void copyError(Packet *pkt) { assert(pkt->isError()); cmd = pkt->cmd; }

-    Addr getAddr() const { return addr; }
+    Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
     /**
      * Update the address of this packet mid-transaction. This is used
      * by the address mapper to change an already set address to a new
@@ -527,9 +531,9 @@
      * an existing address, so it asserts that the current address is
      * valid.
      */
-    void setAddr(Addr _addr) { addr = _addr; }
-
-    unsigned getSize() const  { return size; }
+    void setAddr(Addr _addr) { assert(flags.isSet(VALID_ADDR)); addr = _addr; }
+
+    unsigned getSize() const  { assert(flags.isSet(VALID_SIZE)); return size; }

     Addr getOffset(unsigned int blk_size) const
     {
@@ -541,7 +545,11 @@
         return getAddr() & ~(Addr(blk_size - 1));
     }

-    bool isSecure() const { return _isSecure; }
+    bool isSecure() const
+    {
+        assert(flags.isSet(VALID_ADDR));
+        return _isSecure;
+    }

     /**
      * It has been determined that the SC packet should successfully update
@@ -569,28 +577,43 @@

     /**
      * Constructor. Note that a Request object must be constructed
-     * first, and have a valid physical address and size. The command
-     * must be supplied.
+     * first, but the Requests's physical address and size fields need
+     * not be valid. The command must be supplied.
      */
     Packet(const RequestPtr _req, MemCmd _cmd)
-        :  cmd(_cmd), req(_req), data(nullptr), addr(req->getPaddr()),
-           _isSecure(req->isSecure()), size(req->getSize()),
+        :  cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
+           size(0), headerDelay(0), payloadDelay(0),
+           senderState(NULL)
+    {
+        if (req->hasPaddr()) {
+            addr = req->getPaddr();
+            flags.set(VALID_ADDR);
+            _isSecure = req->isSecure();
+        }
+        if (req->hasSize()) {
+            size = req->getSize();
+            flags.set(VALID_SIZE);
+        }
+    }
+
+    /**
+     * Alternate constructor if you are trying to create a packet with
+     * a request that is for a whole block, not the address from the
+     * req.  this allows for overriding the size/addr of the req.
+     */
+    Packet(const RequestPtr _req, MemCmd _cmd, int _blkSize)
+        :  cmd(_cmd), req(_req), data(nullptr), addr(0), _isSecure(false),
            headerDelay(0), payloadDelay(0),
            senderState(NULL)
-    { }
-
-    /**
-     * Alternate constructor when creating a packet that is for a
-     * whole block. This allows for overriding the size and addr of
-     * the request.
-     */
-    Packet(const RequestPtr _req, MemCmd _cmd, unsigned _blkSize)
-        :  cmd(_cmd), req(_req), data(nullptr),
-           addr(_req->getPaddr() & ~Addr(_blkSize - 1)),
-           _isSecure(_req->isSecure()), size(_blkSize),
-           headerDelay(0), payloadDelay(0),
-           senderState(NULL)
-    { }
+    {
+        if (req->hasPaddr()) {
+            addr = req->getPaddr() & ~(_blkSize - 1);
+            flags.set(VALID_ADDR);
+            _isSecure = req->isSecure();
+        }
+        size = _blkSize;
+        flags.set(VALID_SIZE);
+    }

     /**
      * Alternate constructor for copying a packet.  Copy all fields
@@ -610,6 +633,8 @@
     {
         if (!clear_flags)
             flags.set(pkt->flags & COPY_FLAGS);
+
+        flags.set(pkt->flags & (VALID_ADDR|VALID_SIZE));

         // should we allocate space for data, or not, the express
         // snoops do not need to carry any data as they only serve to
@@ -732,6 +757,16 @@
         }
     }

+    void
+    setSize(unsigned size)
+    {
+        assert(!flags.isSet(VALID_SIZE));
+
+        this->size = size;
+        flags.set(VALID_SIZE);
+    }
+
+
   public:
     /**
      * @{


non working mappings 0,1

non working mappings 0,1

--- src/mesh/Mesh.cpp
+++ src/mesh/Mesh.cpp
@@ -483,12 +483,12 @@
 	  IS_Gmt2Mts_dof[2][ii]=counter;
 	  counter++;
           own_size[2][isdom]++;
-// 	  if( inode < el->GetElementDofNumber(iel,0) ){
-// 	    own_size[0][isdom]++;
-// 	  }
-// 	  if( inode < el->GetElementDofNumber(iel,1) ){
-// 	    own_size[1][isdom]++;
-// 	  }
+ 	  if( inode < el->GetElementDofNumber(iel,0) ){
+ 	    own_size[0][isdom]++;
+ 	  }
+ 	  if( inode < el->GetElementDofNumber(iel,1) ){
+ 	    own_size[1][isdom]++;
+ 	  }
 	}
       }
     }
@@ -559,6 +559,8 @@

   // ghost nodes
   npart.assign(GetDofNumber(2), 0);
+  ghost_size[0].assign(_nprocs,0);
+  ghost_size[1].assign(_nprocs,0);
   ghost_size[2].assign(_nprocs,0);

   for(int isdom = 0; isdom < _nprocs; isdom++){
@@ -568,7 +570,16 @@
 	if(npart[ii] < isdom+1){
 	  npart[ii] = isdom+1;
 	  if( ii < MetisOffset[2][isdom]){
+	    // bi-quadratic ghost nodes
 	    ghost_size[2][isdom]++;
+	    // linear ghost nodes
+	    if( inode < el->GetElementDofNumber(iel,0) ){
+	      ghost_size[0][isdom]++;
+	    }
+	    // quadratic ghost nodes
+	    if( inode < el->GetElementDofNumber(iel,1) ){
+	      ghost_size[1][isdom]++;
+	    }
 	  }
 	}
       }
@@ -577,13 +588,22 @@

   ghost_nd[2].resize(_nprocs);
   ghost_nd_mts[2].resize(_nprocs);
+
+  ghost_nd[0].resize(_nprocs);
+  ghost_nd[1].resize(_nprocs);
+
   for(int isdom=0; isdom<_nprocs; isdom++) {
     ghost_nd[2][isdom].resize(ghost_size[2][isdom]);
     ghost_nd_mts[2][isdom].resize(ghost_size[2][isdom]);
+
+    ghost_nd[0][isdom].resize(ghost_size[0][isdom]);
+    ghost_nd[1][isdom].resize(ghost_size[1][isdom]);
   }

   npart.assign (GetDofNumber(2), 0);
   ghost_size[2].assign(_nprocs,0);
+  ghost_size[0].assign(_nprocs,0);
+  ghost_size[1].assign(_nprocs,0);

   for(int isdom = 0; isdom < _nprocs; isdom++){
     for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
@@ -595,6 +615,14 @@
 	    ghost_nd_mts[2][isdom][ghost_size[2][isdom]]=IS_Gmt2Mts_dof[2][ii];
 	    ghost_nd[2][isdom][ghost_size[2][isdom]]=ii;
 	    ghost_size[2][isdom]++;
+	    if( inode < el->GetElementDofNumber(iel,0) ){
+	      ghost_nd[0][isdom][ghost_size[0][isdom]]=ii;
+	      ghost_size[0][isdom]++;
+	    }
+	    if( inode < el->GetElementDofNumber(iel,1) ){
+	      ghost_nd[1][isdom][ghost_size[1][isdom]]=ii;
+	      ghost_size[1][isdom]++;
+	    }
 	  }
 	}
       }
@@ -602,139 +630,136 @@
   }
   //END building for k = 2

+
+
   //BEGIN building for k = 0, 1
+
+  for(unsigned k = 0; k < 2; k++){
+    std::vector < unsigned > ownedGhostCounter( _nprocs , 0);
+
+    unsigned counter = 0;
+    // isdom = 0
+    for(unsigned inode = MetisOffset[2][0]; inode < own_size[k][0] + MetisOffset[2][0]; inode++) {
+      IS_Gmt2Mts_dof[k][inode] = counter;
+      counter++;
+    }
+    ghost_nd_mts[k][0].resize(0);

-//--------------------- k = 0-----------------------
-/*
-  // isdom = 0
-  for(unsigned inode = MetisOffset[2][0]; inode < own_size[0][0] + MetisOffset[2][0]; inode++) {
-    IS_Gmt2Mts_dof[0][inode] = inode;
-  }
-  // isdom > 0
-  for(int isdom = 1; isdom < _nprocs; isdom++){
-    //ghost nodes
-    int lowerBound = own_size[0][isdom-1]+MetisOffset[2][isdom-1];
-    int temp = lowerBound;
-    int ghostCounter = 0;
-    for (unsigned inode = 0; inode < ghost_size[2][isdom]; inode++){
-      if(ghost_nd_mts[2][isdom][inode]<MetisOffset[2][isdom] && ghost_nd_mts[2][isdom][inode] > lowerBound){
-        IS_Gmt2Mts_dof[0][temp] = ghost_nd_mts[2][isdom][inode];
-	temp++;
-	ghostCounter++;
-      }
-    }
-    //own nodes
-    temp = own_size[0][isdom-1] + ghostCounter;
-    for(unsigned inode = MetisOffset[2][isdom]; inode < own_size[0][isdom] + MetisOffset[2][isdom] - 1; inode++) {
-      IS_Gmt2Mts_dof[0][temp] = inode;
-      temp++;
-    }
-  }
-
-  for (int inode=0; inode<GetDofNumber(2); inode++){
-    std::cout<<"ciao"<<IS_Gmt2Mts_dof[0][inode]<<"bla"<<GetDofNumber(0)-1<<std::endl;
-  }
-
-//--------------------- k = 1-----------------------
-
-  // isdom = 0
-  for(unsigned inode = MetisOffset[2][0]; inode < own_size[1][0] + MetisOffset[2][0]; inode++) {
-    IS_Gmt2Mts_dof[1][inode] = inode;
-  }
-  // isdom > 0
-  for(int isdom = 1; isdom < _nprocs; isdom++){
-    //ghost nodes
-    int lowerBound = own_size[1][isdom-1]+MetisOffset[2][isdom-1];
-    int temp = lowerBound;
-    int ghostCounter = 0;
-    for (unsigned inode = 0; inode < ghost_size[2][isdom]; inode++){
-      if(ghost_nd_mts[2][isdom][inode]<MetisOffset[2][isdom] && ghost_nd_mts[2][isdom][inode] > lowerBound){
-        IS_Gmt2Mts_dof[1][temp] = ghost_nd_mts[2][isdom][inode];
-	temp++;
-	ghostCounter++;
-      }
-    }
-    //own nodes
-    temp = own_size[1][isdom-1] + ghostCounter;
-    for(unsigned inode = MetisOffset[2][isdom]; inode < own_size[1][isdom] + MetisOffset[2][isdom] - 1; inode++) {
-      IS_Gmt2Mts_dof[1][temp] = inode;
-      temp++;
-    }
-  }*/
-
-//--------------------------------------------------
-
-  vector <unsigned short> node_count;
-  node_count.reserve(GetDofNumber(2));
-
-  for(unsigned k=0; k<2; k++) {
-
-    // Initialization for each k = 0,1,2
-    npart.assign(GetDofNumber(2),_nprocs);
-    unsigned counter = 0;
+    // isdom > 0
+    for(int isdom = 1; isdom < _nprocs; isdom++){
+      //ghost nodes
+      int lowerBound = MetisOffset[2][isdom-1] + own_size[k][isdom-1];
+      ghost_nd_mts[k][isdom].reserve(ghost_size[k][isdom]);
+      ghost_nd_mts[k][isdom].resize(0);
+      for (unsigned inode = 0; inode < ghost_size[k][isdom]; inode++){
+	if( ghost_nd[k][isdom][inode] < lowerBound ){ // real ghost nodes
+	  unsigned counter = ghost_nd_mts[k][isdom].size();
+	  ghost_nd_mts[k][isdom].resize(counter + 1);
+	  ghost_nd_mts[k][isdom][counter] = IS_Gmt2Mts_dof[k][ ghost_nd[k][isdom][inode] ];
+	}
+	else{ // owned ghost nodes
+
+	  IS_Gmt2Mts_dof[k][ ghost_nd[k][isdom][inode] ] = counter;
+	  counter++;
+	  ownedGhostCounter[isdom]++;
+
+	  for(unsigned jnode = inode; jnode < ghost_size[k][isdom]-1; jnode++ ){
+	    ghost_nd[k][isdom][jnode] = ghost_nd[k][isdom][jnode + 1];
+	  }
+	  ghost_size[k][isdom]--;
+	  ghost_nd[k][isdom].resize(ghost_size[k][isdom]);
+	}
+
+      }
+      //owned nodes
+      for(unsigned inode = MetisOffset[2][isdom]; inode < own_size[k][isdom] + MetisOffset[2][isdom]; inode++) {
+	IS_Gmt2Mts_dof[k][inode] = counter;
+	counter++;
+      }
+    }
+
     for(int isdom = 0; isdom < _nprocs; isdom++){
-      for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
-	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
-	  unsigned ii=el->GetElementVertexIndex(iel,inode) - 1;
-	  if(npart[ii] > isdom) {
-	    npart[ii] = isdom;
-	    IS_Gmt2Mts_dof[k][ii] = counter;
-	    counter++;
-	  }
-	}
-      }
-    }
-
-    // ghost vs own nodes
-    node_count.assign(GetDofNumber(2), 0);
-
-    ghost_size[k].assign(_nprocs,0);
-    own_size[k].assign(_nprocs,0);
-
-    for(int isdom = 0; isdom < _nprocs; isdom++){
-      for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
-	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
-	  unsigned ii=el->GetElementVertexIndex(iel,inode)-1;
-	  if(node_count[ii] < isdom+1){
-	    node_count[ii]=isdom+1;
-	    if( npart[ii] != isdom){
-	      ghost_size[k][isdom]++;
-	    }
-	    else {
-	      own_size[k][isdom]++;
-	    }
-	  }
-	}
-      }
-    }
-
-    ghost_nd[k].resize(_nprocs);
-    ghost_nd_mts[k].resize(_nprocs);
-    for(int isdom=0; isdom<_nprocs; isdom++) {
-      ghost_nd[k][isdom].resize(ghost_size[k][isdom]);
-      ghost_nd_mts[k][isdom].resize(ghost_size[k][isdom]);
-    }
-
-    node_count.assign (GetDofNumber(2), 0);
-    ghost_size[k].assign(_nprocs,0);
-
-    for(int isdom = 0; isdom < _nprocs; isdom++){
-      for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
-	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
-	  unsigned ii=el->GetElementVertexIndex(iel,inode)-1;
-	  if(node_count[ii]<isdom+1){
-	    node_count[ii]=isdom+1;
-	    if(npart[ii] != isdom){
-	      ghost_nd_mts[k][isdom][ghost_size[k][isdom]]=IS_Gmt2Mts_dof[k][ii];
-	      ghost_nd[k][isdom][ghost_size[k][isdom]]=ii;
-	      ghost_size[k][isdom]++;
-	    }
-	  }
-	}
-      }
-    }
-  }
+      own_size[k][isdom] += ownedGhostCounter[isdom];
+    }
+
+    for (int inode=0; inode<GetDofNumber(2); inode++){
+      std::cout<<"ciao"<<IS_Gmt2Mts_dof[k][inode]<<"bla"<<GetDofNumber(k)-1<<std::endl;
+    }
+  }
+
    //END building for k = 0, 1
+
+//   vector <unsigned short> node_count;
+//   node_count.reserve(GetDofNumber(2));
+//
+//   for(unsigned k=0; k<2; k++) {
+//
+//     // Initialization for each k = 0,1,2
+//     npart.assign(GetDofNumber(2),_nprocs);
+//     unsigned counter = 0;
+//     for(int isdom = 0; isdom < _nprocs; isdom++){
+//       for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
+// 	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
+// 	  unsigned ii=el->GetElementVertexIndex(iel,inode) - 1;
+// 	  if(npart[ii] > isdom) {
+// 	    npart[ii] = isdom;
+// 	    IS_Gmt2Mts_dof[k][ii] = counter;
+// 	    counter++;
+// 	  }
+// 	}
+//       }
+//     }
+//
+//     // ghost vs own nodes
+//     node_count.assign(GetDofNumber(2), 0);
+//
+//     ghost_size[k].assign(_nprocs,0);
+//     own_size[k].assign(_nprocs,0);
+//
+//     for(int isdom = 0; isdom < _nprocs; isdom++){
+//       for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
+// 	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
+// 	  unsigned ii=el->GetElementVertexIndex(iel,inode)-1;
+// 	  if(node_count[ii] < isdom+1){
+// 	    node_count[ii]=isdom+1;
+// 	    if( npart[ii] != isdom){
+// 	      ghost_size[k][isdom]++;
+// 	    }
+// 	    else {
+// 	      own_size[k][isdom]++;
+// 	    }
+// 	  }
+// 	}
+//       }
+//     }
+//
+//     ghost_nd[k].resize(_nprocs);
+//     ghost_nd_mts[k].resize(_nprocs);
+//     for(int isdom=0; isdom<_nprocs; isdom++) {
+//       ghost_nd[k][isdom].resize(ghost_size[k][isdom]);
+//       ghost_nd_mts[k][isdom].resize(ghost_size[k][isdom]);
+//     }
+//
+//     node_count.assign (GetDofNumber(2), 0);
+//     ghost_size[k].assign(_nprocs,0);
+//
+//     for(int isdom = 0; isdom < _nprocs; isdom++){
+//       for(unsigned iel = IS_Mts2Gmt_elem_offset[isdom]; iel < IS_Mts2Gmt_elem_offset[isdom+1]; iel++){
+// 	for (unsigned inode=0; inode<el->GetElementDofNumber(iel,k); inode++) {
+// 	  unsigned ii=el->GetElementVertexIndex(iel,inode)-1;
+// 	  if(node_count[ii]<isdom+1){
+// 	    node_count[ii]=isdom+1;
+// 	    if(npart[ii] != isdom){
+// 	      ghost_nd_mts[k][isdom][ghost_size[k][isdom]]=IS_Gmt2Mts_dof[k][ii];
+// 	      ghost_nd[k][isdom][ghost_size[k][isdom]]=ii;
+// 	      ghost_size[k][isdom]++;
+// 	    }
+// 	  }
+// 	}
+//       }
+//     }
+//   }
+//    //END building for k = 0, 1

   //BEGIN Initilize and set all the Offsets
   MetisOffset.resize(5);


Remove unused var; Use std::swap()

Remove unused var; Use std::swap()

--- elfio/elfio_symbols.hpp
+++ elfio/elfio_symbols.hpp
@@ -383,7 +383,6 @@
         std::function<void( Elf_Xword first, Elf_Xword second )> func )
     {
         const endianess_convertor& convertor = elf_file.get_convertor();
-        const Elf_Xword            size      = symbol_section->get_entry_size();

         Elf_Xword first_not_local =
             1; // Skip the first entry. It is always NOTYPE
@@ -414,11 +413,7 @@
                 if ( func )
                     func( first_not_local, current );

-                // Swap the symbols
-                T tmp;
-                std::copy( p1, p1 + 1, &tmp );
-                std::copy( p2, p2 + 1, p1 );
-                std::copy( &tmp, &tmp + 1, p2 );
+                std::swap( *p1, *p2 );
             }
             else {
                 // Update 'info' field of the section


Use VTK_LEGACY_REMOVE.  Thanks, cato-, for the idea.

--- src/mesh/vtk_io.C
+++ src/mesh/vtk_io.C
@@ -36,22 +36,8 @@

 #ifdef LIBMESH_HAVE_VTK

-#include "libmesh/ignore_warnings.h"
-
-// Hack to avoid warnings coming from stupid VTK files that include
-// deprecated headers.  We only do this for GCC >= 4.2, but it may
-// work for other compilers as well.  Note: technically it is
-// illegal to mess with identifiers that have double leading
-// underscores... but it is also technically super annoying to see
-// this warning all the time.
-#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
-#if __GNUC__ > 3 && __GNUC_MINOR__ > 1
-#ifdef __DEPRECATED
-  #undef __DEPRECATED
-  #define LIBMESH_REDEFINE_DEPRECATED
-#endif // if __DEPRECATED
-#endif // if version
-#endif // if gnu
+// Tell VTK not to use old header files
+#define VTK_LEGACY_REMOVE

 #include "vtkXMLUnstructuredGridReader.h"
 #include "vtkXMLUnstructuredGridWriter.h"
@@ -64,12 +50,6 @@
 #include "vtkPointData.h"
 #include "vtkPoints.h"
 #include "vtkSmartPointer.h"
-
-#ifdef LIBMESH_REDEFINE_DEPRECATED
-  #define __DEPRECATED
-#endif
-
-#include "libmesh/restore_warnings.h"

 // A convenient macro for comparing VTK versions.  Returns 1 if the
 // current VTK version is < major.minor.subminor and zero otherwise.


Restrict iteration in inner XdrIO loop

Restrict iteration in inner XdrIO loop

Our loops go in id order, so we don't have to loop over every single
object to find a contiguous block of ids each time.

--- src/mesh/xdr_io.C
+++ src/mesh/xdr_io.C
@@ -729,6 +729,9 @@

   std::size_t n_written=0;

+  MeshBase::const_node_iterator       node_iter = mesh.local_nodes_begin();
+  const MeshBase::const_node_iterator nodes_end = mesh.local_nodes_end();
+
   for (std::size_t blk=0, last_node=0; last_node<max_node_id; blk++)
     {
       const std::size_t first_node = blk*io_blksize;
@@ -740,19 +743,22 @@
       xfer_ids.clear();
       xfer_coords.clear();

-      for (const auto & node : mesh.local_node_ptr_range())
-        if ((node->id() >= first_node) && // node in [first_node, last_node)
-            (node->id() <  last_node))
-          {
-            xfer_ids.push_back(node->id());
-            xfer_coords.push_back((*node)(0));
+      for (; node_iter != nodes_end; ++node_iter)
+        {
+          const Node & node = **node_iter;
+          libmesh_assert_greater_equal(node.id(), first_node);
+          if (node.id() >= last_node)
+            break;
+
+          xfer_ids.push_back(node.id());
+          xfer_coords.push_back(node(0));
 #if LIBMESH_DIM > 1
-            xfer_coords.push_back((*node)(1));
+          xfer_coords.push_back(node(1));
 #endif
 #if LIBMESH_DIM > 2
-            xfer_coords.push_back((*node)(2));
+          xfer_coords.push_back(node(2));
 #endif
-          }
+        }

       //-------------------------------------
       // Send the xfer buffers to processor 0


Write nodal unique_id values to xda/xdr files

Increment the file version number to 0.9.6+ to signify the format
change.

--- src/mesh/xdr_io.C
+++ src/mesh/xdr_io.C
@@ -128,8 +128,8 @@
 #else
   _write_unique_id    (false),
 #endif
-  _field_width        (4),   // In 0.7.0, all fields are 4 bytes, in 0.9.2 they can vary
-  _version            ("libMesh-0.9.2+"),
+  _field_width        (4),   // In 0.7.0, all fields are 4 bytes, in 0.9.2+ they can vary
+  _version            ("libMesh-0.9.6+"),
   _bc_file_name       ("n/a"),
   _partition_map_file ("n/a"),
   _subdomain_map_file ("n/a"),
@@ -679,8 +679,14 @@
   std::vector<Real> xfer_coords;
   std::vector<Real> & coords=xfer_coords;

-  std::vector<std::vector<dof_id_type> > recv_ids   (this->n_processors());;
+  std::vector<std::vector<dof_id_type> > recv_ids   (this->n_processors());
   std::vector<std::vector<Real> >         recv_coords(this->n_processors());
+
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+  std::vector<xdr_id_type> xfer_unique_ids;
+  std::vector<xdr_id_type> & unique_ids=xfer_unique_ids;
+  std::vector<std::vector<xdr_id_type> > recv_unique_ids (this->n_processors());
+#endif // LIBMESH_ENABLE_UNIQUE_ID

   std::size_t n_written=0;

@@ -694,13 +700,20 @@
         it  = mesh.local_nodes_begin(),
         end = mesh.local_nodes_end();

-      xfer_ids.clear(); xfer_coords.clear();
+      xfer_ids.clear();
+      xfer_coords.clear();
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+      xfer_unique_ids.clear();
+#endif // LIBMESH_ENABLE_UNIQUE_ID

       for (; it!=end; ++it)
         if (((*it)->id() >= first_node) && // node in [first_node, last_node)
             ((*it)->id() <  last_node))
           {
             xfer_ids.push_back((*it)->id());
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+            xfer_unique_ids.push_back((*it)->unique_id());
+#endif // LIBMESH_ENABLE_UNIQUE_ID
             const Point & p = **it;
             xfer_coords.push_back(p(0));
 #if LIBMESH_DIM > 1
@@ -713,28 +726,26 @@

       //-------------------------------------
       // Send the xfer buffers to processor 0
-      std::vector<std::size_t> ids_size, coords_size;
+      std::vector<std::size_t> ids_size;

       const std::size_t my_ids_size = xfer_ids.size();

       // explicitly gather ids_size
       this->comm().gather (0, my_ids_size, ids_size);
-
-      // infer coords_size on processor 0
-      if (this->processor_id() == 0)
-        {
-          coords_size.reserve(this->n_processors());
-          for (std::size_t p=0; p<ids_size.size(); p++)
-            coords_size.push_back(LIBMESH_DIM*ids_size[p]);
-        }

       // We will have lots of simultaneous receives if we are
       // processor 0, so let's use nonblocking receives.
       std::vector<Parallel::Request>
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+        unique_id_request_handles(this->n_processors()-1),
+#endif // LIBMESH_ENABLE_UNIQUE_ID
         id_request_handles(this->n_processors()-1),
         coord_request_handles(this->n_processors()-1);

       Parallel::MessageTag
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+        unique_id_tag = mesh.comm().get_unique_tag(1233),
+#endif // LIBMESH_ENABLE_UNIQUE_ID
         id_tag    = mesh.comm().get_unique_tag(1234),
         coord_tag = mesh.comm().get_unique_tag(1235);

@@ -744,12 +755,18 @@
           for (unsigned int pid=0; pid<this->n_processors(); pid++)
             {
               recv_ids[pid].resize(ids_size[pid]);
-              recv_coords[pid].resize(coords_size[pid]);
+              recv_coords[pid].resize(ids_size[pid]*LIBMESH_DIM);
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+              recv_unique_ids[pid].resize(ids_size[pid]);
+#endif // LIBMESH_ENABLE_UNIQUE_ID

               if (pid == 0)
                 {
                   recv_ids[0] = xfer_ids;
                   recv_coords[0] = xfer_coords;
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+                  recv_unique_ids[0] = xfer_unique_ids;
+#endif // LIBMESH_ENABLE_UNIQUE_ID
                 }
               else
                 {
@@ -759,6 +776,9 @@
                   this->comm().receive (pid, recv_coords[pid],
                                         coord_request_handles[pid-1],
                                         coord_tag);
+                  this->comm().receive (pid, recv_unique_ids[pid],
+                                        unique_id_request_handles[pid-1],
+                                        unique_id_tag);
                 }
             }
         }
@@ -767,6 +787,9 @@
           // Send -- do this on all other processors.
           this->comm().send(0, xfer_ids,    id_tag);
           this->comm().send(0, xfer_coords, coord_tag);
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+          this->comm().send(0, xfer_unique_ids, unique_id_tag);
+#endif // LIBMESH_ENABLE_UNIQUE_ID
         }

       // -------------------------------------------------------
@@ -778,29 +801,43 @@
           // buffer sizes.
           Parallel::wait (id_request_handles);
           Parallel::wait (coord_request_handles);
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+          Parallel::wait (unique_id_request_handles);
+#endif // LIBMESH_ENABLE_UNIQUE_ID

           // Write the coordinates in this block.
           std::size_t tot_id_size=0;
-#ifndef NDEBUG
-          std::size_t tot_coord_size=0;
-#endif
+
           for (unsigned int pid=0; pid<this->n_processors(); pid++)
             {
               tot_id_size    += recv_ids[pid].size();
-#ifndef NDEBUG
-              tot_coord_size += recv_coords[pid].size();
-#endif
+              libmesh_assert_equal_to(recv_coords[pid].size(),
+                                      recv_ids[pid].size()*LIBMESH_DIM);
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+              libmesh_assert_equal_to
+                (recv_ids[pid].size(), recv_unique_ids[pid].size());
+#endif // LIBMESH_ENABLE_UNIQUE_ID
             }

           libmesh_assert_less_equal
             (tot_id_size, std::min(io_blksize, std::size_t(n_nodes)));
-          libmesh_assert_equal_to (tot_coord_size, LIBMESH_DIM*tot_id_size);

           coords.resize (3*tot_id_size);
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+          unique_ids.resize(tot_id_size);
+#endif
+
           for (unsigned int pid=0; pid<this->n_processors(); pid++)
             for (std::size_t idx=0; idx<recv_ids[pid].size(); idx++)
               {
                 const std::size_t local_idx = recv_ids[pid][idx] - first_node;
+
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+                libmesh_assert_less (local_idx, unique_ids.size());
+
+                unique_ids[local_idx] = recv_unique_ids[pid][idx];
+#endif
+
                 libmesh_assert_less ((3*local_idx+2), coords.size());
                 libmesh_assert_less ((LIBMESH_DIM*idx+LIBMESH_DIM-1), recv_coords[pid].size());

@@ -821,6 +858,19 @@

           io.data_stream (coords.empty() ? NULL : &coords[0],
                           cast_int<unsigned int>(coords.size()), 3);
+
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+          // XDR unsigned char doesn't work as anticipated
+          unsigned short write_unique_ids = 1;
+
+          io.data (write_unique_ids, "# presence of unique ids");
+          io.data_stream (unique_ids.empty() ? NULL : &unique_ids[0],
+                          cast_int<unsigned int>(unique_ids.size()), 1);
+#else
+          unsigned short write_unique_ids = 0;
+
+          io.data_stream (&write_unique_ids, 1, 1);
+#endif
         }
     }
   if (this->processor_id() == 0)
@@ -1072,7 +1122,9 @@
   // type_size, uid_size, pid_size, sid_size, p_level_size, eid_size, side_size, bid_size;
   header_id_type pos=0;

-  const bool is_version_0_9_2 = this->version().find("0.9.2") != std::string::npos ? true : false;
+  const bool exceeds_version_0_9_2 =
+    (this->version().find("0.9.2") != std::string::npos) ||
+    (this->version().find("0.9.6") != std::string::npos);

   if (this->processor_id() == 0)
     {
@@ -1083,7 +1135,7 @@
       io.data (this->partition_map_file_name());      // libMesh::out << "pid_file=" << this->partition_map_file_name()      << std::endl;
       io.data (this->polynomial_level_file_name());   // libMesh::out << "pl_file="  << this->polynomial_level_file_name()   << std::endl;

-      if (is_version_0_9_2)
+      if (exceeds_version_0_9_2)
         {
           io.data (meta_data[pos++], "# type size");
           io.data (meta_data[pos++], "# uid size");
@@ -1121,7 +1173,7 @@
    * TODO: All types are stored as the same size. Use the size information to pack things efficiently.
    * For now we will assume that "type size" is how the entire file will be encoded.
    */
-  if (is_version_0_9_2)
+  if (exceeds_version_0_9_2)
     _field_width = meta_data[2];

   if (_field_width == 4)
@@ -1140,7 +1192,7 @@
       // read the boundary conditions
       this->read_serialized_bcs (io, type_size);

-      if (is_version_0_9_2)
+      if (exceeds_version_0_9_2)
         // read the nodesets
         this->read_serialized_nodesets (io, type_size);
     }
@@ -1160,7 +1212,7 @@
       // read the boundary conditions
       this->read_serialized_bcs (io, type_size);

-      if (is_version_0_9_2)
+      if (exceeds_version_0_9_2)
         // read the nodesets
         this->read_serialized_nodesets (io, type_size);
     }
@@ -1176,7 +1228,9 @@

 void XdrIO::read_serialized_subdomain_names(Xdr & io)
 {
-  const bool read_entity_info = this->version().find("0.9.2") != std::string::npos ? true : false;
+  const bool read_entity_info =
+    (this->version().find("0.9.2") != std::string::npos) ||
+    (this->version().find("0.9.6") != std::string::npos);
   if (read_entity_info)
     {
       MeshBase & mesh = MeshInput<MeshBase>::mesh();
@@ -1244,8 +1298,10 @@

   // Version 0.9.2+ introduces unique ids
   const size_t unique_id_size_index = 3;
-  const bool read_unique_id = this->version().find("0.9.2") != std::string::npos &&
-    sizes[unique_id_size_index] ? true : false;
+  const bool read_unique_id =
+    ((this->version().find("0.9.2") != std::string::npos) ||
+     (this->version().find("0.9.6") != std::string::npos)) &&
+    sizes[unique_id_size_index];

   T n_elem_at_level=0, n_processed_at_level=0;
   for (dof_id_type blk=0, first_elem=0, last_elem=0;
@@ -1414,11 +1470,16 @@

   // At this point the elements have been read from file and placeholder nodes
   // have been assigned.  These nodes, however, do not have the proper (x,y,z)
-  // locations.  This method will read all the nodes from disk, and each processor
-  // can then grab the individual values it needs.
+  // locations or unique_id values.  This method will read all the
+  // nodes from disk, and each processor can then grab the individual
+  // values it needs.
+
+  // If the file includes unique ids for nodes (as indicated by a
+  // flag in 0.9.6+ files), those will be read next.

   // build up a list of the nodes contained in our local mesh.  These are the nodes
-  // stored on the local processor whose (x,y,z) values need to be corrected.
+  // stored on the local processor whose (x,y,z) and unique_id values
+  // need to be corrected.
   std::vector<dof_id_type> needed_nodes; needed_nodes.reserve (mesh.n_nodes());
   {
     MeshBase::node_iterator
@@ -1440,6 +1501,7 @@
             std::vector<dof_id_type>::iterator> pos;
   pos.first = needed_nodes.begin();

+  // Broadcast node coordinates
   for (std::size_t blk=0, first_node=0, last_node=0; last_node<n_nodes; blk++)
     {
       first_node = blk*io_blksize;
@@ -1472,6 +1534,76 @@
                        coords[idx+2]);

             }
+        }
+    }
+
+  const bool exceeds_version_0_9_6 =
+    (this->version().find("0.9.6") != std::string::npos);
+
+  if (exceeds_version_0_9_6)
+    {
+      // Check for node unique ids
+      unsigned short read_unique_ids;
+
+      if (this->processor_id() == 0)
+        io.data (read_unique_ids);
+
+      this->comm().broadcast (read_unique_ids);
+
+      // If no unique ids are in the file, we're done.
+      if (!read_unique_ids)
+        return;
+
+      std::vector<uint32_t> unique_32;
+      std::vector<uint64_t> unique_64;
+
+      for (std::size_t blk=0, first_node=0, last_node=0; last_node<n_nodes; blk++)
+        {
+          first_node = blk*io_blksize;
+          last_node  = std::min((blk+1)*io_blksize, std::size_t(n_nodes));
+
+          libmesh_assert((_field_width == 8) || (_field_width == 4));
+
+          if (_field_width == 8)
+            unique_64.resize(last_node - first_node);
+          else
+            unique_32.resize(last_node - first_node);
+
+          if (this->processor_id() == 0)
+            {
+              if (_field_width == 8)
+                io.data_stream (unique_64.empty() ? NULL : &unique_64[0],
+                                cast_int<unsigned int>(unique_64.size()));
+              else
+                io.data_stream (unique_32.empty() ? NULL : &unique_32[0],
+                                cast_int<unsigned int>(unique_32.size()));
+            }
+
+#ifdef LIBMESH_ENABLE_UNIQUE_ID
+          if (_field_width == 8)
+            this->comm().broadcast (unique_64);
+          else
+            this->comm().broadcast (unique_32);
+
+          for (std::size_t n=first_node, idx=0; n<last_node; n++, idx++)
+            {
+              // first see if we need this node.  use pos.first as a smart lower
+              // bound, this will ensure that the size of the searched range
+              // decreases as we match nodes.
+              pos = std::equal_range (pos.first, needed_nodes.end(), n);
+
+              if (pos.first != pos.second) // we need this node.
+                {
+                  libmesh_assert_equal_to (*pos.first, n);
+                  if (_field_width == 8)
+                    mesh.node(cast_int<dof_id_type>(n)).set_unique_id()
+                      = unique_64[idx];
+                  else
+                    mesh.node(cast_int<dof_id_type>(n)).set_unique_id()
+                      = unique_32[idx];
+                }
+            }
+#endif // LIBMESH_ENABLE_UNIQUE_ID
         }
     }
 }
@@ -1635,7 +1767,9 @@

 void XdrIO::read_serialized_bc_names(Xdr & io, BoundaryInfo & info, bool is_sideset)
 {
-  const bool read_entity_info = this->version().find("0.9.2") != std::string::npos ? true : false;
+  const bool read_entity_info =
+    (this->version().find("0.9.2") != std::string::npos) ||
+    (this->version().find("0.9.6") != std::string::npos);
   if (read_entity_info)
     {
       header_id_type n_boundary_names = 0;


Put compiler-internal include in a better place.

--- test/test085.cxx
+++ test/test085.cxx
@@ -2,9 +2,9 @@
 #include <iostream>
 #include <list>

+#include <pqxx/compiler-internal.hxx>
+
 #include <pqxx/pqxx>
-
-#include <pqxx/compiler-internal.hxx>

 using namespace PGSTD;
 using namespace pqxx;


[HB] Simplify MarkBase and MarkLig too

[HB] Simplify MarkBase and MarkLig too

--- pango/opentype/hb-ot-layout-gpos-private.hh
+++ pango/opentype/hb-ot-layout-gpos-private.hh
@@ -265,6 +265,32 @@
 ASSERT_SIZE (Anchor, 2);

+struct AnchorMatrix
+{
+  inline const Anchor& get_anchor (unsigned int row, unsigned int col, unsigned int cols) const {
+    if (HB_UNLIKELY (row >= rows || col >= cols)) return Null(Anchor);
+    return this+matrix[row * cols + col];
+  }
+
+  inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) {
+    SANITIZE_DEBUG ();
+    if (!SANITIZE_SELF ()) return false;
+    unsigned int count = rows * cols;
+    if (!SANITIZE_ARRAY (matrix, sizeof (matrix[0]), count)) return false;
+    for (unsigned int i = 0; i < count; i++)
+      if (!SANITIZE_THIS (matrix[i])) return false;
+    return true;
+  }
+
+  USHORT	rows;			/* Number of rows */
+  private:
+  OffsetTo<Anchor>
+		matrix[];		/* Matrix of offsets to Anchor tables--
+					 * from beginning of AnchorMatrix table */
+};
+ASSERT_SIZE (AnchorMatrix, 2);
+
+
 struct MarkRecord
 {
   friend struct MarkArray;
@@ -876,29 +902,10 @@
 ASSERT_SIZE (CursivePos, 2);

-struct BaseArray
-{
-  friend struct MarkBasePosFormat1;
-
-  inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) {
-    SANITIZE_DEBUG ();
-    if (!SANITIZE_SELF ()) return false;
-    unsigned int count = cols * len;
-    if (!SANITIZE_ARRAY (matrix, sizeof (matrix[0]), count)) return false;
-    for (unsigned int i = 0; i < count; i++)
-      if (!SANITIZE_THIS (matrix[i])) return false;
-    return true;
-  }
-
-  private:
-  USHORT	len;			/* Number of rows */
-  OffsetTo<Anchor>
-		matrix[];		/* Matrix of offsets to Anchor tables--
-					 * from beginning of BaseArray table--
-					 * base-major--in order of
-					 * BaseCoverage Index--, mark-minor--
+typedef AnchorMatrix BaseArray;		/* base-major--
+					 * in order of BaseCoverage Index--,
+					 * mark-minor--
 					 * ordered by class--zero-based. */
-};
 ASSERT_SIZE (BaseArray, 2);

 struct MarkBasePosFormat1
@@ -936,16 +943,14 @@
     const BaseArray& base_array = this+baseArray;

     unsigned int mark_class = mark_array.get_class (mark_index);
+
     const Anchor& mark_anchor = mark_array.get_anchor (mark_index);
-
-    if (HB_UNLIKELY (mark_class >= classCount || base_index >= base_array.len))
-      return false;
+    const Anchor& base_anchor = base_array.get_anchor (base_index, mark_class, classCount);

     hb_position_t mark_x, mark_y, base_x, base_y;

     mark_anchor.get_anchor (context, IN_CURGLYPH (), &mark_x, &mark_y);
-    unsigned int index = base_index * classCount + mark_class;
-    (&base_array+base_array.matrix[index]).get_anchor (context, IN_GLYPH (j), &base_x, &base_y);
+    base_anchor.get_anchor (context, IN_GLYPH (j), &base_x, &base_y);

     hb_internal_glyph_position_t *o = POSITION (buffer->in_pos);
     o->x_pos     = base_x - mark_x;
@@ -1013,20 +1018,10 @@
 ASSERT_SIZE (MarkBasePos, 2);

-struct LigatureAttach
-{
-  friend struct MarkLigPosFormat1;
-
-  private:
-  USHORT	len;			/* Number of ComponentRecords in this
-					 * ligature, ie. number of rows */
-  OffsetTo<Anchor>
-		matrix[];		/* Matrix of offsets to Anchor tables--
-					 * from beginning of LigatureAttach table--
-					 * component-major--in order of
-					 * writing direction--, mark-minor--
+typedef AnchorMatrix LigatureAttach;	/* component-major--
+					 * in order of writing direction--,
+					 * mark-minor--
 					 * ordered by class--zero-based. */
-};
 ASSERT_SIZE (LigatureAttach, 2);

 typedef OffsetArrayOf<LigatureAttach> LigatureArray;
@@ -1068,18 +1063,12 @@

     const MarkArray& mark_array = this+markArray;
     const LigatureArray& lig_array = this+ligatureArray;
-
-    unsigned int mark_class = mark_array.get_class (mark_index);
-    const Anchor& mark_anchor = mark_array.get_anchor (mark_index);
-
-    if (HB_UNLIKELY (mark_class >= classCount || lig_index >= lig_array.len))
-      return false;
-
     const LigatureAttach& lig_attach = &lig_array+lig_array[lig_index];
-    count = lig_attach.len;
+
+    /* Find component to attach to */
+    count = lig_attach.rows;
     if (HB_UNLIKELY (!count))
       return false;
-
     unsigned int comp_index;
     /* We must now check whether the ligature ID of the current mark glyph
      * is identical to the ligature ID of the found ligature.  If yes, we
@@ -1094,11 +1083,15 @@
     else
       comp_index = count - 1;

+    unsigned int mark_class = mark_array.get_class (mark_index);
+
+    const Anchor& mark_anchor = mark_array.get_anchor (mark_index);
+    const Anchor& lig_anchor = lig_attach.get_anchor (comp_index, mark_class, classCount);
+
     hb_position_t mark_x, mark_y, lig_x, lig_y;

     mark_anchor.get_anchor (context, IN_CURGLYPH (), &mark_x, &mark_y);
-    unsigned int index = comp_index * classCount + mark_class;
-    (&lig_attach+lig_attach.matrix[index]).get_anchor (context, IN_GLYPH (j), &lig_x, &lig_y);
+    lig_anchor.get_anchor (context, IN_GLYPH (j), &lig_x, &lig_y);

     hb_internal_glyph_position_t *o = POSITION (buffer->in_pos);
     o->x_pos     = lig_x - mark_x;
@@ -1168,34 +1161,10 @@
 ASSERT_SIZE (MarkLigPos, 2);

-struct AnchorMatrix
-{
-  inline const Anchor& get_anchor (unsigned int row, unsigned int col, unsigned int cols) const {
-    if (HB_UNLIKELY (row >= rows || col >= cols)) return Null(Anchor);
-    return this+matrix[row * cols + col];
-  }
-
-  inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) {
-    SANITIZE_DEBUG ();
-    if (!SANITIZE_SELF ()) return false;
-    unsigned int count = rows * cols;
-    if (!SANITIZE_ARRAY (matrix, sizeof (matrix[0]), count)) return false;
-    for (unsigned int i = 0; i < count; i++)
-      if (!SANITIZE_THIS (matrix[i])) return false;
-    return true;
-  }
-
-  private:
-  USHORT	rows;			/* Number of rows */
-  OffsetTo<Anchor>
-		matrix[];		/* Matrix of offsets to Anchor tables--
-					 * from beginning of AnchorMatrix table */
-};
-ASSERT_SIZE (AnchorMatrix, 2);
-
-/* mark2-major--in order of Mark2Coverage Index--,
- * mark1-minor--ordered by class--zero-based. */
-typedef AnchorMatrix Mark2Array;
+typedef AnchorMatrix Mark2Array;	/* mark2-major--
+					 * in order of Mark2Coverage Index--,
+					 * mark1-minor--
+					 * ordered by class--zero-based. */
 ASSERT_SIZE (Mark2Array, 2);

 struct MarkMarkPosFormat1


INTEGRATION: CWS chart11 (1.9.38); FILE MERGED 2007/07/31 12:56:45 bm 1.9.38.1: #i80084# avoid usage of map operator[] with enums as keys, simplify initialization of default property values

--- chart2/source/model/template/LineChartType.cxx
+++ chart2/source/model/template/LineChartType.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: LineChartType.cxx,v $
  *
- *  $Revision: 1.9 $
- *
- *  last change: $Author: vg $ $Date: 2007-05-22 18:49:07 $
+ *  $Revision: 1.10 $
+ *
+ *  last change: $Author: vg $ $Date: 2007-09-18 15:05:46 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -94,19 +94,12 @@
 void lcl_AddDefaultsToMap(
     ::chart::tPropertyValueMap & rOutMap )
 {
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_CURVE_STYLE ));
-    rOutMap[ PROP_LINECHARTTYPE_CURVE_STYLE ] =
-        uno::makeAny( chart2::CurveStyle_LINES );
-
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_CURVE_RESOLUTION ));
-    rOutMap[ PROP_LINECHARTTYPE_CURVE_RESOLUTION ] =
-        uno::makeAny( sal_Int32( 20 ) );
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINECHARTTYPE_CURVE_STYLE, ::chart2::CurveStyle_LINES );
+    ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_CURVE_RESOLUTION, 20 );

     // todo: check whether order 3 means polygons of order 3 or 2. (see
     // http://www.people.nnov.ru/fractal/Splines/Basis.htm )
-    OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_LINECHARTTYPE_SPLINE_ORDER ));
-    rOutMap[ PROP_LINECHARTTYPE_SPLINE_ORDER ] =
-        uno::makeAny( sal_Int32( 3 ) );
+    ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINECHARTTYPE_SPLINE_ORDER, 3 );
 }

 const Sequence< Property > & lcl_GetPropertySequence()


fix compile error that just started happening on linux views builders, not sure why

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

--- chrome/browser/chromeos/login/web_page_view.cc
+++ chrome/browser/chromeos/login/web_page_view.cc
@@ -30,7 +30,6 @@
 using base::TimeDelta;
 using views::Label;
 using views::View;
-using webkit_glue::FormData;

 namespace chromeos {


unwarn

unwarn

--- examples/phonon/musicplayer/mainwindow.cpp
+++ examples/phonon/musicplayer/mainwindow.cpp
@@ -181,7 +181,7 @@
         QMessageBox::warning(this, tr("Error opening files"),
             metaInformationResolver->errorString());
         while (!sources.isEmpty() &&
-               !(sources.takeLast() == metaInformationResolver->currentSource()));
+               !(sources.takeLast() == metaInformationResolver->currentSource())) /* loop */;
         return;
     }


DevTools: Fix the version info in listing browsers for non-Chrome browsers.

The browser version already removed 'Chrome/' prefix during discovery
stage (DiscoveryRequest::ReceivedVersion).
eg, the browser version of Android WebView here is '33.0.0.0' rather
than 'Chrome/33.0.0.0', so no need to filter out the 'Chrome/' here.

BUG=
TEST=

Review URL: https://codereview.chromium.org/367083002

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

--- chrome/browser/devtools/devtools_targets_ui.cc
+++ chrome/browser/devtools/devtools_targets_ui.cc
@@ -411,16 +411,8 @@
       browser_data->SetString(kTargetSourceField, source_id());

       base::Version remote_version;
-      if (browser->IsChrome()) {
-        remote_version = base::Version(browser->version());
-      } else {
-        // Try parse WebView version.
-        std::string version = browser->version();
-        size_t pos = version.find("Chrome/");
-        if (pos != std::string::npos) {
-          remote_version = base::Version(browser->version().substr(pos + 7));
-        }
-      }
+      remote_version = base::Version(browser->version());
+
       chrome::VersionInfo version_info;
       base::Version local_version(version_info.Version());


DOMUIFavIconSource should use original profile since the incognito profile might go away.

BUG=61535
TEST=None. I haven't been able to reproduce the bug.

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

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

Former-commit-id: 13eb95270e957ae218c0b284200b04f7655668b9

--- chrome/browser/dom_ui/dom_ui_favicon_source.cc
+++ chrome/browser/dom_ui/dom_ui_favicon_source.cc
@@ -13,7 +13,7 @@

 DOMUIFavIconSource::DOMUIFavIconSource(Profile* profile)
     : DataSource(chrome::kChromeUIFavIconHost, MessageLoop::current()),
-      profile_(profile) {
+      profile_(profile->GetOriginalProfile()) {
 }

 DOMUIFavIconSource::~DOMUIFavIconSource() {


Allow no arguments in ConstrainedHtmlUI::OnDialogClose().

This fixes a NOTREACHED in ConstrainedHtmlUI::OnDialogClose() when the auth dialog is cancelled.

BUG=none
TEST=ChromeOS debug build should not trace stack and break on clicking HTTP auth cancel button.

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

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

--- chrome/browser/ui/webui/constrained_html_ui.cc
+++ chrome/browser/ui/webui/constrained_html_ui.cc
@@ -49,7 +49,7 @@
     return;

   std::string json_retval;
-  if (!args->GetString(0, &json_retval))
+  if (!args->empty() && !args->GetString(0, &json_retval))
     NOTREACHED() << "Could not read JSON argument";
   delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(json_retval);
   delegate->OnDialogCloseFromWebUI();


tiny, minor string change.
CCBUGS: 152388

svn path=/branches/KDE/3.5/kdepim/; revision=737263

--- kmail/antispamwizard.cpp
+++ kmail/antispamwizard.cpp
@@ -913,7 +913,7 @@
     mToolsList->show();
     mToolsList->setSelected( 0, true );
     mSelectionHint->setText( i18n("
Please select the tools to be used "
-                                  "for the spam detection and go "
+                                  "for the detection and go "
                                   "to the next page.
") );
   }
 }


Backport: Fix mem leak

Backport:
Fix mem leak

svn path=/branches/KDE/4.1/kdepim/; revision=839487

--- kmail/kmfilteraction.cpp
+++ kmail/kmfilteraction.cpp
@@ -510,8 +510,11 @@

   QString commandLine = substituteCommandLineArgsFor( aMsg, atmList );
   if ( commandLine.isEmpty() )
+  {
+    qDeleteAll( atmList );
+    atmList.clear();
     return ErrorButGoOn;
-
+  }
   // The parentheses force the creation of a subshell
   // in which the user-specified command is executed.
   // This is to really catch all output of the command as well


Faster MinimizerIndex::append()

Faster MinimizerIndex::append()

--- src/minimizer.cpp
+++ src/minimizer.cpp
@@ -569,7 +569,11 @@
             this->clear(offset);
         } else {
             occs->push_back(pos);
-            std::sort(occs->begin(), occs->end());
+            size_t offset = occs->size() - 1;
+            while(offset > 0 && occs->at(offset - 1) > occs->at(offset)) {
+                std::swap(occs->at(offset - 1), occs->at(offset));
+                offset--;
+            }
             this->header.values++;
         }
     } else {


pass context to wait set (#324)

pass context to wait set (#324)

Signed-off-by: William Woodall <c824fe0afe16857dd6f587aa7c4044d2642d60fb@osrfoundation.org>

--- test_communication/test/test_messages_c.cpp
+++ test_communication/test/test_messages_c.cpp
@@ -123,7 +123,11 @@
   }

   template<typename MessageT>
-  void test_message_type(const char * topic_name, const rosidl_message_type_support_t * ts)
+  void
+  test_message_type(
+    const char * topic_name,
+    const rosidl_message_type_support_t * ts,
+    rcl_context_t * context)
   {
     rcl_ret_t ret;
     rcl_publisher_t publisher = rcl_get_zero_initialized_publisher();
@@ -158,6 +162,7 @@
         0,  // number_of_timers
         0,  // number_of_clients
         0,  // number_of_services
+        context,
         rcl_get_default_allocator());
       EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
       ret = rcl_wait_set_clear(&wait_set);
@@ -206,6 +211,7 @@
           0,  // number_of_timers
           0,  // number_of_clients
           0,  // number_of_services
+          context,
           rcl_get_default_allocator());
         EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
         ret = rcl_wait_set_clear(&wait_set);
@@ -362,7 +368,7 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_primitives) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, Primitives);
-  test_message_type<test_msgs__msg__Primitives>("test_primitives", ts);
+  test_message_type<test_msgs__msg__Primitives>("test_primitives", ts, this->context_ptr);
 }

 template<>
@@ -395,7 +401,7 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_nested) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, Nested);
-  test_message_type<test_msgs__msg__Nested>("test_nested", ts);
+  test_message_type<test_msgs__msg__Nested>("test_nested", ts, this->context_ptr);
 }

@@ -439,7 +445,7 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_builtins) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, Builtins);
-  test_message_type<test_msgs__msg__Builtins>("test_builtins", ts);
+  test_message_type<test_msgs__msg__Builtins>("test_builtins", ts, this->context_ptr);
 }

@@ -534,8 +540,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_staticarrayprimitives) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, StaticArrayPrimitives);
-  test_message_type<test_msgs__msg__StaticArrayPrimitives>("test_staticarrayprimitives",
-    ts);
+  test_message_type<test_msgs__msg__StaticArrayPrimitives>(
+    "test_staticarrayprimitives", ts, this->context_ptr);
 }

 template<>
@@ -576,8 +582,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_staticarraynested) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, StaticArrayNested);
-  test_message_type<test_msgs__msg__StaticArrayNested>("test_staticarraynested",
-    ts);
+  test_message_type<test_msgs__msg__StaticArrayNested>(
+    "test_staticarraynested", ts, this->context_ptr);
 }

 template<>
@@ -827,8 +833,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_dynamicarrayprimitives) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, DynamicArrayPrimitives);
-  test_message_type<test_msgs__msg__DynamicArrayPrimitives>("test_dynamicarrayprimitives",
-    ts);
+  test_message_type<test_msgs__msg__DynamicArrayPrimitives>(
+    "test_dynamicarrayprimitives", ts, this->context_ptr);
 }

 template<>
@@ -902,8 +908,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_dynamicarraynested) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, DynamicArrayNested);
-  test_message_type<test_msgs__msg__DynamicArrayNested>("test_dynamicarraynested",
-    ts);
+  test_message_type<test_msgs__msg__DynamicArrayNested>(
+    "test_dynamicarraynested", ts, this->context_ptr);
 }

@@ -1072,8 +1078,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_boundedarrayprimitives) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, BoundedArrayPrimitives);
-  test_message_type<test_msgs__msg__BoundedArrayPrimitives>("test_boundedarrayprimitives",
-    ts);
+  test_message_type<test_msgs__msg__BoundedArrayPrimitives>(
+    "test_boundedarrayprimitives", ts, this->context_ptr);
 }

 template<>
@@ -1148,8 +1154,8 @@
 TEST_F(CLASSNAME(TestMessagesFixture, RMW_IMPLEMENTATION), test_boundedarraynested) {
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, BoundedArrayNested);
-  test_message_type<test_msgs__msg__BoundedArrayNested>("test_boundedarraynested",
-    ts);
+  test_message_type<test_msgs__msg__BoundedArrayNested>(
+    "test_boundedarraynested", ts, this->context_ptr);
 }

 template<>
@@ -1198,5 +1204,5 @@
   const rosidl_message_type_support_t * ts = ROSIDL_GET_MSG_TYPE_SUPPORT(
     test_msgs, msg, DynamicArrayPrimitivesNested);
   test_message_type<test_msgs__msg__DynamicArrayPrimitivesNested>(
-    "test_dynamicarraynestedprimitives", ts);
-}
+    "test_dynamicarraynestedprimitives", ts, this->context_ptr);
+}


add TODO

add TODO

--- testat-1/pocketcalculator_test/src/Test.cpp
+++ testat-1/pocketcalculator_test/src/Test.cpp
@@ -239,6 +239,7 @@
 		" --   -- \n"
 	};

+	// TODO: we don't have a prompt anymore. so maybe this functionality is obsolete anyway
 	bool includes(const std::string str, const std::string substr) {
 		return (str.find(substr) != std::string::npos);
 	}


experimental/editor/application: pre-shape text before showing window

Also, make constructor do even less work.

Change-Id: Iced41488757d6d5d01c4e1d02eee03ab2bb109a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234216
Reviewed-by: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Commit-Queue: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Auto-Submit: Hal Canary <fd9641b23487c8ee78406c27513624c460600766@google.com>

--- experimental/editor/editor_application.cpp
+++ experimental/editor/editor_application.cpp
@@ -343,12 +343,10 @@
     EditorLayer fLayer;
     double fNextTime = -DBL_MAX;

-    EditorApplication(void* platformData)
-        : fWindow(sk_app::Window::CreateNativeWindow(platformData)) {}
+    EditorApplication(std::unique_ptr<sk_app::Window> win) : fWindow(std::move(win)) {}

     bool init(const char* path) {
         fWindow->attach(kBackendType);
-        fLayer.inval();

         fLayer.fEditor.setFont(SkFont(SkTypeface::MakeFromName(kTypefaceName,
                                SkFontStyle(kFontWeight, kFontWidth, kFontSlant)), kFontSize));
@@ -356,8 +354,10 @@

         fWindow->pushLayer(&fLayer);
         fWindow->setTitle(SkStringPrintf("Editor: \"%s\"", fLayer.fPath.c_str()).c_str());
+        fLayer.onResize(fWindow->width(), fWindow->height());
+        fLayer.fEditor.paint(nullptr, editor::Editor::PaintOpts());
+
         fWindow->show();
-        fLayer.onResize(fWindow->width(), fWindow->height());
         return true;
     }
     ~EditorApplication() override { fWindow->detach(); }
@@ -378,7 +378,11 @@
     if (!SkLoadICU()) {
         SK_ABORT("SkLoadICU failed.");
     }
-    EditorApplication* app = new EditorApplication(dat);
-    SkASSERT(app->init(argc > 1 ? argv[1] : nullptr));
-    return app;
-}
+    std::unique_ptr<sk_app::Window> win(sk_app::Window::CreateNativeWindow(dat));
+    if (!win) {
+        SK_ABORT("CreateNativeWindow failed.");
+    }
+    std::unique_ptr<EditorApplication> app(new EditorApplication(std::move(win)));
+    (void)app->init(argc > 1 ? argv[1] : nullptr);
+    return app.release();
+}


Fix PR 2837

Fix PR 2837

--- src/module-dos.cc
+++ src/module-dos.cc
@@ -77,6 +77,29 @@

 	void onUnload() {
 	}
+
+	virtual bool isValidNextConfig( const ConfigValue &value ) {
+		GenericStruct *module_config = dynamic_cast<GenericStruct *>(value.getParent());
+		if (!module_config->get<ConfigBoolean>("enabled")->readNext())
+			return true;
+		else {
+
+#if __APPLE__
+			LOGEN("DosProtection only works on linux hosts. Please disable this module.");
+			return false;
+#else
+
+			int at_command = system("which at");
+			if( WIFEXITED(at_command) && WEXITSTATUS(at_command) == 0 ) {
+				// at command was found, we can be sure that iptables rules will be cleaned up after the required time
+				return true;
+			} else {
+				LOGEN("Couldn't find the commant 'at' in your PATH. DosProtection needs it to be used correctly. Please fix this or disable DosProtection.");
+				return false;
+			}
+#endif
+		}
+	}

 	void onIdle() {
 		struct timeval now;


transport: Move "accept failed" message to the debug log

Fixes #2518

Signed-off-by: Botond Dénes <a584fa4d75a0a85d721f44fb6e06315a2853b0b6@scylladb.com>
Message-Id: <492ea8a916bb3b2427f6cc16a4f6eadadaa30b10.1499418234.git.a584fa4d75a0a85d721f44fb6e06315a2853b0b6@scylladb.com>

--- transport/server.cc
+++ transport/server.cc
@@ -362,7 +362,7 @@
         try {
             f.get();
         } catch (...) {
-            clogger.warn("acccept failed: {}", std::current_exception());
+            clogger.debug("acccept failed: {}", std::current_exception());
             do_accepts(which, keepalive, server_addr);
         }
     });


INTEGRATION: CWS wae4extensions (1.7.388); FILE MERGED 2007/09/27 07:18:22 fs 1.7.388.1: #i81612# warning-free code

--- extensions/source/bibliography/bibcont.hxx
+++ extensions/source/bibliography/bibcont.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: bibcont.hxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.8 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-08 19:13:23 $
+ *  last change: $Author: ihi $ $Date: 2008-01-14 14:38:07 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -77,6 +77,8 @@
         virtual void            GetFocus();

         virtual BOOL            HandleShortCutKey( const KeyEvent& rKeyEvent ); // returns true, if key was handled
+
+        using Window::GetChild;
 };

 inline Window* BibWindowContainer::GetChild()
@@ -94,11 +96,11 @@

         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >              xTopPeerRef;
         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >              xBottomPeerRef;
-        sal_Bool                    bFirstTime;

+        BibDataManager*         pDatMan;
         BibWindowContainer*     pTopWin;
         BibWindowContainer*     pBottomWin;
-        BibDataManager*         pDatMan;
+        sal_Bool                    bFirstTime;
         HdlBibModul             pBibMod;
         Timer                   aTimer;


#98808# DataChanged(): base class call corrected

--- extensions/source/bibliography/toolbar.cxx
+++ extensions/source/bibliography/toolbar.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: toolbar.cxx,v $
  *
- *  $Revision: 1.9 $
- *
- *  last change: $Author: os $ $Date: 2002-05-07 13:49:06 $
+ *  $Revision: 1.10 $
+ *
+ *  last change: $Author: os $ $Date: 2002-05-15 12:18:01 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -599,7 +599,7 @@
     if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
          (rDCEvt.GetFlags() & SETTINGS_STYLE) )
             ApplyImageList();
-    Window::DataChanged( rDCEvt );
+    ToolBox::DataChanged( rDCEvt );
 }
 /* -----------------------------07.05.2002 15:09------------------------------


INTEGRATION: CWS odbmacros2 (1.8.424); FILE MERGED 2008/02/11 11:14:56 fs 1.8.424.3: IWizardPage is COMMIT_REASON is deprecated - replace usages with CommitPageReason, while I have an svtools-incompatible CWS 2008/01/30 13:19:50 fs 1.8.424.2: canAdvance made const 2008/01/15 09:52:42 fs 1.8.424.1: some re-factoring of OWizardMachine, RoadmapWizard and derived classes, to prepare the migration UI for #i49133#

--- extensions/source/dbpilots/groupboxwiz.hxx
+++ extensions/source/dbpilots/groupboxwiz.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: groupboxwiz.hxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-08 19:30:50 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: kz $ $Date: 2008-03-06 18:41:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -83,7 +83,7 @@
     protected:
         // OWizardMachine overridables
         virtual ::svt::OWizardPage* createPage( WizardState _nState );
-        virtual WizardState         determineNextState( WizardState _nCurrentState );
+        virtual WizardState         determineNextState( WizardState _nCurrentState ) const;
         virtual void                enterState( WizardState _nState );

         virtual sal_Bool onFinish(sal_Int32 _nResult);
@@ -129,8 +129,8 @@

         // OWizardPage overridables
         virtual void        initializePage();
-        virtual sal_Bool    commitPage(COMMIT_REASON _eReason);
-        virtual sal_Bool    determineNextButtonState();
+        virtual sal_Bool    commitPage( CommitPageReason _eReason );
+        virtual bool        canAdvance() const;

         DECL_LINK( OnMoveEntry, PushButton* );
         DECL_LINK( OnEntrySelected, ListBox* );
@@ -157,7 +157,7 @@
     protected:
         // OWizardPage overridables
         virtual void        initializePage();
-        virtual sal_Bool    commitPage(COMMIT_REASON _eReason);
+        virtual sal_Bool    commitPage( CommitPageReason _eReason );

         OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
     };
@@ -187,7 +187,7 @@

         // OWizardPage overridables
         virtual void        initializePage();
-        virtual sal_Bool    commitPage(COMMIT_REASON _eReason);
+        virtual sal_Bool    commitPage( CommitPageReason _eReason );

         void implTraveledOptions();

@@ -229,8 +229,8 @@

         // OWizardPage overridables
         virtual void        initializePage();
-        virtual sal_Bool    commitPage(COMMIT_REASON _eReason);
-        virtual sal_Bool    determineNextButtonState();
+        virtual sal_Bool    commitPage( CommitPageReason _eReason );
+        virtual bool        canAdvance() const;
     };

 //.........................................................................


Fix Savannah #95065: flush llvm::outs() before TextInput interaction.

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

--- cint/cling/lib/UserInterface/UserInterface.cpp
+++ cint/cling/lib/UserInterface/UserInterface.cpp
@@ -51,6 +51,7 @@
   MetaProcessorOpts& MPOpts = m_MetaProcessor->getMetaProcessorOpts();

   while (!MPOpts.Quitting) {
+    llvm::outs().flush();
     TextInput::EReadResult RR = TI.ReadInput();
     TI.TakeInput(line);
     if (RR == TextInput::kRREOF) {


Fix casting to uint64_t when returning unix system time

--- drivers/unix/os_unix.cpp
+++ drivers/unix/os_unix.cpp
@@ -187,7 +187,7 @@
 uint64_t OS_Unix::get_system_time_msecs() const {
 	struct timeval tv_now;
 	gettimeofday(&tv_now, NULL);
-	return uint64_t(tv_now.tv_sec * 1000 + tv_now.tv_usec / 1000);
+	return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000;
 }

 OS::Date OS_Unix::get_date(bool utc) const {