Skip to content

Instantly share code, notes, and snippets.

diff --git a/ClangPowerTools/ClangPowerTools/clang-build.ps1 b/ClangPowerTools/ClangPowerTools/clang-build.ps1
index 26b7bbb..8522955 100644
--- a/ClangPowerTools/ClangPowerTools/clang-build.ps1
+++ b/ClangPowerTools/ClangPowerTools/clang-build.ps1
@@ -1585,7 +1585,7 @@ Function Get-ProjectPreprocessorDefines()
# make sure we add the required prefix and escape double quotes
[string[]]$defines = ( $tokens | `
Where-Object { $_ } | `
- ForEach-Object { ($kClangDefinePrefix + $_) -replace '"','"""' } )
+ ForEach-Object { ('"' + $kClangDefinePrefix + $_ + '"') } )
@jiixyj
jiixyj / vimp-ff-44a2.patch
Last active January 27, 2016 12:23
Vimperator hacks for Firefox 44.0a2
diff --git a/common/content/util.js b/common/content/util.js
index e12bee0..2a50b7b 100644
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -827,7 +827,7 @@ const Util = Module("util", {
return {
__proto__: ary,
__iterator__: function () this.iteritems(),
- __noSuchMethod__: function (meth, args) {
+ mapImpl: function (meth, args) {
@jiixyj
jiixyj / explicit-bzero.patch
Created July 31, 2014 14:06
Patch for explicit_bzero
--- lib/libc/string/explicit_bzero.c 2014-07-18 11:19:05.766268531 +0200
+++ lib/libc/string/explicit_bzero.c 2014-07-18 11:19:29.821267650 +0200
@@ -7,13 +7,12 @@
#include <string.h>
__attribute__((weak)) void
-__explicit_bzero_hook(void *buf, size_t len)
-{
-}
+__explicit_bzero_hook(void *buf, size_t len);
@jiixyj
jiixyj / gist:3e3389649c866f7ff7bd
Created July 18, 2014 08:33
Test of various implementations of explicit_bzero
/* $OpenBSD: explicit_bzero.c,v 1.5 2014/07/11 00:38:17 matthew Exp $ */
/*
* Copyright (c) 2014 Google Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@jiixyj
jiixyj / log_star_11.cpp
Created April 27, 2012 10:41
calculate integer binary log star on compile time - C++11
#include <cinttypes>
#include <climits>
namespace {
typedef uintmax_t log_number_t;
constexpr unsigned count_bits(log_number_t n) {
return n == 0 ? 0 : count_bits(n >> 1) + 1;
}
@jiixyj
jiixyj / log_star.cpp
Created April 27, 2012 09:47
calculate integer binary log star on compile time
#include <climits>
namespace {
typedef unsigned long log_number_t;
// count needed bits for a number
template<log_number_t N> struct num_bits_t {
static const log_number_t value = num_bits_t<(N >> 1)>::value + 1;
};
--- ../linux-2.6-3.1.5/drivers/ata/ahci.c 2011-12-09 17:57:05.000000000 +0100
+++ ahci.c 2011-12-12 23:21:48.655875372 +0100
@@ -570,6 +570,7 @@
struct ahci_host_priv *hpriv = host->private_data;
void __iomem *mmio = hpriv->mmio;
u32 ctl;
+ int rc;
if (mesg.event & PM_EVENT_SUSPEND &&
hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {