refine generate_data

refine generate_data

--- generate/generate_data.cpp
+++ generate/generate_data.cpp
@@ -1,12 +1,3 @@
-// g++ -std=c++11 generate_data.cpp -o generate_data
-// /home/sjx/graph-query/generate/generate_data lubm_raw_40 id_lubm_40
-
-
-//to generate minimal_index
-// grep "<http://www.University0.edu>" str_normal >> str_normal_minimal
-// grep "<http://www.Department0.University0.edu>" str_normal >> str_normal_minimal
-
-
 #include <string>
 #include <fstream>
 #include <iostream>
@@ -18,7 +9,25 @@
 #include <algorithm>
 #include <assert.h>

+#include <sys/stat.h>
+#include <sys/types.h>
+
+/**
+ * A simple manual
+ *  $g++ -std=c++11 generate_data.cpp -o generate_data
+ *  $./generate_data lubm_raw_40 id_lubm_40
+ */
+
+/**
+ * How to generate minimal_index file
+ *  $grep "<http://www.University0.edu>" str_normal >> str_normal_minimal
+ *  $grep "<http://www.Department0.University0.edu>" str_normal >> str_normal_minimal
+ *  ...
+ */
+
 using namespace std;
+
+enum { NBTITS_IDX = 17 };

 int
 main(int argc, char** argv)
@@ -27,85 +36,101 @@
     vector<string> normal_str;
     vector<string> index_str;

-    struct dirent *ptr;
-    DIR *dir;
-    if (argc <= 2) {
+    if (argc != 3) {
         printf("usage: ./generate_data src_dir dst_dir\n");
-        return 0;
+        return -1;
     }
-    dir = opendir(argv[1]);

-    //init
+    if (mkdir(argv[2], S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0) {
+        cout << "Error: Creating dst_dir (" << argv[2] << ") failed." << endl;
+        exit(-1);
+    }
+
+    DIR *src = opendir(argv[1]);
+    if (!src) {
+        cout << "Error: Opening src_dir (" << argv[1] << ") failed." << endl;
+        exit(-1);
+    }

     str_to_id["__PREDICT__"] = 0;
     index_str.push_back("__PREDICT__");
+
     str_to_id["<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"] = 1;
     index_str.push_back("<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>");

-    int nbit_predict = 17;
+    // reserve the first two ids for the class of index vertex (i.e, predicate or type)
     size_t next_index_id = 2;
-    size_t next_normal_id = 1 << nbit_predict;
-    int count = 1;
+    size_t next_normal_id = 1 << NBTITS_IDX; // reserve 2^NBTITS_IDX ids for index vertices
+    int count = 0;

-    while ((ptr = readdir(dir)) != NULL) {
-        if (ptr->d_name[0] == '.')
+    struct dirent *dent;
+    while ((dent = readdir(src)) != NULL) {
+        if (dent->d_name[0] == '.')
             continue;
-        ifstream file((string(argv[1]) + "/" + string(ptr->d_name)).c_str());
-        ofstream output((string(argv[2]) + "/id_" + string(ptr->d_name)).c_str());
-        cout << "No." << count << ", loading " << ptr->d_name << endl;
-        //printf("No.%d, loading %s ...\n",count,ptr->d_name);
-        count++;
-        string subject;
-        string predict;
-        string object;
-        string useless_dot;
-        while (file >> subject >> predict >> object >> useless_dot) {
-            int id[3];
+
+        ifstream file((string(argv[1]) + "/" + string(dent->d_name)).c_str());
+        ofstream output((string(argv[2]) + "/id_" + string(dent->d_name)).c_str());
+        cout << "Process No." << ++count << " file: " << dent->d_name << "." << endl;
+
+        string subject, predict, object, dot;
+        while (file >> subject >> predict >> object >> dot) {
+            /* add a new normal vertex */
             if (str_to_id.find(subject) == str_to_id.end()) {
                 str_to_id[subject] = next_normal_id;
-                next_normal_id++;
+                next_normal_id ++;
                 normal_str.push_back(subject);
             }
+
+            /* add a new predicate index vertex (i.e., p-idx) */
             if (str_to_id.find(predict) == str_to_id.end()) {
                 str_to_id[predict] = next_index_id;
-                next_index_id++;
+                next_index_id ++;
                 index_str.push_back(predict);
             }
+
+            /* treat different types as individual indexes */
             if (predict == "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>") {
+                /* add a new type index vertex (i.e., t-idx) */
                 if (str_to_id.find(object) == str_to_id.end()) {
                     str_to_id[object] = next_index_id;
-                    next_index_id++;
+                    next_index_id ++;
                     index_str.push_back(object);
                 }
             } else {
+                /* add a new normal vertex */
                 if (str_to_id.find(object) == str_to_id.end()) {
                     str_to_id[object] = next_normal_id;
-                    next_normal_id++;
+                    next_normal_id ++;
                     normal_str.push_back(object);
                 }
             }
+
+            int id[3];
             id[0] = str_to_id[subject];
             id[1] = str_to_id[predict];
             id[2] = str_to_id[object];
             output << id[0] << "\t" << id[1] << "\t" << id[2] << endl;
         }
     }
+    closedir(src);

+    /* generate a file of the mapping between name and id for nomrmal vertices */
     {
         ofstream f_normal((string(argv[2]) + "/str_normal").c_str());
-        for (int i = 0; i < normal_str.size(); i++) {
+        for (int i = 0; i < normal_str.size(); i++)
             f_normal << normal_str[i] << "\t" << str_to_id[normal_str[i]] << endl;
-        }
     }

+    /* generate a file of the mapping between name and id for index vertices */
     {
         ofstream f_index((string(argv[2]) + "/str_index").c_str());
-        for (int i = 0; i < index_str.size(); i++) {
+        for (int i = 0; i < index_str.size(); i++)
             f_index << index_str[i] << "\t" << str_to_id[index_str[i]] << endl;
-        }
     }

-    cout << "sizeof str_to_id=" << str_to_id.size() << endl;
-    cout << "sizeof normal_str=" << normal_str.size() << endl;
-    cout << "sizeof index_str=" << index_str.size() << endl;
+    cout << "#total_vertex = " << str_to_id.size() << endl;
+    cout << "#normal_vertex = " << normal_str.size() << endl;
+    cout << "#index_vertex = " << index_str.size() << endl;
+
+    return 0;
 }


layers: s/skip_call/skip/ in CV CreateComputePipelines

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -6892,7 +6892,7 @@
                        const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator,
                        VkPipeline *pPipelines) {
     VkResult result = VK_SUCCESS;
-    bool skip_call = false;
+    bool skip = false;

     // TODO : Improve this data struct w/ unique_ptrs so cleanup below is automatic
     vector<PIPELINE_STATE *> pPipeState(count);
@@ -6907,15 +6907,14 @@
         pPipeState[i] = new PIPELINE_STATE;
         pPipeState[i]->initComputePipeline(&pCreateInfos[i]);
         pPipeState[i]->pipeline_layout = *getPipelineLayout(dev_data, pCreateInfos[i].layout);
-        // memcpy(&pPipeState[i]->computePipelineCI, (const void *)&pCreateInfos[i], sizeof(VkComputePipelineCreateInfo));

         // TODO: Add Compute Pipeline Verification
-        skip_call |= !validate_compute_pipeline(dev_data->report_data, pPipeState[i], &dev_data->enabled_features,
+        skip |= !validate_compute_pipeline(dev_data->report_data, pPipeState[i], &dev_data->enabled_features,
                                                 dev_data->shaderModuleMap);
-        // skip_call |= verifyPipelineCreateState(dev_data, pPipeState[i]);
-    }
-
-    if (!skip_call) {
+        // skip |= verifyPipelineCreateState(dev_data, pPipeState[i]);
+    }
+
+    if (!skip) {
         lock.unlock();
         result =
             dev_data->dispatch_table.CreateComputePipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines);


use folly::once_flag instead of std::once_flag

Summary: folly::once_flag provides better exception safety and provides test_once

Reviewed By: yfeldblum

Differential Revision: D34879752

fbshipit-source-id: cc46549c75a4a1124d87d906bcbeb8c5d17dd079

--- thrift/lib/cpp2/server/ConcurrencyControllerBase.cpp
+++ thrift/lib/cpp2/server/ConcurrencyControllerBase.cpp
@@ -15,9 +15,9 @@
  */

 #include <atomic>
-#include <mutex>
 #include <folly/Indestructible.h>
 #include <folly/Synchronized.h>
+#include <folly/synchronization/CallOnce.h>
 #include <thrift/lib/cpp2/server/ConcurrencyControllerBase.h>

 namespace apache::thrift {
@@ -28,21 +28,17 @@
   class Storage {
    public:
     void set(std::shared_ptr<Observer> o) {
-      static std::once_flag observerSetFlag;
-      std::call_once(observerSetFlag, [&] {
-        instance_ = std::move(o);
-        isset_.store(true, std::memory_order_release);
-      });
+      folly::call_once(observerSetFlag_, [&] { instance_ = std::move(o); });
     }
     Observer* get() {
-      if (!isset_.load(std::memory_order_acquire)) {
+      if (!folly::test_once(observerSetFlag_)) {
         return {};
       }
       return instance_.get();
     }

    private:
-    std::atomic<bool> isset_{false};
+    folly::once_flag observerSetFlag_;
     std::shared_ptr<Observer> instance_;
   };


bugfix: zp-meta crach when all data nodes reconnect to meta server

--- src/meta/zp_meta_server.cc
+++ src/meta/zp_meta_server.cc
@@ -517,6 +517,7 @@
           ZPMeta::Node* slave = p->mutable_slaves(j);
           slave->CopyFrom(p->slaves(slaves_size-1));
           p->mutable_slaves()->RemoveLast();
+          break;
         }
       }
     }
@@ -575,10 +576,14 @@
 bool ZPMetaServer::IsLeader() {
   std::string leader_ip;
   int leader_port = 0, leader_cmd_port = 0;
-  while (!GetLeader(leader_ip, leader_port)) {
+  while (!should_exit_ && !GetLeader(leader_ip, leader_port)) {
     LOG(INFO) << "Wait leader ... ";
     // Wait leader election
     sleep(1);
+  }
+  if (should_exit_) {
+    leader_cli_ = NULL;
+    return false;
   }
   LOG(INFO) << "Leader: " << leader_ip << ":" << leader_port;


mrmath: product was doing a sum

mrmath: product was doing a sum

--- cmd/mrmath.cpp
+++ cmd/mrmath.cpp
@@ -119,10 +119,10 @@

 class Product {
   public:
-    Product () : product (0.0) { }
+    Product () : product (1.0) { }
     void operator() (value_type val) {
       if (std::isfinite (val))
-        product += val;
+        product *= val;
     }
     value_type result () const {
       return product;


Fix generation of core.BNLog
Most of the BNLog API methods are just variable length arguments of strings. BNLog also includes a `level` parameter, which causes a `TypeError` when `binaryninja.log.log(level, msg)` is called, because it is expecting all parameters to be strings. This PR fixes it so that `BNLog` is correctly generated.

Note: I haven't actually tested this to verify `generator` still works, because my Makefile is messed up currently.

--- python/generator.cpp
+++ python/generator.cpp
@@ -396,9 +396,18 @@
 			// As of writing this, only BNLog's have variable instruction lengths, but in an attempt not to break in the future:
 			if (funcName.compare(0, 6, "_BNLog") == 0)
 			{
-				fprintf(out, "def %s(*args):\n", name.c_str());
-				fprintf(out, "\treturn %s(*[cstr(arg) for arg in args])\n\n", funcName.c_str());
-				continue;
+				if (funcName != "_BNLog")
+				{
+					fprintf(out, "def %s(*args):\n", name.c_str());
+					fprintf(out, "\treturn %s(*[cstr(arg) for arg in args])\n\n", funcName.c_str());
+					continue;
+				}
+				else
+				{
+					fprintf(out, "def %s(level, *args):\n", name.c_str());
+					fprintf(out, "\treturn %s(level, *[cstr(arg) for arg in args])\n\n", funcName.c_str());
+					continue;
+				}
 			}
 		}


Fix HTTP header decoding

Fix HTTP header decoding

Summary: We shouldn't try to decode encoded values without an '_'.

Reviewed By: spalamarchuk

Differential Revision: D15787396

fbshipit-source-id: 64c371009167528e33b2afded51537d5cf81fc74

--- thrift/lib/cpp2/transport/http2/common/H2Channel.cpp
+++ thrift/lib/cpp2/transport/http2/common/H2Channel.cpp
@@ -71,15 +71,15 @@
     // original key cannot be recovered.
     if (key.find("encode_") == 0) {
       auto us = val.find("_");
-      if (us == string::npos) {
-        LOG(ERROR) << "Encoded value does not contain underscore";
+      if (us != string::npos) {
+        auto decodedKey = proxygen::Base64::urlDecode(val.substr(0, us));
+        auto decodedVal = proxygen::Base64::urlDecode(val.substr(us + 1));
+        dest[decodedKey] = decodedVal;
+        return;
       }
-      auto decodedKey = proxygen::Base64::urlDecode(val.substr(0, us));
-      auto decodedVal = proxygen::Base64::urlDecode(val.substr(us + 1));
-      dest[decodedKey] = decodedVal;
-    } else {
-      dest[key] = val;
+      LOG(ERROR) << "Encoded value does not contain '_'; preserving original";
     }
+    dest[key] = val;
   };
   source.getHeaders().forEach(decodeAndCopyKeyValue);
 }


layers: Free pipeline state memory in vkDestroyPipeline

Pipeline states are allocated in vkCreateGraphicsPipelines and
vkCreateComputePipelines.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -5300,6 +5300,7 @@
                                           VK_OBJECT obj_struct) {
     // Any bound cmd buffers are now invalid
     invalidateCommandBuffers(dev_data, pipeline_state->cb_bindings, obj_struct);
+    delete getPipelineState(dev_data, pipeline);
     dev_data->pipelineMap.erase(pipeline);
 }


Renamed Image.get_bitmap to Image.get_background

Renamed Image.get_bitmap Python-function to clarify that it
returns only the background layer, and not flattened objects,
or a selection.

--- python/py-canvas.cpp
+++ python/py-canvas.cpp
@@ -290,17 +290,17 @@
 Returns a copy of the background from this image as a Bitmap with the
 active selection (if any) and all objects rasterized.\n\n

-See also get_bitmap and get_stamped_bitmap." */
+See also get_background and get_stamped_bitmap." */
 static Bitmap canvas_flattened(Canvas& canvas){
   return flatten(canvas.GetImage());
 }

-/* method: "get_bitmap()\n
+/* method: "get_background()\n
 Returns a copy of the pixel data in the active frame as an
 ifaint.Bitmap, or none if the background is a color.\n\n

 To include a floating selection, use instead get_stamped_bitmap." */
-static const Optional<Bitmap>& canvas_get_bitmap(Canvas& canvas){
+static const Optional<Bitmap>& canvas_get_background(Canvas& canvas){
   return canvas.GetBackground().Get<Bitmap>();
 }

@@ -335,7 +335,7 @@
 /* method: "get_stamped_bitmap()\n
 Returns a copy of the pixel data in the active frame as an
 ifaint.Bitmap. Any floating selection will be stamped onto the
-Bitmap." */
+Bitmap. Objects will not be included. " */
 static Bitmap canvas_get_stamped_bitmap(Canvas& canvas){
   return stamp_raster_selection(canvas.GetImage());
 }


layers: Add helpers for getting fence and queue nodes

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -316,6 +316,22 @@
         return nullptr;
     }
     return bv_it->second.get();
+}
+
+FENCE_NODE *getFenceNode(layer_data *dev_data, VkFence fence) {
+    auto it = dev_data->fenceMap.find(fence);
+    if (it == dev_data->fenceMap.end()) {
+        return nullptr;
+    }
+    return &it->second;
+}
+
+QUEUE_NODE *getQueueNode(layer_data *dev_data, VkQueue queue) {
+    auto it = dev_data->queueMap.find(queue);
+    if (it == dev_data->queueMap.end()) {
+        return nullptr;
+    }
+    return &it->second;
 }

 static VkDeviceMemory *get_object_mem_binding(layer_data *my_data, uint64_t handle, VkDebugReportObjectTypeEXT type) {


layers: Comment update

layers: Comment update

The behavior of the PreCallValidateAllocateDescriptorSets slightly
changed so updating comment accordingly.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -5865,10 +5865,9 @@
     }
     return result;
 }
-
 // Ensure the pool contains enough descriptors and descriptor sets to satisfy
-// an allocation request. Fills requiredDescriptorsByType with the total number
-// of descriptors of each type required, for later update.
+// an allocation request. Fills common_data with the total number of descriptors of each type required,
+// as well as DescriptorSetLayout ptrs used for later update.
 static bool PreCallValidateAllocateDescriptorSets(layer_data *dev_data, const VkDescriptorSetAllocateInfo *pAllocateInfo,
                                                   cvdescriptorset::AllocateDescriptorSetsData *common_data) {
     // All state checks for AllocateDescriptorSets is done in single function


sort the included thrift modules by module path

Summary:
The included thrift modules are previously sorted by the abs file path (i.e. key of the std::map), and at different environements where the root directories are different included files, the order may be non-deterministic. Changing it to sort by the python module path instead so the order is not dependent on the environment/file system.

(Note: this ignores all push blocking failures!)

Reviewed By: junzh0u

Differential Revision: D35767794

fbshipit-source-id: 0132c9f6e1e5913e4cb0c242d1a4ea8e5c57b55e

--- thrift/compiler/generate/t_mstch_python_generator.cc
+++ thrift/compiler/generate/t_mstch_python_generator.cc
@@ -14,9 +14,12 @@
  * limitations under the License.
  */

+#include <algorithm>
 #include <iterator>
 #include <string>
+#include <unordered_map>
 #include <utility>
+#include <vector>

 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/replace.hpp>
@@ -351,12 +354,20 @@
   mstch::node is_types_file() { return has_option("is_types_file"); }

   mstch::node include_namespaces() {
+    std::vector<const Namespace*> namespaces;
+    for (const auto& it : include_namespaces_) {
+      namespaces.push_back(&it.second);
+    }
+    std::sort(
+        namespaces.begin(), namespaces.end(), [](const auto* m, const auto* n) {
+          return m->ns < n->ns;
+        });
     mstch::array a;
-    for (auto& it : include_namespaces_) {
+    for (const auto& it : namespaces) {
       a.push_back(mstch::map{
-          {"included_module_path", it.second.ns},
-          {"has_services?", it.second.has_services},
-          {"has_types?", it.second.has_types}});
+          {"included_module_path", it->ns},
+          {"has_services?", it->has_services},
+          {"has_types?", it->has_types}});
     }
     return a;
   }
@@ -505,7 +516,7 @@
     }
   }

-  std::map<std::string, Namespace> include_namespaces_;
+  std::unordered_map<std::string, Namespace> include_namespaces_;
   std::unordered_set<const t_type*> seen_types_;
 };


Linux 2.4 code finished but untested

Linux 2.4 code finished but untested

--- specialized/fileevent.cpp
+++ specialized/fileevent.cpp
@@ -136,7 +136,7 @@

 static constexpr native_flags_t to_native_flags(const uint8_t flags) noexcept
 {
-  return
+  return DN_MULTISHOT | // force reoccuring event
       (flags & FileEvent::ReadEvent    ? native_flags_t(DN_ACCESS) : 0) | // File was accessed (read) (*).
       (flags & FileEvent::WriteEvent   ? native_flags_t(DN_MODIFY) : 0) | // File was modified (*).
       (flags & FileEvent::AttributeMod ? native_flags_t(DN_ATTRIB) : 0) | // Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc. (*).
@@ -144,6 +144,10 @@
       (flags & FileEvent::Deleted      ? native_flags_t(DN_DELETE) : 0);  // Watched File was deleted.
 }

+template<typename T>
+static inline bool data_identical(T& a, T& b) noexcept
+{ return std::memcmp(&a, &b, sizeof(T)) == 0; }
+
 struct FileEvent::platform_dependant // file notification (inotify)
 {
   enum {
@@ -153,15 +157,17 @@

   struct eventinfo_t
   {
+    posix::fd_t dir_fd; // for lookup
+    const char* filename; // for lookup
     posix::fd_t fd[2]; // two fds for pipe based communication
     Flags_t flags;
     struct stat status;
   };

-  std::unordered_map<std::string, posix::fd_t> dir_lookup;
-  std::unordered_map<std::string, posix::fd_t> file_lookup;
-  std::unordered_map<posix::fd_t, std::set<std::string>> dirs;
-  std::unordered_map<posix::fd_t, eventinfo_t> files;
+  static std::unordered_map<std::string, posix::fd_t> dir_lookup;
+  static std::unordered_map<std::string, posix::fd_t> file_lookup;
+  static std::unordered_map<posix::fd_t, std::set<std::string>> dirs;
+  static std::unordered_map<posix::fd_t, eventinfo_t> files;

   platform_dependant(void) noexcept
   {
@@ -186,11 +192,47 @@

   static void handler(int, siginfo_t* info, void*) noexcept
   {
-    static const uint8_t dummydata = 0; // dummy content
-    flaw(posix::write(info->si_fd, &dummydata, 1) != 1,
-         terminal::critical,
-         std::exit(errno),, // triggers execution stepper FD
-         "Unable to trigger TimerEvent: %s", std::strerror(errno))
+    auto d_iter = dirs.find(info->si_fd);
+    if(d_iter != dirs.end())
+    {
+      for(const std::string& filename : d_iter->second)
+      {
+        auto fl_iter = file_lookup.find(filename);
+        if(fl_iter != file_lookup.end())
+        {
+          auto f_iter = files.find(fl_iter->second);
+          if(f_iter != files.end())
+          {
+            eventinfo_t& data = f_iter->second;
+            struct stat status;
+            if(posix::stat(filename.c_str(), &status))
+            {
+              if(!data_identical(status, data.status))
+              {
+                Flags_t flags;
+                flags.ReadEvent    = data_identical(data.status.st_atim, status.st_atim) ? 0 : 1;
+                flags.WriteEvent   = data_identical(data.status.st_mtim, status.st_mtim) ? 0 : 1;
+                flags.AttributeMod = data.status.st_mode == status.st_mode &&
+                                     data.status.st_uid  == status.st_uid &&
+                                     data.status.st_gid  == status.st_gid &&
+                                     data.status.st_rdev == status.st_rdev ? 0 : 1;
+                flags.Moved        = data.status.st_dev  == status.st_dev &&
+                                     data.status.st_ino  == status.st_ino  ? 0 : 1;
+
+                if(data.flags & flags)
+                {
+                  uint8_t rdata = flags;
+                  flaw(posix::write(data.fd[Write], &rdata, 1) != 1,
+                       terminal::critical,
+                       std::exit(errno),, // triggers execution stepper FD
+                       "Unable to trigger FileEvent: %s", std::strerror(errno))
+                }
+              }
+            }
+          }
+        }
+      }
+    }
   }

   posix::fd_t add(const char* path, Flags_t flags) noexcept
@@ -231,6 +273,8 @@
       data.flags = flags;
       file_fd = data.fd[Read];
       auto rval1 = file_lookup.emplace(path, file_fd);
+      if(!rval1.second)
+         data.filename = rval1.first->first.data();
       auto rval2 = files.emplace(file_fd, data);
       if(!rval1.second || !rval2.second)
       {
@@ -258,15 +302,34 @@

     if((dir_flags & flags) != flags) // if not all flags are set
       posix::fcntl(dir_fd, F_NOTIFY, to_native_flags(dir_flags | flags)); // apply new flags
-    dirs[dir_fd].insert(path); // add file to directory
-
-
+    dirs[dir_fd].insert(path); // add file to directory (if doesn't exist)
     return file_fd;
   }

   bool remove(posix::fd_t wd) noexcept
   {
-    return false;
+    auto f_iter = files.find(wd);
+    if(f_iter == files.end())
+      return false;
+
+    eventinfo_t& data = f_iter->second;
+    posix::close(data.fd[Read ]);
+    posix::close(data.fd[Write]);
+
+    auto d_iter = dirs.find(data.dir_fd);
+    if(d_iter != dirs.end())
+    {
+      d_iter->second.erase(data.filename);
+      if(d_iter->second.empty())
+      {
+        dir_lookup.erase(::dirname(const_cast<char*>(data.filename)));
+        file_lookup.erase(data.filename);
+        dirs.erase(d_iter);
+      }
+    }
+    files.erase(f_iter);
+
+    return true;
   }

   struct return_data
@@ -277,10 +340,24 @@

   return_data read(posix::fd_t wd) const noexcept
   {
-    return { nullptr, 0 }; // read the entire buffer and the event was never found!
+    Flags_t flags;
+    uint8_t buffer = 0;
+    auto f_iter = files.find(wd);
+    if(f_iter == files.end())
+      return { nullptr, 0 };
+
+    while(posix::read(wd, &buffer, 1) == 1) // read all flag data
+      flags = flags | buffer; // add new flags
+
+    return { f_iter->second.filename, flags };
   }

 } FileEvent::s_platform;
+
+std::unordered_map<std::string, posix::fd_t> FileEvent::platform_dependant::dir_lookup;
+std::unordered_map<std::string, posix::fd_t> FileEvent::platform_dependant::file_lookup;
+std::unordered_map<posix::fd_t, std::set<std::string>> FileEvent::platform_dependant::dirs;
+std::unordered_map<posix::fd_t, FileEvent::platform_dependant::eventinfo_t> FileEvent::platform_dependant::files;
 # endif

 FileEvent::FileEvent(const std::string& _file, Flags_t _flags) noexcept


Re-allowed clientmessage command. Will put it at a level 60 command for testing.

--- code/client.cc
+++ code/client.cc
@@ -1311,26 +1311,18 @@

 int TBeing::doClientMessage(const char *arg)
 {
-
-
   if (!desc)
      return FALSE;

-  sendTo("Clientmessage has been disabled, doing shout instead.\n\r");
-  doShout(arg);
-  return TRUE;
-
-  if (!desc->m_bIsClient && GetMaxLevel() <= MAX_MORT && strcmp("Dash", getName())) {
+  if (!desc->m_bIsClient) {
     sendTo("This command is only available for users of the SneezyMUD client (http://sneezy.stanford.edu/client).\n\r");
     return FALSE;
   }
   Descriptor *i;
   TBeing *b;

-  // I dont want immortals or anyone non client getting these
-  // message, PLEASE DONT EDIT
   for (i = descriptor_list; i; i = i->next) {
-    if ((b = i->character) && (b != this) && !i->connected && (i->m_bIsClient || !strcmp("Dash", getName())))
+    if ((b = i->character) && (b != this) && !i->connected && i->m_bIsClient)
       b->sendTo(COLOR_COMM, "
CLIENT<1> (%s): %s\n\r", getName(), arg);
   }
   sendTo(COLOR_COMM, "
CLIENT<1>: %s\n\r", arg);


add support for remote textures to bzwb - this commit adds libcurl as a new dependency

git-svn-id: 7c9ea37791cd259b24cbb3dc83a0e12673e3c8a9@20916 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/model/SceneBuilder.cpp
+++ src/model/SceneBuilder.cpp
@@ -10,6 +10,17 @@
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */

+#include <curl/curl.h>
+#include <curl/types.h>
+#include <curl/easy.h>
+
+#ifdef _WIN32
+	#include <direct.h>
+#else
+	#include <sys/stat.h>
+#endif
+#include <iostream>;
+
 #include "model/SceneBuilder.h"
 #include "windows/View.h"
 #include "model/Primitives.h"
@@ -112,27 +123,118 @@
 	return geode;
 }

+// used by curl function in SceneBuilder::buildTexture2D
+size_t write_curl_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {
+    size_t written;
+    written = fwrite(ptr, size, nmemb, stream);
+    return written;
+}
+
+
+
 /**
  * Build a Texture2D from a file; return NULL if not found
- */
+ */
+
+// FIXME - buildTexture2D function is called too much and waste memory
+// should store a list of textures an reference those
+// load each textures only once

 osg::Texture2D* SceneBuilder::buildTexture2D( const char* filename ) {
 	string searchPath("share/textures/");
-
-	if( filename != NULL ) {
+	string temp_name( filename );
+
+	//---- download and cache remote texture
+	// see if filename starts with "http://"
+	string protocol("http://");
+	if( temp_name.compare(0, protocol.length(), TextUtils::tolower(protocol), 0, protocol.length()) == 0 ){
+		// swap "http://" for "bzwb_cache/" in filename to fix the path
+		temp_name = "bzwb_cache/" + temp_name.substr(protocol.length(),temp_name.length()-protocol.length());
+		//strip off .png from end if it exists since it is added below
+		string last4 = TextUtils::tolower(temp_name.substr(temp_name.length()-4,4));
+		if( last4.compare(".png") == 0 ){
+			temp_name = temp_name.substr(0,temp_name.length()-4);
+		}
+		// check for texture in bzwb_cache
+		// FIXME: should compare modification dates of the file in cache and the one online, not just if it exists locally
+		FILE * cFile;
+		cFile = fopen ( ( searchPath + temp_name + ".png" ).c_str(), "r");
+		if( cFile!=NULL ) {
+			// file exists in http_cache, then close it cause we don't need it.
+			printf ( "Using Cached Texture: %s\n", ( searchPath + temp_name + ".png" ).c_str() );
+			fclose ( cFile );
+		}else{
+			// file does not exist in http_cache:
+			// get texture's parent directory path and create directories
+			string pDirPath = string("");
+			std::vector<std::string> tks = TextUtils::tokenize( string( searchPath + temp_name ), "/", 20, false);
+			for ( std::vector<std::string>::iterator i = tks.begin() ; i < tks.end()-1 ; i++ ){
+				if(i < tks.end()-2)
+					pDirPath += (*i) + "/";
+				else
+					pDirPath += (*i) ;
+				// create directories as we go
+				#ifdef _WIN32
+					_mkdir( pDirPath.c_str() );
+				#else
+					mkdir( pDirPath.c_str(), 0777 );
+				#endif
+			}
+			//printf(  "parent directory path: %s\n", pDirPath.c_str() );
+
+			// download the texture into http_cache
+			printf ( "Downloading Texture: %s\n", ( searchPath + temp_name + ".png" ).c_str() );
+			CURL *curl;
+			FILE *fp;
+			CURLcode res;
+			long len = 0;
+			curl = curl_easy_init();
+			if( curl ) {
+				fp = fopen( ( searchPath + temp_name + ".png" ).c_str(), "wb" );
+				if( fp != NULL ){
+					curl_easy_setopt( curl, CURLOPT_URL, filename );
+					curl_easy_setopt( curl, CURLOPT_WRITEFUNCTION, write_curl_data );
+					curl_easy_setopt( curl, CURLOPT_WRITEDATA, fp );
+					res = curl_easy_perform( curl );
+					curl_easy_cleanup( curl );
+					len = ftell(fp);
+					fclose( fp );
+					if(res != 0){
+						printf ( "Error Downloading: %s, %l\n", curl_easy_strerror(res), len );
+						//remove cached file
+						std::remove( ( searchPath + temp_name + ".png" ).c_str() );
+						//use error downloading texture
+						temp_name = "../UI/error_downloading";
+					}
+				}else{
+					printf( "Unable to open/create texture file: %s\n", ( searchPath + temp_name + ".png" ).c_str() );
+				}
+			}
+		}
+	}
+	//---- end download and cache remote texture
+
+	//strip .png extension - this is done again here for local textures entered with a .png extension
+	string last4 = temp_name.substr(temp_name.length()-4,4);
+	if( last4.compare(".png") == 0 ){
+		temp_name = temp_name.substr(0,temp_name.length()-4);
+	}
+
+	if( temp_name.c_str() != NULL ) {
 		osg::Texture2D* texture = NULL;

 		//see if texture file exists and use a default "missing texture" if it doesn't
 		FILE * cFile;
-		cFile = fopen ( (searchPath + filename + ".png").c_str() ,"r");
+		cFile = fopen ( (searchPath + temp_name + ".png").c_str() ,"r");
 		if (cFile!=NULL) {
 			// file exists in http_cache, then close it cause we don't need it.
 			fclose (cFile);
 		}else{
-			filename = "not_found";
-		}
-
-		osg::Image* image = osgDB::readImageFile( (searchPath + filename + ".png").c_str() );
+			printf("Can not find texture: %s\n", (searchPath + temp_name + ".png").c_str() );
+			temp_name = "../UI/not_found";
+		}
+
+		osg::Image* image = osgDB::readImageFile( (searchPath + temp_name + ".png").c_str() );

 		if( image != NULL ) {	// only build the texture if the image exists!


Null check web_contents in TaskManagerExtensionProcessResource::IsBackground().

BUG=154534
Review URL: https://codereview.chromium.org/11336021

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

--- chrome/browser/task_manager/task_manager_resource_providers.cc
+++ chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -1388,6 +1388,8 @@
 bool TaskManagerExtensionProcessResource::IsBackground() const {
   WebContents* web_contents =
       WebContents::FromRenderViewHost(render_view_host_);
+  if (!web_contents)
+    return false;
   chrome::ViewType view_type = chrome::GetViewType(web_contents);
   return view_type == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE;
 }


Handling strict conversion criteria for StringRef to std::string from TOT llvm.

--- tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
+++ tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
@@ -906,7 +906,7 @@
     if (ClangMod)
       ModuleName = ClangMod->getFullModuleName();
   } else if (VD->getModuleContext() != MainModule) {
-    ModuleName = VD->getModuleContext()->getName().str();
+    ModuleName = VD->getModuleContext()->getName().str().str();
   }
   StringRef ModuleInterfaceName;
   if (auto IFaceGenRef = Lang.getIFaceGenContexts().find(ModuleName, Invok))


Return an error when shape inference fails to converge

PiperOrigin-RevId: 178388660

--- tensorflow/core/grappler/costs/graph_properties.cc
+++ tensorflow/core/grappler/costs/graph_properties.cc
@@ -853,6 +853,10 @@
   } while (!new_shapes->empty() &&
            num_resource_iterations++ < max_resource_iterations);

+  if (!new_shapes->empty()) {
+    return errors::Internal("Shape inference failed to converge");
+  }
+
   return Status::OK();
 }


layers: simplify TransitionSubpassLayouts

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -8783,10 +8783,8 @@
     return skip_call;
 }

-static void TransitionSubpassLayouts(VkCommandBuffer cmdBuffer, const VkRenderPassBeginInfo *pRenderPassBegin,
+static void TransitionSubpassLayouts(layer_data *dev_data, GLOBAL_CB_NODE *pCB, const VkRenderPassBeginInfo *pRenderPassBegin,
                                      const int subpass_index) {
-    layer_data *dev_data = get_my_data_ptr(get_dispatch_key(cmdBuffer), layer_data_map);
-    GLOBAL_CB_NODE *pCB = getCBNode(dev_data, cmdBuffer);
     auto renderPass = getRenderPass(dev_data, pRenderPassBegin->renderPass);
     if (!renderPass)
         return;
@@ -8935,7 +8933,7 @@
         skipCall |= addCmd(dev_data, pCB, CMD_NEXTSUBPASS, "vkCmdNextSubpass()");
         pCB->activeSubpass++;
         pCB->activeSubpassContents = contents;
-        TransitionSubpassLayouts(commandBuffer, &pCB->activeRenderPassBeginInfo, pCB->activeSubpass);
+        TransitionSubpassLayouts(dev_data, pCB, &pCB->activeRenderPassBeginInfo, pCB->activeSubpass);
         skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdNextSubpass");
     }
     lock.unlock();


Added code for the new mobile strings.

Added code for the new mobile strings.

--- code/combat.cc
+++ code/combat.cc
@@ -3,7 +3,7 @@
 // SneezyMUD - All rights reserved, SneezyMUD Coding Team
 //
 // $Log: combat.cc,v $
-// Revision 1.2  1999/09/29 07:44:23  lapsos
+// Revision 1.3  1999/09/30 01:07:10  lapsos
 // Added code for the new mobile strings.
 //
 // Revision 1.1  1999/09/12 17:24:04  sneezy
@@ -183,6 +183,9 @@

   for (door = MIN_DIR; door < MAX_DIR; door++) {
 #if 1
+    if (!roomp->dir_option[door])
+      continue;
+
     new_room = roomp->dir_option[door]->to_room;
     newR     = real_roomp(new_room);
     TMonster *tMons;


Enable FastShutdown interactive ui test on Windows.

It was suggested that it might work better as an interactive test (previously it was a UI test). I recently moved it to interactive tests, so now I am speculatively enabling it.

BUG=46616
TEST=doesn't time out (try bots/waterfall)

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

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

--- chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc
+++ chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc
@@ -20,11 +20,6 @@

 #if defined(OS_MACOSX)
 // SimulateOSClick is broken on the Mac: http://crbug.com/45162
-#define MAYBE_SlowTermination DISABLED_SlowTermination
-#elif defined(OS_LINUX)
-#define MAYBE_SlowTermination SlowTermination
-#elif defined(OS_WIN)
-// Times out: http://crbug.com/46616
 #define MAYBE_SlowTermination DISABLED_SlowTermination
 #else
 #define MAYBE_SlowTermination SlowTermination


Corrected off-by-one error.

Corrected off-by-one error.

--- lib/Parse/ParseDecl.cpp
+++ lib/Parse/ParseDecl.cpp
@@ -5685,7 +5685,7 @@
         }
       } else if (auto *E = Element.dyn_cast<Expr *>()) {
         if (auto SE = dyn_cast<SequenceExpr>(E->getSemanticsProvidingExpr())) {
-          if (SE->getNumElements() > 0 && isa<AssignExpr>(SE->getElement(1))) {
+          if (SE->getNumElements() > 1 && isa<AssignExpr>(SE->getElement(1))) {
             // This is an assignment.  We don't want to implicitly return
             // it.
             return;


Fix for another command line bug.

Fix for another command line bug.

--- tuning/SNR.cpp
+++ tuning/SNR.cpp
@@ -54,7 +54,7 @@
     dSNR = args.getSwitch("-dedispersed");
     bool fSNR = args.getSwitch("-folded");
     if ( (dSNR && fSNR) || (!dSNR && ! fSNR) ) {
-      throw std::exception();
+      throw isa::utils::EmptyCommandLine();
     }
 		nrIterations = args.getSwitchArgument< unsigned int >("-iterations");
 		clPlatformID = args.getSwitchArgument< unsigned int >("-opencl_platform");


show middle bar using damage

show middle bar using damage

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@3383 662fdd30-d327-0410-a531-f549c87e1e9e

--- src/mugen/characterhud.cpp
+++ src/mugen/characterhud.cpp
@@ -339,7 +339,7 @@
     // This is a container just render it normally
     back1.render(layer, position.x, position.y, bmp);

-    middle.render(layer, position.x, position.y, bmp);
+    middle.render(layer, position.x, position.y, bmp, (int)(damage * fabs(range.y) / maxHealth));

     double width = currentHealth * fabs(range.y) / maxHealth;
     front.render(layer, position.x, position.y, bmp, width);


fix for when second derivatives are absent

git-svn-id: e88a1e38e13faf406e05cc89eca8dd613216f6c4@1126 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- trunk/libmesh/src/numerics/fourth_error_estimators.C
+++ trunk/libmesh/src/numerics/fourth_error_estimators.C
@@ -1,4 +1,4 @@
-// $Id: fourth_error_estimators.C,v 1.1 2005-05-27 14:45:39 roystgnr Exp $
+// $Id: fourth_error_estimators.C,v 1.2 2005-05-27 17:21:25 benkirk Exp $

 // The libMesh Finite Element Library.
 // Copyright (C) 2002-2004  Benjamin S. Kirk, John W. Peterson
@@ -37,8 +37,20 @@

 //-----------------------------------------------------------------
 // ErrorEstimator implementations
+#ifndef ENABLE_SECOND_DERIVATIVES
+
+void LaplacianErrorEstimator::estimate_error (const System&,
+					      std::vector<float>&)
+{
+  std::cerr << "ERROR:  This functionalitry requires second-derivative support!"
+	    << std::endl;
+  error();
+}
+
+#else // defined (ENABLE_SECOND_DERIVATIVES)
+
 void LaplacianErrorEstimator::estimate_error (const System& system,
-					   std::vector<float>& error_per_cell)
+					      std::vector<float>& error_per_cell)
 {
   START_LOG("laplacian_jump()", "LaplacianErrorEstimator");

@@ -292,3 +304,5 @@

   STOP_LOG("laplacian_jump()", "LaplacianErrorEstimator");
 }
+
+#endif // defined (ENABLE_SECOND_DERIVATIVES)


Adjusting Solidity Optimizer Tests

Adjusting Solidity Optimizer Tests

--- SolidityCompiler.cpp
+++ SolidityCompiler.cpp
@@ -96,7 +96,7 @@
 							 "}\n";
 	bytes code = compileContract(sourceCode);

-	unsigned boilerplateSize = 72;
+	unsigned boilerplateSize = 73;
 	bytes expectation({byte(Instruction::JUMPDEST),
 					   byte(Instruction::PUSH1), 0x0, // initialize local variable x
 					   byte(Instruction::PUSH1), 0x2,
@@ -115,8 +115,8 @@
 							 "  function g() returns (uint e, uint h) { h = f(1, 2, 3); }\n"
 							 "}\n";
 	bytes code = compileContract(sourceCode);
-	unsigned shift = 102;
-	unsigned boilerplateSize = 115;
+	unsigned shift = 103;
+	unsigned boilerplateSize = 116;
 	bytes expectation({byte(Instruction::JUMPDEST),
 					   byte(Instruction::PUSH1), 0x0, // initialize return variable d
 					   byte(Instruction::DUP3),
@@ -165,8 +165,8 @@
 							 "  function f() { bool x; if (x) 77; else if (!x) 78; else 79; }"
 							 "}\n";
 	bytes code = compileContract(sourceCode);
-	unsigned shift = 59;
-	unsigned boilerplateSize = 72;
+	unsigned shift = 60;
+	unsigned boilerplateSize = 73;
 	bytes expectation({byte(Instruction::JUMPDEST),
 					   byte(Instruction::PUSH1), 0x0,
 					   byte(Instruction::DUP1),
@@ -206,8 +206,8 @@
 							 "  function f() { while(true){1;break;2;continue;3;return;4;} }"
 							 "}\n";
 	bytes code = compileContract(sourceCode);
-	unsigned shift = 59;
-	unsigned boilerplateSize = 72;
+	unsigned shift = 60;
+	unsigned boilerplateSize = 73;
 	bytes expectation({byte(Instruction::JUMPDEST),
 					   byte(Instruction::JUMPDEST),
 					   byte(Instruction::PUSH1), 0x1,


In the CookieMonster code, use the RegistryControlledDomainService only for
http and https URLs. For other schemes (like chrome-extension), use the host
itself as the effective TLD.

BUG=31867

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

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

--- net/base/cookie_monster.cc
+++ net/base/cookie_monster.cc
@@ -260,6 +260,19 @@
   return Time();
 }

+// Returns the effective TLD+1 for a given host. This only makes sense for http
+// and https schemes. For other schemes, the host will be returned unchanged
+// (minus any leading .).
+static std::string GetEffectiveDomain(const std::string& scheme,
+                                      const std::string& host) {
+  if (scheme == "http" || scheme == "https")
+    return RegistryControlledDomainService::GetDomainAndRegistry(host);
+
+  if (!host.empty() && host[0] == '.')
+    return host.substr(1);
+  return host;
+}
+
 // Determine the cookie domain key to use for setting the specified cookie.
 // On success returns true, and sets cookie_domain_key to either a
 //   -host cookie key (ex: "google.com")
@@ -294,12 +307,13 @@
     cookie_domain = "." + cookie_domain;

   // Ensure |url| and |cookie_domain| have the same domain+registry.
+  const std::string url_scheme(url.scheme());
   const std::string url_domain_and_registry(
-      RegistryControlledDomainService::GetDomainAndRegistry(url));
+      GetEffectiveDomain(url_scheme, url_host));
   if (url_domain_and_registry.empty())
     return false;  // IP addresses/intranet hosts can't set domain cookies.
   const std::string cookie_domain_and_registry(
-      RegistryControlledDomainService::GetDomainAndRegistry(cookie_domain));
+      GetEffectiveDomain(url_scheme, cookie_domain));
   if (url_domain_and_registry != cookie_domain_and_registry)
     return false;  // Can't set a cookie on a different domain + registry.

@@ -311,7 +325,6 @@
       url_host.compare(url_host.length() - cookie_domain.length(),
                        cookie_domain.length(), cookie_domain))
     return false;
-

   *cookie_domain_key = cookie_domain;
   return true;
@@ -853,8 +866,7 @@
   FindCookiesForKey(key, url, options, current_time, cookies);

   // See if we can search for domain cookies, i.e. if the host has a TLD + 1.
-  const std::string domain(
-      RegistryControlledDomainService::GetDomainAndRegistry(key));
+  const std::string domain(GetEffectiveDomain(url.scheme(), key));
   if (domain.empty())
     return;
   DCHECK_LE(domain.length(), key.length());


DomainEditor: fix account creation, require quota if domainquota set

--- src/domaineditor.cpp
+++ src/domaineditor.cpp
@@ -339,12 +339,21 @@
                 bool enoughQuotaLeft = true;
                 if (dom.getDomainQuota() > 0) {

-                    if (freeQuota < p.value(QStringLiteral("quota")).toULong()) {
+                    const quint32 accQuota = p.value(QStringLiteral("quota")).toULong();
+                    if (freeQuota < accQuota) {

                         enoughQuotaLeft = false;

                         c->setStash(QStringLiteral("error_msg"),
                                     c->translate("DomainEditor", "There is not enough free quota on this domain. Please lower the quota for the new account to a maximum of %1 KiB.").arg(freeQuota));
+                    }
+
+                    if ((dom.getDomainQuota() > 0) && (accQuota <= 0)) {
+
+                        enoughQuotaLeft = false;
+
+                        c->setStash(QStringLiteral("error_msg"),
+                                    c->translate("DomainEditor", "As this domain has an overall domain quota limit of %1, you have to specify a quota limit for every account that is part of this domain.").arg(dom.getHumanDomainQuota()));
                     }

                 }
@@ -454,7 +463,7 @@
         help.insert(QStringLiteral("accounts"), HelpEntry(c->translate("DomainEditor", "Accounts"), c->translate("DomainEditor", "Number of accounts that are currently part of this domain. If there is a maximum account limit defined, it will be shown, too.")));
         if (dom.getDomainQuota() > 0) {
             help.insert(QStringLiteral("domainQuota"), HelpEntry(c->translate("DomainEditor", "Domain quota"), c->translate("DomainEditor", "Used and total amount of storage quota for this domain.")));
-            help.insert(QStringLiteral("quota"), HelpEntry(c->translate("DomainEditor", "Quota"), c->translate("DomainEditor", "You have to set a storage quota for this account that does not exceed %1.").arg(Utils::humanBinarySize(c, freeQuota))));
+            help.insert(QStringLiteral("quota"), HelpEntry(c->translate("DomainEditor", "Quota"), c->translate("DomainEditor", "You have to set a storage quota for this account that does not exceed %1.").arg(Utils::humanBinarySize(c, static_cast<quint64>(freeQuota) * Q_UINT64_C(1024)))));
         } else {
             help.insert(QStringLiteral("domainQuota"), HelpEntry(c->translate("DomainEditor", "Domain quota"), c->translate("DomainEditor", "This domain has no overall quota limit, so the value shows the sum of the quota limit of all accounts in this domain.")));
             help.insert(QStringLiteral("quota"), HelpEntry(c->translate("DomainEditor", "Quota"), c->translate("DomainEditor", "You can freely set a storage quota for this account or set the quota to 0 to disable it.")));
@@ -473,11 +482,6 @@
             }
         }
         help.insert(QStringLiteral("localpart"), HelpEntry(c->translate("DomainEditor", "Email address"), c->translate("DomainEditor", "Enter the local part of the main email address for this account. You can add more alias addresses to this account later on.")));
-        if (dom.getDomainQuota() > 0) {
-            help.insert(QStringLiteral("quota"), HelpEntry(c->translate("DomainEditor", "Quota"), c->translate("DomainEditor", "You have to set a quota limit for this account that is greater than zero and smaller or equal to %1.").arg(Utils::humanBinarySize(c, freeQuota))));
-        } else {
-            help.insert(QStringLiteral("quota"), HelpEntry(c->translate("DomainEditor", "Quota"), c->translate("DomainEditor", "You can set a quota limit for this account or disable it by setting a quota of 0.")));
-        }
         help.insert(QStringLiteral("password"), HelpEntry(c->translate("DomainEditor", "Password"), c->translate("DomainEditor", "Specify a password with a minimum length of %n character(s).", "", SkaffariConfig::accPwMinlength())));
         help.insert(QStringLiteral("password_confirmation"), HelpEntry(c->translate("DomainEditor", "Password confirmation"), c->translate("DomainEditor", "Confirm your entered password.")));
         help.insert(QStringLiteral("validUntil"), HelpEntry(c->translate("DomainEditor", "Valid until"), c->translate("DomainEditor", "You can set a date and time until this account is valid. To make it valid open-end, simply set a date far in the future.")));


layers: Get rid of remaining use of single physical_device_state in
instance

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -146,7 +146,6 @@
     // Device specific data
     PHYS_DEV_PROPERTIES_NODE phys_dev_properties = {};
     VkPhysicalDeviceMemoryProperties phys_dev_mem_props = {};
-    unique_ptr<PHYSICAL_DEVICE_STATE> physical_device_state = nullptr;

     unordered_map<VkPhysicalDevice, PHYSICAL_DEVICE_STATE> physical_device_map;
 };
@@ -4365,36 +4364,37 @@
 }

 // Verify that queue family has been properly requested
-bool ValidateRequestedQueueFamilyProperties(layer_data *dev_data, const VkDeviceCreateInfo *create_info) {
-    bool skip_call = false;
+bool ValidateRequestedQueueFamilyProperties(layer_data *instance_data, VkPhysicalDevice gpu, const VkDeviceCreateInfo *create_info) {
+    bool skip_call = false;
+    auto physical_device_state = getPhysicalDeviceState(instance_data, gpu);
     // First check is app has actually requested queueFamilyProperties
-    if (!dev_data->physical_device_state) {
-        skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
+    if (!physical_device_state) {
+        skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
                              0, __LINE__, DEVLIMITS_MUST_QUERY_COUNT, "DL",
                              "Invalid call to vkCreateDevice() w/o first calling vkEnumeratePhysicalDevices().");
-    } else if (QUERY_DETAILS != dev_data->physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
+    } else if (QUERY_DETAILS != physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
         // TODO: This is not called out as an invalid use in the spec so make more informative recommendation.
-        skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
+        skip_call |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
                              VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST,
                              "DL", "Call to vkCreateDevice() w/o first calling vkGetPhysicalDeviceQueueFamilyProperties().");
     } else {
         // Check that the requested queue properties are valid
         for (uint32_t i = 0; i < create_info->queueCreateInfoCount; i++) {
             uint32_t requestedIndex = create_info->pQueueCreateInfos[i].queueFamilyIndex;
-            if (dev_data->queue_family_properties.size() <=
+            if (instance_data->queue_family_properties.size() <=
                 requestedIndex) { // requested index is out of bounds for this physical device
                 skip_call |= log_msg(
-                    dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
+                    instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0,
                     __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
                     "Invalid queue create request in vkCreateDevice(). Invalid queueFamilyIndex %u requested.", requestedIndex);
             } else if (create_info->pQueueCreateInfos[i].queueCount >
-                       dev_data->queue_family_properties[requestedIndex]->queueCount) {
+                       instance_data->queue_family_properties[requestedIndex]->queueCount) {
                 skip_call |=
-                    log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
+                    log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
                             0, __LINE__, DEVLIMITS_INVALID_QUEUE_CREATE_REQUEST, "DL",
                             "Invalid queue create request in vkCreateDevice(). QueueFamilyIndex %u only has %u queues, but "
                             "requested queueCount is %u.",
-                            requestedIndex, dev_data->queue_family_properties[requestedIndex]->queueCount,
+                            requestedIndex, instance_data->queue_family_properties[requestedIndex]->queueCount,
                             create_info->pQueueCreateInfos[i].queueCount);
             }
         }
@@ -4445,7 +4445,7 @@
     if (pCreateInfo->pEnabledFeatures) {
         skip_call |= ValidateRequestedFeatures(my_instance_data, gpu, pCreateInfo->pEnabledFeatures);
     }
-    skip_call |= ValidateRequestedQueueFamilyProperties(my_instance_data, pCreateInfo);
+    skip_call |= ValidateRequestedQueueFamilyProperties(my_instance_data, gpu, pCreateInfo);

     if (skip_call) {
         return VK_ERROR_VALIDATION_FAILED_EXT;
@@ -11422,14 +11422,15 @@
     VkQueueFamilyProperties *pQueueFamilyProperties) {
     bool skip_call = false;
     layer_data *phy_dev_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map);
-    if (phy_dev_data->physical_device_state) {
-        if (NULL == pQueueFamilyProperties) {
-            phy_dev_data->physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState = QUERY_COUNT;
+    auto physical_device_state = getPhysicalDeviceState(phy_dev_data, physicalDevice);
+    if (physical_device_state) {
+        if (!pQueueFamilyProperties) {
+            physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState = QUERY_COUNT;
         }
         else {
             // Verify that for each physical device, this function is called first with NULL pQueueFamilyProperties ptr in order to
             // get count
-            if (UNCALLED == phy_dev_data->physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
+            if (UNCALLED == physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState) {
                 skip_call |= log_msg(phy_dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT,
                     VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_MISSING_QUERY_COUNT, "DL",
                     "Call sequence has vkGetPhysicalDeviceQueueFamilyProperties() w/ non-NULL "
@@ -11437,7 +11438,7 @@
                     "NULL pQueueFamilyProperties to query pCount.");
             }
             // Then verify that pCount that is passed in on second call matches what was returned
-            if (phy_dev_data->physical_device_state->queueFamilyPropertiesCount != *pCount) {
+            if (physical_device_state->queueFamilyPropertiesCount != *pCount) {

                 // TODO: this is not a requirement of the Valid Usage section for vkGetPhysicalDeviceQueueFamilyProperties, so
                 // provide as warning
@@ -11445,17 +11446,17 @@
                     VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, 0, __LINE__, DEVLIMITS_COUNT_MISMATCH, "DL",
                     "Call to vkGetPhysicalDeviceQueueFamilyProperties() w/ pCount value %u, but actual count "
                     "supported by this physicalDevice is %u.",
-                    *pCount, phy_dev_data->physical_device_state->queueFamilyPropertiesCount);
-            }
-            phy_dev_data->physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState = QUERY_DETAILS;
+                    *pCount, physical_device_state->queueFamilyPropertiesCount);
+            }
+            physical_device_state->vkGetPhysicalDeviceQueueFamilyPropertiesState = QUERY_DETAILS;
         }
         if (skip_call) {
             return;
         }
         phy_dev_data->instance_dispatch_table->GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount,
             pQueueFamilyProperties);
-        if (NULL == pQueueFamilyProperties) {
-            phy_dev_data->physical_device_state->queueFamilyPropertiesCount = *pCount;
+        if (!pQueueFamilyProperties) {
+            physical_device_state->queueFamilyPropertiesCount = *pCount;
         }
         else { // Save queue family properties
             phy_dev_data->queue_family_properties.reserve(*pCount);


desired load rate achieved - got rid of noisy thing

--- code/socket.cc
+++ code/socket.cc
@@ -1191,7 +1191,7 @@
   scheduler.add(new procBankInterest(PULSE_MUDDAY));

   // pulse realhour
-  scheduler.add(new procTweakLoadRate(PULSE_REALHOUR));
+//  scheduler.add(new procTweakLoadRate(PULSE_REALHOUR)); // desired load rate achieved
   scheduler.add(new procTrophyDecay(PULSE_REALHOUR));

   avail_descs = 150;


Probe test using task queue based congestion controller.

Bug: webrtc:8415
Change-Id: I230a055348f7342cca3eb8cf59a5735bf2e3b940
Reviewed-on: https://webrtc-review.googlesource.com/67343
Commit-Queue: Sebastian Jansson <c24d1bc144eb7c11e553f59153fa17dba85ca83e@webrtc.org>
Reviewed-by: Stefan Holmer <eb0877843acc39f8ef6f7269937dee931c372d23@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#22780}

--- video/end_to_end_tests/probing_tests.cc
+++ video/end_to_end_tests/probing_tests.cc
@@ -26,11 +26,12 @@
  private:
   test::ScopedFieldTrials field_trial_;
 };
-
-INSTANTIATE_TEST_CASE_P(RoundRobin,
-                        ProbingEndToEndTest,
-                        ::testing::Values("WebRTC-RoundRobinPacing/Disabled/",
-                                          "WebRTC-RoundRobinPacing/Enabled/"));
+INSTANTIATE_TEST_CASE_P(
+    FieldTrials,
+    ProbingEndToEndTest,
+    ::testing::Values("WebRTC-RoundRobinPacing/Disabled/",
+                      "WebRTC-RoundRobinPacing/Enabled/",
+                      "WebRTC-TaskQueueCongestionControl/Enabled/"));

 class ProbingTest : public test::EndToEndTest {
  public:


Use the upper-case 'CLEAR FORM' string for keyboard accessory.

BUG=428087

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

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#342918}


Fix my recently introduced 80-col violation

--- lib/Parse/ParseExpr.cpp
+++ lib/Parse/ParseExpr.cpp
@@ -1450,13 +1450,14 @@
     }
     First = false;
   }
-
+
   if (Exprs.empty()) {
     Status.setIsParseError();
     return makeParserResult(Status, new (Context) ErrorExpr(Loc));
   }

-  return makeParserResult(Status, new (Context) InterpolatedStringLiteralExpr(Loc, Context.AllocateCopy(Exprs)));
+  return makeParserResult(Status, new (Context) InterpolatedStringLiteralExpr(
+                                      Loc, Context.AllocateCopy(Exprs)));
 }

 void Parser::diagnoseEscapedArgumentLabel(const Token &tok) {


[Doc] Complete doc around GeometryData

[Doc] Complete doc around GeometryData

--- src/multibody/geometry.hpp
+++ src/multibody/geometry.hpp
@@ -167,10 +167,47 @@

     void removeCollisionPair (const Index co1, const Index co2);
     void removeCollisionPair (const CollisionPair_t& pair);
+
+    ///
+    /// \brief Check if a CollisionPair given by the index of the two colliding geometries exists in collision_pairs.
+    ///        See also findCollisitionPair(const Index co1, const Index co2).
+    ///
+    /// \param[in] co1 Index of the first colliding geometry.
+    /// \param[in] co2 Index of the second colliding geometry.
+    ///
+    /// \return True if the CollisionPair exists, false otherwise.
+    ///
     bool existCollisionPair (const Index co1, const Index co2) const ;
+
+    ///
+    /// \brief Check if a CollisionPair given by the index of the two colliding geometries exists in collision_pairs.
+    ///        See also findCollisitionPair(const CollisionPair_t & pair).
+    ///
+    /// \param[in] pair The CollisionPair.
+    ///
+    /// \return True if the CollisionPair exists, false otherwise.
+    ///
     bool existCollisionPair (const CollisionPair_t & pair) const;
+
+    ///
+    /// \brief Return the index in collision_pairs of a CollisionPair given by the index of the two colliding geometries.
+    ///
+    /// \param[in] co1 Index of the first colliding geometry.
+    /// \param[in] co2 Index of the second colliding geometry.
+    ///
+    /// \return The index of the collision pair in collision_pairs.
+    ///
     Index findCollisionPair (const Index co1, const Index co2) const;
+
+    ///
+    /// \brief Return the index of a given CollisionPair in collision_pairs.
+    ///
+    /// \param[in] pair The CollisionPair.
+    ///
+    /// \return The index of the CollisionPair in collision_pairs.
+    ///
     Index findCollisionPair (const CollisionPair_t & pair) const;
+
     void fillAllPairsAsCollisions();
     void desactivateCollisionPairs();
     void initializeListOfCollisionPairs();


INTEGRATION: CWS changefileheader (1.3.32); FILE MERGED 2008/03/28 15:50:00 rt 1.3.32.1: #i87441# Change license header to LPGL v3.

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


[svg] Fix null text context crash

[svg] Fix null text context crash

The input may contain invalid text constructs lacking a root <text> node
e.g.  <svg><tspan>foo</tspan></svg>

Since we don't perform content model validation at the moment and text
contexts are only instantiated for root nodes, we must guard against
this case at render time.

Bug: oss-fuzz:29558
Change-Id: I7e39c1c4048900ce5becb3549802dc66bb1d242b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353711
Commit-Queue: Florin Malita <a8262bf13ea8c26821e91ea9bca6740a77c96dcd@chromium.org>
Commit-Queue: Florin Malita <a8262bf13ea8c26821e91ea9bca6740a77c96dcd@google.com>
Reviewed-by: Tyler Denniston <293ae2d31b7e9da32c4fb58bdaaed1f4bef4c6e7@google.com>

--- modules/svg/src/SkSVGText.cpp
+++ modules/svg/src/SkSVGText.cpp
@@ -506,6 +506,11 @@

 void SkSVGTextContainer::onRenderText(const SkSVGRenderContext& ctx, SkSVGTextContext* tctx,
                                       SkSVGXmlSpace) const {
+    if (!tctx) {
+        // No text context => missing top-level <text> node.
+        return;
+    }
+
     const SkSVGTextContext::ScopedPosResolver resolver(*this, ctx.lengthContext(), tctx);

     for (const auto& frag : fChildren) {


Silencing an MSVC warning about linkage specifications and C-incompatible UDTs by moving a function definition out of an extern "C" block.

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

--- tools/libclang/CIndex.cpp
+++ tools/libclang/CIndex.cpp
@@ -3538,6 +3538,26 @@
   return E->getLocStart();
 }

+static std::string getMangledStructor(std::unique_ptr<MangleContext> &M,
+                                      std::unique_ptr<llvm::DataLayout> &DL,
+                                      const NamedDecl *ND,
+                                      unsigned StructorType) {
+  std::string FrontendBuf;
+  llvm::raw_string_ostream FOS(FrontendBuf);
+
+  if (const auto *CD = dyn_cast_or_null<CXXConstructorDecl>(ND))
+    M->mangleCXXCtor(CD, static_cast<CXXCtorType>(StructorType), FOS);
+  else if (const auto *DD = dyn_cast_or_null<CXXDestructorDecl>(ND))
+    M->mangleCXXDtor(DD, static_cast<CXXDtorType>(StructorType), FOS);
+
+  std::string BackendBuf;
+  llvm::raw_string_ostream BOS(BackendBuf);
+
+  llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
+
+  return BOS.str();
+}
+
 extern "C" {

 unsigned clang_visitChildren(CXCursor parent,
@@ -3909,26 +3929,6 @@
                                    *DL);

   return cxstring::createDup(FinalBufOS.str());
-}
-
-static std::string getMangledStructor(std::unique_ptr<MangleContext> &M,
-                                      std::unique_ptr<llvm::DataLayout> &DL,
-                                      const NamedDecl *ND,
-                                      unsigned StructorType) {
-  std::string FrontendBuf;
-  llvm::raw_string_ostream FOS(FrontendBuf);
-
-  if (const auto *CD = dyn_cast_or_null<CXXConstructorDecl>(ND))
-    M->mangleCXXCtor(CD, static_cast<CXXCtorType>(StructorType), FOS);
-  else if (const auto *DD = dyn_cast_or_null<CXXDestructorDecl>(ND))
-    M->mangleCXXDtor(DD, static_cast<CXXDtorType>(StructorType), FOS);
-
-  std::string BackendBuf;
-  llvm::raw_string_ostream BOS(BackendBuf);
-
-  llvm::Mangler::getNameWithPrefix(BOS, llvm::Twine(FOS.str()), *DL);
-
-  return BOS.str();
 }

 CXStringSet *clang_Cursor_getCXXManglings(CXCursor C) {


layers: Just return the whole binding struct from has_descriptor_binding

We're about to want the descriptorCount too. This was getting absurd.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -2144,29 +2144,22 @@

 // For given pipelineLayout verify that the setLayout at slot.first
 //  has the requested binding at slot.second
-static bool has_descriptor_binding(layer_data *my_data, vector<VkDescriptorSetLayout> *pipelineLayout, descriptor_slot_t slot,
-                                   VkDescriptorType &type, VkShaderStageFlags &stage_flags) {
-    type = VkDescriptorType(0);
-    stage_flags = VkShaderStageFlags(0);
+static VkDescriptorSetLayoutBinding const * get_descriptor_binding(layer_data *my_data, vector<VkDescriptorSetLayout> *pipelineLayout, descriptor_slot_t slot) {

     if (!pipelineLayout)
-        return false;
+        return nullptr;

     if (slot.first >= pipelineLayout->size())
-        return false;
+        return nullptr;

     auto const layout_node = my_data->descriptorSetLayoutMap[(*pipelineLayout)[slot.first]];

     auto bindingIt = layout_node->bindingToIndexMap.find(slot.second);
     if ((bindingIt == layout_node->bindingToIndexMap.end()) || (layout_node->createInfo.pBindings == NULL))
-        return false;
+        return nullptr;

     assert(bindingIt->second < layout_node->createInfo.bindingCount);
-    VkDescriptorSetLayoutBinding binding = layout_node->createInfo.pBindings[bindingIt->second];
-    type = binding.descriptorType;
-    stage_flags = binding.stageFlags;
-
-    return true;
+    return &layout_node->createInfo.pBindings[bindingIt->second];
 }

 // Block of code at start here for managing/tracking Pipeline state that this layer cares about
@@ -2725,11 +2718,9 @@
                     pPipeline->active_sets.insert(it->first.first);

                     /* find the matching binding */
-                    VkDescriptorType descriptor_type;
-                    VkShaderStageFlags descriptor_stage_flags;
-                    auto found = has_descriptor_binding(my_data, layouts, it->first, descriptor_type, descriptor_stage_flags);
-
-                    if (!found) {
+                    auto binding = get_descriptor_binding(my_data, layouts, it->first);
+
+                    if (!binding) {
                         char type_name[1024];
                         describe_type(type_name, module, it->second.type_id);
                         if (log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
@@ -2738,7 +2729,7 @@
                                     it->first.first, it->first.second, type_name)) {
                             pass = VK_FALSE;
                         }
-                    } else if (~descriptor_stage_flags & pStage->stage) {
+                    } else if (~binding->stageFlags & pStage->stage) {
                         char type_name[1024];
                         describe_type(type_name, module, it->second.type_id);
                         if (log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
@@ -2749,7 +2740,7 @@
                                     it->first.first, it->first.second, type_name, string_VkShaderStageFlagBits(pStage->stage))) {
                             pass = VK_FALSE;
                         }
-                    } else if (!descriptor_type_match(my_data, module, it->second.type_id, descriptor_type)) {
+                    } else if (!descriptor_type_match(my_data, module, it->second.type_id, binding->descriptorType)) {
                         char type_name[1024];
                         describe_type(type_name, module, it->second.type_id);
                         if (log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
@@ -2757,7 +2748,7 @@
                                     "Type mismatch on descriptor slot "
                                     "%u.%u (used as type `%s`) but "
                                     "descriptor of type %s",
-                                    it->first.first, it->first.second, type_name, string_VkDescriptorType(descriptor_type))) {
+                                    it->first.first, it->first.second, type_name, string_VkDescriptorType(binding->descriptorType))) {
                             pass = VK_FALSE;
                         }
                     }


Address reviewers' comments

Address reviewers' comments

--- tensorflow/core/kernels/mkl/mkl_matmul_op_fused.cc
+++ tensorflow/core/kernels/mkl/mkl_matmul_op_fused.cc
@@ -317,7 +317,9 @@
   std::vector<string> fused_ops_;
   const int kInputIndex_Add = 3;
   const int kOutputIndex_Dst = 0;
+#ifdef DNNL_AARCH64_USE_ACL
   const int kWeightTensorHashLength = 1024;
+#endif
 };  // namespace tensorflow

 // Register mkl kernels for supported operations and types.


Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

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

--- lib/Parse/ParseInit.cpp
+++ lib/Parse/ParseInit.cpp
@@ -501,7 +501,8 @@
     Diag(Result.KeywordLoc, diag::warn_microsoft_dependent_exists)
       << Result.IsIfExists;
     // Fall through to skip.
-
+    LLVM_FALLTHROUGH;
+
   case IEB_Skip:
     Braces.skipToEnd();
     return false;


PMT Update

PMT Update

--- TS_Analyser/main.cpp
+++ TS_Analyser/main.cpp
@@ -5,9 +5,9 @@
 #include <vector>

 struct program_association_table_entry {
-  unsigned int Program_Num;
+  unsigned int Program_Number;
   unsigned char Reserved;
-  unsigned int Program_PID;
+  unsigned int Program_Map_PID;
 };

 struct program_association_table {
@@ -27,13 +27,104 @@
   unsigned int CRC_32;
 };

+struct program_mapping_table {
+  unsigned char Pointer_Field;
+  unsigned char Table_ID;
+  bool Section_Syntax_Indicator;
+  bool Zero;
+  unsigned char Reserved_1;
+  unsigned int Section_Length;
+  unsigned int Program_Number;
+  unsigned char Reserved_2;
+  unsigned char Version_Number;
+  bool Current_Next_Indicator;
+  unsigned char Section_Number;
+  unsigned char Last_Section_Number;
+  unsigned char Reserved_3;
+  unsigned int PCR_PID;
+  unsigned char Reserved_4;
+  unsigned int Program_Info_Length;
+  //vector Descriptors
+  //vector programPIDs
+  unsigned int CRC_32;
+};
+
 void print_pat( program_association_table PAT, bool Pointer_Field = false, std::string offset="\t" ) {
-  printf( "\tProgram Association Table\n" );
+  printf( "%sProgram Association Table\n", offset.c_str() );
   if( Pointer_Field ) {
     printf( "%s\tPointer Field:\t\t\t%X\n", offset.c_str(), PAT.Pointer_Field );
   }
   printf( "%s\tTable ID:\t\t\t%X\n", offset.c_str(), PAT.Table_ID );
   printf( "%s\tSection Syntax Indicator:\t%d\n", offset.c_str(), PAT.Section_Syntax_Indicator );
+  printf( "%s\t0:\t\t\t\t%d\n", offset.c_str(), PAT.Zero );
+  printf( "%s\tReserved:\t\t\t%d\n", offset.c_str(), PAT.Reserved_1 );
+  printf( "%s\tSection Length:\t\t\t%X\n", offset.c_str(), PAT.Section_Length );
+  printf( "%s\tTransport Stream ID\t\t%X\n", offset.c_str(), PAT.Transport_Stream_ID );
+  printf( "%s\tReserved:\t\t\t%d\n", offset.c_str(), PAT.Reserved_2 );
+  printf( "%s\tVersion Number:\t\t\t%X\n", offset.c_str(), PAT.Version_Number );
+  printf( "%s\tCurrent Next Indicator:\t\t%d\n", offset.c_str(), PAT.Current_Next_Indicator );
+  printf( "%s\tSection Number:\t\t\t%X\n", offset.c_str(), PAT.Section_Number );
+  printf( "%s\tLast Section Number:\t\t%d\n\n", offset.c_str(), PAT.Last_Section_Number );
+  for( int i = 0; i < PAT.Entries.size(); i++ ) {
+    printf( "%s\tEntry %d\n", offset.c_str(), i );
+    printf( "%s\t\tProgram Number:\t\t%X\n", offset.c_str(), PAT.Entries[i].Program_Number );
+    printf( "%s\t\tReserved:\t\t%X\n", offset.c_str(), PAT.Entries[i].Reserved );
+    printf( "%s\t\tProgram Map PID:\t%X\n", offset.c_str(), PAT.Entries[i].Program_Map_PID );
+  }
+  printf( "\n%s\tCRC_32:\t\t\t\t%X\n", offset.c_str(), PAT.CRC_32 );
+}
+
+void fill_pat( program_association_table & PAT, unsigned char * TempChar ) {
+  PAT.Pointer_Field = TempChar[4];
+  PAT.Table_ID = TempChar[5];
+  PAT.Section_Syntax_Indicator = ((TempChar[6] & 0x80 ) != 0 );
+  PAT.Zero = (( TempChar[6] & 0x40 ) != 0 );
+  PAT.Reserved_1 = (( TempChar[6] & 0x30 ) >> 4 );
+  PAT.Section_Length = (( TempChar[6] & 0x0F ) << 8 ) + TempChar[7];
+  PAT.Transport_Stream_ID = (( TempChar[8] << 8 ) + TempChar[9] );
+  PAT.Reserved_2 = (( TempChar[10] & 0xC0 ) >> 6 );
+  PAT.Version_Number = (( TempChar[10] & 0x01 ) >> 1 );
+  PAT.Current_Next_Indicator = (( TempChar[10] & 0x01 ) != 0 );
+  PAT.Section_Number = TempChar[11];
+  PAT.Last_Section_Number = TempChar[12];
+  PAT.Entries.clear( );
+  for( int i = 0; i < PAT.Section_Length - 9; i += 4 ) {
+    program_association_table_entry PAT_Entry;
+    PAT_Entry.Program_Number = ( TempChar[13+i] << 8 ) + TempChar[14+i];
+    PAT_Entry.Reserved = ( TempChar[15+i] & 0xE0 ) >> 5;
+    PAT_Entry.Program_Map_PID = (( TempChar[15+i] & 0x1F ) << 8 ) + TempChar[16+i];
+    PAT.Entries.push_back( PAT_Entry );
+  }
+  PAT.CRC_32 = ( TempChar[8+PAT.Section_Length-4] << 24 ) + ( TempChar[8+PAT.Section_Length-3] << 16 ) + ( TempChar[8+PAT.Section_Length-2] << 8 ) + ( TempChar[8+PAT.Section_Length-1] );
+}
+
+void fill_pmt( program_mapping_table & PMT, unsigned char * TempChar ) {
+  PMT.Pointer_Field = TempChar[4];
+  PMT.Table_ID = TempChar[5];
+  PMT.Section_Syntax_Indicator = (( TempChar[6] & 0x80 ) != 0 );
+  PMT.Zero = (( TempChar[6] & 0x40 ) != 0 );
+  PMT.Reserved_1 = (( TempChar[6] & 0x30 ) >> 4 );
+  PMT.Section_Length = (( TempChar[6] & 0x0F ) << 8 ) + TempChar[7];
+}
+
+void print_pmt( program_mapping_table PMT, bool Pointer_Field = false, std::string offset="\t" ) {
+  if( Pointer_Field ) {
+    printf( "%s\tPointer Field:\t\t\t%X\n", offset.c_str(), PMT.Pointer_Field );
+  }
+  printf( "%s\tTable ID:\t\t\t%X\n", offset.c_str(), PMT.Table_ID );
+  printf( "%s\tSection Syntax Indicator:\t%d\n", offset.c_str(), PMT.Section_Syntax_Indicator);
+  printf( "%s\t0:\t\t\t\t%d\n", offset.c_str(), PMT.Zero );
+  printf( "%s\tReserved:\t\t\t%d\n", offset.c_str(), PMT.Reserved_1 );
+  printf( "%s\tSection Length:\t\t\t%X\n", offset.c_str(), PMT.Section_Length );
+}
+
+int find_pid_in_pat( program_association_table PAT, unsigned int PID ) {
+  for( int i = 0; i < PAT.Entries.size(); i++ ) {
+    if( PAT.Entries[i].Program_Map_PID == PID ) {
+      return PAT.Entries[i].Program_Number;
+    }
+  }
+  return -1;
 }

 int main( ) {
@@ -44,9 +135,12 @@
   unsigned char Skip;
   unsigned int SkippedBytes = 0;
   unsigned int Adaptation;
+  program_association_table PAT;
+  program_mapping_table PMT;
+  int ProgramNum;
   while( std::cin.good( ) && BlockNo <= 4) {
     for( int i = 0; i < 188; i++ ) {
-      TempChar[i] = std::cin.get();
+      if( std::cin.good( ) ){ TempChar[i] = std::cin.get(); }
     }

     if( ( ( TempChar[1] & 0x1F ) << 8 ) + ( TempChar[2] ) != 0x1FFF ) {
@@ -70,38 +164,20 @@

       if( ( ( ( TempChar[1] & 0x1F ) << 8 ) +  TempChar[2] ) == 0 ) {
-        printf( "\tProgram Association Table\n" );
-        printf( "\t\tpointer_field:\t\t\t%X\n", TempChar[4] );
-        printf( "\t\ttable_id:\t\t\t%X\n", TempChar[5] );
-        printf( "\t\tsection_syntax_indicator:\t%d\n", ( ( TempChar[6] & 0x80 ) != 0 ) );
-
-        printf( "\t\t0:\t\t\t\t%d\n", ( ( TempChar[6] & 0x40 ) != 0 ) );
-        printf( "\t\treserved:\t\t\t%d\n", ( ( TempChar[6] & 0x30 ) >> 4 ) );
-        printf( "\t\tsection_length:\t\t\t%X\n", ( ( TempChar[6] & 0x0F ) << 8 ) + TempChar[7] );
-        printf( "\t\ttransport_stream_id\t\t%X\n", ( ( TempChar[8] << 8 ) + TempChar[9] ) );
-        printf( "\t\treserved:\t\t\t%d\n", ( ( TempChar[10] & 0xC0 ) >> 6 ) );
-        printf( "\t\tversion_number:\t\t\t%X\n", ( ( TempChar[10] & 0x3E ) >> 1 ) );
-        printf( "\t\tcurrent_next_indicator:\t\t%d\n", ( ( TempChar[10] & 0x01 ) != 0 ) );
-        printf( "\t\tsection_number:\t\t\t%X\n", TempChar[11] );
-        printf( "\t\tlast_section_number:\t\t%d\n", TempChar[12] );
-        int SectionLength = ( ( TempChar[6] & 0x0F ) << 8 ) + TempChar[7];
-        for( int i = 0; i < SectionLength - 9; i += 4 ) {
-          printf( "\t\tENTRY %d:\n", i / 4 );
-          printf( "\t\t\tProgram Number:\t%X\n", ( TempChar[13+i] << 8 ) + TempChar[14+i] );
-          printf( "\t\t\tReserved:\t%X\n", ( TempChar[15+i] & 0xE0 ) >> 5 );
-          if( ( ( TempChar[13+i] << 8 ) + TempChar[14+i] ) == 0 ) {
-            printf( "\t\t\tnetwork_PID:\t\t%X\n", ( ( TempChar[15+i] & 0x1F ) << 8 ) + TempChar[16+i] );
-          } else {
-            printf( "\t\t\tprogram_map_PID:\t\t%X\n", ( ( TempChar[15+i] & 0x1F ) << 8 ) + TempChar[16+i] );
-          }
-        }
-        printf( "\t\tCRC_32\t\t\t\t%x\n", ( TempChar[8+SectionLength-4] << 24 ) + ( TempChar[8+SectionLength-3] << 16 ) + ( TempChar[8+SectionLength-2] << 8 ) + ( TempChar[8+SectionLength-1] ) );
+        fill_pat( PAT, TempChar );
+        print_pat( PAT, true );
+      }
+
+      ProgramNum = find_pid_in_pat( PAT, ( ( TempChar[1] & 0x1F ) << 8 ) + ( TempChar[2] ) );
+      if( ProgramNum != -1 ) {
+        printf( "\tProgram Mapping Table for program %X\n", ProgramNum );
+        fill_pmt( PMT, TempChar );
+        print_pmt( PMT, true );
       }

       BlockNo ++;

-    }
-  else {
+    } else {
       EmptyBlocks ++;
     }


fixed crash when moving entity in second open universe

--- src/editor/gizmo.cpp
+++ src/editor/gizmo.cpp
@@ -494,6 +494,7 @@

 	void clearEntities() override
 	{
+		m_active = -1;
 		m_pivot = Pivot::CENTER;
 		m_offset.set(0, 0, 0);
 		m_count = 0;


Removing the NullProxy, better Android implementation

The NullProxy was not used anymore.

Change-Id: I53e91650229e1b20e4376a13080e6681abd5c0a6

--- net/proxy/proxy_service.cc
+++ net/proxy/proxy_service.cc
@@ -83,19 +83,6 @@
 // setups.
 const int64 kNumMillisToStallAfterNetworkChanges = 2000;

-#ifdef ANDROID
-// Config getter that fails every time.
-class ProxyConfigServiceNull : public ProxyConfigService {
- public:
-  // ProxyConfigService implementation:
-  virtual void AddObserver(Observer* observer) {}
-  virtual void RemoveObserver(Observer* observer) {}
-  virtual bool GetLatestProxyConfig(ProxyConfig* config) {
-    return false;
-  }
-};
-#endif
-
 // Config getter that always returns direct settings.
 class ProxyConfigServiceDirect : public ProxyConfigService {
  public:
@@ -808,7 +795,11 @@
   NOTREACHED() << "ProxyConfigService for ChromeOS should be created in "
                << "chrome_url_request_context.cc::CreateProxyConfigService.";
   return NULL;
-#elif defined(OS_LINUX) && !defined(ANDROID)
+#elif defined(ANDROID)
+  NOTREACHED() << "ProxyConfigService for Android should be created in "
+               << "WebCache.cpp: WebCache::WebCache";
+  return NULL;
+#elif defined(OS_LINUX)
   ProxyConfigServiceLinux* linux_config_service
       = new ProxyConfigServiceLinux();


llvm-mc: Support -arch as a simplified form of -triple.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@98417 91177308-0d34-0410-b5e6-96231b3b80d8

--- tools/llvm-mc/llvm-mc.cpp
+++ tools/llvm-mc/llvm-mc.cpp
@@ -26,6 +26,7 @@
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/System/Host.h"
 #include "llvm/System/Signals.h"
 #include "llvm/Target/TargetAsmBackend.h"
 #include "llvm/Target/TargetAsmParser.h"
@@ -76,9 +77,12 @@
             cl::value_desc("directory"), cl::Prefix);

 static cl::opt<std::string>
+ArchName("arch", cl::desc("Target arch to assemble for, "
+                            "see -version for available targets"));
+
+static cl::opt<std::string>
 TripleName("triple", cl::desc("Target triple to assemble for, "
-                              "see -version for available targets"),
-           cl::init(LLVM_HOSTTRIPLE));
+                              "see -version for available targets"));

 enum ActionType {
   AC_AsLex,
@@ -98,6 +102,15 @@
                   clEnumValEnd));

 static const Target *GetTarget(const char *ProgName) {
+  // Figure out the target triple.
+  if (TripleName.empty())
+    TripleName = sys::getHostTriple();
+  if (!ArchName.empty()) {
+    llvm::Triple TT(TripleName);
+    TT.setArchName(ArchName);
+    TripleName = TT.str();
+  }
+
   // Get the target specific parser.
   std::string Error;
   const Target *TheTarget = TargetRegistry::lookupTarget(TripleName, Error);


#87050# ctor of metadata changed

#87050# ctor of metadata changed

--- connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: FDatabaseMetaDataResultSet.cxx,v $
  *
- *  $Revision: 1.10 $
- *
- *  last change: $Author: oj $ $Date: 2001-05-23 09:15:42 $
+ *  $Revision: 1.11 $
+ *
+ *  last change: $Author: oj $ $Date: 2001-07-16 06:17:16 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -400,7 +400,7 @@

     if(!m_xMetaData.is())
-        m_xMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+        m_xMetaData = new ODatabaseMetaDataResultSetMetaData();

     return m_xMetaData;
 }
@@ -734,28 +734,28 @@
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setProceduresMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setProceduresMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setCatalogsMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setCatalogsMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setSchemasMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setSchemasMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setColumnPrivilegesMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setColumnPrivilegesMap();
     m_xMetaData = pMetaData;
 }
@@ -763,7 +763,7 @@
 void ODatabaseMetaDataResultSet::setColumnsMap()
 {

-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setColumnsMap();
     m_xMetaData = pMetaData;
 }
@@ -771,84 +771,84 @@
 void ODatabaseMetaDataResultSet::setTablesMap()
 {

-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setTablesMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setProcedureColumnsMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setProcedureColumnsMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setPrimaryKeysMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setProcedureColumnsMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setIndexInfoMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setIndexInfoMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setTablePrivilegesMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setTablePrivilegesMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setCrossReferenceMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setCrossReferenceMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setVersionColumnsMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setVersionColumnsMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setBestRowIdentifierMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setBestRowIdentifierMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setTypeInfoMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setTypeInfoMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setTableTypes()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setTableTypes();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setExportedKeysMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setExportedKeysMap();
     m_xMetaData = pMetaData;
 }
 // -------------------------------------------------------------------------
 void ODatabaseMetaDataResultSet::setImportedKeysMap()
 {
-    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData(this);
+    ODatabaseMetaDataResultSetMetaData* pMetaData = new ODatabaseMetaDataResultSetMetaData();
     pMetaData->setImportedKeysMap();
     m_xMetaData = pMetaData;
 }


[spinel] move call to va_end to exit path (#2390)

--- src/ncp/spinel_encoder.cpp
+++ src/ncp/spinel_encoder.cpp
@@ -267,9 +267,9 @@

     error = mNcpBuffer.InFrameFeedData(buf, static_cast<uint16_t>(packedLen));

+exit:
     va_end(args);

-exit:
     return error;
 }


Update die.cpp

Update die.cpp

--- combat/die.cpp
+++ combat/die.cpp
@@ -1571,7 +1571,7 @@
     bstring holidayStr = isHoliday();

     if(holidayStr != "")
-        holidayExp = MAX(1, (int)(expAmount * 0.1));
+        holidayExp = MAX(1, (int)(expAmount * 0.5));

     if(victim->flagIsSet(M_PERMENANT_MONSTER))
         holidayExp = 0;


layers: Split validate & update of CmdWriteTimestamp

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -6732,15 +6732,22 @@
     std::unique_lock<std::mutex> lock(global_lock);
     GLOBAL_CB_NODE *cb_state = GetCBNode(dev_data, commandBuffer);
     if (cb_state) {
-        QueryObject query = {queryPool, slot};
-        cb_state->queryUpdates.emplace_back([=](VkQueue q) {return setQueryState(q, commandBuffer, query, true);});
         skip |= ValidateCmdQueueFlags(dev_data, cb_state, "vkCmdWriteTimestamp()", VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT,
                                       VALIDATION_ERROR_1e802415);
         skip |= ValidateCmd(dev_data, cb_state, CMD_WRITETIMESTAMP, "vkCmdWriteTimestamp()");
+    }
+    lock.unlock();
+
+    if (skip) return;
+
+    dev_data->dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
+
+    lock.lock();
+    if (cb_state) {
+        QueryObject query = {queryPool, slot};
+        cb_state->queryUpdates.emplace_back([=](VkQueue q) {return setQueryState(q, commandBuffer, query, true);});
         UpdateCmdBufferLastCmd(cb_state, CMD_WRITETIMESTAMP);
     }
-    lock.unlock();
-    if (!skip) dev_data->dispatch_table.CmdWriteTimestamp(commandBuffer, pipelineStage, queryPool, slot);
 }

 static bool MatchUsage(layer_data *dev_data, uint32_t count, const VkAttachmentReference *attachments,


Fix assert

Fix assert

--- lib/SIL/SILVerifier.cpp
+++ lib/SIL/SILVerifier.cpp
@@ -1657,7 +1657,7 @@
               "[dynamic_replacement_for:...] function");
     } else if (isa<DynamicFunctionRefInst>(FRI))
       require(RefF->isDynamicallyReplaceable(),
-              "dynamic_function_ref cannot reference a "
+              "dynamic_function_ref must reference a "
               "[dynamically_replaceable] function");

     // In canonical SIL, direct reference to a shared_external declaration


[linearelliptic.solver.cg...] added a little more clever handling of dirichlet boundary values, fixes #218

--- dune/detailed-solvers/linearelliptic/solver/cg/detailed-discretizations.hh
+++ dune/detailed-solvers/linearelliptic/solver/cg/detailed-discretizations.hh
@@ -111,10 +111,6 @@
   typedef typename TestSpaceType::PatternType                 PatternType;

 private:
-//  typedef Dune::Detailed::Discretizations::DiscreteFunction::Default< TestSpaceType, VectorType >
-//                                                                                DiscreteTestFunctionType;
-//  typedef Dune::Detailed::Discretizations::DiscreteFunction::DefaultConst< TestSpaceType, VectorType >
-//                                                                                DiscreteTestFunctionConstType;
   typedef Dune::Detailed::Discretizations::DiscreteFunction::Default< AnsatzSpaceType, VectorType >
                                                                                DiscreteAnsatzFunctionType;
   typedef Dune::Detailed::Discretizations::DiscreteFunction::DefaultConst< AnsatzSpaceType, VectorType >
@@ -291,7 +287,7 @@
       } // if (!model_->diffusion()->parametric())
       out << "done (took " << timer.elapsed() << " sec)" << std::endl;
       // * right hand side
-      //   * L2 force functional
+      //   * force functional
       typedef Dune::Detailed::Discretizations::Evaluation::Local::Unary::Scale< FunctionSpaceType,
                                                                                typename ModelType::FunctionType >
         ProductEvaluationType;
@@ -315,7 +311,7 @@
       } // if (!model_->force()->parametric())
       out << "done (took " << timer.elapsed() << " sec)" << std::endl;
       timer.reset();
-      //   * L2 neumann functional
+      //   * neumann functional
       std::vector< ProductEvaluationType* > neumannEvaluations;
       std::vector< L2VolumeFunctionalType* > neumannFunctionals;
       if (!model_->neumann()->parametric())
@@ -358,6 +354,11 @@
           diffusionMatrices.push_back(ContainerFactory::createRowMajorSparseMatrix(*testSpace_,
                                                                                *testSpace_,
                                                                                *diffusionPattern));
+        // if there is no affine part, we add one to hold the diagonal entries for the dirichlet boundaries
+        if (model_->diffusion()->numCoefficients() == model_->diffusion()->numComponents())
+          diffusionMatrices.push_back(ContainerFactory::createRowMajorSparseMatrix(*testSpace_,
+                                                                                *testSpace_,
+                                                                                *diffusionPattern));
         diffusionMatrix = std::make_shared< AffineParametricMatrixType >(model_->diffusion()->paramSize(),
                                                                    diffusionMatrices,
                                                                    model_->diffusion()->coefficients());
@@ -451,6 +452,21 @@
         systemAssembler.addLocalVectorAssembler(localNeumannVectorAssembler[qq],
                                                 neumannVector->components()[qq]);
       systemAssembler.assemble();
+      out << "done (took " << timer.elapsed() << " sec)" << std::endl;
+
+      out << prefix << "applying constraints... " << std::flush;
+      // we delete the rows of all component matrices
+      systemAssembler.clearMatrixRows(diffusionMatrix->components(),
+                                      *diffusionPattern,
+                                      false);
+      // and put the diagonal entries into the one matrix, that does not have a coeffient
+      systemAssembler.clearMatrixRows(*(diffusionMatrix->components()[diffusionMatrix->numComponents() - 1]),
+                                      *diffusionPattern);
+      // we also delete the dirichlet entries of the vectors
+      systemAssembler.clearVectorEntries(forceVector->components(),
+                                         false);
+      systemAssembler.clearVectorEntries(neumannVector->components(),
+                                         false);
       out << "done (took " << timer.elapsed() << " sec)" << std::endl;

       // clean up
@@ -542,7 +558,7 @@
                  << Dune::Stuff::Common::colorStringRed("ERROR:")
                  << " linear solver '" << linearSolverType << "' produced a solution of wrong size (is "
                  << solutionVector->size() << ", should be " << testSpace_->map().size() << ")!");
-    solutionVector->backend() += dirichletVector.components()[0]->backend();
+    solutionVector->backend() += dirichletVector.fix(muDirichlet)->backend();
     out << "done (took " << timer.elapsed() << " sec)" << std::endl;
   } // void solve(...)


Fix bug tabulated ephemeris

Fix bug tabulated ephemeris

--- Tudat/External/JsonInterface/Environment/ephemeris.cpp
+++ Tudat/External/JsonInterface/Environment/ephemeris.cpp
@@ -147,7 +147,7 @@
     }
     case tabulated_ephemeris:
     {
-        TabulatedEphemerisSettings defaults( { } );
+        TabulatedEphemerisSettings defaults( ( std::map< double, Eigen::Vector6d >( ) ) );
         TabulatedEphemerisSettings tabulatedEphemerisSettings(
                     getValue< std::map< double, Eigen::Vector6d > >( jsonObject, K::bodyStateHistory ) );
         tabulatedEphemerisSettings.setUseLongDoubleStates(


tcp: avoid using delegate by default for receive window calculation

--- src/net/tcp/connection.cpp
+++ src/net/tcp/connection.cpp
@@ -36,7 +36,7 @@
     cb{host_.window_size()},
     read_request(nullptr),
     writeq(),
-    recv_wnd_getter{this, &Connection::calculate_rcv_wnd},
+    recv_wnd_getter{nullptr},
     on_connect_{std::move(callback)},
     on_disconnect_({this, &Connection::default_on_disconnect}),
     rtx_timer({this, &Connection::rtx_timeout}),
@@ -777,7 +777,7 @@
       // this ensures that the data we ACK is actually put in our buffer.
       Ensures(recv == length);
       // adjust the rcv wnd to (maybe) new value
-      cb.RCV.WND = recv_wnd_getter();
+      cb.RCV.WND = (recv_wnd_getter == nullptr) ? calculate_rcv_wnd() : recv_wnd_getter();
     }
   }
   // Packet out of order