ENH: better coverage.

ENH: better coverage.

--- Testing/Code/Algorithms/itkAutomaticTopologyMeshSourceTest.cxx
+++ Testing/Code/Algorithms/itkAutomaticTopologyMeshSourceTest.cxx
@@ -112,8 +112,6 @@
   // PROBLEM LINE
   meshSource->AddLine( idArray[6], idArray[7] );

-#if 0
-
   meshSource->AddTriangle( idArray[5], idArray[6], idArray[7] );

   meshSource->AddQuadrilateral( idArray[4], idArray[5],
@@ -131,13 +129,11 @@

   meshSource->AddVertex( meshSource->AddPoint( 3, 1, 1 ) );

-#if 0
   // PROBLEM LINES
   meshSource->AddLine(
     meshSource->AddPoint( 2, 1, 1 ),
     meshSource->AddPoint( 3, 1, 1 )
     );
-#endif

   meshSource->AddTriangle(
     meshSource->AddPoint( 3, 0, 1 ),
@@ -191,12 +187,8 @@
   meshSource->AddHexahedron( points[0], points[1], points[2], points[3],
                              points[4], points[5], points[6], points[7] );

-#endif // 0
-
   // Print out the resulting mesh data.
   std::cout << MeshType::Pointer(meshSource->GetOutput()) << std::endl;
-
-#if 0

   // Now do a sanity check.  Create a mesh consisting of a pair of
   // tetrahedra sharing a face and a pair of cubes sharing a face, and
@@ -355,8 +347,6 @@
     return EXIT_FAILURE;
     }

-#endif
-
   return EXIT_SUCCESS;

 }


Fix BMC #17814 - Browser fails to start when restore session fails

When restore session fails, FinishedTabCreation() should create a new browser.
But we set always_create_tabbed_browser_ to false by mistake and hit this bug.

Former-commit-id: e23f04645edd1954b57d294b0aa68f98e03033f0

--- chrome/browser/sessions/session_restore.cc
+++ chrome/browser/sessions/session_restore.cc
@@ -416,7 +416,7 @@
         browser_(browser),
         synchronous_(synchronous),
         clobber_existing_window_(false),
-        always_create_tabbed_browser_(false),
+        always_create_tabbed_browser_(always_create_tabbed_browser),
         urls_to_open_(urls_to_open),
         restore_started_(base::TimeTicks::Now()) {
   }


Make sure -print-machineinstrs applies to the first pass as well.

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

--- lib/CodeGen/Passes.cpp
+++ lib/CodeGen/Passes.cpp
@@ -433,9 +433,6 @@
 /// TODO: We could use a single addPre/Post(ID) hook to allow pass injection
 /// before/after any target-independent pass. But it's currently overkill.
 void TargetPassConfig::addMachinePasses() {
-  // Print the instruction selected machine code...
-  printAndVerify("After Instruction Selection");
-
   // Insert a machine instr printer pass after the specified pass.
   // If -print-machineinstrs specified, print machineinstrs after all passes.
   if (StringRef(PrintMachineInstrs.getValue()).equals(""))
@@ -451,6 +448,9 @@
     insertPass(TID, IID);
   }

+  // Print the instruction selected machine code...
+  printAndVerify("After Instruction Selection");
+
   // Expand pseudo-instructions emitted by ISel.
   addPass(&ExpandISelPseudosID);


fixed another run time error, sorry :/

fixed another run time error, sorry :/

--- Screens.cpp
+++ Screens.cpp
@@ -173,20 +173,22 @@
 				case FIGHTER:
 					if (!hasRolled)
 						mainCharacter = new Fighter(myRace);
-					else
+					//else
 						//mainCharacter = newFighter(myRace, str, ...)
-					mainCharacter->graphics = characterSprites;
-
-					characterRect->x = availableSprites[selectedSprite].clip.x;
-					characterRect->y = availableSprites[selectedSprite].clip.y;
-					characterRect->w = availableSprites[selectedSprite].clip.w;
-					characterRect->h = availableSprites[selectedSprite].clip.h;
-
-					mainCharacter->x = 10;
-					mainCharacter->y = 14;
-
-					mainCharacter->clip = characterRect;
-			}
+
+			}
+
+			mainCharacter->graphics = characterSprites;
+			characterRect->x = availableSprites[selectedSprite].clip.x;
+			characterRect->y = availableSprites[selectedSprite].clip.y;
+			characterRect->w = availableSprites[selectedSprite].clip.w;
+			characterRect->h = availableSprites[selectedSprite].clip.h;
+
+			mainCharacter->x = 10;
+			mainCharacter->y = 14;
+
+			mainCharacter->clip = characterRect;
+
 			//pass a call back to Game.cpp
 			*signalCompletion = true;
 		}


Fix aura compile.

Fix aura compile.

BUG=none
TEST=none
TBR=yefim

Review URL: https://chromiumcodereview.appspot.com/10836183

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

--- chrome/browser/ui/views/action_box_menu.cc
+++ chrome/browser/ui/views/action_box_menu.cc
@@ -15,7 +15,7 @@
 #include "ui/views/controls/menu/menu_runner.h"
 #include "ui/views/view.h"

-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
 // Included for MENU_POPUPITEM and a few other Windows specific constants.
 #include <vssym32.h>
 #include "ui/base/native_theme/native_theme_win.h"
@@ -62,7 +62,7 @@
 views::Border* ActionBoxMenu::CreateMenuBorder() {
   // TODO(yefim): Use correct theme color on non-Windows.
   SkColor border_color = SK_ColorBLACK;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
   // TODO(yefim): Move to Windows only files if possible.
   border_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
       ui::NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR,
@@ -74,7 +74,7 @@
 views::Background* ActionBoxMenu::CreateMenuBackground() {
   // TODO(yefim): Use correct theme color on non-Windows.
   SkColor background_color = SK_ColorWHITE;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
   // TODO(yefim): Move to Windows only files if possible.
   background_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
       ui::NativeThemeWin::TEXTFIELD, EP_BACKGROUND, EBS_NORMAL,


Ifdef out some Windows dependencies. This is the first pass trying to get
browser_view compiling on Linux. I haven't figured out what we'll do with these
things longer-term.
Review URL: http://codereview.chromium.org/113585

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

--- chrome/browser/views/frame/browser_view.cc
+++ chrome/browser/views/frame/browser_view.cc
@@ -302,6 +302,7 @@
   ticker_.UnregisterTickHandler(&hung_window_detector_);
 }

+#if defined(OS_WIN)
 // static
 BrowserView* BrowserView::GetBrowserViewForHWND(HWND window) {
   if (IsWindow(window)) {
@@ -311,6 +312,7 @@
   }
   return NULL;
 }
+#endif

 int BrowserView::GetShowState() const {
   if (explicit_show_state != -1)
@@ -569,6 +571,7 @@
   return frame_->GetWindow()->IsActive();
 }

+#if defined(OS_WIN)
 void BrowserView::FlashFrame() {
   FLASHWINFO fwi;
   fwi.cbSize = sizeof(fwi);
@@ -578,6 +581,7 @@
   fwi.dwTimeout = 0;
   FlashWindowEx(&fwi);
 }
+#endif

 gfx::NativeWindow BrowserView::GetNativeHandle() {
   return GetWidget()->GetNativeView();
@@ -637,6 +641,7 @@
   return frame_->GetWindow()->IsMaximized();
 }

+#if defined(OS_WIN)
 void BrowserView::SetFullscreen(bool fullscreen) {
   if (IsFullscreen() == fullscreen)
     return;  // Nothing to do.
@@ -692,6 +697,7 @@
   Layout();
   frame_->GetWindow()->PopForceHidden();
 }
+#endif

 bool BrowserView::IsFullscreen() const {
   return frame_->GetWindow()->IsFullscreen();
@@ -867,6 +873,7 @@
                                     delegate)->Show();
 }

+#if defined(OS_WIN)
 void BrowserView::ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
                                  void* parent_window) {
   HWND parent_hwnd = reinterpret_cast<HWND>(parent_window);
@@ -876,6 +883,7 @@
   html_view->InitDialog();
   html_view->window()->Show();
 }
+#endif

 void BrowserView::UserChangedTheme() {
   frame_->GetWindow()->GetNonClientView()->SetUseNativeFrame(false);
@@ -1127,6 +1135,7 @@
   return true;
 }

+#if defined(OS_WIN)
 int BrowserView::NonClientHitTest(const gfx::Point& point) {
   // Since the TabStrip only renders in some parts of the top of the window,
   // the un-obscured area is considered to be part of the non-client caption
@@ -1205,6 +1214,7 @@
   // If the point is somewhere else, delegate to the default implementation.
   return views::ClientView::NonClientHitTest(point);
 }
+#endif

 gfx::Size BrowserView::GetMinimumSize() {
   // TODO: In theory the tabstrip width should probably be


Added a static function pointer to cache the SetActiveURL pointer.
- Windows only change.

This is basically landing jschuh change http://codereview.chromium.org/293040

TEST=none
BUG=25366

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

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

Former-commit-id: ee6a1805d36ce0d8aa4b9f89cf5989dd3c112009

--- chrome/common/child_process_logging_win.cc
+++ chrome/common/child_process_logging_win.cc
@@ -11,19 +11,21 @@
 #include "googleurl/src/gurl.h"

 namespace child_process_logging {
-
+// exported in breakpad_win.cc: void __declspec(dllexport) __cdecl SetActiveURL.
 typedef void (__cdecl *MainSetActiveURL)(const wchar_t*);

 void SetActiveURL(const GURL& url) {
-  HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
-  if (!exe_module)
-    return;
-
-  MainSetActiveURL set_active_url =
-      reinterpret_cast<MainSetActiveURL>(
-          GetProcAddress(exe_module, "SetActiveURL"));
-  if (!set_active_url)
-    return;
+  static MainSetActiveURL set_active_url = NULL;
+  // note: benign race condition on set_active_url.
+  if (!set_active_url) {
+    HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
+    if (!exe_module)
+      return;
+    set_active_url = reinterpret_cast<MainSetActiveURL>(
+        GetProcAddress(exe_module, "SetActiveURL"));
+    if (!set_active_url)
+      return;
+  }

   (set_active_url)(UTF8ToWide(url.possibly_invalid_spec()).c_str());
 }


Add a missing include and match a constant type better.  From phajdan.jr.
Review URL: http://codereview.chromium.org/2922

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

--- chrome/common/net/cookie_monster_sqlite.cc
+++ chrome/common/net/cookie_monster_sqlite.cc
@@ -4,6 +4,9 @@

 #include "chrome/common/net/cookie_monster_sqlite.h"

+#include <list>
+
+#include "base/basictypes.h"
 #include "base/logging.h"
 #include "base/ref_counted.h"
 #include "base/string_util.h"
@@ -104,7 +107,7 @@
   // Commit every 30 seconds.
   static const int kCommitIntervalMs = 30 * 1000;
   // Commit right away if we have more than 512 outstanding operations.
-  static const int kCommitAfterBatchSize = 512;
+  static const size_t kCommitAfterBatchSize = 512;
   DCHECK(MessageLoop::current() != background_loop_);

   // We do a full copy of the cookie here, and hopefully just here.


Consider static global variables inside a namespace to be non-linker-visible.

--- elsa/variable.cc
+++ elsa/variable.cc
@@ -156,7 +156,8 @@
 //      xassert(!hasFlag(DF_GLOBAL));
     newAnswer = false;
   } else {
-    if (scope->isGlobalScope()) {
+    // quarl: namespace scope is similar to global scope
+    if (scope->isGlobalScope() || scope->isNamespace()) {
       if (evenIfStatic) {
         newAnswer = true;
       } else {


no message

no message

--- applications/osmozilla/osmozilla.cpp
+++ applications/osmozilla/osmozilla.cpp
@@ -133,7 +133,7 @@
 		*((char **)aValue) = "Osmozilla";
 		break;
 	case NPPVpluginDescriptionString:
-		*((char **)aValue) = "GPAC Plugin for Mozilla. For more information go to GPAC website";
+		*((char **)aValue) = "GPAC Plugin " GPAC_VERSION " for Mozilla. For more information go to GPAC website";
 		break;
 	default:
 		err = NPERR_INVALID_PARAM;
@@ -451,8 +451,6 @@
 	if (! m_term) return NPERR_GENERIC_ERROR;

 	mInitialized = TRUE;
-
-	SetFocus((HWND)m_user.os_window_handler);

 	/*stream not ready*/
 	if (!m_szURL) return TRUE;
@@ -546,7 +544,6 @@
 	ReloadTerminal();
 	/*connect from 0 and pause if not autoplay*/
 	gf_term_connect_from_time(m_term, m_szURL, 0, m_bAutoStart ? 0 : 1);
-	SetFocus((HWND)m_user.os_window_handler);

 	/*we handle data fetching ourselves*/
     *stype = NP_SEEK;


cleaning

cleaning

Former-commit-id: e9e941ef27dcdd5c5331ae7a81ea7acb7be90a7b

--- applications/sofa/gui/qt/RealGUI.cpp
+++ applications/sofa/gui/qt/RealGUI.cpp
@@ -106,7 +106,7 @@
 namespace qt
 {

-SOFA_LINK_CLASS(ImageQt);
+SOFA_LINK_CLASS(ImageQt)

 using sofa::core::objectmodel::BaseObject;
@@ -212,7 +212,7 @@
     application->setWindowIcon(QIcon(pathIcon));

     // show the gui
-    _gui->show();
+    _gui->show(); // adding extra line in the console?
 }
 //======================= STATIC METHODS ========================= }

@@ -274,7 +274,7 @@
     frameCounter(0),
     m_viewerMSAANbSampling(1)
 {
-    setupUi(this),
+    setupUi(this);

 //    this->setWindowFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
     parseOptions(options);


added behaviors for buzz and intvw  modes

--- apps/3d/Render/src/ContentBubble.cpp
+++ apps/3d/Render/src/ContentBubble.cpp
@@ -42,6 +42,10 @@
 	bobTheta.x = ofRandomuf() * PI;
 	bobTheta.y = ofRandomuf() * PI;
 	bobTheta.z = ofRandomuf() * PI;
+
+	buzzTime	= 0;
+	buzzWait	= 0.1;
+	loopCounter = 0;
 }

 //--------------------------------------------------------------
@@ -92,6 +96,53 @@
 	target.x = resetTarget.x + cos(	bobTheta.x ) * 10.0;
 	target.y = resetTarget.y + sin(	bobTheta.y ) * amp;
 	target.z = resetTarget.z + sin(	bobTheta.z ) * 30.0;
+}
+
+//--------------------------------------------------------------
+void ContentBubble::buzzMe() {
+
+	// maybe there is a moe elegant solution...
+
+	float tForce = 50.f;
+	if(targetForce < tForce)
+		targetForce = targetForce + (tForce-targetForce)*.1;
+
+	float dt = ofGetElapsedTimef() - buzzTime;
+
+	if(dt > buzzWait)
+	{
+		buzzTime = ofGetElapsedTimef();
+		buzzWait = ofRandom(.1,.5);
+
+		float rads = ofRandom(60,80);
+		float angle = ofRandom(0,TWO_PI);
+		buzzDest.x = resetTarget.x + rads * cos(angle);
+		buzzDest.y = resetTarget.y + rads * sin(angle);
+
+		buzzOrig = getPosition();
+	}
+
+	float pct = 1 - powf( (dt / buzzWait),.75);
+
+	target.x = pct * buzzOrig.x + (1-pct) * buzzDest.x;
+	target.y = pct * buzzOrig.y + (1-pct) * buzzDest.y;
+
+
+}
+
+//--------------------------------------------------------------
+void ContentBubble::loopMe(float interactiveWidth,float interactiveHeight){
+
+	if(loopCounter < 1 ) loopCounter += .0015;
+
+	if( getPosition().y < -radius )
+	{
+		loopCounter = 0;
+		rigidBody->setPosition(ofVec3f( (interactiveWidth/2.f) + ofRandom(-300, 300), interactiveHeight+radius, getPosition().z ), ofVec3f(0,0,0), 0);
+	}
+
+	target.x = getPosition().x;
+	target.y = ofLerp(interactiveHeight,-radius,loopCounter);
 }

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


create a default material list instead of blindly adding a material in sg

--- apps/common/sg/geometry/Geometry.cpp
+++ apps/common/sg/geometry/Geometry.cpp
@@ -22,7 +22,10 @@

     Geometry::Geometry(const std::string &type)
     {
-      createChild("material", "Material");
+      auto matList =
+        createChild("materialList", "MaterialList").nodeAs<MaterialList>();
+      matList->push_back(createNode("default", "Material")->nodeAs<Material>());
+
       createChild("type", "string", type);
       setValue((OSPGeometry)nullptr);
     }


more build fixes

more build fixes

--- apps/common/sg/importer/Importer.cpp
+++ apps/common/sg/importer/Importer.cpp
@@ -224,13 +224,11 @@
           files.push_back(FileName(file));

         if (files.size() > 0) {
-          auto& selector =
-            createChild("selector",
-                                  "Selector");
           auto ext = files[0].ext(); //TODO: check that they are all homogeneous
 #ifdef OSPRAY_APPS_SG_VTK
+          auto& selector = createChild("selector", "Selector");
           if (ext == "vti") {
-            sg::importVTIs(selector.shared_from_this(),files);
+            sg::importVTIs(selector.shared_from_this(), files);
             return;
           }
 #endif


Fix mixed indents

Fix mixed indents

--- maindialog.cpp
+++ maindialog.cpp
@@ -1,21 +1,21 @@
 /*
  * <one line to give the library's name and an idea of what it does.>
  * Copyright (C) 2013  <copyright holder> <email>
- *
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
- *
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- *
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
+ *
  */

 #include "maindialog.h"
@@ -80,19 +80,19 @@
     if(child->inherits("QCheckBox")) {
       int val = -1;
       if(config_lookup_bool(&config_, keyName.constData(), &val) == CONFIG_TRUE)
-	static_cast<QCheckBox*>(child)->setChecked((bool)val);
+        static_cast<QCheckBox*>(child)->setChecked((bool)val);
       connect(child, SIGNAL(toggled(bool)), SLOT(onButtonToggled(bool)));
     }
     else if(child->inherits("QDoubleSpinBox")) {
       double val;
       if(config_lookup_float(&config_, keyName.constData(), &val) == CONFIG_TRUE)
-	static_cast<QDoubleSpinBox*>(child)->setValue(val);
+        static_cast<QDoubleSpinBox*>(child)->setValue(val);
       connect(child, SIGNAL(valueChanged(double)), SLOT(onSpinValueChanged(double)));
     }
     else if(child->inherits("QSpinBox")) {
       int val;
       if(config_lookup_int(&config_, keyName.constData(), &val) == CONFIG_TRUE)
-	static_cast<QSpinBox*>(child)->setValue(val);
+        static_cast<QSpinBox*>(child)->setValue(val);
       connect(child, SIGNAL(valueChanged(int)), SLOT(onSpinValueChanged(int)));
     }
   }
@@ -134,7 +134,7 @@
   qDebug() << userConfigFile_;
   // save the config file
   config_write_file(&config_, userConfigFile_.toLocal8Bit().constData());
-
+
   // ask compton to reload the config
   QString displayName = qgetenv("DISPLAY");
   for(int i = 0; i < displayName.length(); ++i) {


filter displayed DB tables on main window.

--- mainwindow.cpp
+++ mainwindow.cpp
@@ -86,7 +86,14 @@

 void MainWindow::loadDBTabs()
 {
-    QStringList tables = db_->tables();
+    QStringList dbtables = db_->tables();
+    QStringList tables, filter;
+    filter << "file" << "tag" << "book" << "author";
+    for (int i = 0; i < filter.size(); ++i){
+        if (dbtables.contains(filter.at(i))){
+            tables.append(filter.at(i));
+        }
+    }
     for( int i = 0; i < tables.size(); ++i){
         DBTableWidget* w = new DBTableWidget(tables.at(i),
                                                db_->conn(),


Cleaned up firmware update workflow

Cleaned up firmware update workflow

--- mainwindow.cpp
+++ mainwindow.cpp
@@ -211,25 +211,25 @@

 // FW Update button
 void MainWindow::on_updateFWButton_clicked() {
+  QMessageBox::information(this,
+              "HDK Driver Update",
+              "Before you can update your HDK's firmware, you must install additional drivers. "
+              "

"
+              "To install these drivers, click here and run HDK_Bootloader_Drivers.exe."
+              "

"
+              "To proceed, click OK. You will be prompted to select the new firmware.");
+
   // Ask user for the HEX file to update with
   QString hexFile;
-  QFileDialog fd(this);
-  fd.setFileMode(QFileDialog::ExistingFile);
-  fd.setNameFilter(tr("Firmware Hex Files (*.hex)"));
-  fd.setDirectory(QCoreApplication::applicationDirPath());
-  if (fd.exec()) {
-    QStringList selected_files = fd.selectedFiles();
-
-    // Sanity check selected files list (this should be impossible)
-    if (selected_files.length() != 1)
-      return;
-
-    hexFile = fd.selectedFiles().at(0);
-  } else
-    return; // user pressed cancel
-
-  // Make absolutely sure the user actually selected a file (this should be
-  // impossible)
+
+  hexFile = QFileDialog::getOpenFileName(this,
+                                         "Select Firmware Update File",
+                                         QCoreApplication::applicationDirPath(),
+                                         tr("Firmware Hex Files (*.hex)"));
+
+  // User pressed cancel
   if (hexFile == "") {
     return;
   }
@@ -244,7 +244,7 @@
         reply = QMessageBox::question(
             this, tr("Ready To Update Firmware Versions"),
             "Current Firmware Versions:
" + firmware_versions +
-                "

Firmware Hex File Selected For Update:
" +
+                "

Selected Firmware Update File:
" +
                 hexFile +
                 "

Do you wish to proceed with the firmware update?",
             QMessageBox::Yes | QMessageBox::No);
@@ -288,29 +288,14 @@
   }

   // Set bootloader mode
-  sendCommandNoResult("#?b1948\n");
-
-  QMessageBox bootloader_message(QMessageBox::Information,
-                                 QString("Bootloader Mode Initalized"),
-                                 QString("This application uses the open source dfu-programmer utility."
-                                         "

"
-                                         "At this time your device should now be in ATMEL bootloader mode. "
-                                         "If you haven't loaded the ATMEL drivers yet, you should do so now. "
-                                         "You can find the drivers within the dfu-prog-usb-1.2.2 folder."
-                                         "

"
-                                         "Right click on the device in the Device Manager and select Update Driver Software."
-                                         "

"
-                                         "Click OK to continue."));
-  bootloader_message.setTextFormat(Qt::RichText);
-  bootloader_message.setTextInteractionFlags(Qt::TextBrowserInteraction);
-  bootloader_message.exec();
-
   FirmwareUpdateProgressDialog dialog;
   dialog.show();
-  dialog.setText("Erasing existing firmware...");
-
+  dialog.setText("Setting bootloader mode...");
+  sendCommandNoResult("#?b1948\n");
+  dialog.setText(dialog.getText() + "done.
");
+
+  // Erase firmware
+  dialog.setText(dialog.getText() + "Erasing existing firmware...");
   int result = atmel_erase();
   if (result == DFU_PROGRAMMER_MISSING) {
       dialog.close();
@@ -324,19 +309,19 @@
       dialog.exec();
       return;
   }
-
-  dialog.setText(dialog.getText() + "done.
Loading new firmware...");
-
+  dialog.setText(dialog.getText() + "done.
Loading new firmware...");
+
+  // Load new firmware
   if (atmel_load(hexFile)) {
       dialog.setText(dialog.getText() + "failed!

" + FW_UPDATE_FAIL_STR);
       dialog.showOK();
       dialog.exec();
       return;
   }
-
   dialog.setText(dialog.getText() +
-                 "done.
Launching new firmware...");
-
+                 "done.
Launching new firmware...");
+
+  // Launch new firmware
   if (atmel_launch()) {
       dialog.setText(dialog.getText() + "failed!

" + FW_UPDATE_FAIL_STR);
       dialog.showOK();
@@ -346,7 +331,7 @@

   // Success!
   dialog.setText(dialog.getText() +
-                 "done.

Firmware update complete."
+                 "done.

Firmware update complete."
                  "

" +
                  POST_FW_UPDATE_STR);
   dialog.setTitle(QString("Firmware Update Complete"));


replace strcpy to normal QString code

replace strcpy to normal QString code

--- mainwindow.cpp
+++ mainwindow.cpp
@@ -269,21 +269,21 @@
         maskImage(&img, HQ_LEVEL_RECT_HEADER);
     }

-    char format[4] = {0};
+    QString format;
     if(settings.value(SETTING_GENERAL_SAVE_PNG, false).toBool())
-        strcpy(format, "png");
+        format = QStringLiteral("png");
     else
-        strcpy(format, "jpg");
-
-    QString path = makeFileName(QString(format));
+        format = QStringLiteral("jpg");
+
+    QString path = makeFileName(format);
 //    qDebug() << "path:" << path;

     //保存する
     ui.statusBar->showMessage(tr("saving to %1...").arg(path), STATUS_BAR_MSG_TIME);
-    if(img.save(path, format)){
+    if (img.save(path, format.toUtf8().constData())) {
         //つぶやくダイアログ
         openTweetDialog(path);
-    }else{
+    } else {
         ui.statusBar->showMessage(tr("failed save image"), STATUS_BAR_MSG_TIME);
     }
 }


Swapped size_t with std::size_t.

Swapped size_t with std::size_t.

--- include/Dynarray/Dynarray.hpp
+++ include/Dynarray/Dynarray.hpp
@@ -40,55 +40,55 @@

 namespace Astuurman {

-    template<size_t dimension, typename ValueType, typename = std::make_index_sequence<dimension>>
+    template<std::size_t dimension, typename ValueType, typename = std::make_index_sequence<dimension>>
     class Dynarray;

-    template <size_t dimension, typename ValueType, std::size_t... Is>
+    template <std::size_t dimension, typename ValueType, std::size_t... Is>
     class Dynarray<dimension, ValueType, std::index_sequence<Is...>>
     {
         template<typename To, std::size_t>
         using to = To;

         ValueType* value;
-        std::tuple<to<size_t, Is>...> size;
+        std::tuple<to<std::size_t, Is>...> size;

-        size_t MultiplySizes() const
+        std::size_t MultiplySizes() const
         {
             return 1;
         }

         template<typename Head, typename... Tail>
-        size_t MultiplySizes(Head head, Tail... tail) const
+        std::size_t MultiplySizes(Head head, Tail... tail) const
         {
             return head * MultiplySizes(tail...);
         }

-        template<size_t dimIndex>
-        size_t _Index(size_t offset) const
+        template<std::size_t dimIndex>
+        std::size_t _Index(std::size_t offset) const
         {
             return 0;
         }

-        template<size_t dimIndex, typename Head, typename... Tail>
-        size_t _Index(size_t offset, Head head, Tail... tail) const
+        template<std::size_t dimIndex, typename Head, typename... Tail>
+        std::size_t _Index(std::size_t offset, Head head, Tail... tail) const
         {
             return head * offset + _Index<dimIndex + 1, Tail...>(offset * std::get<dimIndex>(size), tail...);
         }

         template<typename Head, typename... Tail>
-        size_t Index(Head head, Tail... tail) const
+        std::size_t Index(Head head, Tail... tail) const
         {
             return head + _Index<1, Tail...>(std::get<0>(size), tail...);
         }
     public:
-        Dynarray(const ValueType* value, to<size_t, Is>... sizes) :
+        Dynarray(const ValueType* value, to<std::size_t, Is>... sizes) :
             value(new ValueType[MultiplySizes(sizes...)]()),
             size(std::make_tuple(sizes...))
         {
             std::copy(value, value + MultiplySizes(sizes...), this->value);
         }

-        Dynarray(to<size_t, Is>... sizes) :
+        Dynarray(to<std::size_t, Is>... sizes) :
             value(new ValueType[MultiplySizes(sizes...)]()),
             size(std::make_tuple(sizes...))
         {}
@@ -125,23 +125,23 @@
             size = other.size;
         }

-        constexpr size_t Dimension()
+        constexpr std::size_t Dimension()
         {
             return dimension;
         }

-        ValueType& At(to<size_t, Is>... indexes)
+        ValueType& At(to<std::size_t, Is>... indexes)
         {
             return value[Index(indexes...)];
         }

-        const ValueType& At(to<size_t, Is>... indexes) const
+        const ValueType& At(to<std::size_t, Is>... indexes) const
         {
             return value[Index(indexes...)];
         }

-        template<size_t dim>
-        size_t Size() const
+        template<std::size_t dim>
+        std::size_t Size() const
         {
             return std::get<dim>(size);
         }


Add a Spacer to the Game-List

Add a Spacer to the Game-List

If the available Games do not fill the List, the Spacer
will keep them together

--- mainwindow.cpp
+++ mainwindow.cpp
@@ -286,7 +286,14 @@
         }
         //Select first game by default
         onGameClick(gameList[0], gameWidgetList[0]);
-    }
+
+
+        QSpacerItem *vSpacer;
+        vSpacer = new QSpacerItem(40, 20, QSizePolicy::Minimum, QSizePolicy::Expanding);
+        gameScrollLayout->addItem(vSpacer);
+    }
+
+

     qDebug() << "Time to load list:" << timer.elapsed();
 }


Simple message documentation

Simple message documentation

--- include/Kunlaboro/Message.hpp
+++ include/Kunlaboro/Message.hpp
@@ -8,6 +8,10 @@

 	namespace detail
 	{
+		/** Compile-time capable implementation of the Fowler-Null-Vo string hash method.
+		 *
+		 * Implemented both for 32-bit and 64-bit hashes.
+		 */
 		template<typename S>
 		struct hash_internal;

@@ -41,51 +45,184 @@
 	class MessageSystem;
 	typedef uint32_t MessageId;

+	/** Helper component for handling messaging.
+	 */
 	class MessagingComponent : public Component
 	{
 	public:
 		MessagingComponent();

 	protected:
+		/** This function is called every time the component is added to an entity.
+		 *
+		 * In here you want to request the messages you want to receive during the
+		 * lifetime of your attachment to the current entity.
+		 *
+		 * Example of how such functionality can be done is;
+		 * \code{.cpp}
+		 * void Example::addedToEntity()
+		 * {
+		 *   requestMessageId<float>("System.Tick", &Example::Tick);
+		 *   requestMessageId("System.Reset", &Example::Reset);
+		 *   requestMessageId<std::string&>("System.Display", &Example::Display, priority);
+		 *   // Can also be changed later on through
+		 *   // reprioritizeMessageId("System.Display", priority);
+		 * }
+		 *
+		 * void Example::Tick(float dt)
+		 * {
+		 *   // Run an update tick
+		 * }
+		 * void Example::Reset()
+		 * {
+		 *   // Reset the system state
+		 * }
+		 * void Example::Display(std::string& out)
+		 * {
+		 *   // Append state to output variable
+		 * }
+		 * \endcode
+		 */
 		virtual void addedToEntity() = 0;

+		/** Request to receive messages with the given ID.
+		 *
+		 * \param id The ID of the message to receive.
+		 * \param func The functor to receive the message.
+		 * \param prio The priority of the request, in ascending order.
+		 * \tparam Args The message arguments, must match the functor input.
+		 */
 		template<typename... Args, typename Functor>
 		void requestMessage(MessageId id, Functor&& func, float prio = 0);
+		/** Helper method for requesting against a member method.
+		 *
+		 * \param id The ID of the message to receive.
+		 * \param func The member method to receive the message.
+		 * \param prio The priority of the request, in ascending order.
+		 * \tparam Args The message arguments, must match the method arguments.
+		 */
 		template<typename... Args, typename Obj>
 		void requestMessage(MessageId id, void (Obj::*func)(Args...), float prio = 0);
+		/** Unrequest the message with the given ID.
+		 */
 		void unrequestMessage(MessageId id);
+		/** Change the priority of the message with the given ID.
+		 *
+		 * \todo Look into possible performance increases.
+		 */
 		void reprioritizeMessage(MessageId id, float prio);

+		/** Sends a global message with the given ID.
+		 *
+		 * \param id The ID of the message to send.
+		 * \param args The message arguments.
+		 */
 		template<typename... Args>
 		void sendMessage(MessageId id, Args... args) const;
+		/** Sends a local message with the given ID to the given entity ID.
+		 *
+		 * \param id The ID of the message to send.
+		 * \param ent The ID of the entity to receive the message.
+		 * \param args The message arguments.
+		 */
 		template<typename... Args>
 		void sendMessageTo(MessageId id, EntityId ent, Args... args) const;
+		/** Sends a local message with the given ID to the given component ID.
+		 *
+		 * \param id The ID of the message to send.
+		 * \param comp The ID of the component to receive the message.
+		 * \param args The message arguments.
+		 */
 		template<typename... Args>
 		void sendMessageTo(MessageId id, ComponentId comp, Args... args) const;

+		/** Helper method to request a message from an unhashed string.
+		 *
+		 * \param id The ID string of the message to request.
+		 * \param func The functor to receive the call.
+		 * \param prio The priority of the request, in ascending order.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		template<typename... Args, typename Functor>
 		void requestMessageId(const char* const id, Functor&& func, float prio = 0);
+		/** Helper method to request a message from an unhashed string.
+		 *
+		 * \param id The ID string of the message to request.
+		 * \param func The member function to receive the call.
+		 * \param prio The priority of the request, in ascending order.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		template<typename... Args, typename Obj>
 		void requestMessageId(const char* const id, void (Obj::*func)(Args...), float prio = 0);
+		/** Helper method to unrequest a message from an unhashed string.
+		 *
+		 * \param id The ID string of the message to unrequest.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		void unrequestMessageId(const char* const id);
+		/** Helper method to change message priority from an unhashed string.
+		 *
+		 * \param id The ID string of the message to reprioritize.
+		 * \param prio The new priority of the request, in ascending order.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		void reprioritizeMessageId(const char* const id, float prio);

+		/** Helper method to send a global message by an unhashed string.
+		 *
+		 * \param id The ID string of the message to send.
+		 * \param args The arguments of the message.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		template<typename... Args>
 		void sendMessageId(const char* const id, Args... args) const;
+		/** Helper method to send a entity-local message by an unhashed string.
+		 *
+		 * \param id The ID string of the message to send.
+		 * \param ent The ID of the entity to receive the message.
+		 * \param args The arguments of the message.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		template<typename... Args>
 		void sendMessageIdTo(const char* const id, EntityId ent, Args... args) const;
+		/** Helper method to send a component-local message by an unhashed string.
+		 *
+		 * \param id The ID string of the message to send.
+		 * \param comp The ID of the component to receive the message.
+		 * \param args The arguments of the message.
+		 *
+		 * \note Even though these functions hash at compile time,
+		 *       using pre-hashed messages will be faster.
+		 */
 		template<typename... Args>
 		void sendMessageIdTo(const char* const id, ComponentId comp, Args... args) const;
 	};

+	/** Helper struct for storing registered messages.
+	 *
+	 */
 	struct BaseMessageType
 	{
 		BaseMessageType(MessageId mId)
 			: Id(mId)
 		{ }

+		/// The ID of the message.
 		MessageId Id;
 #ifdef _DEBUG
+		/// The unhashed name of the message, for Debug-time collision checking.
 		std::string Name;
 #endif

@@ -119,6 +256,8 @@
 		using can_call = decltype(can_call_test::template f<F>(0));

 	public:
+		/** Checks that the given functor can be called with the message arguments.
+		 */
 		template<typename Functor>
 		static constexpr bool isValid(Functor&&) { return can_call<Functor>{}; }


Добавлен Update Учащихся

Добавлен Update Учащихся

--- mainwindow.cpp
+++ mainwindow.cpp
@@ -51,7 +51,7 @@

    /* queryStud.append("SELECT 'ID', 'Фамилия', 'Имя', 'Отчество', 'Тип документа', 'Номер документа', 'Пол', 'Год рождения', ");
     queryStud.append("'Район школы', 'Школа', 'Класс', 'Родители', 'Домашний адрес', 'Телефон', 'e-mail', 'Дата заявления', 'Форма обучения', ");
-    queryStud.append("'Когда выбыл', 'С ослабленным здоровьем', 'Сирота', 'Инвалид', 'На учёте в милиции', 'Многодетная семья', ");
+    queryStud.append("'Когда выбыл', 'С ослабленным здоровьем', 'Сирота', 'Инвалид', 'На учёте в полиции', 'Многодетная семья', ");
     queryStud.append("'Неполная семья', 'Малообеспеченная семья', 'Мигранты', 'Примечания' FROM Учащиеся;");
 */

@@ -371,7 +371,7 @@
         else
             ui->invalid->setChecked(false);

-        if (ui->tableWidget->item(row, 21)->text() == "true")       // На учёте в милиции
+        if (ui->tableWidget->item(row, 21)->text() == "true")       // На учёте в полиции
             ui->accountInPolice->setChecked(true);
         else
             ui->accountInPolice->setChecked(false);
@@ -694,7 +694,7 @@
                 strQuery = "INSERT INTO Учащиеся(";
                 strQuery.append("'Фамилия', 'Имя', 'Отчество', 'Тип документа', 'Номер документа', 'Пол', 'Год рождения', ");
                 strQuery.append("'Район школы', 'Школа', 'Класс', 'Родители', 'Домашний адрес', 'Телефон', 'e-mail', 'Дата заявления', 'Форма обучения', ");
-                strQuery.append("'Когда выбыл', 'С ослабленным здоровьем', 'Сирота', 'Инвалид', 'На учёте в милиции', 'Многодетная семья', ");
+                strQuery.append("'Когда выбыл', 'С ослабленным здоровьем', 'Сирота', 'Инвалид', 'На учёте в полиции', 'Многодетная семья', ");
                 strQuery.append("'Неполная семья', 'Малообеспеченная семья', 'Мигранты', 'Примечания') VALUES ('");
                 strQuery.append(surname + "', '" + name  + "', '" + patr  + "', '" + docType  + "', '" + docNum  + "', '" + gender  + "', '" + birthday  + "', '");
                 strQuery.append(arSchool  + "', '" + school  + "', '" + grad  + "', '" + parents  + "', '" + address  + "', '" + phone  + "', '" + email  + "', '" + admiss  + "', '" + eduForm  + "', '");
@@ -706,6 +706,13 @@
             else
             {
                 // UPDATE
+                // Здесь: поправить изменение bool-значений!!! Пока что оно не очень хочет работать.
+
+                strQuery.append("UPDATE Учащиеся SET Фамилия = '" + surname + "', Имя = '" + name  + "', Отчество = '" + patr  + "', 'Тип документа' = '" + docType  + "', 'Номер документа' = '" + docNum  + "', 'Пол' = '" + gender  + "', 'Год рождения' = '" + birthday  + "', ");
+                strQuery.append("'Район школы' = '" + arSchool  + "', 'Школа' = '" + school  + "', 'Класс' = '" + grad  + "', 'Родители' = '" + parents  + "', 'Домашний адрес' = '" + address  + "', 'Телефон' = '" + phone  + "', 'e-mail' = '" + email  + "', 'Дата заявления' = '" + admiss  + "', 'Форма обучения' = '" + eduForm  + "', ");
+                strQuery.append("'Когда выбыл' = '" + out  + "', 'С ослабленным здоровьем' = " + weackHealth  + ", 'Сирота' = " + orphan  + ", 'Инвалид' = " + invalid  + ", 'На учёте в полиции' = " + accountInPolice + ", 'Многодетная семья' = " + large  + ", ");
+                strQuery.append("'Неполная семья' = " + incompleteFamily  + ", 'Малообеспеченная семья' = " + lowIncome  + ", 'Мигранты' = " + migrants  + ", 'Примечания' = '" + comments  + "' ");
+                strQuery.append("'WHERE ID = " + id + ";");
             }

             break;


[MISC] xor-shift fix invalid include

[MISC] xor-shift fix invalid include

--- include/ai/misc/xor-shift.hxx
+++ include/ai/misc/xor-shift.hxx
@@ -1,7 +1,7 @@
 #pragma once

 #include "xor-shift.hh"
-#include "date.hh"
+#include "../shell/date.hh"

 inline XorShift64::XorShift64()
         : XorShift64(Date::now())


Fixed Logger logges messages when loading layouts from file and string

--- cegui/src/WindowManager.cpp
+++ cegui/src/WindowManager.cpp
@@ -293,7 +293,7 @@
 	}
 	CEGUI_CATCH(...)
 	{
-        Logger::getSingleton().logEvent("WindowManager::loadWindowLayout - loading of layout from file '" + filename +"' failed.", Errors);
+        Logger::getSingleton().logEvent("WindowManager::loadLayoutFromFile - loading of layout from file '" + filename +"' failed.", Errors);
         CEGUI_RETHROW;
 	}

@@ -318,7 +318,7 @@
     }
     CEGUI_CATCH(...)
     {
-        Logger::getSingleton().logEvent("WindowManager::loadWindowLayout - loading of layout from string failed.", Errors);
+        Logger::getSingleton().logEvent("WindowManager::loadLayoutFromString - loading of layout from string failed.", Errors);
         CEGUI_RETHROW;
     }


Better delegation from AVX to SSE

Better delegation from AVX to SSE

--- include/etl/impl/avx/conv.hpp
+++ include/etl/impl/avx/conv.hpp
@@ -30,6 +30,26 @@
 namespace avx {

 #if defined(ETL_VECTORIZE_IMPL) && defined(__AVX__)
+
+namespace detail {
+
+template<typename T>
+constexpr bool prefer_sse(const size_t n){
+    return
+          std::is_same<T, float>::value
+        ? (n < 8 || (n % 4 == 0 && n % 8 != 0))
+        : (n < 4 || (n % 2 == 0 && n % 4 != 0));
+}
+
+template <typename T>
+void pad_2d_input(const opaque_memory<T, 2>& in, opaque_memory<T, 2>& out, size_t p1, size_t p2) {
+    auto in_m = in.memory_start();
+    auto out_m = out.memory_start();
+
+    for (std::size_t i = 0; i < in.template dim<0>(); ++i) {
+        direct_copy_n(in_m + i * in.template dim<1>(), out_m + (i + p1) * out.template dim<1>() + p2, in.template dim<1>());
+    }
+}

 ETL_INLINE(__m256d) mm256_reverse_pd(__m256d m1) {
 #ifdef __AVX2__
@@ -264,47 +284,6 @@
     }
 }

-template <typename I, typename K, typename C>
-void conv1_full(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
-    std::size_t left = size(kernel) - 1;
-
-    auto* out      = conv.memory_start();
-    const auto* in = input.memory_start();
-    const auto* k  = kernel.memory_start();
-
-    //Process not-'valid' parts of the convolution (left and right)
-    etl::impl::common::left_full_kernel(in, size(input), k, size(kernel), out, first, last);
-    etl::impl::common::right_full_kernel(in, size(input), k, size(kernel), out, first, last);
-
-    //Central part is a 'valid' convolution
-    conv1_valid_micro_kernel(in, size(input), k, size(kernel), out + left, first, last);
-}
-
-template <typename I, typename K, typename C>
-void conv1_same(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
-    std::size_t left = (size(kernel) - 1) / 2;
-
-    auto* out      = conv.memory_start();
-    const auto* in = input.memory_start();
-    const auto* k  = kernel.memory_start();
-
-    //Process not-'valid' parts of the convolution (left and right)
-    etl::impl::common::left_same_kernel(in, size(input), k, size(kernel), out, first, last);
-    etl::impl::common::right_same_kernel(in, size(input), k, size(kernel), out, first, last);
-
-    //Central part is a 'valid' convolution
-    conv1_valid_micro_kernel(in, size(input), k, size(kernel), out + left, first, last);
-}
-
-template <typename I, typename K, typename C>
-void conv1_valid(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
-    auto* out      = conv.memory_start();
-    const auto* in = input.memory_start();
-    const auto* k  = kernel.memory_start();
-
-    conv1_valid_micro_kernel(in, size(input), k, size(kernel), out, first, last);
-}
-
 inline void conv2_valid_flipped_border(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out, double beta, std::size_t i, std::size_t j, size_t s1, size_t s2, size_t p1, size_t p2) {
     const std::size_t c2 = (n2 - m2 + 2 * p2) / s2 + 1;

@@ -332,11 +311,6 @@
 }

 inline void conv2_valid_flipped_micro_kernel(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out, double beta, size_t s1, size_t s2, size_t p1, size_t p2) {
-    if(m2 < 4){
-        etl::impl::sse::conv2_valid_flipped_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta, s1, s2, p1, p2);
-        return;
-    }
-
     const std::size_t c1 = (n1 - m1 + 2 * p1) / s1 + 1;
     const std::size_t c2 = (n2 - m2 + 2 * p2) / s2 + 1;

@@ -551,11 +525,6 @@
 }

 inline void conv2_valid_micro_kernel(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out, double beta, size_t s1, size_t s2, size_t p1, size_t p2) {
-    if(m2 < 4){
-        etl::impl::sse::conv2_valid_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta, s1, s2, p1, p2);
-        return;
-    }
-
     auto kernel_reverse = aligned_allocate_auto<double>(m1 * m2);

     std::reverse_copy(kernel, kernel + m1 * m2, kernel_reverse.get());
@@ -564,11 +533,6 @@
 }

 inline void conv2_same_micro_kernel(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out) {
-    if(m2 < 4){
-        etl::impl::sse::conv2_same_micro_kernel(in, n1, n2, kernel, m1, m2, out);
-        return;
-    }
-
     std::size_t c1 = n1;
     std::size_t c2 = n2;

@@ -619,11 +583,6 @@
 }

 inline void conv2_full_micro_kernel(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out, double beta) {
-    if(m2 < 4){
-        etl::impl::sse::conv2_full_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta);
-        return;
-    }
-
     std::size_t c1 = n1 + m1 - 1;
     std::size_t c2 = n2 + m2 - 1;

@@ -705,11 +664,6 @@
 }

 inline void conv2_full_flipped_micro_kernel(const double* in, std::size_t n1, std::size_t n2, const double* kernel, std::size_t m1, std::size_t m2, double* out, double beta) {
-    if(m2 < 4){
-        etl::impl::sse::conv2_full_flipped_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta);
-        return;
-    }
-
     std::size_t c1 = n1 + m1 - 1;
     std::size_t c2 = n2 + m2 - 1;

@@ -815,11 +769,6 @@
 }

 inline void conv2_valid_flipped_micro_kernel(const float* in, std::size_t n1, std::size_t n2, const float* kernel, std::size_t m1, std::size_t m2, float* out, float beta, size_t s1, size_t s2, size_t p1, size_t p2) {
-    if(m2 < 8){
-        etl::impl::sse::conv2_valid_flipped_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta, s1, s2, p1, p2);
-        return;
-    }
-
     const std::size_t c1 = (n1 - m1 + 2 * p1) / s1 + 1;
     const std::size_t c2 = (n2 - m2 + 2 * p2) / s2 + 1;

@@ -1060,10 +1009,6 @@
 }

 inline void conv2_valid_micro_kernel(const float* in, std::size_t n1, std::size_t n2, const float* kernel, std::size_t m1, std::size_t m2, float* out, float beta, size_t s1, size_t s2, size_t p1, size_t p2) {
-    if(m2 < 8){
-        etl::impl::sse::conv2_valid_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta, s1, s2, p1, p2);
-        return;
-    }

     auto kernel_reverse = aligned_allocate_auto<float>(m1 * m2);

@@ -1073,11 +1018,6 @@
 }

 inline void conv2_same_micro_kernel(const float* in, std::size_t n1, std::size_t n2, const float* kernel, std::size_t m1, std::size_t m2, float* out) {
-    if(m2 < 8){
-        etl::impl::sse::conv2_same_micro_kernel(in, n1, n2, kernel, m1, m2, out);
-        return;
-    }
-
     std::size_t c1 = n1;
     std::size_t c2 = n2;

@@ -1128,11 +1068,6 @@
 }

 inline void conv2_full_micro_kernel(const float* in, std::size_t n1, std::size_t n2, const float* kernel, std::size_t m1, std::size_t m2, float* out, float beta) {
-    if(m2 < 8){
-        etl::impl::sse::conv2_full_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta);
-        return;
-    }
-
     std::size_t c1 = n1 + m1 - 1;
     std::size_t c2 = n2 + m2 - 1;

@@ -1214,11 +1149,6 @@
 }

 inline void conv2_full_flipped_micro_kernel(const float* in, std::size_t n1, std::size_t n2, const float* kernel, std::size_t m1, std::size_t m2, float* out, float beta) {
-    if (m2 < 8) {
-        etl::impl::sse::conv2_full_flipped_micro_kernel(in, n1, n2, kernel, m1, m2, out, beta);
-        return;
-    }
-
     std::size_t c1 = n1 + m1 - 1;
     std::size_t c2 = n2 + m2 - 1;

@@ -1297,18 +1227,56 @@
     }
 }

-template <typename T>
-void pad_2d_input(const opaque_memory<T, 2>& in, opaque_memory<T, 2>& out, size_t p1, size_t p2) {
-    auto in_m = in.memory_start();
-    auto out_m = out.memory_start();
-
-    for (std::size_t i = 0; i < in.template dim<0>(); ++i) {
-        direct_copy_n(in_m + i * in.template dim<1>(), out_m + (i + p1) * out.template dim<1>() + p2, in.template dim<1>());
-    }
+} // end of namespace detail
+
+template <typename I, typename K, typename C>
+void conv1_full(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
+    std::size_t left = size(kernel) - 1;
+
+    auto* out      = conv.memory_start();
+    const auto* in = input.memory_start();
+    const auto* k  = kernel.memory_start();
+
+    //Process not-'valid' parts of the convolution (left and right)
+    etl::impl::common::left_full_kernel(in, size(input), k, size(kernel), out, first, last);
+    etl::impl::common::right_full_kernel(in, size(input), k, size(kernel), out, first, last);
+
+    //Central part is a 'valid' convolution
+    detail::conv1_valid_micro_kernel(in, size(input), k, size(kernel), out + left, first, last);
+}
+
+template <typename I, typename K, typename C>
+void conv1_same(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
+    std::size_t left = (size(kernel) - 1) / 2;
+
+    auto* out      = conv.memory_start();
+    const auto* in = input.memory_start();
+    const auto* k  = kernel.memory_start();
+
+    //Process not-'valid' parts of the convolution (left and right)
+    etl::impl::common::left_same_kernel(in, size(input), k, size(kernel), out, first, last);
+    etl::impl::common::right_same_kernel(in, size(input), k, size(kernel), out, first, last);
+
+    //Central part is a 'valid' convolution
+    detail::conv1_valid_micro_kernel(in, size(input), k, size(kernel), out + left, first, last);
+}
+
+template <typename I, typename K, typename C>
+void conv1_valid(const I& input, const K& kernel, C&& conv, std::size_t first, std::size_t last) {
+    auto* out      = conv.memory_start();
+    const auto* in = input.memory_start();
+    const auto* k  = kernel.memory_start();
+
+    detail::conv1_valid_micro_kernel(in, size(input), k, size(kernel), out, first, last);
 }

 template <typename T>
 void conv2_valid(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
+    if(detail::prefer_sse<T>(kernel.dim(1))){
+        etl::impl::sse::conv2_valid(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
     if(p1 || p2){
         const auto ws_h = input.template dim<0>() + 2 * p1;
         const auto ws_w = input.template dim<1>() + 2 * p2;
@@ -1317,9 +1285,9 @@
             etl::dyn_matrix<T, 2> workspace(ws_h, ws_w, T(0));
             auto ws_direct = workspace.direct();

-            pad_2d_input(input, ws_direct, p1, p2);
-
-            conv2_valid_micro_kernel(
+            detail::pad_2d_input(input, ws_direct, p1, p2);
+
+            detail::conv2_valid_micro_kernel(
                 workspace.memory_start(), ws_h, ws_w,
                 kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
                 conv.memory_start(), 0.0, s1, s2, 0, 0);
@@ -1328,7 +1296,7 @@
         }
     }

-    conv2_valid_micro_kernel(
+    detail::conv2_valid_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start(), 0.0, s1, s2, p1, p2);
@@ -1336,7 +1304,12 @@

 template <typename T>
 void conv2_valid_flipped(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
-    conv2_valid_flipped_micro_kernel(
+    if(detail::prefer_sse<T>(kernel.dim(1))){
+        etl::impl::sse::conv2_valid_flipped(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
+    detail::conv2_valid_flipped_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start(), 0.0, s1, s2, p1, p2);
@@ -1344,6 +1317,11 @@

 template <typename T>
 void conv2_valid_multi(const opaque_memory<T, 2>& input, const opaque_memory<T, 3>& kernel, const opaque_memory<T, 3>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
+    if(detail::prefer_sse<T>(kernel.dim(2))){
+        etl::impl::sse::conv2_valid_multi(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
     const auto K = kernel.template dim<0>();

     auto fun_k = [&](const size_t first, const size_t last) {
@@ -1351,7 +1329,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_valid_micro_kernel(
+            detail::conv2_valid_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc, 0.0, s1, s2, p1, p2);
@@ -1363,6 +1341,11 @@

 template <typename T>
 void conv2_valid_multi_flipped(const opaque_memory<T, 2>& input, const opaque_memory<T, 3>& kernel, const opaque_memory<T, 3>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
+    if(detail::prefer_sse<T>(kernel.dim(2))){
+        etl::impl::sse::conv2_valid_multi_flipped(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
     const auto K = kernel.template dim<0>();

     auto fun_k = [&](const size_t first, const size_t last) {
@@ -1370,7 +1353,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_valid_flipped_micro_kernel(
+            detail::conv2_valid_flipped_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc, 0.0, s1, s2, p1, p2);
@@ -1382,6 +1365,11 @@

 template <typename T>
 void conv2_valid_multi_multi(const opaque_memory<T, 3>& input, const opaque_memory<T, 3>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
+    if(detail::prefer_sse<T>(kernel.dim(2))){
+        etl::impl::sse::conv2_valid_multi_multi(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
     const auto K  = kernel.template dim<0>();
     const auto N  = input.template dim<0>();
     const auto KN = K * N;
@@ -1397,7 +1385,7 @@
             const auto c_k = conv.template dim<1>() * conv.template dim<2>() * conv.template dim<3>();
             const auto c_i = conv.template dim<2>() * conv.template dim<3>();

-            conv2_valid_micro_kernel(
+            detail::conv2_valid_micro_kernel(
                 input.memory_start() + n * ii, input.template dim<1>(), input.template dim<2>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * c_k + n * c_i, 0.0, s1, s2, p1, p2);
@@ -1409,6 +1397,11 @@

 template <typename T>
 void conv2_valid_multi_multi_flipped(const opaque_memory<T, 3>& input, const opaque_memory<T, 3>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
+    if(detail::prefer_sse<T>(kernel.dim(2))){
+        etl::impl::sse::conv2_valid_multi_multi_flipped(input, kernel, conv, s1, s2, p1, p2);
+        return;
+    }
+
     const auto K  = kernel.template dim<0>();
     const auto N  = input.template dim<0>();
     const auto KN = K * N;
@@ -1424,7 +1417,7 @@
             const auto c_k = conv.template dim<1>() * conv.template dim<2>() * conv.template dim<3>();
             const auto c_i = conv.template dim<2>() * conv.template dim<3>();

-            conv2_valid_flipped_micro_kernel(
+            detail::conv2_valid_flipped_micro_kernel(
                 input.memory_start() + n * ii, input.template dim<1>(), input.template dim<2>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * c_k + n * c_i, 0.0, s1, s2, p1, p2);
@@ -1437,6 +1430,14 @@
 template <typename T>
 void conv4_valid(const opaque_memory<T, 4>& input, const opaque_memory<T, 4>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
     if(kernel.dim(1) > 0){
+        const auto m1 = kernel.dim(2);
+        const auto m2 = kernel.dim(3);
+
+        if(detail::prefer_sse<T>(m2)){
+            etl::impl::sse::conv4_valid(input, kernel, conv, s1, s2, p1, p2);
+            return;
+        }
+
         const auto conv_i_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
         const auto conv_k_inc = conv.dim(2) * conv.dim(3);

@@ -1449,9 +1450,6 @@
         const auto N = input.dim(0);  // The number of images
         const auto K = kernel.dim(0); // The number of kernels
         const auto C = input.dim(1);  // The number of channels
-
-        const auto m1 = kernel.dim(2);
-        const auto m2 = kernel.dim(3);

         const auto n1 = input.dim(2);
         const auto n2 = input.dim(3);
@@ -1469,7 +1467,7 @@
                         auto m_in     = input.memory_start() + i * input_i_inc + c * input_c_inc;
                         auto m_out    = conv.memory_start() + i * conv_i_inc + k * conv_k_inc;

-                        conv2_valid_micro_kernel(m_in, n1, n2, m_kernel, m1, m2, m_out, 1.0, s1, s2, p1, p2);
+                        detail::conv2_valid_micro_kernel(m_in, n1, n2, m_kernel, m1, m2, m_out, 1.0, s1, s2, p1, p2);
                     }
                 }
             };
@@ -1492,7 +1490,7 @@
                         const auto* m_in = input_mem + i * input_i_inc + c * input_c_inc;
                         auto* m_out      = conv_mem + i * conv_i_inc + k * conv_k_inc;

-                        conv2_valid_flipped_micro_kernel(m_in, n1, n2, kernel_reverse_mem, m1, m2, m_out, 1.0, s1, s2, p1, p2);
+                        detail::conv2_valid_flipped_micro_kernel(m_in, n1, n2, kernel_reverse_mem, m1, m2, m_out, 1.0, s1, s2, p1, p2);
                     }
                 }
             }
@@ -1503,6 +1501,14 @@
 template <typename T>
 void conv4_valid_flipped(const opaque_memory<T, 4>& input, const opaque_memory<T, 4>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
     if(kernel.dim(1) > 0){
+        const auto m1 = kernel.dim(2);
+        const auto m2 = kernel.dim(3);
+
+        if(detail::prefer_sse<T>(m2)){
+            etl::impl::sse::conv4_valid_flipped(input, kernel, conv, s1, s2, p1, p2);
+            return;
+        }
+
         auto conv_i_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
         auto conv_k_inc = conv.dim(2) * conv.dim(3);

@@ -1515,9 +1521,6 @@
         const auto N = input.dim(0);  // The number of images
         const auto K = kernel.dim(0); // The number of kernels
         const auto C = input.dim(1);  // The number of channels
-
-        const auto m1 = kernel.dim(2);
-        const auto m2 = kernel.dim(3);

         const auto n1 = input.dim(2);
         const auto n2 = input.dim(3);
@@ -1532,14 +1535,14 @@
                 auto k = nk % K;

                 //c = 0
-                conv2_valid_flipped_micro_kernel(
+                detail::conv2_valid_flipped_micro_kernel(
                     input_mem + i * input_i_inc, n1, n2,
                     kernel_mem + k * kernel_k_inc, m1, m2,
                     conv_mem + i * conv_i_inc + k * conv_k_inc, 0.0, s1, s2, p1, p2);

                 // c = [1, C]
                 for (std::size_t c = 1; c < C; ++c) {
-                    conv2_valid_flipped_micro_kernel(
+                    detail::conv2_valid_flipped_micro_kernel(
                         input_mem + i * input_i_inc + c * input_c_inc, n1, n2,
                         kernel_mem + k * kernel_k_inc + c * kernel_c_inc, m1, m2,
                         conv_mem + i * conv_i_inc + k * conv_k_inc, 1.0, s1, s2, p1, p2);
@@ -1554,6 +1557,14 @@
 template <typename T>
 void conv4_valid_filter(const opaque_memory<T, 4>& input, const opaque_memory<T, 4>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
     if (input.dim(0) > 0) {
+        const auto m1 = kernel.dim(2);
+        const auto m2 = kernel.dim(3);
+
+        if(detail::prefer_sse<T>(m2)){
+            etl::impl::sse::conv4_valid_filter(input, kernel, conv, s1, s2, p1, p2);
+            return;
+        }
+
         const auto conv_k_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
         const auto conv_c_inc = conv.dim(2) * conv.dim(3);

@@ -1565,9 +1576,6 @@

         const auto n1 = input.dim(2);
         const auto n2 = input.dim(3);
-
-        const auto m1 = kernel.dim(2);
-        const auto m2 = kernel.dim(3);

         const auto N = input.dim(0);  // The number of images
         const auto C = input.dim(1);  // The number of channels
@@ -1583,7 +1591,7 @@
                 auto k = kc / C;
                 auto c = kc % C;

-                conv2_valid_micro_kernel(
+                detail::conv2_valid_micro_kernel(
                     input_mem + 0 * input_i_inc + c * input_c_inc, n1, n2,
                     kernel_mem + 0 * kernel_i_inc + k * kernel_k_inc, m1, m2,
                     conv_mem + k * conv_k_inc + c * conv_c_inc, 0.0, s1, s2, p1, p2);
@@ -1594,7 +1602,7 @@
                     auto k = kc / C;
                     auto c = kc % C;

-                    conv2_valid_micro_kernel(
+                    detail::conv2_valid_micro_kernel(
                         input_mem + i * input_i_inc + c * input_c_inc, n1, n2,
                         kernel_mem + i * kernel_i_inc + k * kernel_k_inc, m1, m2,
                         conv_mem + k * conv_k_inc + c * conv_c_inc, 1.0, s1, s2, p1, p2);
@@ -1609,6 +1617,14 @@
 template <typename T>
 void conv4_valid_filter_flipped(const opaque_memory<T, 4>& input, const opaque_memory<T, 4>& kernel, const opaque_memory<T, 4>& conv, size_t s1, size_t s2, size_t p1, size_t p2) {
     if (input.dim(0) > 0) {
+        const auto m1 = kernel.dim(2);
+        const auto m2 = kernel.dim(3);
+
+        if(detail::prefer_sse<T>(m2)){
+            etl::impl::sse::conv4_valid_filter_flipped(input, kernel, conv, s1, s2, p1, p2);
+            return;
+        }
+
         const auto conv_k_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
         const auto conv_c_inc = conv.dim(2) * conv.dim(3);

@@ -1620,9 +1636,6 @@

         const auto n1 = input.dim(2);
         const auto n2 = input.dim(3);
-
-        const auto m1 = kernel.dim(2);
-        const auto m2 = kernel.dim(3);

         const auto N = input.dim(0);  // The number of images
         const auto C = input.dim(1);  // The number of channels
@@ -1638,7 +1651,7 @@
                 auto k = kc / C;
                 auto c = kc % C;

-                conv2_valid_flipped_micro_kernel(
+                detail::conv2_valid_flipped_micro_kernel(
                     input_mem + 0 * input_i_inc + c * input_c_inc, n1, n2,
                     kernel_mem + 0 * kernel_i_inc + k * kernel_k_inc, m1, m2,
                     conv_mem + k * conv_k_inc + c * conv_c_inc, 0.0, s1, s2, p1, p2);
@@ -1649,7 +1662,7 @@
                     auto k = kc / C;
                     auto c = kc % C;

-                    conv2_valid_flipped_micro_kernel(
+                    detail::conv2_valid_flipped_micro_kernel(
                         input_mem + i * input_i_inc + c * input_c_inc, n1, n2,
                         kernel_mem + i * kernel_i_inc + k * kernel_k_inc, m1, m2,
                         conv_mem + k * conv_k_inc + c * conv_c_inc, 1.0, s1, s2, p1, p2);
@@ -1667,6 +1680,14 @@
     const auto K = kernel.dim(0);
     const auto C = kernel.dim(1);

+    const auto k1 = kernel.dim(2);
+    const auto k2 = kernel.dim(3);
+
+    if(detail::prefer_sse<T>(k2)){
+        etl::impl::sse::conv4_full(input, kernel, conv);
+        return;
+    }
+
     if (C > 0) {
         auto conv_i_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
         auto conv_c_inc = conv.dim(2) * conv.dim(3);
@@ -1676,9 +1697,6 @@

         auto input_i_inc = input.dim(1) * input.dim(2) * input.dim(3);
         auto input_k_inc = input.dim(2) * input.dim(3);
-
-        const auto k1 = kernel.dim(2);
-        const auto k2 = kernel.dim(3);

         etl::dyn_matrix<T, 4> prepared_k(K, C, k1, k2);

@@ -1692,7 +1710,7 @@
                     for (std::size_t i = first; i < last; ++i) {
                         // k = 0
                         for (std::size_t c = 0; c < C; ++c) {
-                            conv2_full_flipped_micro_kernel(
+                            detail::conv2_full_flipped_micro_kernel(
                                 input.memory_start() + i * input_i_inc + 0 * input_k_inc, input.dim(2), input.dim(3),
                                 prepared_k.memory_start() + 0 * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                 conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 0.0);
@@ -1700,7 +1718,7 @@

                         for (std::size_t k = 1; k < K; ++k) {
                             for (std::size_t c = 0; c < C; ++c) {
-                                conv2_full_flipped_micro_kernel(
+                                detail::conv2_full_flipped_micro_kernel(
                                     input.memory_start() + i * input_i_inc + k * input_k_inc, input.dim(2), input.dim(3),
                                     prepared_k.memory_start() + k * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                     conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 1.0);
@@ -1717,7 +1735,7 @@
                     for (std::size_t i = 0; i < N; ++i) {
                         // k = 0
                         for (std::size_t c = first; c < last; ++c) {
-                            conv2_full_flipped_micro_kernel(
+                            detail::conv2_full_flipped_micro_kernel(
                                 input.memory_start() + i * input_i_inc + 0 * input_k_inc, input.dim(2), input.dim(3),
                                 prepared_k.memory_start() + 0 * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                 conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 0.0);
@@ -1725,7 +1743,7 @@

                         for (std::size_t k = 1; k < K; ++k) {
                             for (std::size_t c = first; c < last; ++c) {
-                                conv2_full_flipped_micro_kernel(
+                                detail::conv2_full_flipped_micro_kernel(
                                     input.memory_start() + i * input_i_inc + k * input_k_inc, input.dim(2), input.dim(3),
                                     prepared_k.memory_start() + k * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                     conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 1.0);
@@ -1745,6 +1763,13 @@
     const auto N = input.dim(0);
     const auto K = kernel.dim(0);
     const auto C = kernel.dim(1);
+
+    const auto k2 = kernel.dim(3);
+
+    if(detail::prefer_sse<T>(k2)){
+        etl::impl::sse::conv4_full_flipped(input, kernel, conv);
+        return;
+    }

     if (C > 0) {
         auto conv_i_inc = conv.dim(1) * conv.dim(2) * conv.dim(3);
@@ -1762,7 +1787,7 @@
                     for (std::size_t i = first; i < last; ++i) {
                         // k = 0
                         for (std::size_t c = 0; c < C; ++c) {
-                            conv2_full_flipped_micro_kernel(
+                            detail::conv2_full_flipped_micro_kernel(
                                 input.memory_start() + i * input_i_inc + 0 * input_k_inc, input.dim(2), input.dim(3),
                                 kernel.memory_start() + 0 * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                 conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 0.0);
@@ -1770,7 +1795,7 @@

                         for (std::size_t k = 1; k < K; ++k) {
                             for (std::size_t c = 0; c < C; ++c) {
-                                conv2_full_flipped_micro_kernel(
+                                detail::conv2_full_flipped_micro_kernel(
                                     input.memory_start() + i * input_i_inc + k * input_k_inc, input.dim(2), input.dim(3),
                                     kernel.memory_start() + k * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                     conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 1.0);
@@ -1787,7 +1812,7 @@
                     for (std::size_t i = 0; i < N; ++i) {
                         // k = 0
                         for (std::size_t c = first; c < last; ++c) {
-                            conv2_full_flipped_micro_kernel(
+                            detail::conv2_full_flipped_micro_kernel(
                                 input.memory_start() + i * input_i_inc + 0 * input_k_inc, input.dim(2), input.dim(3),
                                 kernel.memory_start() + 0 * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                 conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 0.0);
@@ -1795,7 +1820,7 @@

                         for (std::size_t k = 1; k < K; ++k) {
                             for (std::size_t c = first; c < last; ++c) {
-                                conv2_full_flipped_micro_kernel(
+                                detail::conv2_full_flipped_micro_kernel(
                                     input.memory_start() + i * input_i_inc + k * input_k_inc, input.dim(2), input.dim(3),
                                     kernel.memory_start() + k * kernel_k_inc + c * kernel_c_inc, kernel.dim(2), kernel.dim(3),
                                     conv.memory_start() + i * conv_i_inc + c * conv_c_inc, 1.0);
@@ -1812,7 +1837,7 @@

 template <typename T>
 void conv2_same(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv) {
-    conv2_same_micro_kernel(
+    detail::conv2_same_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start());
@@ -1820,7 +1845,7 @@

 template <typename T>
 void conv2_same_flipped(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv) {
-    conv2_same_flipped_micro_kernel(
+    detail::conv2_same_flipped_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start());
@@ -1835,7 +1860,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_same_micro_kernel(
+            detail::conv2_same_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc);
@@ -1854,7 +1879,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_same_flipped_micro_kernel(
+            detail::conv2_same_flipped_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc);
@@ -1866,7 +1891,7 @@

 template <typename T>
 void conv2_full(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv) {
-    conv2_full_micro_kernel(
+    detail::conv2_full_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start(), 0.0);
@@ -1874,7 +1899,7 @@

 template <typename T>
 void conv2_full_flipped(const opaque_memory<T, 2>& input, const opaque_memory<T, 2>& kernel, const opaque_memory<T, 2>& conv) {
-    conv2_full_flipped_micro_kernel(
+    detail::conv2_full_flipped_micro_kernel(
         input.memory_start(), input.template dim<0>(), input.template dim<1>(),
         kernel.memory_start(), kernel.template dim<0>(), kernel.template dim<1>(),
         conv.memory_start(), 0.0);
@@ -1889,7 +1914,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_full_micro_kernel(
+            detail::conv2_full_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc, 0.0);
@@ -1908,7 +1933,7 @@
             auto kk = kernel.template dim<1>() * kernel.template dim<2>();
             auto cc = conv.template dim<1>() * conv.template dim<2>();

-            conv2_full_flipped_micro_kernel(
+            detail::conv2_full_flipped_micro_kernel(
                 input.memory_start(), input.template dim<0>(), input.template dim<1>(),
                 kernel.memory_start() + k * kk, kernel.template dim<1>(), kernel.template dim<2>(),
                 conv.memory_start() + k * cc, 0.0);


more info

more info

--- adding-types/customitem.cpp
+++ adding-types/customitem.cpp
@@ -14,6 +14,15 @@
 void CustomItem::setSize(int size)
 {
     m_size = size;
+
+    /*To prevent loops or excessive evaluation, developers should ensure that
+     * the property change signal is only emitted when the property value has
+     * actually changed.
+     * Also, if a property or group of properties is infrequently used,
+     * it is permitted to use the same NOTIFY signal for several properties.
+     * This should be done with care to ensure that performance doesn't
+     * suffer.
+    */
     emit sizeChanged(m_size);
 }


Fix size ambiguity

Fix size ambiguity

--- include/etl/impl/std/conv.hpp
+++ include/etl/impl/std/conv.hpp
@@ -24,8 +24,8 @@
 template <typename I, typename K, typename C>
 void conv1_full(const I& input, const K& kernel, C&& conv, size_t first, size_t last) {
     for (size_t i = first; i < last; ++i) {
-        const auto lo = i >= size(kernel) - 1 ? i - (size(kernel) - 1) : 0;
-        const auto hi = (i < size(input) - 1 ? i : size(input) - 1) + 1;
+        const auto lo = i >= etl::size(kernel) - 1 ? i - (etl::size(kernel) - 1) : 0;
+        const auto hi = (i < etl::size(input) - 1 ? i : etl::size(input) - 1) + 1;

         value_t<I> temp = 0.0;

@@ -48,13 +48,13 @@
 template <typename I, typename K, typename C>
 void conv1_same(const I& input, const K& kernel, C&& conv, size_t first, size_t last) {
     for (size_t j = first; j < last; ++j) {
-        size_t l_lo = std::max<int>(0, j - (size(kernel) - 1) / 2);
-        size_t l_hi = std::min<int>(size(input) - 1, j + size(kernel) / 2) + 1;
+        size_t l_lo = std::max<int>(0, j - (etl::size(kernel) - 1) / 2);
+        size_t l_hi = std::min<int>(etl::size(input) - 1, j + etl::size(kernel) / 2) + 1;

         value_t<I> temp = 0.0;

         for (size_t l = l_lo; l < l_hi; ++l) {
-            temp += input(l) * kernel(j - l + size(kernel) / 2);
+            temp += input(l) * kernel(j - l + etl::size(kernel) / 2);
         }

         conv[j] = temp;
@@ -74,8 +74,8 @@
     for (size_t j = first; j < last; ++j) {
         value_t<I> temp = 0.0;

-        for (size_t l = j; l < j + size(kernel); ++l) {
-            temp += input[l] * kernel[j + size(kernel) - 1 - l];
+        for (size_t l = j; l < j + etl::size(kernel); ++l) {
+            temp += input[l] * kernel[j + etl::size(kernel) - 1 - l];
         }

         conv[j] = temp;


add string::empty()

add string::empty()

--- include/flusspferd/string.hpp
+++ include/flusspferd/string.hpp
@@ -49,6 +49,10 @@
   string &operator=(string const &o);

   std::size_t length() const;
+
+  bool empty() const {
+    return !length();
+  }

   std::string to_string() const;
   char const *c_str() const;


Return type of rect.points()

Return type of rect.points()

--- include/geometry/geometry.hpp
+++ include/geometry/geometry.hpp
@@ -595,7 +595,7 @@
 	}

 	//Returns the corners of the rectangle in counter-clockwise order
-	std::array<Vec2D<double>, 4> points() const {
+	std::vector<Vec2D<double>> points() const {
 		return{ x1,x2,x3,x4 };
 	}

@@ -966,6 +966,7 @@
 template<typename T>
 geom2d::Rectangle bounding_box( const geom::point_cloud<T, 2>& points ) {
 	assert( !points.empty() );
+	static_assert(std::is_convertible<T, double>::value);

 	T x_max = points[0].x();
 	T x_min = points[0].x();
@@ -989,7 +990,7 @@
 		}
 	}

-	return{ Rectangle({x_min, y_min}, {x_max, y_max}) };
+	return{ Rectangle( Vec2D<T>({x_min, y_min}).as_doubles(), Vec2D<T>({x_max, y_max}).as_doubles() ) };
 }


use posix_memalign on linux, not valloc

use posix_memalign on linux, not valloc

git-svn-id: 6ed3528c1be4534134272ad6dd050eeaa1f628d3@8186 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda

--- include/libtorrent/config.hpp
+++ include/libtorrent/config.hpp
@@ -201,6 +201,7 @@
 #define TORRENT_USE_NETLINK 1
 #define TORRENT_USE_IFCONF 1
 #define TORRENT_HAS_SALEN 0
+#define TORRENT_USE_POSIX_MEMALIGN 1

 // ==== MINGW ===
 #elif defined __MINGW32__


fix minor mingw issue

fix minor mingw issue

git-svn-id: 4f0141143c3c635d33f1b9f02fcb2b6c73e45c89@5501 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- include/libtorrent/config.hpp
+++ include/libtorrent/config.hpp
@@ -47,7 +47,7 @@
 #endif

 #ifndef PRId64
-#ifdef _WIN32
+#ifdef _MSC_VER
 #define PRId64 "I64d"
 #else
 #define PRId64 "lld"


Make sure to remove a timed-out event before passing time-out to caller

--- include/lofty/keyed_demux.hxx
+++ include/lofty/keyed_demux.hxx
@@ -140,7 +140,14 @@
          _std::unique_lock<_std::mutex> lock(outstanding_gets_mutex);
          outstanding_gets.add_or_assign(key, outstanding_get_t(&get_event));
       }
-      get_event.wait(timeout_millisecs);
+      try {
+         get_event.wait(timeout_millisecs);
+      } catch (io::timeout const &) {
+         // The event is dead to us.
+         _std::unique_lock<_std::mutex> lock(outstanding_gets_mutex);
+         outstanding_gets.remove(key);
+         throw;
+      }

       // Re-retrieve the key/value, since outstanding_gets might have changed in the meantime.
       _std::unique_lock<_std::mutex> lock(outstanding_gets_mutex);


make params_ accessible from derived classes

--- include/mapnik/datasource.hpp
+++ include/mapnik/datasource.hpp
@@ -66,7 +66,6 @@

     class MAPNIK_DECL datasource : private boost::noncopyable
     {
-        parameters params_;
     public:
         enum {
             Vector,
@@ -87,6 +86,8 @@
         virtual Envelope<double> envelope() const=0;
         virtual layer_descriptor get_descriptor() const=0;
         virtual ~datasource() {};
+    protected:
+        parameters params_;
     };

     typedef std::string datasource_name();


page 1 is the "top", so page up should take the page number DOWN (and vice versa)

--- src/bzflag/FormatMenu.cxx
+++ src/bzflag/FormatMenu.cxx
@@ -33,13 +33,13 @@
   if (key.ascii == 0) switch (key.button) {
     case BzfKeyEvent::PageUp:
       if (HUDui::getFocus()) {
-	menu->setPage(menu->page + 1);
+	menu->setPage(menu->page - 1);
       }
       return true;

     case BzfKeyEvent::PageDown:
       if (HUDui::getFocus()) {
-	menu->setPage(menu->page - 1);
+	menu->setPage(menu->page + 1);
       }
       return true;


Removing unused variable

Removing unused variable

git-svn-id: c0942edff5350604e2827ab28bdfcfa5200fadee@21371 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/ServerMenu.cxx
+++ src/bzflag/ServerMenu.cxx
@@ -683,8 +683,7 @@

   // add cache items w/o re-caching them
   serversFound = 0;
-  int numItemsAdded;
-  numItemsAdded = realServerList.updateFromCache();
+  realServerList.updateFromCache();

   // update the status
   updateStatus();


don't display the search and keybinding help strings if there are no servers to search on nor add to favorites

--- src/bzflag/ServerMenu.cxx
+++ src/bzflag/ServerMenu.cxx
@@ -180,13 +180,18 @@
   search->setFontFace(MainMenu::getFontFace());
   search->setMaxLength(30);
   getControls().push_back(search);
-  setFind(false);

   // short key help
   help = new HUDuiLabel;
   help->setFontFace(MainMenu::getFontFace());
-  help->setString("Press  +/- add/remove favorites   f - toggle view");
+  if (serverList.size() == 0) {
+    help->setString("");
+  } else {
+    help->setString("Press  +/- add/remove favorites   f - toggle view");
+  }
   getControls().push_back(help);
+
+  setFind(false);

   // set initial focus
   setFocus(status);
@@ -210,7 +215,13 @@
     search->setFocus();
   } else {
     if (search->getString() == "" || search->getString() == "*") {
-      search->setLabel("Press '/' to search");
+      if (serverList.size() == 0) {
+	search->setLabel("");
+	help->setString("");
+      } else {
+	search->setLabel("Press '/' to search");
+	help->setString("Press  +/- add/remove favorites   f - toggle view");
+      }
       search->setString("");
       filter = "*";
     } else {


fix previous

fix previous

--- src/monitor/reputationTracer.cpp
+++ src/monitor/reputationTracer.cpp
@@ -488,6 +488,7 @@
 	if ( iterator != m_registeredTrackers.end() )
 	{
 		_trackerData = (*iterator).second;
+		return true;
 	}

 	return false;


[Array] Fixed more mismatched new/deletes

--- include/occa/array/linalg.tpp
+++ include/occa/array/linalg.tpp
@@ -229,7 +229,7 @@
       for (int i = 0; i < 1024; ++i) {
         ret += partialReduction[i];
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return ret;
     }

@@ -243,7 +243,7 @@
       for (int i = 0; i < 1024; ++i) {
         ret += partialReduction[i];
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return sqrt(ret);
     }

@@ -269,7 +269,7 @@
       for (int i = 0; i < 1024; ++i) {
         ret += hostBuffer[i];
       }
-      delete hostBuffer;
+      delete [] hostBuffer;
       return pow(ret, 1.0/p);
     }

@@ -286,7 +286,7 @@
           ret = abs_i;
         }
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return ret;
     }

@@ -302,7 +302,7 @@
           ret = partialReduction[i];
         }
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return ret;
     }

@@ -318,7 +318,7 @@
           ret = partialReduction[i];
         }
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return ret;
     }

@@ -372,7 +372,7 @@
       for (int i = 0; i < 1024; ++i) {
         ret += hostBuffer[i];
       }
-      delete hostBuffer;
+      delete [] hostBuffer;
       return sqrt(ret);
     }

@@ -386,7 +386,7 @@
       for (int i = 0; i < 1024; ++i) {
         ret += partialReduction[i];
       }
-      delete partialReduction;
+      delete [] partialReduction;
       return ret;
     }


Minor edits to API documentation of sqloxx::PersistentObject.

--- include/persistent_object.hpp
+++ include/persistent_object.hpp
@@ -328,7 +328,7 @@
 	 * changes to the in-memory object remain in the in-memory object and
 	 * are subsequently written to the database
 	 * when save() is called, you should always call load() as
-	 * the \e first statement in the implementation of any \e setter method in
+	 * the \e first statement in the implementation of any setter method in
 	 * the DerivedT class.
 	 *
 	 * (2) Object does not have id
@@ -361,17 +361,17 @@
 	 * the greatest primary key value already in the primary table for the
 	 * type DerivedT is
 	 * the maximum possible value for the type Id, so that another row
-	 * could not be inserted without overflow.
+	 * could not be inserted without overflow.\n
 	 *
 	 * @throws std::bad_alloc in the unlikely event of memory allocation
-	 * failure during execution.
+	 * failure during execution.\n
 	 *
 	 * @throws TransactionNestingException if the maximum transaction
 	 * nesting level of the DatabaseConnection has been reached (extremely
-	 * unlikely). (May be thrown under either (1) or (2).)
+	 * unlikely).\n
 	 *
 	 * @throws InvalidConnection if the DatabaseConnection is
-	 * invalid. (May be thrown under either (1) or (2).)
+	 * invalid.\n
 	 *
 	 * @throws UnresolvedTransactionException if there is failure in
 	 * the process of committing the database transaction, or if there is
@@ -398,16 +398,14 @@
 	 *  state;\n
 	 *  (c) If the object has an id, save() may fail and throw an
 	 *  exception but with the object left in a
-	 * ghost state.
+	 * ghost state.\n
 	 * In either (b) or (c), it is possible that failure may occur
-	 * with UnresolvedTransactionException being thrown. If this occurs,
+	 * with \b UnresolvedTransactionException being thrown. If this occurs,
 	 * it is recommended that the application session be gracefully
 	 * terminated.
 	 * Note that (b) and (c) are functionally equivalent to one another
 	 * as far as client
-	 * code is concerned, providing the preconditions are met, and in
-	 * particular, providing client DerivedT class always calls load() as
-	 * the first statement of any getter.
+	 * code is concerned, providing the preconditions are met.
 	 */
 	void save();

@@ -425,10 +423,10 @@
 	 * by the class DerivedT, then the preconditions of \b do_remove()
 	 * must be satisfied (see separate documentation for \b do_remove());\n
 	 * If \b do_remove() is redefined by DerivedT, then it should offer the
-	 * strong guarantee, i.e. be atomic, in respect of the state of
+	 * strong guarantee, i.e. be atomic, in respect of the state of
 	 * the in-memory objects (but note, the base remove() method takes
 	 * care of wrapping the implementation as a SQL transaction, so
-	 * in general, \b do_removed() doesn't need to worry about atomicity
+	 * in general, \b do_remove() doesn't need to worry about atomicity
 	 * in regards to the database);\n
 	 * \b DerivedT::do_ghostify() should be defined so as to adhere to the
 	 * preconditions detailed in the documentation for ghostify();\n and
@@ -436,13 +434,13 @@
 	 * first statement.
 	 *
 	 * @throws std::bad_alloc in the unlikely event of mememory allocation
-	 * failure during execution.
-	 *
-	 * @throws InvalidConnection if the database connection is invalid.
+	 * failure during execution.\n
+	 *
+	 * @throws InvalidConnection if the database connection is invalid.\n
 	 *
 	 * @throws TransactionNestingException if the maximum transaction
 	 * nesting level of the DatabaseConnection has been reached (extremely
-	 * unlikely).
+	 * unlikely).\n
 	 *
 	 * @throws UnresolvedTransactionException if there is failure in
 	 * the process of committing the database transaction, or if there is
@@ -454,7 +452,7 @@
 	 * same application session may jeopardize that situation.
 	 *
 	 * Exception safety: basic guarantee. If an exception other
-	 * than UnresolvedTransactionException is thrown, then the
+	 * than \b UnresolvedTransactionException is thrown, then the
 	 * application state will be effectively rolled back, and although the
 	 * object may be left in a ghost state, this should require no
 	 * special handling by the client code provided the preconditions are
@@ -469,7 +467,7 @@
 	/**
 	 * @returns the id of the object, if it has one.
 	 *
-	 * @throws jewel::UninitializedOptionalException if the object doesn't
+	 * @throws \b jewel::UninitializedOptionalException if the object doesn't
 	 * have an id.
 	 *
 	 * Exception safety: strong guarantee.
@@ -685,8 +683,8 @@
 	PersistentObject(PersistentObject const&) = default;

 	/**
-	 * Swap function. Does what you expect. This swaps the base part of
-	 * the object only.
+	 * Swap function. This swaps the base (sqloxx::PersistentObject) part of the
+	 * object only: it does not call down into any virtual functions.
 	 *
 	 * Exception safety: nothrow guarantee
 	 */


fix variant clustering

fix variant clustering

--- src/nanopolish_call_variants.cpp
+++ src/nanopolish_call_variants.cpp
@@ -157,10 +157,10 @@
     while(curr_variant_idx < candidate_variants.size()) {

         // Group the variants that are within calling_span bases of each other
-        size_t end_variant_idx = curr_variant_idx;
+        size_t end_variant_idx = curr_variant_idx + 1;
         while(end_variant_idx < candidate_variants.size()) {
             int distance = candidate_variants[end_variant_idx].ref_position -
-                           candidate_variants[curr_variant_idx].ref_position;
+                           candidate_variants[end_variant_idx - 1].ref_position;
             if(distance > calling_span)
                 break;
             end_variant_idx++;


Comment.

Comment.

--- include/pqxx/notification.hxx
+++ include/pqxx/notification.hxx
@@ -68,7 +68,7 @@
   /// The channel that this receiver listens on.
   [[nodiscard]] std::string const &channel() const { return m_channel; }

-  // TODO: Can we phase this out in favour of zview or string_view?
+  // TODO: Change API to take payload as zview instead of string ref.
   /// Overridable: action to invoke when notification arrives.
   /**
    * @param payload An optional string that may have been passed to the NOTIFY


Fixed win64 build error

Fixed win64 build error

--- src/native/ui/bgfx/ui_render.cpp
+++ src/native/ui/bgfx/ui_render.cpp
@@ -91,7 +91,7 @@
         return 0;
     }

-    const bgfx::Memory* mem = bgfx::makeRef(data, size + 1, NULL, NULL);
+    const bgfx::Memory* mem = bgfx::makeRef(data, (uint32_t)(size + 1), NULL, NULL);

     // terminate strings
     data[size] = 0;


Backends: WGPU: removed Emscripten version check (currently failing on CI, ensure why, and tbh its redundant/unnecessary with changes of wgpu api nowadays)

--- backends/imgui_impl_wgpu.cpp
+++ backends/imgui_impl_wgpu.cpp
@@ -25,12 +25,6 @@
 #include "imgui_impl_wgpu.h"
 #include <limits.h>
 #include <webgpu/webgpu.h>
-
-#define HAS_EMSCRIPTEN_VERSION(major, minor, tiny) (__EMSCRIPTEN_major__ > (major) || (__EMSCRIPTEN_major__ == (major) && __EMSCRIPTEN_minor__ > (minor)) || (__EMSCRIPTEN_major__ == (major) && __EMSCRIPTEN_minor__ == (minor) && __EMSCRIPTEN_tiny__ >= (tiny)))
-
-#if defined(__EMSCRIPTEN__) && !HAS_EMSCRIPTEN_VERSION(2, 0, 20)
-#error "Requires at least emscripten 2.0.20"
-#endif

 // Dear ImGui prototypes from imgui_internal.h
 extern ImGuiID ImHashData(const void* data_p, size_t data_size, ImU32 seed = 0);


Optimize for Intel Skylake CPUs

Optimize for Intel Skylake CPUs

--- include/primesieve/config.hpp
+++ include/primesieve/config.hpp
@@ -125,7 +125,13 @@
   /// (and > EratSmall see above) are processed in EratMedium objects.
   /// @pre FACTOR_ERATMEDIUM >= 0 && <= 9
   ///
-  const double FACTOR_ERATMEDIUM = 7.5;
+  /// Statistically ideal factor for 4th Wheel is:
+  /// FACTOR_ERATMEDIUM * (4.468 / 2) + FACTOR_ERATMEDIUM * 10 = 30
+  /// FACTOR_ERATMEDIUM * (2.234 + 10) = 30
+  /// FACTOR_ERATMEDIUM =  30 / 12.234
+  /// FACTOR_ERATMEDIUM = 2.452
+  ///
+  const double FACTOR_ERATMEDIUM = 2.452;

   /// Each thread sieves at least an interval of size
   /// MIN_THREAD_INTERVAL to reduce the initialization overhead.


Call util function instead of duplicate the code in gpu_feature_browsertest.cc

BUG=
TEST=GpuFeatureBrowsertest
R=jbates
Review URL: http://codereview.chromium.org/8816027

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

--- chrome/test/gpu/gpu_feature_browsertest.cc
+++ chrome/test/gpu/gpu_feature_browsertest.cc
@@ -11,6 +11,7 @@
 #include "chrome/browser/ui/browser.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/test_launcher_utils.h"
 #include "chrome/test/base/tracing.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "content/browser/gpu/gpu_blacklist.h"
@@ -39,9 +40,9 @@
     // This enables DOM automation for tab contents.
     EnableDOMAutomation();
 #if !defined(OS_MACOSX)
-    CHECK(!command_line->HasSwitch(switches::kUseGL)) <<
+    CHECK(test_launcher_utils::OverrideGLImplementation(
+        command_line, gfx::kGLImplementationOSMesaName)) <<
         "kUseGL must not be set by test framework code!";
-    command_line->AppendSwitchASCII(switches::kUseGL, "osmesa");
 #endif
   }


httpd: add a ctor without addr parameter

`addr` parameter is not used, and compiler complains at seeing
unused parameter.

in this change

* the `addr` parameter of `seastar::httpd::connection::connection()`
  is removed. this silences the compiler warning.
* a new ctor for `httpd::connection` is added. so we can encourage
  new application can start using the ctor without the unused parameter.
* a [[deprecated]] attribute is added to the ctor with the `addr`
  parameter. so developers which compiles Seastar applications using
  the old ctor can be switch to the new one.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>

Closes #1201

--- include/seastar/http/httpd.hh
+++ include/seastar/http/httpd.hh
@@ -75,8 +75,10 @@
     queue<std::unique_ptr<reply>> _replies { 10 };
     bool _done = false;
 public:
+    [[deprecated("use connection(http_server&, connected_socket&&)")]]
     connection(http_server& server, connected_socket&& fd,
-            socket_address addr)
+            socket_address) : connection(server, std::move(fd)) {}
+    connection(http_server& server, connected_socket&& fd)
             : _server(server), _fd(std::move(fd)), _read_buf(_fd.input()), _write_buf(
                     _fd.output()) {
         on_new_connection();


Disable GpuFeatureTest.MultisamplingAllowed

This test was basically only running when on OSMesa and is disabled in
many cases. Just disable the test officially until it can be enabled
more cleanly.

R=zmo@chromium.org
BUG=270918

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

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

--- chrome/test/gpu/gpu_feature_browsertest.cc
+++ chrome/test/gpu/gpu_feature_browsertest.cc
@@ -296,19 +296,14 @@
   RunEventTest(url, kWebGLCreationEvent, false);
 }

-#if defined(GOOGLE_CHROME_BUILD) && defined(OS_MACOSX)
 // This test is oblivious to the fact that multisample could be blacklisted on
-// some configurations.
-// http://crbug.com/314745
-#define MAYBE_MultisamplingAllowed DISABLED_MultisamplingAllowed
-#else
-#define MAYBE_MultisamplingAllowed MultisamplingAllowed
-#endif
-IN_PROC_BROWSER_TEST_F(GpuFeatureTest, MAYBE_MultisamplingAllowed) {
+// some configurations. Previously disabled on GOOGLE_CHROME_BUILD and
+// on OS_MACOSX: http://crbug.com/314745
+IN_PROC_BROWSER_TEST_F(GpuFeatureTest, DISABLED_MultisamplingAllowed) {
   if (gpu::GPUTestBotConfig::GpuBlacklistedOnBot())
     return;
   // Multisampling is not supported if running on top of osmesa.
-  if (gfx::GetGLImplementation() != gfx::kGLImplementationOSMesaGL)
+  if (gfx::GetGLImplementation() == gfx::kGLImplementationOSMesaGL)
     return;
   // Linux Intel uses mesa driver, where multisampling is not supported.
   // Multisampling is also not supported on virtualized mac os.


coverity#708192 Uninitialized pointer field

Change-Id: Iaccc034f61442242ce1b864457f0d048cdeae98d

--- include/svtools/asynclink.hxx
+++ include/svtools/asynclink.hxx
@@ -43,11 +43,23 @@
     SVT_DLLPRIVATE void Call_Impl( void* pArg );

 public:
-    AsynchronLink( const Link& rLink ) :
-        _aLink( rLink ), _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
-        _pDeleted( 0 ), _pMutex( 0 ){}
-    AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( sal_False ),
-            _pDeleted( 0 ), _pMutex( 0 ){}
+    AsynchronLink( const Link& rLink )
+        : _aLink( rLink )
+        , _nEventId( 0 )
+        , _pTimer( 0 )
+        , _bInCall( sal_False )
+        , _pDeleted( 0 )
+        , _pArg( 0 )
+        , _pMutex( 0 )
+    {}
+    AsynchronLink()
+        : _nEventId( 0 )
+        , _pTimer( 0 )
+        , _bInCall( sal_False )
+        , _pDeleted( 0 )
+        , _pArg( 0 )
+        , _pMutex( 0 )
+    {}
     ~AsynchronLink();

     void CreateMutex();


[lib/LTO] Simplify a bit. NFCI.

[lib/LTO] Simplify a bit. NFCI.

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

--- lib/LTO/LTOBackend.cpp
+++ lib/LTO/LTOBackend.cpp
@@ -140,10 +140,7 @@
          bool IsThinLto) {
   M.setDataLayout(TM->createDataLayout());
   runOldPMPasses(C, M, TM, IsThinLto);
-  if (C.PostOptModuleHook && !C.PostOptModuleHook(Task, M))
-    return false;
-
-  return true;
+  return !C.PostOptModuleHook || C.PostOptModuleHook(Task, M);
 }

 /// Monolithic LTO does not support caching (yet), this is a convenient wrapper