Fixed conflicts

Fixed conflicts

--- src/air_guitarApp.cpp
+++ src/air_guitarApp.cpp
@@ -1,6 +1,5 @@
 // Includes
 #include <Windows.h>
-#include "NuiApi.h"
 #include "cinder/app/AppBasic.h"
 #include "cinder/Camera.h"
 #include "cinder/gl/Texture.h"
@@ -10,11 +9,15 @@
 #include "cinder/Utilities.h"
 #include "cinder/gl/gl.h"
 #include "cinder/Text.h"
+#include "NuiApi.h"
 #include "moduleCapture.h"
 #include "moduleProcessing.h"
 #include "modulePresentation.h"
-
-
+#include "ciUI.h"
+/*
+* This application demonstrates how to acquire and display
+* skeleton data.
+*/
 class AirGuitarApp : public ci::app::AppBasic
 {

@@ -23,10 +26,11 @@
 	// Cinder callbacks
 	void	draw();
 	void	keyDown( ci::app::KeyEvent event );
-	void	prepareSettings( ci::app::AppBasic::Settings *settings );
+//	void	prepareSettings( ci::app::AppBasic::Settings *settings );
 	void	setup();
 	void	shutdown();
 	void	update();
+	void	guiEvent(ciUIEvent *event);

 	moduleCapture capture;

@@ -34,14 +38,20 @@
 	modulePresentation mPresentation;
 	moduleProcessing mProcessing;
 	HandsHip *handsHip;
-
-	ci::gl::TextureFontRef mFont;
+	float guiWidth;
+    float guiHeight;
+    float dim;
+    float length;
 	ci::gl::Texture *backgroundTex;
 	ci::gl::Texture guitar;
 	std::string mText;
 	point chordHandPos;
 	point playHandPos;
-	point HipPos;
+	point HipPos;
+    ColorA backgroundColor;
+    ciUICanvas *gui;
+	int instrument;
+	bool rightHanded;
 };

 // Imports
@@ -52,17 +62,21 @@
 // Render
 void AirGuitarApp::draw()
 {
-	ci::gl::clear();
+	ci::gl::clear(backgroundColor);
+
 	if(backgroundTex != NULL){
 		gl::draw(*backgroundTex, getWindowBounds());
 	}
-	mFont->drawString(mText, cinder::Rectf(0,0,800,200));
 	if(handsHip != NULL){
 		mPresentation.drawGuitar(guitar, HipPos, chordHandPos);
 		ci::gl::drawSolidCircle( Vec2f( chordHandPos.x, chordHandPos.y), 10);
 		ci::gl::drawSolidCircle( Vec2f( playHandPos.x, playHandPos.y), 10);
 		ci::gl::drawSolidCircle( Vec2f( HipPos.x, HipPos.y), 10);
 	}
+	 gl::enableAlphaBlending();
+	 gui->draw();
+	 gl::disableAlphaBlending();
+//	mFont->drawString(mText, cinder::Rectf(0,0,800,200));
 }

 // Handles key press
@@ -77,27 +91,87 @@
 	case KeyEvent::KEY_f:
 		setFullScreen( !isFullScreen() );
 		break;
+	case KeyEvent::KEY_SPACE:
+		/*if(mText == "hejsan"){
+			mText = "apfan";
+		} else {
+			mText = "hejsan";
+		}*/
+		break;
 	}
 }

 // Prepare window
-void AirGuitarApp::prepareSettings( Settings *settings )
+/*void AirGuitarApp::prepareSettings( Settings *settings )
 {
         settings->setWindowSize( 800, 600 );
         settings->setFrameRate( 60.0f );
-}
+}*/

 // Set up
 void AirGuitarApp::setup(){
-	mFont = ci::gl::TextureFont::create(Font("Arial Black", 40));
-	mText = "durr";
+	backgroundTex = NULL;
+
+    backgroundColor = ColorA(233.0/255.0, 52.0/255.0, 27.0/255.0);
+    guiWidth = getWindowWidth()*.4;
+    guiHeight= getWindowHeight()*.75;
+    dim = guiWidth*.0625;
+    length = guiWidth-CI_UI_GLOBAL_WIDGET_SPACING*2;
+
+	rightHanded = true;
+
+	vector<string> instruments;
+	instruments.push_back("Electric Guitar");
+	instruments.push_back("Bass");
+
+
+	vector<string> handedness;
+	handedness.push_back("Right");
+	handedness.push_back("Left");
+
+
+    gui = new ciUICanvas(10,10,guiWidth, guiHeight);
+	gui->addWidgetDown(new ciUILabel(0,25, "AIRGUITAR", CI_UI_FONT_MEDIUM));
+	gui->addWidgetDown(new ciUISlider(length - CI_UI_GLOBAL_WIDGET_SPACING, dim, 0.0, 1.0, 1.0, "Volume"));
+	gui->addWidgetDown(new ciUIRadio(20.0,20.0,"Instrument",instruments,0));
+	((ciUIRadio *) gui->getWidget("Instrument"))->activateToggle("Electric Guitar");
+	gui->addWidgetDown(new ciUIRadio(20.0,20.0,"Handedness",handedness,0));
+	((ciUIRadio *) gui->getWidget("Handedness"))->activateToggle("Right");
+
+    gui->registerUIEvents(this, &AirGuitarApp::guiEvent);
+
 	capture = moduleCapture();
-	backgroundTex = NULL;
 	mPresentation.setSounds(0);
 	guitar = loadImage(getAssetPath("electric/image/electric_right.png"));
 	OutputDebugStringW(L"In setup end\n");
 }

+void AirGuitarApp::guiEvent(ciUIEvent *event){
+	string name = event->widget->getName();
+
+	if(name == "Volume")
+	{
+		ciUISlider *slider = (ciUISlider *) event->widget;
+		mPresentation.globalVolume = slider->getScaledValue();
+	}
+	if(name == "Electric Guitar")
+	{
+		mPresentation.setSounds(0);
+	}
+	if(name == "Bass")
+	{
+		mPresentation.setSounds(1);
+	}
+	if(name == "Right")
+	{
+		rightHanded = true;
+	}
+	if(name == "Left")
+	{
+		rightHanded = false;
+	}
+}
+
 // Called on exit
 void AirGuitarApp::shutdown()
 {
@@ -106,20 +180,24 @@
 // Runs update logic
 void AirGuitarApp::update()
 {
-	handsHip = capture.formHandsHip(0);
-
+
+	gui->update();
+	handsHip = capture.formHandsHip(0,rightHanded);
 	if(handsHip != NULL){
+		/*mText = std::to_string(handsHip->chordHandPosition.x) + ", " + std::to_string(handsHip->chordHandPosition.y) + ", " + std::to_string(handsHip->chordHandPosition.z);
+		mText += "\n";
+		mText += std::to_string(handsHip->playingHandPosition.x) + ", " + std::to_string(handsHip->playingHandPosition.y) + ", " + std::to_string(handsHip->playingHandPosition.z);
+		mText += "\n";
+		mText += std::to_string(handsHip->hipPosition.x) + ", " + std::to_string(handsHip->hipPosition.y) + ", " + std::to_string(handsHip->hipPosition.z);
+		mText += "\n";*/
 		mProcessing.calculateVolume(handsHip);
 		mProcessing.calculateTone(handsHip);
 		if(mProcessing.playedNote(handsHip)){
 			mPresentation.playNote(mProcessing.tone,mProcessing.volume);
 		}
-		chordHandPos = capture.SkeletonPointToScreen(handsHip->chordHandPosition, ci::app::getWindowHeight(), ci::app::getWindowWidth());
-		playHandPos = capture.SkeletonPointToScreen(handsHip->playingHandPosition, ci::app::getWindowHeight(), ci::app::getWindowWidth());
-		HipPos = capture.SkeletonPointToScreen(handsHip->hipPosition, ci::app::getWindowHeight(), ci::app::getWindowWidth());
-		mText = std::to_string(mProcessing.tone);
+		//mText += std::to_string(mProcessing.tone);
 	} else {
-		mText = "Skeleton not found";
+		//mText = "Skeleton not found";
 	}
 	ci::gl::Texture *tmp = capture.getNextFrame();
 	if (tmp != NULL){


more debugging support for cell properties

--- writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: DomainMapperTableHandler.cxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: os $ $Date: 2007-05-09 13:54:44 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: os $ $Date: 2007-05-21 14:21:17 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -125,7 +125,7 @@

         sal_Int32 nCell = 0;
         pCellProperties[nRow].realloc( aRowOfCellsIterator->size() );
-        beans::PropertyValues* pSingleCellProperties = pCellProperties->getArray();
+        beans::PropertyValues* pSingleCellProperties = pCellProperties[nRow].getArray();
         while( aCellIterator != aCellIteratorEnd )
         {
             //TODO: aCellIterator contains HorizontalBorder and VerticalBorder
@@ -162,9 +162,59 @@
             ++nCell;
             ++aCellIterator;
         }
+#ifdef DEBUG
+//-->debug cell properties
+        {
+            ::rtl::OUString sNames;
+            const uno::Sequence< beans::PropertyValues > aDebugCurrentRow = aCellProperties[nRow];
+            sal_Int32 nDebugCells = aDebugCurrentRow.getLength();
+            (void) nDebugCells;
+            for( sal_Int32  nDebugCell = 0; nDebugCell < nDebugCells; ++nDebugCell)
+            {
+                const uno::Sequence< beans::PropertyValue >& aDebugCellProperties = aDebugCurrentRow[nDebugCell];
+                sal_Int32 nDebugCellProperties = aDebugCellProperties.getLength();
+                for( sal_Int32  nDebugProperty = 0; nDebugProperty < nDebugCellProperties; ++nDebugProperty)
+                {
+                    const ::rtl::OUString sName = aDebugCellProperties[nDebugProperty].Name;
+                    sNames += sName;
+                    sNames += ::rtl::OUString('-');
+                }
+                sNames += ::rtl::OUString(' ');
+            }
+            (void)sNames;
+        }
+//--<
+#endif
         ++nRow;
         ++aRowOfCellsIterator;
     }
+#ifdef DEBUG
+//-->debug cell properties of all rows
+    {
+        ::rtl::OUString sNames;
+        for( sal_Int32  nDebugRow = 0; nDebugRow < aCellProperties.getLength(); ++nDebugRow)
+        {
+            const uno::Sequence< beans::PropertyValues > aDebugCurrentRow = aCellProperties[nDebugRow];
+            sal_Int32 nDebugCells = aDebugCurrentRow.getLength();
+            (void) nDebugCells;
+            for( sal_Int32  nDebugCell = 0; nDebugCell < nDebugCells; ++nDebugCell)
+            {
+                const uno::Sequence< beans::PropertyValue >& aDebugCellProperties = aDebugCurrentRow[nDebugCell];
+                sal_Int32 nDebugCellProperties = aDebugCellProperties.getLength();
+                for( sal_Int32  nDebugProperty = 0; nDebugProperty < nDebugCellProperties; ++nDebugProperty)
+                {
+                    const ::rtl::OUString sName = aDebugCellProperties[nDebugProperty].Name;
+                    sNames += sName;
+                    sNames += ::rtl::OUString('-');
+                }
+                sNames += ::rtl::OUString('+');
+            }
+            sNames += ::rtl::OUString('|');
+        }
+        (void)sNames;
+    }
+//--<
+#endif

     RowPropertyValuesSeq_t      aRowProperties( m_aRowProperties.size() );
     PropertyMapVector1::const_iterator aRowIter = m_aRowProperties.begin();


Make Linux happy.

Make Linux happy.

--- src/analysermodel.cpp
+++ src/analysermodel.cpp
@@ -16,7 +16,7 @@

 #include "libcellml/analysermodel.h"

-#include <vector>
+#include <algorithm>

 #include "libcellml/variable.h"


Bug #439 - dateformat.annotation not considered

- dateformat.annotation were not considered when doing annotation=sparse

--- src/report.cpp
+++ src/report.cpp
@@ -2712,7 +2712,10 @@
         desc = "+" + desc;
       Att anno (annotations.back());
       Date dt (atoi (anno.name ().substr (11).c_str ()));
-      std::string when = dt.toString (context.config.get ("dateformat"));
+      std::string format = context.config.get ("dateformat.annotation");
+      if (format == "")
+        format = context.config.get ("dateformat");
+      std::string when = dt.toString (format);
       desc += "\n" + when + " " + anno.value ();
     }
     else


[axl_test_con] ifdef the code authenticator test


fixup to compile

fixup to compile

--- libzinniajni.cpp
+++ libzinniajni.cpp
@@ -127,7 +127,7 @@
 (JNIEnv *env, jobject jobj, jlong character, jlong id, jint x, jint y)
 {
     zinnia_character_t* p = reinterpret_cast<zinnia_character_t*>(character);
-    zinnia_character_add(p, id, x, y);
+    return zinnia_character_add(p, id, x, y);
 }

 /*
@@ -186,6 +186,8 @@
 JNIEXPORT jint JNICALL Java_org_xdump_android_zinnia_Zinnia_zinnia_1character_1parse
   (JNIEnv *env, jobject jobj, jlong, jstring jstr)
 {
+    /* TODO */
+    return 0;
 }

 /*
@@ -316,6 +318,8 @@
 JNIEXPORT jint JNICALL Java_org_xdump_android_zinnia_Zinnia_zinnia_1recognizer_1open_1from_1ptr
 (JNIEnv *env, jobject jobj, jlong, jstring jstr, jlong jlongv)
 {
+    /* TODO */
+    return 0;
 }

 /*
@@ -464,6 +468,8 @@
 JNIEXPORT jint JNICALL Java_org_xdump_android_zinnia_Zinnia_zinnia_1trainer_1convert_1model
   (JNIEnv *env, jobject jobj, jstring txt_model, jstring binary_mode, jdouble compression_threshold)
 {
+    /* TODO */
+    return 0;
 }

 /*
@@ -474,5 +480,7 @@
 JNIEXPORT jint JNICALL Java_org_xdump_android_zinnia_Zinnia_zinnia_1trainer_1make_1header
 (JNIEnv *env, jobject jobj, jstring txt_model, jstring header_file, jstring name, jdouble compression_threashold)
 {
-}
-
+    /* TODO */
+    return 0;
+}
+


Minor performance improvement

Minor performance improvement

--- grit_core/src/GritObject.c++
+++ grit_core/src/GritObject.c++
@@ -300,7 +300,7 @@
         const float over = streamer.fadeOverlapFactor;

-        float range = ::sqrt(range2);
+        float range = ::sqrtf(range2);

         float fade = 1.0;
         // if near is not activated, farfade will be out of date


fixed missing Optional<T2,TRAITS2>&& CTOR

--- Library/Sources/Stroika/Foundation/Memory/Optional.inl
+++ Library/Sources/Stroika/Foundation/Memory/Optional.inl
@@ -270,13 +270,18 @@
                     this->_fStorage.fValue_ = this->_fStorage.alloc (static_cast<T> (*from._fStorage.peek ()));
                 }
             }
-#if 0
-            template    <typename T, typename TRAITS>
-            constexpr   inline  Optional<T, TRAITS>::Optional (const T& from)
-                : inherited{ from }
-            {
-            }
-#endif
+            template    <typename T, typename TRAITS>
+            template    <typename T2, typename TRAITS2, typename SFINAE_SAFE_CONVERTIBLE>
+            inline  Optional<T, TRAITS>::Optional (Optional<T2, TRAITS2>&& from)
+                : inherited (from ? Optional<T, TRAITS> (move (*from)) : Optional<T, TRAITS> {})
+            {
+            }
+            template    <typename T, typename TRAITS>
+            template    <typename T2, typename TRAITS2, typename SFINAE_UNSAFE_CONVERTIBLE>
+            inline  Optional<T, TRAITS>::Optional (Optional<T2, TRAITS2>&& from, SFINAE_UNSAFE_CONVERTIBLE*)
+                : inherited (from ? Optional<T, TRAITS> (move (*from)) : Optional<T, TRAITS> {})
+            {
+            }
             template    <typename T, typename TRAITS>
             template    <typename U, typename SFINAE_SAFE_CONVERTIBLE>
             inline  Optional<T, TRAITS>::Optional (U&& from)


FIX warning

FIX warning

--- QApplications/MainApp/ChiliPlugin/QmitkEventCollector.cpp
+++ QApplications/MainApp/ChiliPlugin/QmitkEventCollector.cpp
@@ -122,7 +122,7 @@
 }

 bool
-EventCollector::SetObjectValue( QObject* o, QString className, QString value, QString value2 )
+EventCollector::SetObjectValue( QObject* o, QString className, QString value, QString /*value2*/ )
 {

   if (!value.compare("NULL")) return true;
@@ -322,7 +322,7 @@

 QString
-EventCollector::Object2String( QEvent::Type eventid, QObject* o)
+EventCollector::Object2String( QEvent::Type /*eventid*/, QObject* o)
 {
   QStringList objlist;

@@ -521,7 +521,7 @@
     }
   }

-  bool send;
+  bool send = false;
   if(aObject)
   {
     std::cout<<"POST: "<<aObject->className()<<" --> "<< aObject->name()<<std::endl;


Simplified value extraction for bipartite adjacency matrices

Again, this is related to issue #41. Instead of taking into account all
the tokens per line, I am calculating width and height afterwards using
a *single sweep*.

--- include/aleph/topology/io/BipartiteAdjacencyMatrix.hh
+++ include/aleph/topology/io/BipartiteAdjacencyMatrix.hh
@@ -70,50 +70,39 @@
   {
     using Simplex    = typename SimplicialComplex::ValueType;
     using DataType   = typename Simplex::DataType;
-
-    auto position = in.tellg();
-
+    using VertexType = typename Simplex::VertexType;
+
+    auto position      = in.tellg();
     std::size_t height = 0;
-    std::size_t width  = 0;
+
+    // An 'unrolled' version of all edge weights that can be read from
+    // the file. They are supposed to correspond to a matrix with some
+    // number of columns and some number of rows.
+    std::vector<DataType> values;

     using namespace aleph::utilities;

     {
       std::string line;
       while( std::getline( in, line ) )
-      {
-        line           = trim( line );
-        auto numTokens = countTokens( line );
-
-        if( width == 0 )
-          width = numTokens;
-        else if( width != numTokens )
-          throw std::runtime_error( "Format error: number of columns must not vary" );
-
         ++height;
-      }

       in.clear();
       in.seekg( position );
     }

-    _height = height;
-    _width  = width;
-
-    using Simplex    = typename SimplicialComplex::ValueType;
-    using DataType   = typename Simplex::DataType;
-    using VertexType = typename Simplex::VertexType;
-
-    std::vector<DataType> values;
-    values.reserve( _height * _width );
-
     std::copy( std::istream_iterator<DataType>( in ), std::istream_iterator<DataType>(),
                std::back_inserter( values ) );

-    // We cannot fill an empt simplicial complex. It might be useful to
+    // We cannot fill an empty simplicial complex. It might be useful to
     // throw an error here, though.
     if( values.empty() )
       return;
+
+    _height = height;
+    _width  = values.size() / height;
+    if( values.size() % height != 0 )
+      throw std::runtime_error( "Format error: number of columns must not vary" );

     // This is required in order to assign the weight of nodes
     // correctly; we cannot trust the weights to be positive.
@@ -146,7 +135,7 @@
     {
       for( std::size_t x = 0; x < _width; x++ )
       {
-        auto i = static_cast<VertexType>( width * y + x   );
+        auto i = static_cast<VertexType>( _width * y + x   );
         auto w = values.at( i );

         // Map matrix indices to the corresponding vertex indices as


fixed (32bit??) bug on my 32 bit machine in graphicalmodel_hdf5

--- include/opengm/graphicalmodel/graphicalmodel_hdf5.hxx
+++ include/opengm/graphicalmodel/graphicalmodel_hdf5.hxx
@@ -533,7 +533,8 @@
          const opengm::UInt64Type indexInVisVector  = static_cast<opengm::UInt64Type> (gm.factorsVis_.size());

          gm.factors_[i].vis_.assign(gm.factorsVis_,indexInVisVector,order);
-         gm.order_ = std::max( gm.order_,order);
+         gm.order_ = std::max( static_cast<size_t>(gm.order_),
+            static_cast<size_t>(order));

          //gm.factors_[i].order_=static_cast<opengm::UInt64Type> (serializationIndicies[sIndex]);
          //gm.factors_[i].indexInVisVector_=static_cast<opengm::UInt64Type> (gm.factorsVis_.size());


Minor debugging fixups by David B

Minor debugging fixups by David B

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

--- kpilot/kpilot/conduitConfigDialog.cc
+++ kpilot/kpilot/conduitConfigDialog.cc
@@ -321,11 +321,13 @@
 		factory(library);
 	if (!f)
 	{
+#ifdef DEBUG
 		DEBUGKPILOT << fname
 			<< ": No conduit library "
 			<< library
 			<< " found."
 			<< endl;
+#endif
 		warnNoLibrary(p);
 		return;
 	}
@@ -338,9 +340,11 @@

 	if (!o)
 	{
+#ifdef DEBUG
 		DEBUGKPILOT << fname
 			<< ": Can't create object."
 			<< endl;
+#endif

 		KLibLoader::self()->unloadLibrary(
 			library);
@@ -352,9 +356,12 @@

 	if (!d)
 	{
+#ifdef DEBUG
 		DEBUGKPILOT << fname
 			<< ": Can't cast to dialog."
 			<< endl;
+#endif
+
 		delete o;
 		KLibLoader::self()->unloadLibrary(
 			library);
@@ -423,6 +430,9 @@

 // $Log$
+// Revision 1.7  2002/01/26 15:00:11  adridg
+// Dblclick to configure
+//
 // Revision 1.6  2002/01/02 11:42:19  bero
 // Fix build.
 //


Fix GM that was trying to create mip-mapped proxies without checking caps

Bug: skia:
Change-Id: Iafd6a7cc1288b7287bb5d127e542e530647d74d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203387
Commit-Queue: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>
Commit-Queue: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>
Auto-Submit: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>
Reviewed-by: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>

--- gm/texturedomaineffect.cpp
+++ gm/texturedomaineffect.cpp
@@ -86,7 +86,7 @@
                       SkCanvas* canvas, SkString* errorMsg) override {
         GrProxyProvider* proxyProvider = context->priv().proxyProvider();
         sk_sp<GrTextureProxy> proxy;
-        if (fFilter == GrSamplerState::Filter::kMipMap) {
+        if (fFilter == GrSamplerState::Filter::kMipMap && context->priv().caps()->mipMapSupport()) {
             SkBitmap copy;
             SkImageInfo info = fImage->imageInfo().makeColorType(kN32_SkColorType);
             if (!copy.tryAllocPixels(info) || !fImage->readPixels(copy.pixmap(), 0, 0)) {


FIX (SPECULATIVE) MAINT-1340 - Media Volume control broken on Vista+ systems

--- indra/media_plugins/webkit/windows_volume_catcher.cpp
+++ indra/media_plugins/webkit/windows_volume_catcher.cpp
@@ -48,18 +48,37 @@
 	set_volume_func_t mSetVolumeFunc;
 	set_mute_func_t mSetMuteFunc;

+	// tests if running on Vista, 7, 8 + once in CTOR
+	bool isWindowsVistaOrHigher();
+
 	F32 	mVolume;
 	F32 	mPan;
+	bool mSystemIsVistaOrHigher;
 };
+
+bool VolumeCatcherImpl::isWindowsVistaOrHigher()
+{
+	OSVERSIONINFO osvi;
+	ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+	osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+	GetVersionEx(&osvi);
+	return osvi.dwMajorVersion >= 6;
+}
+
 VolumeCatcherImpl::VolumeCatcherImpl()
-:	mVolume(1.0f),	// default volume is max
-	mPan(0.f)		// default pan is centered
+:	mVolume(1.0f),			// default volume is max
+	mPan(0.f)				// default pan is centered
 {
-	HMODULE handle = ::LoadLibrary(L"winmm.dll");
-	if(handle)
+	mSystemIsVistaOrHigher = isWindowsVistaOrHigher();
+
+	if ( mSystemIsVistaOrHigher )
 	{
-		mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
-		mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
+		HMODULE handle = ::LoadLibrary(L"winmm.dll");
+		if(handle)
+		{
+			mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
+			mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
+		}
 	}
 }

@@ -67,18 +86,29 @@
 {
 }

-
 void VolumeCatcherImpl::setVolume(F32 volume)
 {
 	mVolume = volume;

-	if (mSetMuteFunc)
+	if ( mSystemIsVistaOrHigher )
 	{
-		mSetMuteFunc(volume == 0.f);
+		// set both left/right to same volume
+		// TODO: use pan value to set independently
+		DWORD left_channel  = (DWORD)(mVolume * 65535.0f);
+		DWORD right_channel =  (DWORD)(mVolume * 65535.0f);
+		DWORD hw_volume = left_channel << 16 | right_channel;
+		::waveOutSetVolume(NULL, hw_volume);
 	}
-	if (mSetVolumeFunc)
+	else
 	{
-		mSetVolumeFunc(mVolume);
+		if (mSetMuteFunc)
+		{
+			mSetMuteFunc(volume == 0.f);
+		}
+		if (mSetVolumeFunc)
+		{
+			mSetVolumeFunc(mVolume);
+		}
 	}
 }


fix windows build (suppress warning from lexical_cast)

--- indra/viewer_components/updater/llupdateinstaller.cpp
+++ indra/viewer_components/updater/llupdateinstaller.cpp
@@ -22,6 +22,9 @@
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
+
+#pragma warning(disable: 4702)      // disable 'unreachable code' so we can use lexical_cast (really!).
+

 #include "linden_common.h"
 #include <apr_file_io.h>


Replace with getNeighbors

Replace with getNeighbors

Additional premises can be acquired using getNeighbors method from the atomspace API.
This seems a straight forward way of getting additional premises on which a selected
rule can be applied in a forward chaining step.

--- opencog/reasoning/RuleEngine/rule-engine-src/pln/DefaultForwardChainerCB.cc
+++ opencog/reasoning/RuleEngine/rule-engine-src/pln/DefaultForwardChainerCB.cc
@@ -108,24 +108,8 @@

 HandleSeq DefaultForwardChainerCB::choose_input(FCMemory& fcmem) {
 	Handle htarget = fcmem.get_cur_target();
-	HandleSeq inputs;
-	if (NodeCast(htarget)) {
-		inputs = as_->getIncoming(htarget);
-	}
-	if (LinkCast(htarget)) {
-		map<Handle, string> hnode_vname_map = choose_variable(htarget);
-		Handle implicant = target_to_pmimplicant(htarget, hnode_vname_map);
-		PLNCommons pc(as_);
-		Handle bindLink = pc.create_bindLink(implicant);
-		//find inputs by pattern matching with custom callback fcim_
-		PatternMatch pm;
-		try {
-			pm.do_bindlink(bindLink, *fcim_);
-		} catch (InvalidParamException& e) {
-			cout << "VALIDATION FAILED:" << endl << e.what() << endl;
-		}
-		inputs = fcim_->get_input_matches();
-	}
+	//get everything associated with the target handle
+	HandleSeq inputs = as_->getNeighbors(htarget,true,true,LINK,true);
 	return inputs;
 }


Adjusted a comment

Adjusted a comment

--- linalg/hypre.cpp
+++ linalg/hypre.cpp
@@ -945,8 +945,8 @@

    if ( M() == N() )
    {
-      /* If the matrix is square make sure that the first entry in each
-      row is the diagonal one. */
+      /* If the matrix is square, make sure that the first entry in each
+         row is the diagonal one. */
       hypre_CSRMatrixReorder(hypre_ParCSRMatrixDiag(At));
    }


Corrected test names

Corrected test names

--- test/complex_reduction.cpp
+++ test/complex_reduction.cpp
@@ -143,7 +143,7 @@
       }                                                                 \
     }                                                                   \
   }                                                                     \
-  TEST(TensorTest, func ## Test) {                                      \
+  TEST(ComplexTest, func ## Test) {                                     \
     func ## Test< DoubleComplexTensor >();                              \
     func ## Test< FloatComplexTensor >();                               \
   }


Add "GL_NV_ray_tracing" extension to output when ray tracing execution model is found

--- spirv_glsl.cpp
+++ spirv_glsl.cpp
@@ -408,6 +408,17 @@
 			require_extension_internal("GL_EXT_tessellation_shader");
 		if (!options.es && options.version < 400)
 			require_extension_internal("GL_ARB_tessellation_shader");
+		break;
+
+	case ExecutionModelRayGenerationNV:
+	case ExecutionModelIntersectionNV:
+	case ExecutionModelAnyHitNV:
+	case ExecutionModelClosestHitNV:
+	case ExecutionModelMissNV:
+	case ExecutionModelCallableNV:
+		if (options.es || options.version < 460)
+			SPIRV_CROSS_THROW("Ray tracing shaders require non-es profile with version 460 or above.");
+		require_extension("GL_NV_ray_tracing");
 		break;

 	default:


changed back deref on color sweep after bugfixing, switched python exposed consume_sequence_and_tag_with_colors to use new color allocation function

--- python/_khmermodule.cc
+++ python/_khmermodule.cc
@@ -3889,10 +3889,11 @@
   }

   unsigned long long n_consumed = 0;
-  khmer::Color * the_color = new Color(c);
+  khmer::Color * the_color = hb->check_and_allocate_color(c);

   try {
   //if (hb->check_and_normalize_read(seq)) {
+
     hb->consume_sequence_and_tag_with_colors(seq, n_consumed, *the_color);
   //}
   } catch (_khmer_signal &e) {
@@ -3946,7 +3947,7 @@
   khmer::ColorPtrSet::const_iterator si;
   unsigned long long i = 0;
   for (si=found_colors.begin(); si!=found_colors.end(); ++si) {
-    PyList_SET_ITEM(x, i, Py_BuildValue("K", *si));
+    PyList_SET_ITEM(x, i, Py_BuildValue("K", *(*si)));
     i++;
   }


Changed keywords to const static unordered_set and indented the keywords


Fail path rendering gracefully when vb/ib space alloc fails

Review URL: http://codereview.appspot.com/4839050/

--- gpu/src/GrPathRenderer.cpp
+++ gpu/src/GrPathRenderer.cpp
@@ -233,6 +233,9 @@
 void GrDefaultPathRenderer::pathWillClear() {
     fSubpathVertCount.realloc(0);
     fTarget->resetVertexSource();
+    if (fUseIndexedDraw) {
+        fTarget->resetIndexSource();
+    }
     fPreviousSrcTol = -GR_Scalar1;
     fPreviousStages = -1;
 }
@@ -268,9 +271,6 @@
         return false;
     }

-    fPreviousSrcTol = srcSpaceTol;
-    fPreviousStages = stages;
-
     GrVertexLayout layout = 0;
     for (int s = 0; s < GrDrawTarget::kNumStages; ++s) {
         if ((1 << s) & stages) {
@@ -298,14 +298,21 @@
     }

     GrPoint* base;
-    fTarget->reserveVertexSpace(layout, maxPts, (void**)&base);
+    if (!fTarget->reserveVertexSpace(layout, maxPts, (void**)&base)) {
+        return false;
+    }
+    GrAssert(NULL != base);
     GrPoint* vert = base;

     uint16_t* idxBase = NULL;
     uint16_t* idx = NULL;
     uint16_t subpathIdxStart = 0;
     if (fUseIndexedDraw) {
-        fTarget->reserveIndexSpace(maxIdxs, (void**)&idxBase);
+        if (!fTarget->reserveIndexSpace(maxIdxs, (void**)&idxBase)) {
+            fTarget->resetVertexSource();
+            return false;
+        }
+        GrAssert(NULL != idxBase);
         idx = idxBase;
     }

@@ -393,6 +400,11 @@
         }
     }
     }
+    // set these at the end so if we failed on first drawPath inside a
+    // setPath/clearPath block we won't assume geom was created on a subsequent
+    // drawPath in the same block.
+    fPreviousSrcTol = srcSpaceTol;
+    fPreviousStages = stages;
     return true;
 }


- Doc improvements

- Doc improvements

--- graf2d/graf/src/TGaxis.cxx
+++ graf2d/graf/src/TGaxis.cxx
@@ -66,6 +66,7 @@
 - [Labels' position on tick marks](#GA08)
 - [Labels' format](#GA09)
 - [Alphanumeric labels](#GA10)
+- [Changing axis labels](#GA10a)
 - [Number of divisions optimisation](#GA11)
 - [Maximum Number of Digits for the axis labels](#GA12)
 - [Optional grid](#GA13)
@@ -317,6 +318,29 @@
 Because the alphanumeric labels are usually longer that the numeric labels, their
 size is by default equal to `0.66666 * the_numeric_labels_size`.

+##  Changing axis labels
+\since **ROOT version 6.07/07:**
+
+After an axis has been created, TGaxis::ChangeLabel allows to define new text
+attributes for a given label. A fine tuning of the labels can be done. All the
+attributes can be changed as well as the text label itself.
+
+When plotting an histogram or a graph the labels can be changed like in the
+following example which shows a way to produce \f$\pi\f$-axis
+
+Begin_Macro(source)
+{
+   Double_t pi = TMath::Pi();
+   TF1*   f = new TF1("f","TMath::Cos(x/TMath::Pi())", -pi, pi);
+   TH1*   h = f->GetHistogram();
+   TAxis* a = h->GetXaxis();
+   a->SetNdivisions(-502);
+   a->ChangeLabel(1,-1,-1,-1,-1,-1,"-#pi");
+   a->ChangeLabel(-1,-1,-1,-1,-1,-1,"#pi");
+   f->Draw();
+}
+End_Macro
+
 ##  Number of divisions optimisation

 By default the number of divisions on axis is optimised to show a coherent
@@ -383,7 +407,7 @@
 The `TGaxis` minimum (`wmin`) and maximum (`wmax`) values
 are considered as two time values in seconds.
 The time axis will be spread around the time offset value (set with
-`SetTimeOffset()`). Actually it will go from `TimeOffset+wmin`to
+`SetTimeOffset()`). Actually it will go from `TimeOffset+wmin` to
 `TimeOffset+wmax`

 Usually time axis are created automatically via histograms, but one may also
@@ -841,9 +865,14 @@
          optionText = 1;
          ndiv = fAxis->GetLast()-fAxis->GetFirst()+1;
       }
-      fModLabs = fAxis->GetModifiedLabels();
-      if (fModLabs) fNModLabs = fModLabs->GetSize();
-      else          fNModLabs = 0;
+      TList *ml = fAxis->GetModifiedLabels();
+      if (ml) {
+         fModLabs = ml;
+         fNModLabs = fModLabs->GetSize();
+      } else {
+         fModLabs  = 0;
+         fNModLabs = 0;
+      }
    }
    if (ndiv < 0) {
       Error(where, "Invalid number of divisions: %d",ndiv);
@@ -2255,7 +2284,7 @@
 /// If an attribute should not be changed just give the value
 /// "-1".The following macro gives an example:
 ///
-/// ~~~ {.cpp}
+/// Begin_Macro(source)
 /// {
 ///    c1 = new TCanvas("c1","Examples of Gaxis",10,10,900,500);
 ///    c1->Range(-6,-0.1,6,0.1);
@@ -2272,7 +2301,7 @@
 ///    axis1->ChangeLabel(-2,-1,-1,-1,3,-1,"2nd to last label");
 ///    axis1->Draw();
 /// }
-/// ~~~
+/// End_Macro
 ///
 /// If labnum=0 the list of modified labels is reset.


Improve the TGFileDialog class documentation

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

--- gui/gui/src/TGFileDialog.cxx
+++ gui/gui/src/TGFileDialog.cxx
@@ -101,6 +101,10 @@
 {
    // Create a file selection dialog. Depending on the dlg_type it can be
    // used for opening or saving a file.
+   // About the first two arguments, p is the parent Window, usually the
+   // desktop (root) window, and main is the main (TGMainFrame) application
+   // window (the one opening the dialog), onto which the dialog is
+   // usually centered, and which is waiting for it to close.

    SetCleanup(kDeepCleanup);
    Connect("CloseWindow()", "TGFileDialog", this, "CloseWindow()");


Unbreak the build on Sparc.

Unbreak the build on Sparc.

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

--- lib/Analysis/DataStructure/Local.cpp
+++ lib/Analysis/DataStructure/Local.cpp
@@ -501,6 +501,8 @@
         getValueDest(*CS.getInstruction()).
           mergeWith(getValueDest(**(CS.arg_begin())));
         return;
+        // FIXME: the #undef is a quick fix for compilation on Sparc
+#undef va_end
       case Intrinsic::va_end:
         return;  // noop
       case Intrinsic::memmove:


Small layout adjustment

Small layout adjustment

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

--- gui/gui/src/TRootBrowser.cxx
+++ gui/gui/src/TRootBrowser.cxx
@@ -174,7 +174,7 @@

    fLH0 = new TGLayoutHints(kLHintsNormal);
    fLH1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
-   fLH2 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 1, 3);
+   fLH2 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 1);
    fLH3 = new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX);
    fLH4 = new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX | kLHintsExpandY,2,2,2,2);
    fLH5 = new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX | kLHintsExpandY);


gcc warning fix.

gcc warning fix.

--- spsc/queue.hpp
+++ spsc/queue.hpp
@@ -22,7 +22,7 @@

 // Check Boost version. We need at least 1.55 to run properly.
 #if BOOST_VERSION < 105500
-#error This code has been developed and tested with Boost 1.55. It's not guaranteed to compile and run with earlier Boost versions.
+#error This code has been developed and tested with Boost 1.55. Not guaranteed to compile and run with earlier Boost versions.
 #endif

 namespace xcon


Bugfix setId

Bugfix setId

--- mudObject.cpp
+++ mudObject.cpp
@@ -271,7 +271,7 @@
 }

 const bstring& MudObject::getId() const {
-    return(id);
+    return(id);n
 }

 // Return for Python which doesn't like bstring&


Bug #21072  Duplicate key error in NDB references wrong key: Re-wrote string usage to avoid valgrind warnings

--- sql/handler.cc
+++ sql/handler.cc
@@ -2035,9 +2035,7 @@
   if (key_nr == MAX_KEY)
   {
     /* Key is unknown */
-    str.length(0);
-    str.append(STRING_WITH_LEN(""));
-    key_nr= -1;
+    str.copy("", 0, system_charset_info);
     my_printf_error(ER_DUP_ENTRY, msg,
 		    MYF(0), str.c_ptr(), "*UNKNOWN*");
   }


Add mark algorithm for k-ary nodes.

Add mark algorithm for k-ary nodes.

--- lingo/memory.hpp
+++ lingo/memory.hpp
@@ -161,6 +161,17 @@
 {
   mark_binary(t);
   mark(t->third);
+}
+
+
+// Mark a k-ary node.
+template<typename T>
+inline void
+mark_kary(T const* t)
+{
+  mark_nullary(t);
+  for (auto const* p : *t)
+    mark(p);
 }


Do a separate pass to compute spill weights because doing it inline
with live intervals was missing registers that were used before they
were defined (in the arbitrary order live intervals numbers
instructions).

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

--- lib/CodeGen/LiveIntervalAnalysis.cpp
+++ lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -106,6 +106,33 @@

     computeIntervals();

+    // compute spill weights
+    const LoopInfo& loopInfo = getAnalysis<LoopInfo>();
+
+    for (MbbIndex2MbbMap::iterator
+             it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
+         it != itEnd; ++it) {
+        MachineBasicBlock* mbb = it->second;
+
+        unsigned loopDepth = loopInfo.getLoopDepth(mbb->getBasicBlock());
+
+        for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
+             mi != miEnd; ++mi) {
+            MachineInstr* instr = *mi;
+            for (int i = instr->getNumOperands() - 1; i >= 0; --i) {
+                MachineOperand& mop = instr->getOperand(i);
+
+                if (!mop.isVirtualRegister())
+                    continue;
+
+                unsigned reg = mop.getAllocatedRegNum();
+                Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
+                assert(r2iit != r2iMap_.end());
+                intervals_[r2iit->second].weight += pow(10.0F, loopDepth);
+            }
+        }
+    }
+
     return true;
 }

@@ -255,16 +282,12 @@
 {
     DEBUG(std::cerr << "computing live intervals:\n");

-    const LoopInfo& loopInfo = getAnalysis<LoopInfo>();
-
     for (MbbIndex2MbbMap::iterator
              it = mbbi2mbbMap_.begin(), itEnd = mbbi2mbbMap_.end();
          it != itEnd; ++it) {
         MachineBasicBlock* mbb = it->second;
         DEBUG(std::cerr << "machine basic block: "
               << mbb->getBasicBlock()->getName() << "\n");
-
-        unsigned loopDepth = loopInfo.getLoopDepth(mbb->getBasicBlock());

         for (MachineBasicBlock::iterator mi = mbb->begin(), miEnd = mbb->end();
              mi != miEnd; ++mi) {
@@ -296,12 +319,6 @@
                     else
                         handleVirtualRegisterDef(mbb, mi, reg);
                 }
-
-                // update weights
-                Reg2IntervalMap::iterator r2iit = r2iMap_.find(reg);
-                if (r2iit != r2iMap_.end() &&
-                    reg >= MRegisterInfo::FirstVirtualRegister)
-                    intervals_[r2iit->second].weight += pow(10.0F, loopDepth);
             }
         }
     }


fixed single & and |

fixed single & and |

--- src/rshell.cpp
+++ src/rshell.cpp
@@ -101,12 +101,14 @@

     if(logic == '&' || logic == '|')
     {
-      cmds.push(new_cmd);
+      if(parse[pos + 1] == logic)
+        cmds.push(new_cmd);
       parse.erase(0, pos + 2);
     }
     else if(logic == ';')
     {
-      cmds.push(new_cmd);
+      if(parse[pos + 1] == logic)
+        cmds.push(new_cmd);
       parse.erase(0, pos + 1);
     }
     else


@@optimizer_switch switch from no_xxx to xxx={on|off} syntax: - Fix valgrind warning on attempt to run a "SET optimizer_switch=number" statement.   Need to call c_ptr_safe() as strings returned by non-string items are not    necessarily null-terminated.

--- sql/set_var.cc
+++ sql/set_var.cc
@@ -3990,7 +3990,7 @@
                                optimizer_switch_typelib.count,
                                thd->variables.optimizer_switch,
                                global_system_variables.optimizer_switch,
-                               res->c_ptr(), res->length(), NULL,
+                               res->c_ptr_safe(), res->length(), NULL,
                                &error, &error_len, &not_used);
   if (error_len)
   {


Use interators instead of counters for loops.

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

--- lib/CodeGen/PrologEpilogInserter.cpp
+++ lib/CodeGen/PrologEpilogInserter.cpp
@@ -163,25 +163,27 @@
   FFI->setHasCalls(HasCalls);
   FFI->setMaxCallFrameSize(MaxCallFrameSize);

-  for (unsigned i = 0, e = FrameSDOps.size(); i != e; ++i) {
-    MachineBasicBlock::iterator I = FrameSDOps[i];
-    // If call frames are not being included as part of the stack frame,
-    // and there is no dynamic allocation (therefore referencing frame slots
-    // off sp), leave the pseudo ops alone. We'll eliminate them later.
+  for (std::vector<MachineBasicBlock::iterator>::iterator
+         i = FrameSDOps.begin(), e = FrameSDOps.end(); i != e; ++i) {
+    MachineBasicBlock::iterator I = *i;
+
+    // If call frames are not being included as part of the stack frame, and
+    // there is no dynamic allocation (therefore referencing frame slots off
+    // sp), leave the pseudo ops alone. We'll eliminate them later.
     if (RegInfo->hasReservedCallFrame(Fn) || RegInfo->hasFP(Fn))
       RegInfo->eliminateCallFramePseudoInstr(Fn, *I->getParent(), I);
   }

   // Now figure out which *callee saved* registers are modified by the current
   // function, thus needing to be saved and restored in the prolog/epilog.
-  //
-  const TargetRegisterClass* const *CSRegClasses =
+  const TargetRegisterClass * const *CSRegClasses =
     RegInfo->getCalleeSavedRegClasses(&Fn);
+
   std::vector<CalleeSavedInfo> CSI;
   for (unsigned i = 0; CSRegs[i]; ++i) {
     unsigned Reg = CSRegs[i];
     if (Fn.getRegInfo().isPhysRegUsed(Reg)) {
-        // If the reg is modified, save it!
+      // If the reg is modified, save it!
       CSI.push_back(CalleeSavedInfo(Reg, CSRegClasses[i]));
     } else {
       for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
@@ -203,9 +205,10 @@

   // Now that we know which registers need to be saved and restored, allocate
   // stack slots for them.
-  for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
-    unsigned Reg = CSI[i].getReg();
-    const TargetRegisterClass *RC = CSI[i].getRegClass();
+  for (std::vector<CalleeSavedInfo>::iterator
+         I = CSI.begin(), E = CSI.end(); I != E; ++I) {
+    unsigned Reg = I->getReg();
+    const TargetRegisterClass *RC = I->getRegClass();

     // Check to see if this physreg must be spilled to a particular stack slot
     // on this target.
@@ -215,13 +218,14 @@
       ++FixedSlot;

     int FrameIdx;
-    if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
+    if (FixedSlot == FixedSpillSlots + NumFixedSpillSlots) {
       // Nope, just spill it anywhere convenient.
       unsigned Align = RC->getAlignment();
       unsigned StackAlign = TFI->getStackAlignment();
-      // We may not be able to sastify the desired alignment specification of
-      // the TargetRegisterClass if the stack alignment is smaller.
-      // Use the min.
+
+      // We may not be able to satisfy the desired alignment specification of
+      // the TargetRegisterClass if the stack alignment is smaller. Use the
+      // min.
       Align = std::min(Align, StackAlign);
       FrameIdx = FFI->CreateStackObject(RC->getSize(), Align);
       if ((unsigned)FrameIdx < MinCSFrameIndex) MinCSFrameIndex = FrameIdx;
@@ -230,7 +234,8 @@
       // Spill it to the stack where we must.
       FrameIdx = FFI->CreateFixedObject(RC->getSize(), FixedSlot->second);
     }
-    CSI[i].setFrameIdx(FrameIdx);
+
+    I->setFrameIdx(FrameIdx);
   }

   FFI->setCalleeSavedInfo(CSI);


tweaks

tweaks

--- src/rshell.cpp
+++ src/rshell.cpp
@@ -29,7 +29,7 @@
 }

  void laydapipe(char **x, char **y) {
-
+
           int pfds[2];
           pid_t pid, pid2;
           int status, status2;
@@ -186,32 +186,34 @@
 	string bar = "|";
 	size_t check = x.find(bar);
 	if(check != string::npos) {
-		if(x.at(check+1) != '|') {
+		if(x.at(check+1) != '|') {
 			char *argv[9];
           		char *args[9];
        			vector<string> blast;
           		vector<string> laser;
-          	//string x;
-          	//getline(cin, x);
          	 	int i = 0;
          	 	int k = 0;
-        		  typedef tokenizer< char_separator<char> > tokenizer;
-       		  	 char_separator<char> sep (" ", "~<>>>\"#-;:\'||&&", drop_empty_tokens);
+        		typedef tokenizer< char_separator<char> > tokenizer;
+       		  	char_separator<char> sep (" ", "~<>>>\"#-;:\'||&&", drop_empty_tokens);
         	  	tokenizer tokens(x, sep);
-     		   	  for(tokenizer::iterator tok_iter=tokens.begin(); tok_iter != tokens.end(); ++tok_iter) {
+     		   	for(tokenizer::iterator tok_iter=tokens.begin(); tok_iter != tokens.end(); ++tok_iter) {

- 		                 if(*tok_iter == "|") {
-        	                  ++tok_iter;
-        	        	          while(tok_iter != tokens.end()) {
+ 		                if(*tok_iter == "|") {
+        	                	++tok_iter;
+        	        	        while(tok_iter != tokens.end() && *tok_iter != "|") {

-       		 	                          blast.push_back(*tok_iter);
-       		         	                  args[i] = new char[12];
-       	        	         	          strcpy(args[i], const_cast<char*>(blast[i].c_str()));
-               	       		          	  ++i;
+       		 	                        blast.push_back(*tok_iter);
+       		         	                args[i] = new char[12];
+       	        	         	        strcpy(args[i], const_cast<char*>(blast[i].c_str()));
+               	       		         	++i;
            	       		                ++tok_iter;
-               	        	           continue;
-                		          }
-                	       	   break;
+               	        	        //        continue;
+                		        }
+					//argv[k] = NULL;
+					//args[i] = NULL;
+					//laydapipe(argv, args);
+                	       	 	//continue;
+                	       	 	break;
                 	 	 }

  	           	      laser.push_back(*tok_iter);
@@ -220,10 +222,10 @@
  	           	      ++k;
  	        	 }

-		          argv[k] = NULL;
-	       	 	  args[i] = NULL;
-	       		  laydapipe(argv, args);
-	 		return;
+		         argv[k] = NULL;
+	       	 	 args[i] = NULL;
+	       		 laydapipe(argv, args);
+	 	 	 return;
 		}

 	}
@@ -374,6 +376,7 @@

 		  if(*tok_iter == "0") {
+			++tok_iter;
 			if(*tok_iter == ">") {
 				++tok_iter;
 				if(*tok_iter == ">") {
@@ -518,57 +521,6 @@
 			//tokenizer::iterator coward;
 			if(*tok_iter != "|") {
 			//piping
-			/*
-				char *ant[9];
-				char *spider[9];
-          			vector<string> blast;
-         			vector<string> laser;
-          			int a = 0;
-          			int b = 0;
-          			char_separator<char> sep2 (" ", "~<>>>\"#-;:\'||&&", drop_empty_tokens);
-          			tokenizer tokens2(x, sep2); //here is the issue
-          			for(tokenizer::iterator tok_iter2=tok_iter; tok_iter2 != tokens2.end(); ++tok_iter2) {
-  				//	cerr << *tok_iter2 << endl;
- 			                if(*tok_iter2 == "|") {
-                        	//	cerr << *tok_iter << endl;
-				//	blast.push_back(*tok_iter2);
-				//	cerr << blast[a] << endl;
-				//	spider[a] = new char[12];
-				//	strcpy(spider[a], const_cast<char*>(blast[a].c_str()));
-				//	++a;
-						++tok_iter2;
-						++tok_iter;
-                          	 		while(tok_iter2 != tokens2.end() ) {
-
-                                 			blast.push_back(*tok_iter2);
-                                  			cerr << blast[a] << endl;
-							spider[a] = new char[12];
-                                  			strcpy(spider[a], const_cast<char*>(blast[a].c_str()));
-                                  			++a;
-                                  			++tok_iter2;
-							++tok_iter;
-
-						}	cerr << "got to this point" << endl;
-
-						break;
-					}
-					//cerr << *tok_iter2 << endl;
-                         		//break;
-                 			//tok_iter = tok_iter2;
- 					//break;
-                 			laser.push_back(*tok_iter2);
-                  			ant[b] = new char[12];
-                  			strcpy(ant[b], const_cast<char*>(laser[b].c_str()));
-                  			++b;
-          			}
- 				cerr << "sweg" << endl;
-          			ant[b] = NULL;
-          			spider[a] = NULL;
-         			laydapipe(ant, spider);
-				cerr << "here" << endl;
-				return;
-				//delete **spider;
-				*/
 			}
 			else if(*tok_iter == "|") {
 				++tok_iter;
@@ -656,7 +608,7 @@
 			exit(0);

 		  ++i;
-
+		  //cerr << going << endl;
 	}

 	execvp(argv, i);


display character column instead of byte column in status line

--- src/client_manager.cc
+++ src/client_manager.cc
@@ -200,11 +200,12 @@

 static DisplayLine generate_status_line(const Context& context)
 {
-    BufferCoord cursor = context.editor().main_selection().last().coord();
+    auto pos = context.editor().main_selection().last();
+    auto col = utf8::distance(context.buffer().iterator_at_line_begin(pos), pos);
+
     std::ostringstream oss;
-
     oss << context.buffer().display_name()
-        << " " << (int)cursor.line+1 << "," << (int)cursor.column+1;
+        << " " << (int)pos.line()+1 << "," << (int)col+1;
     if (context.buffer().is_modified())
         oss << " [+]";
     if (context.input_handler().is_recording())


edited sentences such that it can read the last data of each line

--- logreader.cpp
+++ logreader.cpp
@@ -39,10 +39,8 @@
     QString parsedFileLine;
     fileLine = readDataFromFile();
     parsedFileLine = parseData(fileLine);
-    //transmitData(parsedFileLine);
+    transmitData(parsedFileLine);
     qDebug() << parsedFileLine;
-    qDebug() << counter;
-    qDebug() << packetno;
     counter++;
     if (counter==2){
           packetno ++;
@@ -76,9 +74,9 @@
     parsedFileLine.clear();

     foreach (QChar var, fileLine) {
-        if (var != ';'){
+        if ((var != ';')&& (var != '\n')){
             processData.append(var);
-        } else if (var == ';'){
+        } else if ((var == ';')|| (var == '\n')){
             parsingData.append(processData);
             processData.clear();
         }


DON'T make the actual object GarbageCollected - just the wrapper!

--- csv/csv.cpp
+++ csv/csv.cpp
@@ -110,7 +110,7 @@
     return &list;
 }

-class CSV : public GarbageCollected {
+class CSV  {
     int numCols;
     const char **colNames;
     bool noHead;


set_var.cc:   Reorder out-of-order system variables

--- sql/set_var.cc
+++ sql/set_var.cc
@@ -764,12 +764,14 @@
   {"datadir",                 mysql_real_data_home,                 SHOW_CHAR},
   {sys_date_format.name,      (char*) &sys_date_format,		    SHOW_SYS},
   {sys_datetime_format.name,  (char*) &sys_datetime_format,	    SHOW_SYS},
-  {sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
   {sys_default_week_format.name, (char*) &sys_default_week_format,  SHOW_SYS},
   {sys_delay_key_write.name,  (char*) &sys_delay_key_write,         SHOW_SYS},
   {sys_delayed_insert_limit.name, (char*) &sys_delayed_insert_limit,SHOW_SYS},
   {sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS},
   {sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size,     SHOW_SYS},
+  {sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS},
+  {sys_engine_condition_pushdown.name,
+   (char*) &sys_engine_condition_pushdown,                          SHOW_SYS},
   {sys_expire_logs_days.name, (char*) &sys_expire_logs_days,        SHOW_SYS},
   {sys_flush.name,             (char*) &sys_flush,                  SHOW_SYS},
   {sys_flush_time.name,        (char*) &sys_flush_time,             SHOW_SYS},
@@ -805,6 +807,7 @@
   {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG },
   {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG },
   {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL},
+  {sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS},
   {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS},
   {"innodb_data_file_path", (char*) &innobase_data_file_path,	    SHOW_CHAR_PTR},
   {"innodb_data_home_dir",  (char*) &innobase_data_home_dir,	    SHOW_CHAR_PTR},
@@ -827,11 +830,10 @@
   {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS},
   {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG},
   {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG },
+  {sys_innodb_support_xa.name, (char*) &sys_innodb_support_xa, SHOW_SYS},
   {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS},
   {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS},
-  {sys_innodb_support_xa.name, (char*) &sys_innodb_support_xa, SHOW_SYS},
   {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS},
-  {sys_innodb_commit_concurrency.name, (char*) &sys_innodb_commit_concurrency, SHOW_SYS},
   {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS},
 #endif
   {sys_interactive_timeout.name,(char*) &sys_interactive_timeout,   SHOW_SYS},
@@ -845,8 +847,8 @@
                                                                     SHOW_SYS},
   {"language",                language,                             SHOW_CHAR},
   {"large_files_support",     (char*) &opt_large_files,             SHOW_BOOL},
+  {"large_page_size",         (char*) &opt_large_page_size,         SHOW_INT},
   {"large_pages",             (char*) &opt_large_pages,             SHOW_MY_BOOL},
-  {"large_page_size",         (char*) &opt_large_page_size,         SHOW_INT},
   {sys_license.name,	      (char*) &sys_license,                 SHOW_SYS},
   {sys_local_infile.name,     (char*) &sys_local_infile,	    SHOW_SYS},
 #ifdef HAVE_MLOCKALL
@@ -895,8 +897,6 @@
 #ifdef __NT__
   {"named_pipe",	      (char*) &opt_enable_named_pipe,       SHOW_MY_BOOL},
 #endif
-  {sys_engine_condition_pushdown.name,
-   (char*) &sys_engine_condition_pushdown,                          SHOW_SYS},
 #ifdef HAVE_NDBCLUSTER_DB
   {sys_ndb_autoincrement_prefetch_sz.name,
    (char*) &sys_ndb_autoincrement_prefetch_sz,                      SHOW_SYS},


HTTP Client: Implement retrieve_database_view

--- src/server/http_client.cc
+++ src/server/http_client.cc
@@ -1932,7 +1932,77 @@
 {
 	L_CALL("HttpClient::retrieve_database_view()");

-	write_http_response(request, HTTP_STATUS_NOT_IMPLEMENTED);
+	ASSERT(request.path_parser.get_id().empty());
+
+	auto query_field = query_field_maker(request, QUERY_FIELD_VOLATILE);
+	if (endpoints_maker(request, query_field) > 1) {
+		THROW(ClientError, "Method can only be used with single indexes");
+	}
+
+	auto id = std::string(unsharded_path(endpoints[0].path));
+
+	endpoints = XapiandManager::resolve_index_endpoints(
+		Endpoint{".xapiand/index"},
+		false,
+		query_field.primary);
+
+	auto selector = query_field.selector.empty() ? request.path_parser.get_slc() : query_field.selector;
+
+	request.processing = std::chrono::system_clock::now();
+
+	DatabaseHandler db_handler;
+	if (query_field.primary) {
+		db_handler.reset(endpoints, DB_OPEN | DB_WRITABLE);
+	} else {
+		db_handler.reset(endpoints, DB_OPEN);
+	}
+
+	// Retrive document ID
+	Xapian::docid did;
+	did = db_handler.get_docid(id);
+
+	// Retrive document data
+	auto document = db_handler.get_document(did);
+
+	auto obj = document.get_obj();
+
+	// Detailed info about the document:
+	if (obj.find(ID_FIELD_NAME) == obj.end()) {
+		obj[ID_FIELD_NAME] = document.get_value(ID_FIELD_NAME);
+	}
+	auto version = document.get_value(DB_SLOT_VERSION);
+	if (!version.empty()) {
+		obj[RESERVED_VERSION] = static_cast<Xapian::rev>(sortable_unserialise(version));
+	}
+
+	if (request.comments) {
+		obj[RESPONSE_xDOCID] = did;
+
+		size_t n_shards = endpoints.size();
+		size_t shard_num = (did - 1) % n_shards;
+		obj[RESPONSE_xSHARD] = shard_num + 1;
+		// obj[RESPONSE_xENDPOINT] = endpoints[shard_num].to_string();
+	}
+
+	if (!selector.empty()) {
+		obj = obj.select(selector);
+	}
+
+	request.ready = std::chrono::system_clock::now();
+
+	write_http_response(request, HTTP_STATUS_OK, obj);
+
+	auto took = std::chrono::duration_cast<std::chrono::nanoseconds>(request.ready - request.processing).count();
+	L_TIME("Retrieving database took {}", string::from_delta(took));
+
+	Metrics::metrics()
+		.xapiand_operations_summary
+		.Add({
+			{"operation", "retrieve_database"},
+		})
+		.Observe(took / 1e9);
+
+	L_SEARCH("FINISH RETRIEVE DATABASE");
 }

@@ -1967,12 +2037,12 @@
 	write_http_response(request, HTTP_STATUS_CREATED);

 	auto took = std::chrono::duration_cast<std::chrono::nanoseconds>(request.ready - request.processing).count();
-	L_TIME("Touch took {}", string::from_delta(took));
+	L_TIME("Updating database took {}", string::from_delta(took));

 	Metrics::metrics()
 		.xapiand_operations_summary
 		.Add({
-			{"operation", "write_database"},
+			{"operation", "update_database"},
 		})
 		.Observe(took / 1e9);
 }


Turn assert into RUNTIME_ASSERT

Turn assert into RUNTIME_ASSERT

TBR=dcarney@chromium.org
BUG=

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

git-svn-id: f98b9d40cb02301bc76fa9e1b46ee668158567fd@21926 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- src/runtime.cc
+++ src/runtime.cc
@@ -2086,7 +2086,7 @@
   ASSERT(args.length() == 1);
   CONVERT_ARG_HANDLE_CHECKED(HeapObject, object, 0);
   Handle<Map> old_map(object->map());
-  ASSERT(!old_map->is_access_check_needed());
+  RUNTIME_ASSERT(!old_map->is_access_check_needed());
   // Copy map so it won't interfere constructor's initial map.
   Handle<Map> new_map = Map::Copy(old_map);
   new_map->set_is_access_check_needed(true);


Removed stale hello world file.

Removed stale hello world file.

--- hello.cpp
+++ hello.cpp
@@ -1,6 +0,0 @@
-#include "hello.h"
-
-int main()
-{
-  print_hello();
-}


sp_head.cc:   Post-merge fix.

sp_head.cc:
  Post-merge fix.

--- sql/sp_head.cc
+++ sql/sp_head.cc
@@ -958,7 +958,7 @@
     query_cache_send_result_to_client function.
   */
   buf_len= qbuf.length() + thd->db_length + 1 + QUERY_CACHE_FLAGS_SIZE + 1;
-  if ((pbuf= alloc_root(thd->mem_root, buf_len)))
+  if ((pbuf= (char *) alloc_root(thd->mem_root, buf_len)))
   {
     memcpy(pbuf, qbuf.ptr(), qbuf.length());
     pbuf[qbuf.length()]= 0;


namespace: add package name to error message

Also, re-word the error message to make more sense.

Change-Id: I5bf9e735d9fdc54b5d834c47756cd36bb5473a52
Reviewed-by: Ridge Kennedy <c60c433c4c1ae237d133641099200771ff6f6f30@alliedtelesis.co.nz>
Signed-off-by: Matt Bennett <e3d8681cec70d3da741935b3385821001b249adc@alliedtelesis.co.nz>

--- namespace.cpp
+++ namespace.cpp
@@ -110,7 +110,7 @@
 		}

 		if(!found) {
-			throw CustomException("Failed opening Package");
+			throw CustomException("Package not found: " + name);
 		}


normalize color psnr peak to 1

normalize color psnr peak to 1

--- quality/include/pcl/quality/impl/quality_metrics_impl.hpp
+++ quality/include/pcl/quality/impl/quality_metrics_impl.hpp
@@ -114,8 +114,8 @@
 		double mse_colors_yuv[3]  = {0.0,0.0,0.0};

 		// maximum color values needed to compute PSNR
-		double peak_yuv[3] = {0.0,0.0,0.0};
-		double min_yuv[3] = {0.0,0.0,0.0};
+		// double peak_yuv[3] = {0.0,0.0,0.0};
+		// double min_yuv[3] = {0.0,0.0,0.0};

 		//! compute the maximum and mean square distance between each point in a to the nearest point in b
 		//! compute the mean square color error for each point in a to the nearest point in b
@@ -146,14 +146,14 @@
 		  convertRGBtoYUV<PointT>(cloud_b.points[indices[0]],out_yuv);

 		  // calculate the maximum YUV components
-		  for(int cc=0;cc<3;cc++)
-			if((in_yuv[cc] * in_yuv[cc])  > (peak_yuv[cc] * peak_yuv[cc]))
-				peak_yuv[cc] = in_yuv[cc];
+		  //for(int cc=0;cc<3;cc++)
+		  //if((in_yuv[cc] * in_yuv[cc])  > (peak_yuv[cc] * peak_yuv[cc]))
+		  //		peak_yuv[cc] = in_yuv[cc];

 		  // calculate the minimum YUV components
-		  for (int cc = 0; cc<3; cc++)
-			  if ((in_yuv[cc] * in_yuv[cc]) < (min_yuv[cc] * min_yuv[cc]))
-				  min_yuv[cc] = in_yuv[cc];
+		  //for (int cc = 0; cc<3; cc++)
+		  //  if ((in_yuv[cc] * in_yuv[cc]) < (min_yuv[cc] * min_yuv[cc]))
+		  //	  min_yuv[cc] = in_yuv[cc];

 		  mse_colors_yuv[0]+=((in_yuv[0] - out_yuv[0]) * (in_yuv[0] - out_yuv[0]));
 		  mse_colors_yuv[1]+=((in_yuv[1] - out_yuv[1]) * (in_yuv[1] - out_yuv[1]));
@@ -221,12 +221,12 @@

 		// compute PSNR for YUV colors
 		// compute the peak signal also taking into account the
-		for(int cc=0;cc<3;cc++)
-		  peak_yuv[cc] = peak_yuv[cc] - min_yuv[cc];
+		//for(int cc=0;cc<3;cc++)
+		//  peak_yuv[cc] = peak_yuv[cc] - min_yuv[cc];

-		psnr_colors_yuv[0] = 10 * std::log10( (peak_yuv[0] * peak_yuv[0] )/mse_colors_yuv[0]);
-		psnr_colors_yuv[1] = 10 * std::log10( (peak_yuv[1] * peak_yuv[1] )/mse_colors_yuv[1]);
-		psnr_colors_yuv[2] = 10 * std::log10( (peak_yuv[2] * peak_yuv[2] )/mse_colors_yuv[2]);
+		psnr_colors_yuv[0] = 10 * std::log10( 1 /mse_colors_yuv[0]);
+		psnr_colors_yuv[1] = 10 * std::log10( 1 /mse_colors_yuv[1]);
+		psnr_colors_yuv[2] = 10 * std::log10( 1 /mse_colors_yuv[2]);

 		print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms \n");
 		//print_info ("A->B: "); print_value ("%f\n", max_dist_a);


included `stat` function, we now check to make sure the file exists before trying to load it

--- dllmain.cpp
+++ dllmain.cpp
@@ -1,4 +1,5 @@
 #include <windows.h>
+#include <sys/stat.h>

 int APIENTRY DllMain(HMODULE hDLL, DWORD Reason, LPVOID Reserved)
 {
@@ -8,6 +9,7 @@
 		{
 			char ini_path[MAX_PATH] = { 0 };
 			char * temp_path;
+			struct stat buffer;
 			/* get our current path so that we can load stuff from our settings */
 			GetModuleFileNameA(hDLL, ini_path, MAX_PATH);
 			temp_path = strrchr(ini_path, '\\');
@@ -17,7 +19,8 @@
 			GetPrivateProfileStringA("bootstrap", "dll", NULL, bootstrap_dll, MAX_PATH, ini_path);
 			/* at this point we should be in process. we should load our bootstrapped dll here and unload ourselves */
 			if (bootstrap_dll != NULL && bootstrap_dll[0] != NULL)
-				LoadLibraryA(bootstrap_dll);
+				if (stat(bootstrap_dll, &buffer) == 0)
+					LoadLibraryA(bootstrap_dll);
 		}
 		break;
 	case DLL_PROCESS_DETACH:


Merging debug_profile_verify & debug_blake2b_generate

--- rai/rai_node/entry.cpp
+++ rai/rai_node/entry.cpp
@@ -123,7 +123,6 @@
 		("debug_profile_kdf", "Profile kdf function")
 		("debug_verify_profile", "Profile signature verification")
 		("debug_xorshift_profile", "Profile xorshift algorithms")
-		("debug_blake2b_generate", "Blake2b work generation")
 		("platform", boost::program_options::value <std::string> (), "Defines the <platform> for OpenCL commands")
 		("device", boost::program_options::value <std::string> (), "Defines <device> for OpenCL command")
 		("threads", boost::program_options::value <std::string> (), "Defines <threads> count for OpenCL command");
@@ -267,23 +266,6 @@
             block.block_work_set (work.generate (block.root ()));
             auto end1 (std::chrono::high_resolution_clock::now ());
             std::cerr << boost::str (boost::format ("%|1$ 12d|\n") % std::chrono::duration_cast <std::chrono::microseconds> (end1 - begin1).count ());
-        }
-    }
-    else if (vm.count ("debug_blake2b_generate"))
-    {
-		rai::work_pool work (std::numeric_limits <unsigned>::max (), nullptr);
-		rai::change_block block (0, 0, rai::keypair ().prv, 0, 0);
-		for (uint64_t i (0); true; ++i)
-		{
-			block.hashables.previous.qwords [0] += 1;
-			auto begin1 (std::chrono::high_resolution_clock::now ());
-			auto hash (block.hash ());
-			for (uint64_t t (0); t < 1000000; ++t)
-			{
-				work.work_value (hash, t);
-			}
-			auto end1 (std::chrono::high_resolution_clock::now ());
-			std::cerr << boost::str (boost::format ("%|1$ 12d|\n") % std::chrono::duration_cast <std::chrono::microseconds> (end1 - begin1).count ());
         }
     }
     else if (vm.count ("debug_opencl"))
@@ -376,7 +358,12 @@
         {
             block.hashables.previous.qwords [0] += 1;
             auto begin1 (std::chrono::high_resolution_clock::now ());
-            work.work_validate (block);
+            for (uint64_t t (0); t < 1000000; ++t)
+            {
+                block.hashables.previous.qwords [0] += 1;
+                block.block_work_set (t);
+                work.work_validate (block);
+            }
             auto end1 (std::chrono::high_resolution_clock::now ());
             std::cerr << boost::str (boost::format ("%|1$ 12d|\n") % std::chrono::duration_cast <std::chrono::microseconds> (end1 - begin1).count ());
         }


check the input type, reset to default keys if they dont match

--- src/configuration.cpp
+++ src/configuration.cpp
@@ -483,12 +483,15 @@
                     attack2, attack3, jump;
                 right = left = down = up = attack1 = attack2
                       = attack3 = jump = InvalidKey;
+                std::string input = INPUT_TYPE;

                 while ( n->hasTokens() ){
                     Token * thing;
                     *n >> thing;
                     if ( *thing == config_number){
                         *thing >> number;
+                    } else if (*thing == config_input){
+                        *thing >> input;
                     } else if ( *thing == config_left){
                         *thing >> left;
                     } else if ( *thing == config_right){
@@ -511,21 +514,24 @@
                     /* should use config_number here */
                     throw LoadException( string("Config file ") + Filesystem::configFile().path() + " does not specifiy (number #) for a keyboard-configuration" );
                 }
-                Configuration & myconfig = config(number);
-                myconfig.setRight(right);
-                myconfig.setLeft(left);
-                myconfig.setUp(up);
-                myconfig.setDown(down);
-                myconfig.setAttack1(attack1);
-                myconfig.setAttack2(attack2);
-                myconfig.setAttack3(attack3);
-                myconfig.setJump(jump);
+                if (input != INPUT_TYPE){
+                    Configuration & myconfig = config(number);
+                    myconfig.setRight(right);
+                    myconfig.setLeft(left);
+                    myconfig.setUp(up);
+                    myconfig.setDown(down);
+                    myconfig.setAttack1(attack1);
+                    myconfig.setAttack2(attack2);
+                    myconfig.setAttack3(attack3);
+                    myconfig.setJump(jump);
+                }
             } else if ( *n == config_joystick_configuration ){
                 int number = -1;
                 JoystickInput right, left, down, up, attack1,
                     attack2, attack3, jump;
                 right = left = down = up = attack1 = attack2
                       = attack3 = jump = InvalidJoystick;
+                std::string input = INPUT_TYPE;

                 while ( n->hasTokens() ){
                     int temp;
@@ -533,6 +539,8 @@
                     *n >> thing;
                     if ( *thing == config_number){
                         *thing >> number;
+                    } else if (*thing == config_input){
+                        *thing >> input;
                     } else if ( *thing == config_left){
                         *thing >> temp;
                         left = intToJoystick(temp);
@@ -563,15 +571,18 @@
                     /* should use config_number here */
                     throw LoadException( string("Config file ") + Filesystem::configFile().path() + " does not specifiy (number #) for a joystick-configuration" );
                 }
-                Configuration & myconfig = config(number);
-                myconfig.setJoystickRight(right);
-                myconfig.setJoystickLeft(left);
-                myconfig.setJoystickUp(up);
-                myconfig.setJoystickDown(down);
-                myconfig.setJoystickAttack1(attack1);
-                myconfig.setJoystickAttack2(attack2);
-                myconfig.setJoystickAttack3(attack3);
-                myconfig.setJoystickJump(jump);
+
+                if (input != INPUT_TYPE){
+                    Configuration & myconfig = config(number);
+                    myconfig.setJoystickRight(right);
+                    myconfig.setJoystickLeft(left);
+                    myconfig.setJoystickUp(up);
+                    myconfig.setJoystickDown(down);
+                    myconfig.setJoystickAttack1(attack1);
+                    myconfig.setJoystickAttack2(attack2);
+                    myconfig.setJoystickAttack3(attack3);
+                    myconfig.setJoystickJump(jump);
+                }
             } else if ( *n == config_game_speed){
                 *n >> gamespeed;
             } else if ( *n == config_invincible){
@@ -672,13 +683,6 @@

     config->addToken( new Token(config_joystick_configuration, false ) );

-    /*
-    Token * number = new Token();
-    *number << config_number;
-    config->addToken( number );
-    *number << num;
-    */
-
     *config->newToken() << config_number << num;
     *config->newToken() << config_input << INPUT_TYPE;


Random cube coordinate generator fixed. Breed function added.

--- hexon.cpp
+++ hexon.cpp
@@ -217,8 +217,9 @@
     return;
 }

-
 Hexon * breed_hexon(HexItem *A, HexItem *B, cube h)
 {
+    A;
+    B;
     return &Hexon(h);
 }


internal doc; minor chg to getEdgeComplement

--- Child/Code/tMesh/tMesh.cpp
+++ Child/Code/tMesh/tMesh.cpp
@@ -2,7 +2,7 @@
 **
 **  tGrid.cpp: Functions for class tGrid
 **
-**  $Id: tMesh.cpp,v 1.52 1999-01-05 21:53:32 stlancas Exp $
+**  $Id: tMesh.cpp,v 1.53 1999-01-08 22:29:08 gtucker Exp $
 \***************************************************************************/

 #include "tGrid.h"
@@ -2522,7 +2522,7 @@
    //cout << "ExtricateEdge: " << edgePtr->getID() << endl;
    assert( edgePtr != 0 );
      //temporary objects:
-   tEdge *tempedgePtr, *ce, *cce, *spk;
+   tEdge *tempedgePtr=0, *ce, *cce, *spk;
    tGridListIter< tEdge > edgIter( edgeList );
    tPtrListIter< tEdge > spokIter;
    tPtrList< tEdge > *spkLPtr;
@@ -3835,6 +3835,7 @@
 }
 #undef kLargeNumber

+
 template <class tSubNode>
 tGridList<tEdge> * tGrid<tSubNode>::
 getEdgeList() {return &edgeList;}
@@ -3847,21 +3848,37 @@
 tList< tTriangle > * tGrid<tSubNode>::
 getTriList() {return &triList;}

+
+/**************************************************************************\
+**  tGrid::getEdgeComplement
+**
+**  Returns the complement of _edge_ (i.e., the edge that shares the same
+**  endpoints but points in the opposite direction). To find the complement,
+**  it exploits the fact that complementary pairs of edges are stored
+**  together on the edge list, with the first of each pair having an
+**  even-numbered ID and the second having an odd-numbered ID.
+**
+**  Modifications: gt replaced 2nd IF with ELSE to avoid compiler warning
+\**************************************************************************/
 template< class tSubNode >
 tEdge *tGrid< tSubNode >::
 getEdgeComplement( tEdge *edge )
 {
    tGridListIter< tEdge > edgIter( edgeList );
    int edgid = edge->getID();
+
    assert( edgIter.Get( edgid ) );
-   edgIter.Get( edgid );
+   edgIter.Get( edgid ); // TODO: why necessary?
    if( edgid%2 == 0 ) return edgIter.GetP( edgid + 1 );
-   if( edgid%2 == 1 ) return edgIter.GetP( edgid - 1 );
+   else /*if( edgid%2 == 1 )*/ return edgIter.GetP( edgid - 1 );
 }

+
 /**************************************************************************\
-**  UpdateMesh(): Master clean-up routine to update quantities inherent
-**   to mesh data structure.
+**  tGrid::UpdateMesh()
+**
+**  Master clean-up routine to update quantities inherent
+**  to mesh data structure.
 **
 **  Calls: MakeCCWEdges(), setVoronoiVertices(), CalcVoronoiEdgeLengths(),
 **   CalcVAreas(), CheckMeshConsistency()


MDEV-6749 - Deadlock between GRANT/REVOKE, SELECT FROM I_S.COLUMNS,
            SET slow_query_log and failed connection attempt

A very subtle though valid deadlock. Deadlock chain:
wrlock(LOCK_grant)    -> lock(acl_cache->lock) GRANT/REVOKE CREATE/DROP USER
lock(LOCK_open)       -> rdlock(LOCK_grant)    SELECT * FROM I_S.COLUMNS
wrlock(LOCK_logger)   -> lock(LOCK_open)       SET @@global.slow_query_log='ON'
lock(acl_cache->lock) -> rdlock(LOCK_logger)   Failed connection

Fixed by removing relationship between acl_cache->lock and LOCK_logger
during failed connection attempt.

--- sql/sql_acl.cc
+++ sql/sql_acl.cc
@@ -9224,9 +9224,9 @@
                                     mpvio.auth_info.authenticated_as, TRUE);
       if (!acl_proxy_user)
       {
+        mysql_mutex_unlock(&acl_cache->lock);
         if (!thd->is_error())
           login_failed_error(thd);
-        mysql_mutex_unlock(&acl_cache->lock);
         DBUG_RETURN(1);
       }
       acl_user= acl_proxy_user->copy(thd->mem_root);


From S. Ryu:
In TFileCollection::GetFilesPerServer(), when 'curronly' is kTRUE always
use 'break' to exit the internal loop on the available URLs instead of
'continue'. Fix possible infinite loop.

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

--- core/base/src/TFileCollection.cxx
+++ core/base/src/TFileCollection.cxx
@@ -786,11 +786,16 @@
          // Find the key for this server
          key.Form("%s://%s", xurl->GetProtocol(), xurl->GetHostFQDN());
          // Check if this has to be ignored
-         if (excl && excl->FindObject(key.Data())) continue;
-         // Complete the key, if needed, and recheck
-         if (xurl->GetPort() > 0) {
+         if (excl && excl->FindObject(key.Data())) {
+            if (curronly) break;
+            continue;
+         } else if (excl && xurl->GetPort() > 0) {
+            // Complete the key, if needed, and recheck
             key += TString::Format(":%d", xurl->GetPort());
-            if (excl && excl->FindObject(key.Data())) continue;
+            if (excl->FindObject(key.Data())) {
+               if (curronly) break;
+               continue;
+            }
          }
          // Get the map entry for this key
          TPair *ent = 0;


Fix compilation after r22461: removed now unused var

BUG=none
LOG=n
TBR=danno@chromium.org

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

git-svn-id: f98b9d40cb02301bc76fa9e1b46ee668158567fd@22462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- src/runtime.cc
+++ src/runtime.cc
@@ -334,9 +334,6 @@
   isolate->ThrowIllegalOperation();
   return MaybeHandle<Object>();
 }
-
-
-static const int kSmiLiteralMinimumLength = 1024;

 MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate(


Fix of tooltip updating when sidebar is being hidden/shown The tooltip would only update when the toolbar was clicked, not when respective menu item or keyboard shortcut were used

--- src/slic3r/GUI/Plater.cpp
+++ src/slic3r/GUI/Plater.cpp
@@ -1597,7 +1597,7 @@
     void show_view3D_labels(bool show) { if (current_panel == view3D) view3D->get_canvas3d()->show_labels(show); }

     bool is_sidebar_collapsed() const   { return sidebar->is_collapsed(); }
-    void collapse_sidebar(bool show)    { sidebar->collapse(show); }
+    void collapse_sidebar(bool collapse);

     bool is_view3D_layers_editing_enabled() const { return (current_panel == view3D) && view3D->get_canvas3d()->is_layers_editing_enabled(); }

@@ -2128,6 +2128,20 @@
         set_current_panel(view3D);
 }

+void Plater::priv::collapse_sidebar(bool collapse)
+{
+    sidebar->collapse(collapse);
+
+    // Now update the tooltip in the toolbar.
+    std::string new_tooltip = collapse
+                              ? _utf8(L("Expand sidebar"))
+                              : _utf8(L("Collapse sidebar"));
+    new_tooltip += " [Shift+Tab]";
+    int id = collapse_toolbar.get_item_id("collapse_sidebar");
+    collapse_toolbar.set_tooltip(id, new_tooltip);
+}
+
+
 void Plater::priv::reset_all_gizmos()
 {
     view3D->get_canvas3d()->reset_all_gizmos();
@@ -4075,26 +4089,19 @@

     GLToolbarItem::Data item;

-    auto item_tooltip_update = [this, item](bool flip) {
-        std::string new_tooltip = wxGetApp().plater()->is_sidebar_collapsed() ^ flip?
-            _utf8(L("Expand sidebar")) : _utf8(L("Collapse sidebar"));
-        new_tooltip += " [Shift+Tab]";
-        int id = collapse_toolbar.get_item_id("collapse_sidebar");
-        collapse_toolbar.set_tooltip(id, new_tooltip);
-    };
-
     item.name = "collapse_sidebar";
     item.icon_filename = "collapse.svg";
     item.sprite_id = 0;
-    item.left.action_callback = [this, item_tooltip_update]() {
-        item_tooltip_update(true);
+    item.left.action_callback = []() {
         wxGetApp().plater()->collapse_sidebar(!wxGetApp().plater()->is_sidebar_collapsed());
     };

     if (!collapse_toolbar.add_item(item))
         return false;

-    item_tooltip_update(false);
+    // Now "collapse" sidebar to current state. This is done so the tooltip
+    // is updated before the toolbar is first used.
+    wxGetApp().plater()->collapse_sidebar(wxGetApp().plater()->is_sidebar_collapsed());
     return true;
 }


fix typo.

fix typo.

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

--- lib/Parse/ParseExprCXX.cpp
+++ lib/Parse/ParseExprCXX.cpp
@@ -38,7 +38,7 @@
       (Tok.isNot(tok::identifier) || NextToken().isNot(tok::coloncolon)))
     return false;

-  // ::new and ::delete aren'T nested-name-specifiers, so parsing the :: as
+  // ::new and ::delete aren't nested-name-specifiers, so parsing the :: as
   // a scope specifier only makes things more complicated.
   if (Tok.is(tok::coloncolon) && (NextToken().is(tok::kw_new) ||
                                   NextToken().is(tok::kw_delete)))


Support beep and plain char codes

Support beep and plain char codes

svn path=/trunk/kdenetwork/kopete/; revision=218359

--- protocols/irc/ksparser.cpp
+++ protocols/irc/ksparser.cpp
@@ -26,7 +26,7 @@
 #include <qstring.h>
 #include <qcolor.h>
 #include <qregexp.h>
-
+#include <knotifyclient.h>
 #include <kdebug.h>
 #include "ksparser.h"

@@ -44,6 +44,7 @@
 		{
 			case 3:
 			{
+				//Color code
 				if ( message[++i].digitValue() > -1 )
 				{
 					QString tagStyle;
@@ -79,10 +80,24 @@
 				break;
 			}
 			case 2:
+				//Bold
 				res += toggleTag("b");
 				break;
+			case 6:
+				//Invert Colors
+				break;
+			case 7:
+				//System bell
+				KNotifyClient::beep( QString::fromLatin1("IRC beep event recieved in a message") );
+				break;
+
+			case 15:
+				//Plain Text, close all tags
+				res.append( popAll() );
+				break;

 			case 31:
+				//Underline
 				res += toggleTag("u");
 				break;


sql_udf.cc:
  Comment changes: use standard style; fix grammar.

sql/sql_udf.cc:
  Comment changes: use standard style; fix grammar.

--- sql/sql_udf.cc
+++ sql/sql_udf.cc
@@ -17,15 +17,15 @@
 /* This implements 'user defined functions' */

 /*
-** Known bugs:
-**
-** Memory for functions are never freed!
-** Shared libraries are not closed before mysqld exists;
-**   - This is because we can't be sure if some threads is using
-**     a functions.
-**
-** The buggs only affects applications that creates and frees a lot of
-** dynamic functions, so this shouldn't be a real problem.
+   Known bugs:
+
+   Memory for functions is never freed!
+   Shared libraries are not closed before mysqld exits;
+     - This is because we can't be sure if some threads are using
+       a function.
+
+   The bugs only affect applications that create and free a lot of
+   dynamic functions, so this shouldn't be a real problem.
 */

 #ifdef __GNUC__


changed user input game test

changed user input game test

--- src/cpp/game/test.cpp
+++ src/cpp/game/test.cpp
@@ -7,7 +7,7 @@
 void test_print() {
   std::vector<Board> boards = {
     0x6621533332211111ull, 0x8643553333101100ull, 0x9653531032001001ull,
-   0x01231334047814cdull, 0x23212234346935cdull, 0x12231334248916cdull,
+    0x01231334047814cdull, 0x23212234346935cdull, 0x12231334248916cdull,
     0x10022321345a34cdull, 0x11222234148a11cdull, 0x21121667028a20cdull
   };

@@ -18,25 +18,25 @@

 Action user_move(Board board) {
   print_board(board);
-  int move;
-  std::cout << "Please enter 0 (up), 1 (down), 2 (left), or 3 (right): ";
+  char move;
+  std::cout << "Please enter w (up), s (down), a (left), or d (right): ";
   std::cin >> move;
-  std::cout << "You input ";
+  std::cout << "You input: ";
   switch (move) {
-    case 0:
+    case 'w':
       std::cout << "up\n";
       return 0;
-    case 1:
+    case 's':
       std::cout << "down\n";
       return 1;
-    case 2:
+    case 'a':
       std::cout << "left\n";
       return 2;
-    case 3:
+    case 'd':
       std::cout << "right\n";
       return 3;
     default:
-      std::cout << "an invalid character, ending game...\n";
+      std::cout << move << "\nInvalid character, ending game...\n";
       return -1;
   }
 }
@@ -46,6 +46,7 @@
 }

 int main() {
+  test_print();
   test_game();

   return 0;


Add support for creating object via TClass without dict but with library.

This fixes ROOT-5579.
ROOT now supports:

    #include "class1.h"
    .L libclass1nodict.cxx
    TClass::GetClass("class1")->New();

--- core/meta/src/TClingClassInfo.cxx
+++ core/meta/src/TClingClassInfo.cxx
@@ -453,6 +453,19 @@
    return offset;
 }

+static bool HasBody(const clang::FunctionDecl &decl, const cling::Interpreter &interp)
+{
+   if (decl.hasBody()) return true;
+
+   std::string mangledName;
+   interp.maybeMangleDeclName(&decl, mangledName);
+
+   void *GV = interp.getAddressOfGlobal(mangledName.c_str());
+   if (GV) return true;
+
+   return false;
+}
+
 bool TClingClassInfo::HasDefaultConstructor() const
 {
    // Return true if there a constructor taking no arguments (including
@@ -481,13 +494,13 @@
    for (CXXRecordDecl::ctor_iterator I = CRD->ctor_begin(),
          E = CRD->ctor_end(); I != E; ++I) {
       if (I->getMinRequiredArguments() == 0) {
-         if (I->hasBody() && (I->getAccess() == AS_public)) {
+         if ((I->getAccess() == AS_public) && HasBody(**I,*fInterp)) {
             return true;
          }
          if (I->isTemplateInstantiation()) {
             const clang::FunctionDecl* FD =
                I->getInstantiatedFromMemberFunction();
-            if (FD->hasBody() && (FD->getAccess() == AS_public)) {
+            if ((FD->getAccess() == AS_public) && HasBody(*FD,*fInterp)) {
                return true;
             }
          }


[PM] Speculative patch to try and fix MSVC's compilation.

No idea why r262004 triggered this, but just trying to fix somehow.

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

--- lib/Passes/PassBuilder.cpp
+++ lib/Passes/PassBuilder.cpp
@@ -49,6 +49,7 @@
 #include "llvm/Transforms/Scalar/LowerExpectIntrinsic.h"
 #include "llvm/Transforms/Scalar/SROA.h"
 #include "llvm/Transforms/Scalar/SimplifyCFG.h"
+#include <type_traits>

 using namespace llvm;

@@ -261,7 +262,8 @@
 bool PassBuilder::parseAAPassName(AAManager &AA, StringRef Name) {
 #define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS)                             \
   if (Name == NAME) {                                                          \
-    AA.registerFunctionAnalysis<decltype(CREATE_PASS)>();                      \
+    AA.registerFunctionAnalysis<                                               \
+        std::remove_reference<decltype(CREATE_PASS)>::type>();                 \
     return true;                                                               \
   }
 #include "PassRegistry.def"


Change confusing message text

Change confusing message text

--- src/slic3r/GUI/Plater.cpp
+++ src/slic3r/GUI/Plater.cpp
@@ -2348,7 +2348,7 @@
                                 if (object->volumes.size() > 1)
                                 {
                                     Slic3r::GUI::show_info(nullptr,
-                                        _(L("You can't load SLA project if there is at least one multi-part object on the bed")) + "\n\n" +
+                                        _(L("You cannot load SLA project with a multi-part object on the bed")) + "\n\n" +
                                         _(L("Please check your object list before preset changing.")),
                                         _(L("Attention!")));
                                     return obj_idxs;


crypto: Make MuHash Remove method efficient

Summary:
Division of MuHash objects are very expensive and multiplication relatively cheap. The whole idea of introducing and tracking numerator and denominators seperately as a representation of the internal state was so that divisions would be rare. So using divison in the Remove method did not make any sense and was just a silly mistake which is corrected here.

This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/19521 | core#19521]]
https://github.com/bitcoin/bitcoin/pull/19521/commits/2e2648a9021dfbb6e17dfa81472f057dacbc34e0

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11168

--- src/crypto/muhash.cpp
+++ src/crypto/muhash.cpp
@@ -379,6 +379,6 @@
 }

 MuHash3072 &MuHash3072::Remove(Span<const uint8_t> in) noexcept {
-    m_numerator.Divide(ToNum3072(in));
+    m_denominator.Multiply(ToNum3072(in));
     return *this;
 }


AMDGPU/SI: Fix a bug in SIFoldOperands

AMDGPU/SI: Fix a bug in SIFoldOperands

Summary: ret.ll will contain a test for this

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

Differential Revision: http://reviews.llvm.org/D16029

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

--- lib/Target/AMDGPU/SIFoldOperands.cpp
+++ lib/Target/AMDGPU/SIFoldOperands.cpp
@@ -336,6 +336,17 @@

       if (OpToFold.isReg() &&
           !TargetRegisterInfo::isVirtualRegister(OpToFold.getReg()))
+        continue;
+
+      // Prevent folding operands backwards in the function. For example,
+      // the COPY opcode must not be replaced by 1 in this example:
+      //
+      //    %vreg3<def> = COPY %VGPR0; VGPR_32:%vreg3
+      //    ...
+      //    %VGPR0<def> = V_MOV_B32_e32 1, %EXEC<imp-use>
+      MachineOperand &Dst = MI.getOperand(0);
+      if (Dst.isReg() &&
+          !TargetRegisterInfo::isVirtualRegister(Dst.getReg()))
         continue;

       // We need mutate the operands of new mov instructions to add implicit


[Diagnostics] Add a tailored diagnostic for attempt to use optional as a `Bool` in argument position

--- lib/Sema/CSDiagnostics.cpp
+++ lib/Sema/CSDiagnostics.cpp
@@ -4449,6 +4449,9 @@
 }

 bool ArgumentMismatchFailure::diagnoseAsError() {
+  if (diagnoseConversionToBool())
+    return true;
+
   emitDiagnostic(getLoc(), diag::cannot_convert_argument_value, getFromType(),
                  getToType());
   return true;


working on integration

working on integration

--- src/scenes.cpp
+++ src/scenes.cpp
@@ -141,6 +141,19 @@

 	}
 	void Stage::readNextwork() {
+		if (client) {
+			for (const auto&c : client->IRQ()) {
+				addToAnimatable(c);
+			}
+			for (const auto&c : client->bodyIndexQ()) {
+				addToAnimatable(c);
+			}
+			for (const auto&c : client->kinectQ()) {
+				addToAnimatable(c);
+			}
+			shared_ptr<ofxJSON> json = client->get(const string&address);
+
+		}

 	}

@@ -175,7 +188,7 @@
 		if (data) {
 			Json::Value::Members m = data->getMemberNames();
 			readGraphics((*data)["graphics"], nullptr);
-			readNextwork();
+
 			CreateReadAndaddBackgroundItems((*data)["background"]);
 			readLights((*data)["lights"]);
 			readCameras((*data)["cameras"]);
@@ -238,7 +251,7 @@
 		mySetup();
 	}
 	void Stage::update() {
-
+		readNextwork();
 		for (auto& a : animatables) {
 			a->updateForDrawing();
 		}


remove unused code

remove unused code

--- ocl_xpm/ocl_silentarmy.cpp
+++ ocl_xpm/ocl_silentarmy.cpp
@@ -397,7 +397,6 @@
 	for (unsigned i = 0; i < gpus.size(); i++) {
 		cl_context_properties props[] = { CL_CONTEXT_PLATFORM, (cl_context_properties)device_context.oclc->platform_id, 0 };
 		cl_int error;
-		//gContext[i] = clCreateContext(props, 1, &gpus[i], 0, 0, &error);
 		device_context.oclc->_context = clCreateContext(NULL, 1, &gpus[i], 0, 0, &error);
 		//OCLR(error, false);
 		if (cl_int err = error) {
@@ -452,89 +451,6 @@
 	std::function<void(void)> hashdonef,
 	ocl_silentarmy& device_context) {

-#if 0
-	unsigned char context[140];
-	memset(context, 0, 140);
-	memcpy(context, tequihash_header, tequihash_header_len);
-	memcpy(context + tequihash_header_len, nonce, nonce_len);
-
-	OclContext *miner = device_context.oclc;
-	clFlush(miner->queue);
-
-	//C++ START
-	blake2b_state_t initialCtx;
-	cl::Buffer buf_blake_st;
-	zcash_blake2b_init(&initialCtx, ZCASH_HASH_LEN, PARAM_N, PARAM_K);
-	zcash_blake2b_update(&initialCtx, (const uint8_t*)context, 128, 0);
-
-	//miner->nonce = header.nNonce;
-	size_t global_ws;
-	size_t local_work_size = 64;
-	for (unsigned round = 0; round < PARAM_K; round++) {
-		clBuffer<uint8_t> &bufHtFirst = (round % 2 == 0) ? miner->buf_ht0 : miner->buf_ht1;
-		clBuffer<uint8_t> &bufHtSecond = (round % 2 == 0) ? miner->buf_ht1 : miner->buf_ht0;
-
-		init_ht(miner->queue, miner->k_init_ht, bufHtFirst);
-		if (round == 0) {
-			OCL(clSetKernelArg(miner->k_rounds[round], 0, sizeof(cl_mem), &bufHtFirst.DeviceData));
-			OCL(clSetKernelArg(miner->k_rounds[round], 1, sizeof(cl_mem), &bufHtFirst.DeviceData));
-			OCL(clSetKernelArg(miner->k_rounds[round], 3, sizeof(cl_ulong), &initialCtx.h[0]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 4, sizeof(cl_ulong), &initialCtx.h[1]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 5, sizeof(cl_ulong), &initialCtx.h[2]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 6, sizeof(cl_ulong), &initialCtx.h[3]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 7, sizeof(cl_ulong), &initialCtx.h[4]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 8, sizeof(cl_ulong), &initialCtx.h[5]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 9, sizeof(cl_ulong), &initialCtx.h[6]));
-			OCL(clSetKernelArg(miner->k_rounds[round], 10, sizeof(cl_ulong), &initialCtx.h[7]));
-			global_ws = select_work_size_blake();
-		}
-		else {
-			OCL(clSetKernelArg(miner->k_rounds[round], 0, sizeof(cl_mem), &bufHtSecond.DeviceData));
-			OCL(clSetKernelArg(miner->k_rounds[round], 1, sizeof(cl_mem), &bufHtFirst.DeviceData));
-			global_ws = NR_ROWS;
-		}
-
-		OCL(clSetKernelArg(miner->k_rounds[round], 2, sizeof(cl_mem), &miner->buf_dbg.DeviceData));
-		OCL(clEnqueueNDRangeKernel(miner->queue, miner->k_rounds[round], 1, NULL, &global_ws, &local_work_size, 0, NULL, NULL));
-	}
-
-	OCL(clSetKernelArg(miner->k_sols, 0, sizeof(cl_mem), &miner->buf_ht0.DeviceData));
-	OCL(clSetKernelArg(miner->k_sols, 1, sizeof(cl_mem), &miner->buf_ht1.DeviceData));
-	OCL(clSetKernelArg(miner->k_sols, 2, sizeof(cl_mem), &miner->buf_sols.DeviceData));
-	global_ws = NR_ROWS;
-	OCL(clEnqueueNDRangeKernel(miner->queue, miner->k_sols, 1, NULL, &global_ws, &local_work_size, 0, NULL, NULL));
-	//C++ END
-
-	miner->buf_sols.copyToHost(miner->queue, true);
-	sols_t *sols = miner->buf_sols.HostData;
-	if (sols->nr > MAX_SOLS)
-		sols->nr = MAX_SOLS;
-
-	for (unsigned sol_i = 0; sol_i < sols->nr; sol_i++)
-		verify_sol(sols, sol_i);
-
-	// TODO send compressed or non compressed data
-	uint32_t nsols = 0;
-	uint8_t proof[COMPRESSED_PROOFSIZE * 2];
-	for (uint32_t i = 0; i < sols->nr; i++) {
-		if (sols->valid[i]) {
-			/*std::vector<uint32_t> index_vector(PROOFSIZE);
-			for (uint32_t el = 0; el < PROOFSIZE; el++) {
-				index_vector[i] = sols->values[i][el];
-			}
-
-			solutionf(index_vector, DIGITBITS, nullptr);
-			if (cancelf()) return;*/
-			compress(proof, (uint32_t *)(sols->values[i]), 1 << PARAM_K);
-			solutionf(std::vector<uint32_t>(0), 1344, proof);
-			// TODO remove
-			nsols++;
-		}
-	}
-	// TODO remove
-	//printf("solution num %d\n", nsols);
-#else
-
 	unsigned char context[140];
 	memset(context, 0, 140);
 	memcpy(context, tequihash_header, tequihash_header_len);
@@ -603,22 +519,15 @@
 	for (unsigned sol_i = 0; sol_i < sols->nr; sol_i++)
 		verify_sol(sols, sol_i);

-	// TODO send compressed or non compressed data
-	uint32_t nsols = 0;
+
 	uint8_t proof[COMPRESSED_PROOFSIZE * 2];
 	for (uint32_t i = 0; i < sols->nr; i++) {
 		if (sols->valid[i]) {
 			compress(proof, (uint32_t *)(sols->values[i]), 1 << PARAM_K);
 			solutionf(std::vector<uint32_t>(0), 1344, proof);
-			// TODO remove
-			nsols++;
 		}
 	}
 	free(sols);
-	// TODO remove
-	//printf("solution num %d\n", nsols);
-
-#endif
 }

 void ocl_silentarmy::print_opencl_devices() {


Revert some debugging related changes that I had made to qt.cpp

svn path=/trunk/; revision=10112

--- drivers/qt.cpp
+++ drivers/qt.cpp
@@ -238,7 +238,6 @@
 #endif
 #if defined(PLD_qtwidget) || defined(PLD_extqt)
   if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev);
-  //  if(widget==NULL) widget=(QtPLWidget*)pls->dev;
 #endif
   if(widget==NULL) return;

@@ -263,7 +262,7 @@
   if(widget!=NULL && qt_family_check(pls)) {return;}
 #endif
 #if defined(PLD_qtwidget) || defined(PLD_extqt)
-  if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QtPLDriver *) pls->dev);
+  if(widget==NULL) widget=dynamic_cast<QtPLWidget*>((QWidget *) pls->dev);
 #endif
   if(widget==NULL) return;