Skip to content

Instantly share code, notes, and snippets.

View kalineh's full-sized avatar

kalineh

  • Funktronic Labs
  • Pasadena, CA
View GitHub Profile
@kalineh
kalineh / main.cpp
Created October 31, 2012 02:14
VS2010 X64 compiler bug repro
//
// Visual Studio 2010
// X64 Compiler Bug
//
struct IntProxy
{
static IntProxy MakeIntProxy(int rhs)
{
IntProxy result;
//
// debug_stringbuf.h
//
// put this somewhere during init:
//
// debug_stringbuf_init();
//
#pragma once
@kalineh
kalineh / pch
Last active December 22, 2015 06:29
Header for intended use as pre-compiled header. Includes C++ standard libraries and platform headers. Force include + use as precompiled-header.
#define _PCH_LIBC
#define _PCH_WINDOWS_H
#define _PCH_EXTLIB
#ifdef _PCH_LIBC
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
@kalineh
kalineh / Default (Windows).sublime-keymap
Last active December 8, 2020 18:24
Sublime Text - Windows Keymap
[
// custom keys
{ "keys": [ "f7", ], "command": "build", },
{ "keys": [ "f5", ], "command": "build", "args": { "variant": "Run" } },
{ "keys": [ "ctrl+alt+o", ], "command": "show_panel", "args": { "panel": "output.exec", }, },
{ "keys": [ "ctrl+,", ], "command": "focus_group", "args": { "group": 0, }, },
{ "keys": [ "ctrl+.", ], "command": "focus_group", "args": { "group": 1, }, },
{ "keys": [ "ctrl+shift+,", ], "command": "move_to_group", "args": { "group": 0, }, },
{ "keys": [ "ctrl+shift+.", ], "command": "move_to_group", "args": { "group": 1, }, },
{ "keys": [ "ctrl+shift+/", ], "command": "move_to_group", "args": { "group": 2, }, },
{
"animation_enabled": false,
"bold_folder_labels": true,
"caret_style": "solid",
//"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"font_size": 9,
"highlight_line": false,
"ignored_packages":
[
//"Vintageous",
# Mostly generated from this:
# http://randomartifacts.blogspot.com.au/2012/10/a-proper-cygwin-environment.html
# Return immediately if we are not interactive
[ -z "$PS1" ] && return
# get current git branch name
set nocompatible
set esckeys
set hidden
set ruler
set visualbell
set showcmd
set wildmenu
set noerrorbells
set noexpandtab
set nostartofline
const int bufferSize = 256;
int len = 0, size = 0, i, ret = -1;
char * str = NULL, buffer[bufferSize];
// build the string
for(i = 0; i < a_thread->GetNumParams(); ++i)
{
gmConcat(a_thread->GetMachine(), str, len, size, a_thread->Param(i).AsString(a_thread->GetMachine(), buffer, bufferSize), 64);
if(str)
// grab all the relevant constants
const int bufferSize = 256;
const int numParams = a_thread-&gt;GetNumParams();
// split single-line declarations
int len = 0;
int size = 0;
int ret = -1;
// might as well zero-init the buffer
const int bufferSize = 256;
const int numParams = a_thread-&gt;GetNumParams();
int len = 0;
int size = 0;
int ret = -1;
char* str = NULL;
char buffer[bufferSize] = { 0 };