Make sure PluginDataRemoverImpl::Init is executed after the constructor has finished.

BUG=106709
TEST=none

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

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

--- content/browser/plugin_data_remover_impl.cc
+++ content/browser/plugin_data_remover_impl.cc
@@ -60,25 +60,26 @@
 class PluginDataRemoverImpl::Context
     : public PluginProcessHost::Client,
       public IPC::Channel::Listener,
-      public base::RefCountedThreadSafe<Context> {
+      public base::RefCountedThreadSafe<Context,
+                                        BrowserThread::DeleteOnIOThread> {
  public:
-  Context(const std::string& mime_type,
-          base::Time begin_time,
+  Context(base::Time begin_time,
           const content::ResourceContext& resource_context)
       : event_(new base::WaitableEvent(true, false)),
         begin_time_(begin_time),
         is_removing_(false),
         resource_context_(resource_context),
         channel_(NULL) {
-    // Balanced in OnChannelOpened or OnError. Exactly one them will eventually
-    // be called, so we need to keep this object around until then.
-    AddRef();
-    remove_start_time_ = base::Time::Now();
+  }
+
+  virtual ~Context() {
+  }
+
+  void Init(const std::string& mime_type) {
     BrowserThread::PostTask(
         BrowserThread::IO,
         FROM_HERE,
-        base::Bind(&Context::Init, this, mime_type));
-
+        base::Bind(&Context::InitOnIOThread, this, mime_type));
     BrowserThread::PostDelayedTask(
         BrowserThread::IO,
         FROM_HERE,
@@ -86,9 +87,23 @@
         kRemovalTimeoutMs);
   }

-  virtual ~Context() {
-    if (channel_)
-      BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, channel_);
+  // Initialize on the IO thread.
+  void InitOnIOThread(const std::string& mime_type) {
+    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+    remove_start_time_ = base::Time::Now();
+    is_removing_ = true;
+    // Balanced in OnChannelOpened or OnError. Exactly one them will eventually
+    // be called, so we need to keep this object around until then.
+    AddRef();
+    PluginService::GetInstance()->OpenChannelToNpapiPlugin(
+        0, 0, GURL(), GURL(), mime_type, this);
+  }
+
+  // Called when a timeout happens in order not to block the client
+  // indefinitely.
+  void OnTimeout() {
+    LOG_IF(ERROR, is_removing_) << "Timed out";
+    SignalDone();
   }

   // PluginProcessHost::Client methods.
@@ -145,18 +160,9 @@
     }
   }

-
   base::WaitableEvent* event() { return event_.get(); }

  private:
-  // Initialize on the IO thread.
-  void Init(const std::string& mime_type) {
-    DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-    is_removing_ = true;
-    PluginService::GetInstance()->OpenChannelToNpapiPlugin(
-        0, 0, GURL(), GURL(), mime_type, this);
-  }
-
   // Connects the client side of a newly opened plug-in channel.
   void ConnectToChannel(const IPC::ChannelHandle& handle) {
     DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -165,8 +171,8 @@
     if (!is_removing_)
       return;

-    DCHECK(!channel_);
-    channel_ = new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this);
+    DCHECK(!channel_.get());
+    channel_.reset(new IPC::Channel(handle, IPC::Channel::MODE_CLIENT, this));
     if (!channel_->Connect()) {
       NOTREACHED() << "Couldn't connect to plugin";
       SignalDone();
@@ -190,13 +196,6 @@
     SignalDone();
   }

-  // Called when a timeout happens in order not to block the client
-  // indefinitely.
-  void OnTimeout() {
-    LOG_IF(ERROR, is_removing_) << "Timed out";
-    SignalDone();
-  }
-
   // Signals that we are finished with removing data (successful or not). This
   // method is safe to call multiple times.
   void SignalDone() {
@@ -217,10 +216,9 @@
   // The resource context for the profile.
   const content::ResourceContext& resource_context_;

-  // We own the channel, but it's used on the IO thread, so it needs to be
-  // deleted there. It's NULL until we have opened a connection to the plug-in
+  // The channel is NULL until we have opened a connection to the plug-in
   // process.
-  IPC::Channel* channel_;
+  scoped_ptr<IPC::Channel> channel_;
 };

@@ -236,6 +234,7 @@
 base::WaitableEvent* PluginDataRemoverImpl::StartRemoving(
     base::Time begin_time) {
   DCHECK(!context_.get());
-  context_ = new Context(mime_type_, begin_time, resource_context_);
+  context_ = new Context(begin_time, resource_context_);
+  context_->Init(mime_type_);
   return context_->event();
 }


Switch from using Speex to FLAC for speech input requests.

BUG=61677
TEST=manual, verify that the audio received by server is in FLAC format.

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

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

Former-commit-id: 571cc3bd4a0de569ed17ee54b4a48f21433f6df6

--- content/browser/speech/speech_recognizer.cc
+++ content/browser/speech/speech_recognizer.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

@@ -66,7 +66,7 @@
       grammar_(grammar),
       hardware_info_(hardware_info),
       origin_url_(origin_url),
-      codec_(AudioEncoder::CODEC_SPEEX),
+      codec_(AudioEncoder::CODEC_FLAC),
       encoder_(NULL),
       endpointer_(kAudioSampleRate),
       num_samples_recorded_(0),


fix memory leak (CID 4060)

fix memory leak (CID 4060)

svn path=/trunk/kdesupport/strigi/; revision=728061

--- src/streams/base64inputstream.cpp
+++ src/streams/base64inputstream.cpp
@@ -68,8 +68,11 @@
     }
 }

-Base64InputStream::Base64InputStream(InputStream* i) :p(new Private(this, i)) {
-}
+Base64InputStream::Base64InputStream(InputStream* i)
+    :p(new Private(this, i))
+{
+}
+
 Base64InputStream::~Base64InputStream() {
     delete p;
 }


Remove unused variable.

Remove unused variable.

--- src/structures/vroom/tw_route.cpp
+++ src/structures/vroom/tw_route.cpp
@@ -1112,8 +1112,6 @@
       }
     }
   }
-
-  Duration bwd_next_travel = next.travel; // Used for latest dates.

   // Determine break range between first_rank and last_rank.
   Index current_break = breaks_counts[first_rank] - breaks_at_rank[first_rank];


MetadataParser: Don't check for nullptr album

--- src/metadata_services/MetadataParser.cpp
+++ src/metadata_services/MetadataParser.cpp
@@ -707,6 +707,7 @@
         assert( artist != nullptr );
         albumArtist = artist;
     }
+    assert( album != nullptr );

     // We might modify albumArtist later, hence handle thumbnails before.
     // If we have an albumArtist (meaning the track was properly tagged, we
@@ -717,7 +718,7 @@
     if ( albumArtist != nullptr && albumArtist->id() != UnknownArtistID &&
          albumArtist->id() != VariousArtistID &&
          albumArtist->artworkMrl().empty() == true &&
-         album != nullptr && album->artworkMrl().empty() == false )
+         album->artworkMrl().empty() == false )
         albumArtist->setArtworkMrl( album->artworkMrl(), Thumbnail::Origin::Album );

     // Until we have a better artwork extraction/assignation, simply do the same
@@ -725,7 +726,7 @@
     if ( artist != nullptr && artist->id() != UnknownArtistID &&
          artist->id() != VariousArtistID &&
          artist->artworkMrl().empty() == true &&
-         album != nullptr && album->artworkMrl().empty() == false )
+         album->artworkMrl().empty() == false )
         artist->setArtworkMrl( album->artworkMrl(), Thumbnail::Origin::Album );

     if ( albumArtist != nullptr )


This file doesn't exist.  I didn't need it.

--- src/mlpack/methods/maxip/max_ip_impl.hpp
+++ src/mlpack/methods/maxip/max_ip_impl.hpp
@@ -10,7 +10,6 @@
 // In case it hasn't yet been included.
 #include "max_ip.hpp"

-#include <mlpack/core/tree/traversers/single_cover_tree_traverser.hpp>
 #include "max_ip_rules.hpp"

 namespace mlpack {


use LIBJ_USE_CXX11

use LIBJ_USE_CXX11

--- src/js_regexp.cpp
+++ src/js_regexp.cpp
@@ -10,16 +10,16 @@
 namespace libj {

 static glue::RegExp::U16String toU16String(String::CPtr str) {
-    if (Type<char16_t>::id() == Type<uint16_t>::id()) {
-        return str->toStdU16String();
-    } else {
-        glue::RegExp::U16String s;
-        std::u16string ss = str->toStdU16String();
-        for (size_t i = 0; i < ss.length(); i++) {
-            s.push_back(ss[i]);
-        }
-        return s;
+#ifdef LIBJ_USE_CXX11
+    glue::RegExp::U16String s;
+    std::u16string ss = str->toStdU16String();
+    for (size_t i = 0; i < ss.length(); i++) {
+        s.push_back(ss[i]);
     }
+    return s;
+#else
+    return str->toStdU16String();
+#endif
 }

 class JsRegExpImpl : public JsRegExp {


beutify the stack trace printing message just a little bit.

--- opencog/util/Logger.cc
+++ opencog/util/Logger.cc
@@ -121,10 +121,12 @@

 	// Start printing at a bit into the stack, so as to avoid recording
 	// the logger functions in the stack trace.
+	fprintf(fh, "\tStack Trace:\n");
 	for (int i=2; i< stack_depth; i++)
 	{
-		fprintf(fh, "%s\n", syms[i]);
+		fprintf(fh, "\t%d: %s\n", i, syms[i]);
 	}
+	fprintf(fh, "\n");
 	free(syms);
 }


logger: if we are going to do this OSX thing, lets do it correctly.

--- opencog/util/Logger.cc
+++ opencog/util/Logger.cc
@@ -30,19 +30,19 @@
 #include "Logger.h"
 #include "Config.h"

-#include <pthread.h>
-#define pthread_yield sched_yield
-
 #ifndef WIN32
 #include <cxxabi.h>
 #include <execinfo.h>
 #endif

 #include <iostream>
+#include <sstream>
+
+#include <pthread.h>
+#include <sched.h>
+#include <stdarg.h>
 #include <stdlib.h>
-#include <stdarg.h>
 #include <time.h>
-#include <sstream>

 #ifdef WIN32_NOT_UNIX
 #include <winsock2.h>
@@ -167,7 +167,7 @@
 {
     while (!pendingMessagesToWrite.empty())
     {
-        pthread_yield();
+        sched_yield();
         usleep(100);
     }
 }


more iterator porting

more iterator porting

svn path=/trunk/KDE/kdepim/; revision=489372

--- kaddressbook/kabcore.cpp
+++ kaddressbook/kabcore.cpp
@@ -25,7 +25,6 @@
 #include <qdir.h>
 #include <qfile.h>
 #include <qlayout.h>
-#include <q3ptrlist.h>
 #include <qregexp.h>
 #include <q3vbox.h>
 #include <QSplitter>
@@ -271,15 +270,13 @@

 KABC::Resource *KABCore::requestResource( QWidget *parent )
 {
-  Q3PtrList<KABC::Resource> kabcResources = addressBook()->resources();
-
-  Q3PtrList<KRES::Resource> kresResources;
-  Q3PtrListIterator<KABC::Resource> resIt( kabcResources );
-  KABC::Resource *resource;
-  while ( ( resource = resIt.current() ) != 0 ) {
-    ++resIt;
-    if ( !resource->readOnly() ) {
-      KRES::Resource *res = static_cast<KRES::Resource*>( resource );
+  const QList<KABC::Resource*> kabcResources = addressBook()->resources();
+
+  QList<KRES::Resource*> kresResources;
+  QList<KABC::Resource*>::const_iterator resIt;
+  for ( resIt = kabcResources.begin(); resIt != kabcResources.end(); ++resIt) {
+    if ( (*resIt)->readOnly() ) {
+      KRES::Resource *res = static_cast<KRES::Resource*>( *resIt );
       if ( res )
         kresResources.append( res );
     }
@@ -724,14 +721,15 @@

 void KABCore::save()
 {
-  Q3PtrList<KABC::Resource> resources = mAddressBook->resources();
-  Q3PtrListIterator<KABC::Resource> it( resources );
-  while ( it.current() && !it.current()->readOnly() ) {
-    KABC::Ticket *ticket = mAddressBook->requestSaveTicket( it.current() );
+  const QList<KABC::Resource*> resources = mAddressBook->resources();
+  QList<KABC::Resource*>::const_iterator it;
+
+  for(it = resources.begin(); it != resources.end(); ++it) {
+    KABC::Ticket *ticket = mAddressBook->requestSaveTicket( *it );
     if ( ticket ) {
       if ( !mAddressBook->save( ticket ) ) {
         KMessageBox::error( mWidget,
-                            i18n( "<qt>Unable to save address book %1.</qt>" ).arg( it.current()->resourceName() ) );
+                            i18n( "<qt>Unable to save address book %1.</qt>" ).arg( (*it)->resourceName() ) );
         mAddressBook->releaseSaveTicket( ticket );
       } else {
         setModified( false );
@@ -739,10 +737,8 @@
     } else {
       KMessageBox::error( mWidget,
                           i18n( "<qt>Unable to get access for saving the address book %1.</qt>" )
-                          .arg( it.current()->resourceName() ) );
+                          .arg( (*it)->resourceName() ) );
     }
-
-    ++it;
   }
 }

@@ -925,11 +921,10 @@
   saveSettings();
   KABPrefs::instance()->writeConfig();

-  Q3PtrList<KABC::Resource> resources = mAddressBook->resources();
-  Q3PtrListIterator<KABC::Resource> it( resources );
-  while ( it.current() ) {
-    it.current()->close();
-    ++it;
+  QList<KABC::Resource*> resources = mAddressBook->resources();
+  QList<KABC::Resource*>::iterator it;
+  for (it = resources.begin(); it != resources.end(); ++it ) {
+    (*it)->close();
   }

   return true;


fixed compiler warning with clang: 'illegal character encoding in string literal [-Winvalid-source-encoding]'

--- src/unit_tests/variant/variant_conv_to_string.cpp
+++ src/unit_tests/variant/variant_conv_to_string.cpp
@@ -104,7 +104,7 @@
     {
         variant var = char(-60);
         bool ok = false;
-        CHECK(var.to_string(&ok) == "");
+        CHECK(var.to_string(&ok) == std::string(1, char(-60)));
         CHECK(ok == true);
         CHECK(var.convert(type::get<std::string>()) == true);
     }


fixup for qtcbuildhelper usage (change Ib6f5be80)

Change-Id: I4d265f2e0a077e7608cb51c5631f157cdb667481
Reviewed-on: http://codereview.qt.nokia.com/2565
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@nokia.com>
Reviewed-by: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>

--- src/tools/qtcbuildhelper/main.cpp
+++ src/tools/qtcbuildhelper/main.cpp
@@ -95,7 +95,7 @@
             return 1;
     if (!findFirst(strCommandLine, strCommandLineLength, pos, L" \t", pos))
         return 1;
-    wmemmove_s(strCommandLine, strCommandLineLength, strCommandLine + pos + 2, strCommandLineLength - pos);
+    wmemmove_s(strCommandLine, strCommandLineLength, strCommandLine + pos + 1, strCommandLineLength - pos);

     bool bSuccess = startProcess(strCommandLine);
     free(strCommandLine);


PRD: Update reg list in prdfMemChnlFailCache.H

Change-Id: I156b2d58b11c2b7ca3cc3e7ea63158a3e8d3a0d2
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/107538
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Brian J Stegmiller <4c05ea37f9d6efb9a2c94995009b8b66580a4c01@us.ibm.com>
Reviewed-by: Benjamen G Tyner <506b6a2e26cca05d0eb1ae91301b5a4a8d39199d@ibm.com>
Reviewed-by: Zane C Shelley <fc96e127d170d6ac0b2af86a8a56f95974ff36e8@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/107585
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>

--- src/usr/diag/prdf/plat/mem/prdfMemChnlFailCache.H
+++ src/usr/diag/prdf/plat/mem/prdfMemChnlFailCache.H
@@ -5,7 +5,7 @@
 /*                                                                        */
 /* OpenPOWER HostBoot Project                                             */
 /*                                                                        */
-/* Contributors Listed Below - COPYRIGHT 2018,2019                        */
+/* Contributors Listed Below - COPYRIGHT 2018,2020                        */
 /* [+] International Business Machines Corp.                              */
 /*                                                                        */
 /*                                                                        */
@@ -36,106 +36,89 @@
 TargetScoms_t chnlFailScomList =
 {
     {
-        TARGETING::TYPE_MEMBUF,
+        TARGETING::TYPE_OCMB_CHIP,
         { // SCOMs
-            0x500F001C, // GLOBAL_CS_FIR
-            0x500F001B, // GLOBAL_RE_FIR
-            0x500F001A, // GLOBAL_SPA_FIR
-            0x01040000, // TP_CHIPLET_CS_FIR
-            0x01040001, // TP_CHIPLET_RE_FIR
-            0x01040002, // TP_CHIPLET_FIR_MASK
-            0x0104000A, // TP_LFIR
-            0x0104000D, // TP_LFIR_MASK
-            0x01040010, // TP_LFIR_ACT0
-            0x01040011, // TP_LFIR_ACT1
-            0x02040000, // NEST_CHIPLET_CS_FIR
-            0x02040001, // NEST_CHIPLET_RE_FIR
-            0x02040002, // NEST_CHIPLET_FIR_MASK
-            0x0204000A, // NEST_LFIR
-            0x0204000D, // NEST_LFIR_MASK
-            0x02040010, // NEST_LFIR_ACT0
-            0x02040011, // NEST_LFIR_ACT1
-            0x02010400, // DMIFIR
-            0x02010403, // DMIFIR_MASK
-            0x02010406, // DMIFIR_ACT0
-            0x02010407, // DMIFIR_ACT1
-            0x02010800, // MBIFIR
-            0x02010803, // MBIFIR_MASK
-            0x02010806, // MBIFIR_ACT0
-            0x02010807, // MBIFIR_ACT1
-            0x02011400, // MBSFIR
-            0x02011403, // MBSFIR_MASK
-            0x02011406, // MBSFIR_ACT0
-            0x02011407, // MBSFIR_ACT1
-            0x0201141e, // MBSSECUREFIR
-            0x02011440, // MBSECCFIR_0
-            0x02011443, // MBSECCFIR_0_MASK
-            0x02011446, // MBSECCFIR_0_ACT0
-            0x02011447, // MBSECCFIR_0_ACT1
-            0x02011480, // MBSECCFIR_1
-            0x02011483, // MBSECCFIR_1_MASK
-            0x02011486, // MBSECCFIR_1_ACT0
-            0x02011487, // MBSECCFIR_1_ACT1
-            0x020115c0, // SCACFIR
-            0x020115c3, // SCACFIR_MASK
-            0x020115c6, // SCACFIR_ACT0
-            0x020115c7, // SCACFIR_ACT1
-            0x02011600, // MCBISTFIR_0
-            0x02011603, // MCBISTFIR_0_MASK
-            0x02011606, // MCBISTFIR_0_ACT0
-            0x02011607, // MCBISTFIR_0_ACT1
-            0x02011700, // MCBISTFIR_1
-            0x02011703, // MCBISTFIR_1_MASK
-            0x02011706, // MCBISTFIR_1_ACT0
-            0x02011707, // MCBISTFIR_1_ACT1
-            0x03040000, // MEM_CHIPLET_CS_FIR
-            0x03040001, // MEM_CHIPLET_RE_FIR
-            0x03040002, // MEM_CHIPLET_FIR_MASK
-            0x03040004, // MEM_CHIPLET_SPA_FIR
-            0x03040007, // MEM_CHIPLET_SPA_FIR_MASK
-            0x0304000A, // MEM_LFIR
-            0x0304000D, // MEM_LFIR_MASK
-            0x03040010, // MEM_LFIR_ACT0
-            0x03040011, // MEM_LFIR_ACT1
-            0x01030009, // TP_ERROR_STATUS
-            0x02030009, // NEST_ERROR_STATUS
-            0x0201080F, // MBIERPT
-            0x02011413, // MBSCERR1
-            0x0201142C, // MBSCERR2
-            0x02011466, // MBA0_MBSECCERRPT_0
-            0x02011467, // MBA0_MBSECCERRPT_1
-            0x020114A6, // MBA1_MBSECCERRPT_0
-            0x020114A7, // MBA1_MBSECCERRPT_1
-            0x0201168f, // MBA0_MBXERRSTAT
-            0x0201178f, // MBA1_MBXERRSTAT
-            0x020115D4, // SENSORCACHEERRPT
-            0x03030009, // MEM_ERROR_STATUS
-        }
-    },
-    {
-        TARGETING::TYPE_MBA,
-        {
-            0x03010400, // MBACALFIR
-            0x03010403, // MBACALFIR_MASK
-            0x03010406, // MBACALFIR_ACT0
-            0x03010407, // MBACALFIR_ACT1
-            0x0301041b, // MBASECUREFIR
-            0x03010600, // MBAFIR
-            0x03010603, // MBAFIR_MASK
-            0x03010606, // MBAFIR_ACT0
-            0x03010607, // MBAFIR_ACT1
-            0x03010611, // MBASPA
-            0x03010614, // MBASPA_MASK
-            0x0301041A, // MBA_ERR_REPORT
-            0x030106E7, // MBA_MCBERRPTQ
-            0x800200900301143F, // MBADDRPHYFIR
-            0x800200930301143F, // MBADDRPHYFIR_MASK
-            0x800200960301143F, // MBADDRPHYFIR_ACT0
-            0x800200970301143F, // MBADDRPHYFIR_ACT1
-            0x8000D0060301143F, // DDRPHY_APB_FIR_ERR0_P0
-            0x8000D0070301143F, // DDRPHY_APB_FIR_ERR1_P0
-            0x8001D0060301143F, // DDRPHY_APB_FIR_ERR0_P1
-            0x8001D0070301143F, // DDRPHY_APB_FIR_ERR1_P1
+            0x08040000, // OCMB_CHIPLET_CS_FIR
+            0x08040001, // OCMB_CHIPLET_RE_FIR
+            0x08040002, // OCMB_CHIPLET_FIR_MASK
+            0x08040004, // OCMB_CHIPLET_SPA_FIR
+            0x08040007, // OCMB_CHIPLET_SPA_FIR_MASK
+            0x0804000a, // OCMB_LFIR
+            0x0804000d, // OCMB_LFIR_MASK
+            0x08040010, // OCMB_LFIR_ACT0
+            0x08040011, // OCMB_LFIR_ACT1
+            0x08010870, // MMIOFIR
+            0x08010873, // MMIOFIR_MASK
+            0x08010876, // MMIOFIR_ACT0
+            0x08010877, // MMIOFIR_ACT1
+            0x08011400, // SRQFIR
+            0x08011403, // SRQFIR_MASK
+            0x08011406, // SRQFIR_ACT0
+            0x08011407, // SRQFIR_ACT1
+            0x08011800, // MCBISTFIR
+            0x08011803, // MCBISTFIR_MASK
+            0x08011806, // MCBISTFIR_ACT0
+            0x08011807, // MCBISTFIR_ACT1
+            0x08011c00, // RDFFIR
+            0x08011c03, // RDFFIR_MASK
+            0x08011c06, // RDFFIR_ACT0
+            0x08011c07, // RDFFIR_ACT1
+            0x08012400, // TLXFIR
+            0x08012403, // TLXFIR_MASK
+            0x08012406, // TLXFIR_ACT0
+            0x08012407, // TLXFIR_ACT1
+            0x08012800, // OMIDLFIR
+            0x08012803, // OMIDLFIR_MASK
+            0x08012806, // OMIDLFIR_ACT0
+            0x08012807, // OMIDLFIR_ACT1
+            0x08011858, // OCMB_MBSSYMEC0
+            0x08011859, // OCMB_MBSSYMEC1
+            0x0801185A, // OCMB_MBSSYMEC2
+            0x0801185B, // OCMB_MBSSYMEC3
+            0x0801185C, // OCMB_MBSSYMEC4
+            0x0801185D, // OCMB_MBSSYMEC5
+            0x0801185E, // OCMB_MBSSYMEC6
+            0x0801185F, // OCMB_MBSSYMEC7
+            0x08011860, // OCMB_MBSSYMEC8
+            0x0801187E, // MBSEVR0
+            0x08011855, // MBSEC0
+            0x08011856, // MBSEC1
+            0x08011869, // MBSMSEC
+            0x08011857, // MBSTR
+            0x080118D6, // MCBAGRA
+            0x080118D7, // MCBMCAT
+            0x080118DB, // MCB_CNTL
+            0x080118DC, // MCB_CNTLSTAT
+            0x08011C10, // HW_MS0
+            0x08011C11, // HW_MS1
+            0x08011C12, // HW_MS2
+            0x08011C13, // HW_MS3
+            0x08011C14, // HW_MS4
+            0x08011C15, // HW_MS5
+            0x08011C16, // HW_MS6
+            0x08011C17, // HW_MS7
+            0x08011C18, // FW_MS0
+            0x08011C19, // FW_MS1
+            0x08011C1A, // FW_MS2
+            0x08011C1B, // FW_MS3
+            0x08011C1C, // FW_MS4
+            0x08011C1D, // FW_MS5
+            0x08011C1E, // FW_MS6
+            0x08011C1F, // FW_MS7
+            0x0801241C, // TLX_ERR0_REPORT
+            0x0801241D, // TLX_ERR1_REPORT
+            0x08012414, // TLX_ERR0_REPORT_MASK
+            0x08012415, // TLX_ERR1_REPORT_MASK
+            0x0801186A, // MBNCER
+            0x0801186B, // MBRCER
+            0x0801186C, // MBMPER
+            0x0801186D, // MBUER
+            0x0801186E, // MBAUER
+            0x08011415, // FARB0
+            0x08011C0C, // EXP_MSR
+            0x0801186F, // MC_ADDR_TRANS
+            0x08011870, // MC_ADDR_TRANS1
+            0x08011871, // MC_ADDR_TRANS2
         }
     }
 };


Fix memory leak

Fix memory leak

--- src/kopsik_api.cc
+++ src/kopsik_api.cc
@@ -1162,6 +1162,10 @@
     free(item->DateHeader);
     item->DateHeader = 0;
   }
+  if (item->DateDuration) {
+    free(item->DateDuration);
+    item->DateDuration = 0;
+  }
   delete item;
 }


Removed spurious line (#121)

Removed spurious line (#121)

--- src/kubernetes.cc
+++ src/kubernetes.cc
@@ -950,7 +950,6 @@
 void KubernetesReader::WatchPods(
     const std::string& node_name,
     MetadataUpdater::UpdateCallback callback) const {
-  HealthChecker health_reporter(config_);
   LOG(INFO) << "Watch thread (pods) started for node "
             << (node_name.empty() ? "<unscheduled>" : node_name);


Stateless Grammar: getGrammarPoolMemoryManager()

git-svn-id: 3ec853389310512053d525963cab269c063bb453@175110 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/validators/common/GrammarResolver.hpp
+++ src/xercesc/validators/common/GrammarResolver.hpp
@@ -62,16 +62,17 @@
 #if !defined(GRAMMARRESOLVER_HPP)
 #define GRAMMARRESOLVER_HPP

+#include <xercesc/framework/XMLGrammarPool.hpp>
 #include <xercesc/util/RefHashTableOf.hpp>
 #include <xercesc/util/StringPool.hpp>
 #include <xercesc/validators/common/Grammar.hpp>

+
 XERCES_CPP_NAMESPACE_BEGIN

 class DatatypeValidator;
 class DatatypeValidatorFactory;
-class XMLGrammarPool;
 class XMLGrammarDescription;
 class GrammarEntry;

@@ -147,6 +148,8 @@
     bool containsNameSpace( const XMLCh* const nameSpaceKey );

     inline XMLGrammarPool* const getGrammarPool() const;
+
+    inline MemoryManager* const getGrammarPoolMemoryManager() const;

     //@}

@@ -248,6 +251,11 @@
     return fGrammarPool;
 }

+inline MemoryManager* const GrammarResolver::getGrammarPoolMemoryManager() const
+{
+    return fGrammarPool->getMemoryManager();
+}
+
 XERCES_CPP_NAMESPACE_END

 #endif


Update to reflect changes in signature of ChFrame::GetA()

--- src/unit_CASCADE/ChCascadeDoc.cpp
+++ src/unit_CASCADE/ChCascadeDoc.cpp
@@ -21,6 +21,7 @@

 #include "ChCascadeDoc.h"
+#include "core/ChMatrixDynamic.h"

 //#include "ChIrrCascadeMeshTools.h"

@@ -496,15 +497,15 @@

  void ChCascadeDoc::FromChronoToCascade(const ChFrame<>& from_coord, TopLoc_Location& to_coord)
 {
-	ChVector<> mpos = ((ChFrame<>&)from_coord).GetPos();
+	const ChVector<>& mpos = from_coord.GetPos();
 	gp_Vec mtr(mpos.x, mpos.y, mpos.z);

-	ChMatrix33<>* from_mat = ((ChFrame<>&)from_coord).GetA();
+	const ChMatrix33<>& from_mat = from_coord.GetA();

 	((gp_Trsf)(to_coord.Transformation()) ).SetValues(
-		 (*from_mat)(0,0) ,(*from_mat)(0,1), (*from_mat)(0,2), mpos.x ,
-		 (*from_mat)(1,0) ,(*from_mat)(1,1), (*from_mat)(1,2), mpos.y ,
-		 (*from_mat)(2,0) ,(*from_mat)(2,1), (*from_mat)(2,2), mpos.z ,
+		 from_mat(0,0) ,from_mat(0,1), from_mat(0,2), mpos.x ,
+		 from_mat(1,0) ,from_mat(1,1), from_mat(1,2), mpos.y ,
+		 from_mat(2,0) ,from_mat(2,1), from_mat(2,2), mpos.z ,
 		 0,0);
 }


Removed deltaVthDecay (an experiment that should never have been committed).

git-svn-id: 602a26e73ae9f2a14e2bb95676f2e137fcc39919@1424 7c0444ca-5550-0410-9008-faecdbe78eb5

--- src/layers/V1.cpp
+++ src/layers/V1.cpp
@@ -25,7 +25,7 @@
 {
     V_REST, V_EXC, V_INH, V_INHB,            // V (mV)
     TAU_VMEM, TAU_EXC, TAU_INH, TAU_INHB,
-    VTH_REST,  TAU_VTH, DELTA_VTH, DELTA_VTH_DECAY,	     // tau (ms)
+    VTH_REST,  TAU_VTH, DELTA_VTH,	     // tau (ms)
     250, NOISE_AMP*( 1.0/TAU_EXC ) * ( ( TAU_INH * (V_REST-V_INH) + TAU_INHB * (V_REST-V_INHB) ) / (V_EXC-V_REST) ),
     250, NOISE_AMP*1.0,
     250, NOISE_AMP*1.0                       // noise (G)
@@ -61,7 +61,7 @@
    memcpy(clayer->params, p, sizeof(*p));

    clayer->numParams = sizeof(*p) / sizeof(float);
-   assert(clayer->numParams == 18);
+   assert(clayer->numParams == 17);

    V1Params * cp = (V1Params *) clayer->params;

@@ -78,7 +78,6 @@
    if (params->present(name, "VthRest"))  cp->VthRest  = params->value(name, "VthRest");
    if (params->present(name, "tauVth"))   cp->tauVth   = params->value(name, "tauVth");
    if (params->present(name, "deltaVth")) cp->deltaVth = params->value(name, "deltaVth");
-   if (params->present(name, "deltaVthDecay")) cp->deltaVthDecay = params->value(name, "deltaVthDecay");

    if (params->present(name, "noiseAmpE"))   cp->noiseAmpE   = params->value(name, "noiseAmpE");
    if (params->present(name, "noiseAmpI"))   cp->noiseAmpI   = params->value(name, "noiseAmpI");


File request ported to json.

File request ported to json.

--- src/lf/engine.cpp
+++ src/lf/engine.cpp
@@ -395,15 +395,12 @@
     server += "/requests";
     curl_easy_setopt(m_curl, CURLOPT_URL, server.c_str());
     curl_header_guard hg(m_curl);
-    std::string data = std::string(
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
-  <request>\
-    <recipient>") + user + std::string("</recipient>\
-    <subject>") + subject + std::string("</subject>\
-    <message>") + message + std::string("</message>\
-    <send_email>true</send_email>\
-");
-    data += "</request>\n";
+    nlohmann::json j;
+    j["request"]["recipient"] = user;
+    j["request"]["subject"] = subject;
+    j["request"]["message"] = message;
+    j["request"]["send_email"] = true;
+    auto data = j.dump();
     curl_easy_setopt(m_curl, CURLOPT_HTTPPOST, 0);
     curl_easy_setopt(m_curl, CURLOPT_POSTFIELDS, data.c_str());
     if (s >= NORMAL) {
@@ -863,25 +860,13 @@

 std::string engine::process_file_request_responce(const std::string& r, report_level s) const
 {
-    xml::document<> d;
-    d.parse<xml::parse_fastest | xml::parse_no_utf8>(const_cast<char*>(r.c_str()));
-
-    xml::node_iterator<> i(d.first_node());
-    xml::node_iterator<> e;
-    std::string q;
-    while(i != e) {
-        std::string n(i->name(), i->name_size());
-        if (n == "url") {
-            q = std::string(i->value(), i->value_size());
-            if (s >= NORMAL) {
-                    io::mout << "Request sent successfully. URL: " << q << io::endl;
-            }
-            break;
-        }
-        ++i;
-    }
+    auto j = nlohmann::json::parse(r);
+    std::string q = j["request"]["url"].get<std::string>();
     if (q.empty()) {
         throw request_error("file_request", r);
+    }
+    if (s >= NORMAL) {
+        io::mout << "Request sent successfully. URL: " << q << io::endl;
     }
     return q;
 }


Add new LMB size strings to an internal vector of possible values

While new strings were added to supprt the new 1024MB, 2048MB, and
4096 LMB sizes, these strings were not added to the vector
POSSIBLE_HB_MEM_REGION_SIZE_STRINGS that is used to see if there is
a match to the bios attribute sent from the BMC to hostboot.

Fortunately, the strings were still being used correctly to properly
set the ATTR_LMB_SIZE once the match was determined.

Change-Id: I7d3f1aa11477de07ccda677ce23731ff8bc85e0c
RTC:258716
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/134144
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Chen Du <10793d83dd2b346092aca99468e01b6a2b9d993a@us.ibm.com>
Reviewed-by: Matthew Raybuck <9bcecd56bb1097e934e4548e2b924569df303f40@ibm.com>
Reviewed-by: Nick Bofferding <fb8db48116bc8a69e29dd8cdb037246f232f4af5@us.ibm.com>

--- src/usr/pldm/base/hb_bios_attrs.C
+++ src/usr/pldm/base/hb_bios_attrs.C
@@ -129,7 +129,10 @@
                                                                      PLDM_BIOS_DISABLED_STRING};

 const std::vector<const char*> POSSIBLE_HB_MEM_REGION_SIZE_STRINGS = {PLDM_BIOS_128_MB_STRING,
-                                                                      PLDM_BIOS_256_MB_STRING};
+                                                                      PLDM_BIOS_256_MB_STRING,
+                                                                      PLDM_BIOS_1024_MB_STRING,
+                                                                      PLDM_BIOS_2048_MB_STRING,
+                                                                      PLDM_BIOS_4096_MB_STRING};

 const std::vector<const char*> POSSIBLE_HB_POWER_LIMIT_STRINGS = {PLDM_BIOS_ENABLED_STRING,
                                                                   PLDM_BIOS_DISABLED_STRING};


separate icesheet vertices

separate icesheet vertices

--- test/icesheet.cc
+++ test/icesheet.cc
@@ -20,7 +20,8 @@
 #define BOTTOM_EDGE 2
 #define TOP_EDGE 1
 #define TOUCH_EDGE 3
-#define TOUCH_VERTEX 1
+#define BOTTOM_VERTEX 2
+#define TOP_VERTEX 1
 #define INTERIOR_REGION 1

 unsigned getElmType(int numVtxPerElm) {
@@ -318,7 +319,8 @@
   apf::ModelEntity* mdlBotFace = getMdlFace(mesh,BOTTOMFACE);
   apf::ModelEntity* mdlPerFace = getMdlFace(mesh,PERIMETERFACE);
   apf::ModelEntity* mdlTouchEdge = getMdlEdge(mesh,TOUCH_EDGE);
-  apf::ModelEntity* mdlTouchVtx = mesh->findModelEntity(0, TOUCH_VERTEX);
+  apf::ModelEntity* mdlTopVtx = mesh->findModelEntity(0, TOP_VERTEX);
+  apf::ModelEntity* mdlBottomVtx = mesh->findModelEntity(0, BOTTOM_VERTEX);
   apf::MeshIterator* it = mesh->begin(0);
   apf::MeshEntity* vtx;
   while( (vtx = mesh->iterate(it)) ) {
@@ -329,12 +331,12 @@
     // classified on bottom perimeter
     else if( tag == BOTTOM_PERIMETERTAG ) {
       if (isVertexAdjacentToTouchEdge(mesh, vtx, mdlTouchEdge))
-        mesh->setModelEntity(vtx,mdlTouchVtx);
+        mesh->setModelEntity(vtx, mdlBottomVtx);
       else
         mesh->setModelEntity(vtx,mdlBotEdge);
     } else if( tag == TOP_PERIMETERTAG ) { // classified on top perimeter
       if (isVertexAdjacentToTouchEdge(mesh, vtx, mdlTouchEdge))
-        mesh->setModelEntity(vtx,mdlTouchVtx);
+        mesh->setModelEntity(vtx, mdlTopVtx);
       else
         mesh->setModelEntity(vtx,mdlTopEdge);
     } else if( tag == TOPTAG ) // classified on top face


fixes to compile on linux

fixes to compile on linux

--- src/utCalibration/Correlation.cpp
+++ src/utCalibration/Correlation.cpp
@@ -8,6 +8,7 @@
  */

 #include "Correlation.h"
+#include <math.h>

 #ifdef HAVE_LAPACK

@@ -17,7 +18,7 @@
 								  const std::vector< double >& right)
 {
 	double res = 0.0;
-	size_t len = left.size() < right.size() ? left.size() : right.size();
+	std::size_t len = left.size() < right.size() ? left.size() : right.size();

 	double var1 = 0.0;
 	double var2 = 0.0;


Fix transparent ambient for perspective shadows

When splitting the long edges for the ambient code, I wasn't adding
the corresponding triangle for the new point into the center region
for transparent occluders.

Change-Id: Ie2d1dcffbd701c0750d5da95e9d673b700a0e85a
Reviewed-on: https://skia-review.googlesource.com/16492
Reviewed-by: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>
Commit-Queue: Jim Van Verth <509afb0bfbb23ecaaf1fb3323209f531b45e75a6@google.com>

--- src/utils/SkShadowTessellator.cpp
+++ src/utils/SkShadowTessellator.cpp
@@ -449,6 +449,16 @@
             *fIndices.push() = fPositions.count() - 1;
             *fIndices.push() = fPositions.count() - 2;

+            // if transparent, add point to first one in array and add to center fan
+            if (fTransparent) {
+                fPositions[0] += centerPoint;
+                ++fCentroidCount;
+
+                *fIndices.push() = 0;
+                *fIndices.push() = fPrevUmbraIndex;
+                *fIndices.push() = fPositions.count() - 2;
+            }
+
             fPrevUmbraIndex = fPositions.count() - 2;
         }

@@ -479,6 +489,7 @@
     // finalize centroid
     if (fTransparent) {
         fPositions[0] *= SkScalarFastInvert(fCentroidCount);
+        fColors[0] = this->umbraColor(fTransformedHeightFunc(fPositions[0]));

         *fIndices.push() = 0;
         *fIndices.push() = fPrevUmbraIndex;
@@ -604,6 +615,16 @@
             *fIndices.push() = fPrevUmbraIndex;
             *fIndices.push() = fPositions.count() - 1;
             *fIndices.push() = fPositions.count() - 3;
+        }
+
+        // if transparent, add point to first one in array and add to center fan
+        if (fTransparent) {
+            fPositions[0] += centerPoint;
+            ++fCentroidCount;
+
+            *fIndices.push() = 0;
+            *fIndices.push() = fPrevUmbraIndex;
+            *fIndices.push() = fPositions.count() - 2;
         }

         fPrevUmbraIndex = fPositions.count() - 2;


[avr] More IT+ updates to improve reception

-- deviation 90kHz -> 60kHz
-- Frequency 915.000 -> 915.025
-- AFC tighten restriction, use fine tuning

--- arduino/libraries/rf12_itplus/rf12_itplus.cpp
+++ arduino/libraries/rf12_itplus/rf12_itplus.cpp
@@ -418,19 +418,17 @@
     switch (band)
     {
         case RF12_868MHZ: rf12_xfer(0xA67C); break;// FREQUENCY 868.300MHz
-        case RF12_915MHZ: rf12_xfer(0xA7D0); break;// FREQUENCY 915.000MHz
+        case RF12_915MHZ: rf12_xfer(0xA7D3); break;// FREQUENCY 915.025MHz
         default: rf12_xfer(0xA640); // ???
     }
-    //rf12_xfer(0xC606); // approx 49.2 Kbps, i.e. 10000/29/(1+6) Kbps
     rf12_xfer(0xC613); // DATA RATE 17.241 kbps
     rf12_xfer(0x94A2); // VDI,FAST,134kHz,0dBm,-91dBm
     rf12_xfer(0xC2AC); // AL,!ml,DIG,DQD4
     rf12_xfer(0xCA83); // FIFO8,2-SYNC,!ff,DR
     rf12_xfer(0xCE00 | TX29_GROUP); // SYNC=2DXX；
-    rf12_xfer(0xC483); // @PWR,NO RSTRIC,!st,!fi,OE,EN
-    rf12_xfer(0x9850); // !mp,90kHz,MAX OUT
-    //rf12_xfer(0xCC77); // OB1,OB0,LPX,!ddy,DDIT,BW0
-    rf12_xfer(0xCC76); // OB1,OB0,LPX,!ddyDDIT,!BW0
+    rf12_xfer(0xC4B7); // On VDF,TightRestrict,!strobe,Fine,OE,EN
+    rf12_xfer(0x9830); // 60kHz,positive
+    rf12_xfer(0xCC76); // OB1,OB0,!delay,dither,86.2kbit bandwidth
     rf12_xfer(0xE000); // NOT USE
     rf12_xfer(0xC800); // NOT USE
     rf12_xfer(0xC000); // 1.00MHz,2.2V


observable Lua thread in progress

observable Lua thread in progress

--- test/lua/lua.cpp
+++ test/lua/lua.cpp
@@ -24,12 +24,12 @@
 		return L;
 	}

-	typedef rx::observer<int> yield_destination;
+	typedef rx::observer<lua_Integer> yield_destination;

 	static int yield(lua_State *L)
 	{
 		yield_destination &dest = *static_cast<yield_destination *>(lua_touserdata(L, lua_upvalueindex(1)));
-		int element = lua_tointeger(L, 1);
+		lua_Integer element = lua_tointeger(L, 1);
 		dest.got_element(element);
 		return lua_yield(L, 0);
 	}
@@ -45,14 +45,12 @@
 			throw std::runtime_error(lua_tostring(L.get(), -1));
 		}

-		rx::bridge<int> yielded;
-		// fn &yielded
+		rx::bridge<lua_Integer> yielded;
 		lua_pushlightuserdata(coro, &static_cast<yield_destination &>(yielded));
-		// fn yield[&yielded]
 		lua_pushcclosure(coro, yield, 1);

-		boost::optional<int> got;
-		auto consumer = rx::consume<int>([&got](boost::optional<int> element)
+		boost::optional<lua_Integer> got;
+		auto consumer = rx::consume<lua_Integer>([&got](boost::optional<lua_Integer> element)
 		{
 			BOOST_REQUIRE(element);
 			got = element;
@@ -65,7 +63,7 @@
 			{
 				throw std::runtime_error(lua_tostring(coro, -1));
 			}
-			BOOST_CHECK_EQUAL(boost::make_optional(4), got);
+			BOOST_CHECK_EQUAL(boost::make_optional<lua_Integer>(4), got);
 		}

 		{
@@ -75,7 +73,107 @@
 			{
 				throw std::runtime_error(lua_tostring(coro, -1));
 			}
-			BOOST_CHECK_EQUAL(boost::make_optional(5), got);
+			BOOST_CHECK_EQUAL(boost::make_optional<lua_Integer>(5), got);
 		}
 	}
 }
+
+namespace rx
+{
+	template <class Element, class ElementFromLua>
+	struct lua_thread : public observable<Element>
+	{
+		using element_type = Element;
+
+		explicit lua_thread(lua_State &thread, ElementFromLua from_lua)
+			: s(std::make_shared<state>(thread, std::move(from_lua)))
+		{
+		}
+
+		virtual void async_get_one(observer<element_type> &receiver) SILICIUM_OVERRIDE
+		{
+			s->receiver = &receiver;
+			if (s->was_resumed)
+			{
+				lua_resume(s->thread, 0);
+			}
+			else
+			{
+				void *bound_state = lua_newuserdata(s->thread, sizeof(weak_state));
+				new (static_cast<weak_state *>(bound_state)) weak_state(s);
+				//TODO __gc
+				//TODO error handling
+				lua_pushcclosure(s->thread, lua_thread::yield, 1);
+				lua_resume(s->thread, 1);
+			}
+		}
+
+		virtual void cancel() SILICIUM_OVERRIDE
+		{
+			s.reset();
+		}
+
+	private:
+
+		struct state
+		{
+			//TODO: keep the Lua thread alive
+			lua_State *thread = nullptr;
+			ElementFromLua from_lua;
+			bool was_resumed = false;
+			observer<element_type> *receiver = nullptr;
+
+			explicit state(lua_State &thread, ElementFromLua from_lua)
+				: thread(&thread)
+				, from_lua(std::move(from_lua))
+			{
+			}
+		};
+		typedef std::weak_ptr<state> weak_state;
+
+		std::shared_ptr<state> s;
+
+		static int yield(lua_State *thread)
+		{
+			weak_state * const bound_state = static_cast<weak_state *>(lua_touserdata(thread, lua_upvalueindex(1)));
+			std::shared_ptr<state> locked_state = bound_state->lock();
+			if (!locked_state)
+			{
+				return 0;
+			}
+			assert(locked_state->receiver);
+			exchange(locked_state->receiver, nullptr)->got_element(locked_state->from_lua(*thread, -1));
+			return 0;
+		}
+	};
+
+	inline void swap_top(lua_State &lua)
+	{
+		lua_pushvalue(&lua, -2);
+		lua_remove(&lua, -3);
+	}
+
+	template <class Element, class ElementFromLua>
+	auto make_lua_thread(lua_State &parent, ElementFromLua &&from_lua)
+	{
+		lua_State * const coro = lua_newthread(&parent);
+		lua_xmove(&parent, coro, 2);
+		swap_top(*coro);
+		return lua_thread<Element, typename std::decay<ElementFromLua>::type>(parent, std::forward<ElementFromLua>(from_lua));
+	}
+}
+
+namespace Si
+{
+	BOOST_AUTO_TEST_CASE(lua_thread_observable)
+	{
+		auto L = open_lua();
+		BOOST_REQUIRE_EQUAL(0, luaL_loadstring(L.get(), "return function (yield) yield(4) yield(5) end"));
+		if (0 != lua_pcall(L.get(), 0, 1, 0))
+		{
+			throw std::runtime_error(lua_tostring(L.get(), -1));
+		}
+
+		auto thread = rx::make_lua_thread<lua_Integer>(*L, [](lua_State &lua, int idx) -> lua_Integer { return lua_tointeger(&lua, idx); });
+	}
+}


Put the serialization marker under its own IFDEF. (#11568)

--- src/vm/eventpipeeventinstance.cpp
+++ src/vm/eventpipeeventinstance.cpp
@@ -89,7 +89,7 @@
     }
     CONTRACTL_END;

-#ifdef _DEBUG
+#ifdef EVENTPIPE_EVENT_MARKER
     // Useful for diagnosing serialization bugs.
     const unsigned int value = 0xDEADBEEF;
     pSerializer->WriteBuffer((BYTE*)&value, sizeof(value));


Fix packet parsing for "ICMP time exceeded" messages

VRouter can trap "time exceeded" ICMP messages for flow-processing.
Parse inner payload to get keys for "ICMP Time Exceeded" packets

Change-Id: I98f84c332e42fe5c5d637b19af394e00bf1ca1c9
Partial-Bug: #1587277

--- src/vnsw/agent/pkt/pkt_handler.cc
+++ src/vnsw/agent/pkt/pkt_handler.cc
@@ -461,7 +461,8 @@
             pkt_info->dport = ICMP_ECHOREPLY;
             pkt_info->sport = htons(icmp->icmp_id);
         } else if (IsFlowPacket(pkt_info) &&
-                   icmp->icmp_type == ICMP_DEST_UNREACH) {
+                   ((icmp->icmp_type == ICMP_DEST_UNREACH) ||
+                    (icmp->icmp_type == ICMP_TIME_EXCEEDED))) {
             //Agent has to look at inner payload
             //and recalculate the parameter
             //Handle this only for packets requiring flow miss


test: minor changes

test: minor changes

--- test/mod/mod.cpp
+++ test/mod/mod.cpp
@@ -175,7 +175,7 @@
     }

     static duk_ret_t identifier(duk_context *ctx) {
-        static ENTT_ID_TYPE next{};
+        static ENTT_ID_TYPE next{1000u};
         duk_push_uint(ctx, next++);
         return 1;
     }


Remove variable length array

Remove variable length array

Variable length arrays are discouraged by -Wvla.

PiperOrigin-RevId: 268803918
Change-Id: I07bf45e53398dfe5652c07f9801a63733621b0d0

--- asylo/platform/host_call/test/test_enclave.cc
+++ asylo/platform/host_call/test/test_enclave.cc
@@ -22,6 +22,8 @@
 #include <sys/statfs.h>
 #include <sys/un.h>

+#include <vector>
+
 #include "absl/base/macros.h"
 #include "asylo/platform/host_call/test/enclave_test_selectors.h"
 #include "asylo/platform/host_call/trusted/host_call_dispatcher.h"
@@ -293,12 +295,12 @@

   auto msg_to_pipe = in->next();
   int p[2];
-  char inbuf[msg_to_pipe.size()];
+  std::vector<char> inbuf(msg_to_pipe.size());

   out->Push<int>(enc_untrusted_pipe2(p, O_NONBLOCK));
   enc_untrusted_write(p[1], msg_to_pipe.data(), msg_to_pipe.size());
-  enc_untrusted_read(p[0], inbuf, msg_to_pipe.size());
-  out->Push(std::string(inbuf, msg_to_pipe.size()));
+  enc_untrusted_read(p[0], inbuf.data(), msg_to_pipe.size());
+  out->Push(std::string(inbuf.data(), msg_to_pipe.size()));
   return PrimitiveStatus::OkStatus();
 }


Fix to enable build on BC++B6

Fix to enable build on BC++B6

git-svn-id: b36ee6b6e70810a25e81bc801db00a83677983fc@342323 13f79535-47bb-0310-9956-ffa450edef68

--- src/xalanc/Include/XalanDeque.hpp
+++ src/xalanc/Include/XalanDeque.hpp
@@ -172,8 +172,9 @@

     typedef XalanVector<BlockType*> BlockIndexType;

-    typedef XalanDequeIterator<XalanDequeIteratorTraits<value_type>, XalanDeque> iterator;
-    typedef XalanDequeIterator<XalanDequeConstIteratorTraits<value_type>, XalanDeque> const_iterator;
+    typedef XalanDeque<Type, ConstructionTraits>							ThisType;
+    typedef XalanDequeIterator<XalanDequeIteratorTraits<value_type>, ThisType> 		iterator;
+    typedef XalanDequeIterator<XalanDequeConstIteratorTraits<value_type>, ThisType> 	const_iterator;

 #if defined(XALAN_HAS_STD_ITERATORS)
     typedef XALAN_STD_QUALIFIER reverse_iterator<iterator>          reverse_iterator_;


Added initializer

Added initializer

--- src/osgPlugins/3ds/WriterNodeVisitor.cpp
+++ src/osgPlugins/3ds/WriterNodeVisitor.cpp
@@ -134,9 +134,9 @@
           osg::PrimitiveIndexFunctor(),
           _drawable_n(drawable_n),
           _listTriangles(listTriangles),
+          _modeCache(0),
           _hasNormalCoords(geo->getNormalArray() != NULL),
           _hasTexCoords(geo->getTexCoordArray(0) != NULL),
-          _lastFaceIndex(0),
           _material(material)
       {
       }
@@ -152,6 +152,7 @@
       virtual void setVertexArray(unsigned int,const osg::Vec2d*) {}

       virtual void setVertexArray(unsigned int ,const osg::Vec3d*) {}
+
       virtual void setVertexArray(unsigned int,const osg::Vec4d*) {}


refactor the mugen arguments

refactor the mugen arguments

--- src/main-menu.cpp
+++ src/main-menu.cpp
@@ -79,8 +79,6 @@
     }

     vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
-        /* Just move to the next argument */
-        current++;
         return current;
     }
 };
@@ -129,7 +127,6 @@
     }

     vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
-        current++;
         return current;
     }
 };
@@ -170,7 +167,6 @@
     }

     vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
-        current++;
         return current;
     }

@@ -194,7 +190,6 @@
     }

     vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
-        current++;
         return current;
     }
 };
@@ -213,7 +208,176 @@
     }

     vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
+        return current;
+    }
+};
+
+static bool parseMugenInstant(string input, string * player1, string * player2, string * stage){
+    unsigned int comma = input.find(',');
+    if (comma == string::npos){
+        Global::debug(0) << "Expected three arguments separated by a comma, only 1 was given: " << input << endl;
+        return false;
+    }
+    *player1 = input.substr(0, comma);
+    input.erase(0, comma + 1);
+    comma = input.find(',');
+
+    if (comma == string::npos){
+        Global::debug(0) << "Expected three arguments separated by a comma, only 2 were given: " << input << endl;
+        return false;
+    }
+
+    *player2 = input.substr(0, comma);
+    input.erase(0, comma + 1);
+    *stage = input;
+
+    return true;
+}
+
+struct MugenInstant{
+    enum Kind{
+        None,
+        Training,
+        Watch,
+        Arcade,
+        Script
+    };
+
+    MugenInstant():
+        enabled(false),
+        kind(None){
+        }
+
+    bool enabled;
+    string player1;
+    string player2;
+    string player1Script;
+    string player2Script;
+    string stage;
+    Kind kind;
+};
+
+class MugenTrainingArgument: public Argument {
+public:
+
+    MugenInstant data;
+
+    vector<string> keywords() const {
+        vector<string> out;
+        out.push_back("mugen:training");
+        return out;
+    }
+
+    string description() const {
+        return " <player 1 name>,<player 2 name>,<stage> : Start training game with the specified players and stage";
+    }
+
+    vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
         current++;
+        if (current != end){
+            data.enabled = parseMugenInstant(*current, &data.player1, &data.player2, &data.stage);
+            data.kind = MugenInstant::Training;
+        } else {
+            Global::debug(0) << "Expected an argument. Example: mugen:training kfm,ken,falls" << endl;
+        }
+        return current;
+    }
+};
+
+static void splitString(const string & subject, char split, string & left, string & right){
+    size_t find = subject.find(split);
+    if (find != string::npos){
+        left = subject.substr(0, find);
+        right = subject.substr(find + 1);
+    }
+}
+
+class MugenScriptArgument: public Argument {
+public:
+    MugenInstant data;
+
+    vector<string> keywords() const {
+        vector<string> out;
+        out.push_back("mugen:script");
+        return out;
+    }
+
+    string description() const {
+        return " <player 1 name>:<player 1 script>,<player 2 name>:<player 2 script>,<stage> : Start a scripted mugen game where each player reads its input from the specified scripts";
+    }
+
+    vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
+        current++;
+        if (current != end){
+            data.enabled = parseMugenInstant(*current, &data.player1, &data.player2, &data.stage);
+            string player, script;
+            splitString(data.player1, ':', player, script);
+            data.player1 = player;
+            data.player1Script = script;
+
+            splitString(data.player2, ':', player, script);
+            data.player2 = player;
+            data.player2Script = script;
+
+            data.kind = MugenInstant::Script;
+        } else {
+            Global::debug(0) << "Expected an argument. Example: mugen:script kfm:kfm-script.txt,ken:ken-script.txt,falls" << endl;
+        }
+
+        return current;
+    }
+};
+
+class MugenWatchArgument: public Argument {
+public:
+    MugenInstant data;
+
+    vector<string> keywords() const {
+        vector<string> out;
+        out.push_back("mugen:watch");
+        return out;
+    }
+
+    string description() const {
+        return " <player 1 name>,<player 2 name>,<stage> : Start watch game with the specified players and stage";
+    }
+
+    vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
+        current++;
+        if (current != end){
+            data.enabled = parseMugenInstant(*current, &data.player1, &data.player2, &data.stage);
+            data.kind = MugenInstant::Watch;
+        } else {
+            Global::debug(0) << "Expected an argument. Example: mugen:watch kfm,ken,falls" << endl;
+        }
+
+        return current;
+    }
+};
+
+class MugenArcadeArgument: public Argument {
+public:
+    MugenInstant data;
+
+    vector<string> keywords() const {
+        vector<string> out;
+        out.push_back("mugen:arcade");
+        return out;
+    }
+
+    string description() const {
+        return " <player 1 name>,<player 2 name>,<stage> : Start an arcade mugen game between two players";
+    }
+
+    vector<string>::iterator parse(vector<string>::iterator current, vector<string>::iterator end){
+        current++;
+        if (current != end){
+            data.enabled = parseMugenInstant(*current, &data.player1, &data.player2, &data.stage);
+            data.kind = MugenInstant::Arcade;
+        } else {
+            Global::debug(0) << "Expected an argument. Example: mugen:arcade kfm,ken,falls" << endl;
+        }
+
         return current;
     }
 };
@@ -226,10 +390,10 @@
 static const char * NETWORK_SERVER_ARG[] = {"server", "network-server"};
 static const char * NETWORK_JOIN_ARG[] = {"network-join"};
 // static const char * MUGEN_ARG[] = {"mugen", "--mugen"};
-static const char * MUGEN_INSTANT_ARG[] = {"mugen:training"};
-static const char * MUGEN_INSTANT_WATCH_ARG[] = {"mugen:watch"};
-static const char * MUGEN_INSTANT_SCRIPT_ARG[] = {"mugen:script"};
-static const char * MUGEN_INSTANT_ARCADE_ARG[] = {"mugen:arcade"};
+// static const char * MUGEN_INSTANT_ARG[] = {"mugen:training"};
+// static const char * MUGEN_INSTANT_WATCH_ARG[] = {"mugen:watch"};
+// static const char * MUGEN_INSTANT_SCRIPT_ARG[] = {"mugen:script"};
+// static const char * MUGEN_INSTANT_ARCADE_ARG[] = {"mugen:arcade"};
 // static const char * JOYSTICK_ARG[] = {"joystick", "nojoystick", "no-joystick"};
 static const char * DISABLE_QUIT_ARG[] = {"disable-quit"};
 // static const char * RATE_LIMIT_ARG[] = {"fps", "rate-limit"};
@@ -292,10 +456,18 @@
     Global::debug(0) << " " << Util::join(music.keywords(), ", ") << music.description() << endl;
     MugenArgument mugen;
     Global::debug(0) << " " << Util::join(mugen.keywords(), ", ") << mugen.description() << endl;
-    Global::debug(0) << " " << all(MUGEN_INSTANT_ARG, NUM_ARGS(MUGEN_INSTANT_ARG)) << " <player 1 name>,<player 2 name>,<stage> : Start training game with the specified players and stage" << endl;
-    Global::debug(0) << " " << all(MUGEN_INSTANT_WATCH_ARG, NUM_ARGS(MUGEN_INSTANT_WATCH_ARG)) << " <player 1 name>,<player 2 name>,<stage> : Start watch game with the specified players and stage" << endl;
-    Global::debug(0) << " " << all(MUGEN_INSTANT_SCRIPT_ARG, NUM_ARGS(MUGEN_INSTANT_SCRIPT_ARG)) << " <player 1 name>:<player 1 script>,<player 2 name>:<player 2 script>,<stage> : Start a scripted mugen game where each player reads its input from the specified scripts" << endl;
-    Global::debug(0) << " " << all(MUGEN_INSTANT_ARCADE_ARG, NUM_ARGS(MUGEN_INSTANT_ARCADE_ARG)) << " <player 1 name>,<player 2 name>,<stage> : Start an arcade mugen game between two players" << endl;
+    MugenTrainingArgument mugenTraining;
+    Global::debug(0) << " " << Util::join(mugenTraining.keywords(), ", ") << mugenTraining.description() << endl;
+
+    MugenWatchArgument mugenWatch;
+    Global::debug(0) << " " << Util::join(mugenWatch.keywords(), ", ") << mugenWatch.description() << endl;
+
+    MugenScriptArgument mugenScript;
+    Global::debug(0) << " " << Util::join(mugenScript.keywords(), ", ") << mugenScript.description() << endl;
+
+    MugenArcadeArgument mugenArcade;
+    Global::debug(0) << " " << Util::join(mugenArcade.keywords(), ", ") << mugenArcade.description() << endl;
+
     JoystickArgument joystick;
     Global::debug(0) << " " << Util::join(joystick.keywords(), ", ") << joystick.description() << endl;
     Global::debug(0) << " " << all(DISABLE_QUIT_ARG, NUM_ARGS(DISABLE_QUIT_ARG)) << " : Don't allow the game to exit using the normal methods" << endl;
@@ -349,27 +521,7 @@
 }
 */

-static bool parseMugenInstant(string input, string * player1, string * player2, string * stage){
-    unsigned int comma = input.find(',');
-    if (comma == string::npos){
-        Global::debug(0) << "Expected three arguments separated by a comma, only 1 was given: " << input << endl;
-        return false;
-    }
-    *player1 = input.substr(0, comma);
-    input.erase(0, comma + 1);
-    comma = input.find(',');
-
-    if (comma == string::npos){
-        Global::debug(0) << "Expected three arguments separated by a comma, only 2 were given: " << input << endl;
-        return false;
-    }
-
-    *player2 = input.substr(0, comma);
-    input.erase(0, comma + 1);
-    *stage = input;
-
-    return true;
-}
+

 static void runMugenTraining(const string & player1, const string & player2, const string & stage){
     Global::debug(0) << "Mugen training mode player1 '" << player1 << "' player2 '" << player2 << "' stage '" << stage << "'" << endl;
@@ -468,29 +620,6 @@
     string name;
     string host;
     string port;
-};
-
-struct MugenInstant{
-    enum Kind{
-        None,
-        Training,
-        Watch,
-        Arcade,
-        Script
-    };
-
-    MugenInstant():
-        enabled(false),
-        kind(None){
-        }
-
-    bool enabled;
-    string player1;
-    string player2;
-    string player1Script;
-    string player2Script;
-    string stage;
-    Kind kind;
 };

 /* dispatch to the top level function */
@@ -590,13 +719,7 @@
     return 0;
 }

-static void splitString(const string & subject, char split, string & left, string & right){
-    size_t find = subject.find(split);
-    if (find != string::npos){
-        left = subject.substr(0, find);
-        right = subject.substr(find + 1);
-    }
-}
+

 /* 1. parse arguments
  * 2. initialize environment
@@ -627,10 +750,10 @@
     // ADD_ARGS(DEBUG_ARG);
     // ADD_ARGS(MUSIC_ARG);
     // ADD_ARGS(MUGEN_ARG);
-    ADD_ARGS(MUGEN_INSTANT_ARG);
-    ADD_ARGS(MUGEN_INSTANT_WATCH_ARG);
-    ADD_ARGS(MUGEN_INSTANT_SCRIPT_ARG);
-    ADD_ARGS(MUGEN_INSTANT_ARCADE_ARG);
+    // ADD_ARGS(MUGEN_INSTANT_ARG);
+    // ADD_ARGS(MUGEN_INSTANT_WATCH_ARG);
+    // ADD_ARGS(MUGEN_INSTANT_SCRIPT_ARG);
+    // ADD_ARGS(MUGEN_INSTANT_ARCADE_ARG);
     // ADD_ARGS(RATE_LIMIT_ARG);
 #ifdef HAVE_NETWORKING
     ADD_ARGS(NETWORK_SERVER_ARG);
@@ -662,6 +785,10 @@
     RateLimitArgument rateLimit;
     JoystickArgument joystick;
     MugenArgument mugenArgument;
+    MugenTrainingArgument mugenTrainingArgument;
+    MugenScriptArgument mugenScriptArgument;
+    MugenWatchArgument mugenWatchArgument;
+    MugenArcadeArgument mugenArcadeArgument;

     /* don't use the Configuration class here because its not loaded until init()
      * is called.
@@ -679,51 +806,20 @@
             joystick_on = false;
         } else if (rateLimit.isArg(*it)){
             Global::rateLimit = false;
-        } else if (isArg(*it, MUGEN_INSTANT_ARG, NUM_ARGS(MUGEN_INSTANT_ARG))){
-            it++;
-            if (it != stringArgs.end()){
-                mugenInstant.enabled = parseMugenInstant(*it, &mugenInstant.player1, &mugenInstant.player2, &mugenInstant.stage);
-                mugenInstant.kind = MugenInstant::Training;
-            } else {
-                Global::debug(0) << "Expected an argument. Example: mugen:training kfm,ken,falls" << endl;
-            }
+        } else if (mugenTrainingArgument.isArg(*it)){
+            it = mugenTrainingArgument.parse(it, stringArgs.end());
+            mugenInstant = mugenTrainingArgument.data;
         } else if (isArg(*it, DISABLE_QUIT_ARG, NUM_ARGS(DISABLE_QUIT_ARG))){
             allow_quit = false;
-        } else if (isArg(*it, MUGEN_INSTANT_SCRIPT_ARG, NUM_ARGS(MUGEN_INSTANT_SCRIPT_ARG))){
-            it++;
-            if (it != stringArgs.end()){
-                mugenInstant.enabled = parseMugenInstant(*it, &mugenInstant.player1, &mugenInstant.player2, &mugenInstant.stage);
-                string player, script;
-                splitString(mugenInstant.player1, ':', player, script);
-                mugenInstant.player1 = player;
-                mugenInstant.player1Script = script;
-
-                splitString(mugenInstant.player2, ':', player, script);
-                mugenInstant.player2 = player;
-                mugenInstant.player2Script = script;
-
-                mugenInstant.kind = MugenInstant::Script;
-            } else {
-                Global::debug(0) << "Expected an argument. Example: mugen:script kfm:kfm-script.txt,ken:ken-script.txt,falls" << endl;
-            }
-        } else if (isArg(*it, MUGEN_INSTANT_WATCH_ARG, NUM_ARGS(MUGEN_INSTANT_WATCH_ARG))){
-            it++;
-            if (it != stringArgs.end()){
-                mugenInstant.enabled = parseMugenInstant(*it, &mugenInstant.player1, &mugenInstant.player2, &mugenInstant.stage);
-                mugenInstant.kind = MugenInstant::Watch;
-            } else {
-                Global::debug(0) << "Expected an argument. Example: mugen:watch kfm,ken,falls" << endl;
-            }
-
-        } else if (isArg(*it, MUGEN_INSTANT_ARCADE_ARG, NUM_ARGS(MUGEN_INSTANT_ARCADE_ARG))){
-            it++;
-            if (it != stringArgs.end()){
-                mugenInstant.enabled = parseMugenInstant(*it, &mugenInstant.player1, &mugenInstant.player2, &mugenInstant.stage);
-                mugenInstant.kind = MugenInstant::Arcade;
-            } else {
-                Global::debug(0) << "Expected an argument. Example: mugen:arcade kfm,ken,falls" << endl;
-            }
-
+        } else if (mugenScriptArgument.isArg(*it)){
+            it = mugenScriptArgument.parse(it, stringArgs.end());
+            mugenInstant = mugenScriptArgument.data;
+        } else if (mugenWatchArgument.isArg(*it)){
+            it = mugenWatchArgument.parse(it, stringArgs.end());
+            mugenInstant = mugenWatchArgument.data;
+        } else if (mugenArcadeArgument.isArg(*it)){
+            it = mugenArcadeArgument.parse(it, stringArgs.end());
+            mugenInstant = mugenArcadeArgument.data;
         } else if (debug.isArg(*it)){
             it = debug.parse(it, stringArgs.end());


Oops! we still need to create a Document::Ptr for the `unresolved' files.

--- src/plugins/cpptools/cppmodelmanager.cpp
+++ src/plugins/cpptools/cppmodelmanager.cpp
@@ -456,7 +456,6 @@
             m_currentDoc->addDiagnosticMessage(d);

             //qWarning() << "file not found:" << fileName << m_currentDoc->fileName() << env.current_line;
-            return;
         }
     }


debugger: change default value for 'break on qFatal' to 'false'

Change-Id: Ief1879c1e8009d1a60575180d4132d8f03a88b08
Reviewed-on: http://codereview.qt.nokia.com/2690
Reviewed-by: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>
Reviewed-by: Eike Ziller <c142da16c73a95a82d35191bcc55b22835617128@nokia.com>

--- src/plugins/debugger/debuggeractions.cpp
+++ src/plugins/debugger/debuggeractions.cpp
@@ -332,8 +332,8 @@
     item = new SavedAction(this);
     item->setText(tr("Break on \"qFatal\""));
     item->setCheckable(true);
-    item->setDefaultValue(true);
-    item->setValue(true);
+    item->setDefaultValue(false);
+    item->setValue(false);
     item->setSettingsKey(debugModeGroup, QLatin1String("BreakOnFatal"));
     insertItem(BreakOnFatal, item);


Debugger: Weaken abi check for attaching to local process

Given that we don't detect all aspects of the tool chain under all
circumstances, an '==' is too strong.

Change-Id: I1c07d58d824e765f9d89fb7dd3007ca716997ee0
Reviewed-by: Tobias Hunger <012f8d714267bccc9d4766fbeace9f175fcc70c4@digia.com>

--- src/plugins/debugger/debuggerdialogs.cpp
+++ src/plugins/debugger/debuggerdialogs.cpp
@@ -117,7 +117,7 @@
         return false;
     if (m_mode == LocalDebugging) {
         const ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k);
-        return tc && tc->targetAbi().os() == m_hostAbi.os();
+        return tc && tc->targetAbi().isCompatibleWith(m_hostAbi);
     }
     return true;
 }


fts-lucene: Don't crash when trying to search an unsearchable word.

--- src/plugins/fts-lucene/lucene-wrapper.cc
+++ src/plugins/fts-lucene/lucene-wrapper.cc
@@ -582,9 +582,15 @@
 		Query *q1 = lucene_get_query(index, _T("hdr"), arg);
 		Query *q2 = lucene_get_query(index, _T("body"), arg);

-		bq->add(q1, true, BooleanClause::SHOULD);
-		bq->add(q2, true, BooleanClause::SHOULD);
-		q = bq;
+		if (q1 == NULL && q2 == NULL)
+			q = NULL;
+		else {
+			if (q1 != NULL)
+				bq->add(q1, true, BooleanClause::SHOULD);
+			if (q2 != NULL)
+				bq->add(q2, true, BooleanClause::SHOULD);
+			q = bq;
+		}
 		break;
 	}
 	case SEARCH_BODY:
@@ -595,6 +601,10 @@
 	case SEARCH_HEADER_COMPRESS_LWSP:
 		if (!fts_header_want_indexed(arg->hdr_field_name))
 			return false;
+		if (*arg->value.str == '\0') {
+			/* FIXME: handle existence of a search key */
+			return false;
+		}

 		q = lucene_get_query(index,
 				     t_lucene_utf8_to_tchar(arg->hdr_field_name),
@@ -604,6 +614,11 @@
 		return false;
 	}

+	if (q == NULL) {
+		/* couldn't handle this search after all (e.g. trying to search
+		   a stop word) */
+		return false;
+	}
 	if (!and_args)
 		query.add(q, true, BooleanClause::SHOULD);
 	else if (!arg->match_not)