Skip to content

Instantly share code, notes, and snippets.

@theuni
theuni / dersig.cpp
Created January 14, 2015 09:25
dersig constexpr evaluation
// Compile with: g++ -std=c++11 dersig.cpp -o dersig
#include <cstddef>
#include <vector>
#include <array>
inline constexpr char getHex(const char in)
{
return in >= '0' && in <= '9' ? in - '0' :
in >= 'A' && in <= 'F' ? in - 'A' + 10 :
cory@cory-i7:~/dev/openssl(OpenSSL_1_0_1m-backport)$ git diff -w manual-backport..gentoo-patched
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index 6f19829..d28dc60 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -130,11 +130,17 @@ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
{
ASN1_TLC c;
ASN1_VALUE *ptmpval = NULL;
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index 6f19829..d28dc60 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -130,11 +130,17 @@ ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
{
ASN1_TLC c;
ASN1_VALUE *ptmpval = NULL;
- if (!pval)
- pval = &ptmpval;
@theuni
theuni / gist:f5d6d3db9434ca546422
Created June 23, 2015 20:36
clang locking test
#include <vector>
#include <mutex>
#if defined(__clang__) && (!defined(SWIG))
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
#endif
#define EXCLUSIVE_LOCKS_REQUIRED(...) THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
CPP AudioLibrary.o
In file included from JSONRPC.h:31,
from AudioLibrary.h:24,
from AudioLibrary.cpp:22:
JSONUtils.h: In static member function ‘static int JSONRPC::CJSONUtils::Compare(const Json::Value&, const Json::Value&)’:
JSONUtils.h:505: error: conversion from ‘long int’ to ‘const Json::Value’ is ambiguous
/scratch/xbmc/lib/jsoncpp/include/json/value.h:237: note: candidates are: Json::Value::Value(bool)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:220: note: Json::Value::Value(const char*)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:219: note: Json::Value::Value(double)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:217: note: Json::Value::Value(Json::UInt64)
CPP Application.o
In file included from interfaces/json-rpc/JSONRPC.h:31,
from Application.cpp:133:
interfaces/json-rpc/JSONUtils.h: In static member function ‘static int JSONRPC::CJSONUtils::Compare(const Json::Value&, const Json::Value&)’:
interfaces/json-rpc/JSONUtils.h:505: error: conversion from ‘long int’ to ‘const Json::Value’ is ambiguous
/scratch/xbmc/lib/jsoncpp/include/json/value.h:237: note: candidates are: Json::Value::Value(bool)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:220: note: Json::Value::Value(const char*)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:219: note: Json::Value::Value(double)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:217: note: Json::Value::Value(Json::UInt64)
/scratch/xbmc/lib/jsoncpp/include/json/value.h:216: note: Json::Value::Value(Json::Int64)
diff --git a/xbmc/linux/HALManager.cpp b/xbmc/linux/HALManager.cpp
index b409af8..baf2db3 100644
--- a/xbmc/linux/HALManager.cpp
+++ b/xbmc/linux/HALManager.cpp
@@ -30,6 +30,7 @@
#include "guilib/LocalizeStrings.h"
#include "powermanagement/PowerManager.h"
#include "settings/AdvancedSettings.h"
+#include "dialogs/GUIDialogKaiToast.h"
@theuni
theuni / gist:3353618
Created August 14, 2012 22:37
libsquish sse
diff --git a/lib/libsquish/Makefile.in b/lib/libsquish/Makefile.in
index f7b3cc1..34f93bd 100644
--- a/lib/libsquish/Makefile.in
+++ b/lib/libsquish/Makefile.in
@@ -12,11 +12,6 @@ SRCS= \
squish.cpp
CXXFLAGS+=-I.
-ifeq ($(findstring powerpc,$(ARCH)),powerpc)
- CXXFLAGS+=-DSQUISH_USE_ALTIVEC=1 -maltivec
diff --git a/tools/android/depends/Makefile.include.in b/tools/android/depends/Makefile.include.in
index a209546..67e4022 100644
--- a/tools/android/depends/Makefile.include.in
+++ b/tools/android/depends/Makefile.include.in
@@ -70,6 +70,7 @@ ifneq ($(NATIVE_BUILD),1)
export ACLOCAL_PATH=$(PREFIX)/share/aclocal:$(NATIVEPREFIX)/share/aclocal
export LIBTOOLIZE=$(NATIVEPREFIX)/bin/libtoolize
export AUTORECONF=$(NATIVEPREFIX)/bin/autoreconf
+ export CMAKE=$(NATIVEPREFIX)/bin/cmake
else
From 0305caa07c0f9532a667d151076e7031d5fa5c40 Mon Sep 17 00:00:00 2001
From: Cory Fields <theuni-nospam-@xbmc.org>
Date: Sat, 3 Nov 2012 14:58:35 -0400
Subject: [PATCH] egl: Android: Add quirk for destroying nativewindow with
surface
Don't count on the driver to realize that the NativeWindow is stale, it may try
to use it and crash. Instead, forcefully kill it when we destroy a window in
order to force recreation later.
---