This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Naur TeXmacs-1.99.5-src/src/Plugins/Qt/qt_simple_widget.cpp TeXmacs-1.99.5-src-fix-simple-widget-crash/src/Plugins/Qt/qt_simple_widget.cpp | |
--- TeXmacs-1.99.5-src/src/Plugins/Qt/qt_simple_widget.cpp 2016-07-08 01:56:55.000000000 +0800 | |
+++ TeXmacs-1.99.5-src-fix-simple-widget-crash/src/Plugins/Qt/qt_simple_widget.cpp 2017-02-20 13:53:30.741575287 +0800 | |
@@ -615,6 +615,10 @@ | |
iterator<pointer> i = iterate(qt_simple_widget_rep::all_widgets); | |
while (i->busy()) { | |
qt_simple_widget_rep *w = static_cast<qt_simple_widget_rep*>(i->next()); | |
+ if (w->canvas() == NULL) { | |
+ all_widgets->remove ((pointer) w); | |
+ continue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <utility> // std::forward | |
#include <iterator> // std::iterator, std::output_iterator_tag | |
template <class Container> | |
struct capped_back_insert_iterator final: std::iterator<std::output_iterator_tag, void, void, void, void> | |
{ | |
capped_back_insert_iterator(Container & con, int cap) | |
: con{con}, capacity{cap}, size{0} {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fcntl.h> | |
#include <unistd.h> | |
#include <err.h> | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
#include <vector> | |
#include "scope-exit.hh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The official OpenCL C++ wrapper is just a rubbish. | |
// It doesn't mean mine is good. | |
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS | |
#include <CL/cl.h> // ml:lib += OpenCL | |
#include <type_traits> | |
#include <stdexcept> | |
#include <memory> | |
#include <string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <cstdio> | |
namespace | |
{ | |
auto decode(char const* & s) | |
{ | |
std::uint32_t code{}; | |
switch (auto c = static_cast<unsigned char>(*s++)) { | |
case 0b0'0000000 ... 0b0'1111111: code = c; break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <fontconfig/fontconfig.h> | |
#include <vector> | |
#include <string> | |
#include <memory> | |
namespace font_prober | |
{ | |
struct finalizer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
-- vector | |
local vector = (function() | |
local mt = {} | |
mt.__index = mt | |
local vector | |
vector = function(x, y, z) | |
if type(x) == 'table' then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
-- vector | |
local make_vector = function() | |
local mt = {} | |
local vector | |
vector = function(x, y, z) | |
if type(x) == 'table' then | |
return setmetatable(x, mt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> // with std::hash<std::string> | |
#include <utility> // for std::move | |
#include <sstream> | |
#include <vector> | |
#include <iomanip> // for std::quoted | |
namespace tag_stack_detail | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T> constexpr auto is_ptr = false; | |
template <class T> constexpr auto is_ptr<T*> = true; | |
int main() | |
{ | |
static_assert(is_ptr<int*>, "int* must be ptr"); | |
static_assert(!is_ptr<int>, "int must not be ptr"); | |
} |