Skip to content

Instantly share code, notes, and snippets.

View Urquelle's full-sized avatar

Serge Ratke Urquelle

View GitHub Profile
enum Item {
ITEM_ONE,
ITEM_TWO,
ITEM_THREE,
};
char *item_names[] = {
[ITEM_TWO] = "two",
[ITEM_THREE] = "three",
[ITEM_ONE] = "one",
@Urquelle
Urquelle / main.sss
Last active February 9, 2019 21:28
a :: () {
}
b :: ( x: u32 ) -> string {
}
_x5 : u64 = ( 5 + 3 ) * -5 - 7 + 4;
zonk : [] * Zipp;
s, t : [10*5] * Zipp;
BIterator iterator, iterator_end;
BIterator_FindEqualOrGreaterItem(&iterator, &tree, key_begin);
BIterator_FindEqualOrGreaterItem(&iterator_end, &tree, key_end);
Value sum = 0;
while (!BIterator_Equals(&iterator, &iterator_end)) {
sum += *iterator.value;
BIterator_FindNextItem(&iterator);
}
@Urquelle
Urquelle / BTree.h
Created January 22, 2019 17:09 — forked from pervognsen/BTree.h
struct BTree;
struct BIterator;
void BTree_Initialize(BTree *tree);
void BTree_Destroy(BTree *tree);
Value *BTree_Get(BTree *tree, Key key);
void BTree_Add(BTree *tree, Key key, Value value);
void BTree_Remove(BTree *tree, Key key);
@Urquelle
Urquelle / zzz.cpp
Created January 22, 2019 17:08 — forked from pervognsen/zzz.cpp
/// zzz - very sleepy replacement, based on etw
#define INITGUID
#include <windows.h>
#include <psapi.h>
#include <tdh.h>
#include <evntrace.h>
#include <guiddef.h>
#pragma warning(disable: 4091)
#include <dbghelp.h>
@Urquelle
Urquelle / Xeno.cpp
Created January 22, 2019 17:08 — forked from pervognsen/Xeno.cpp
// Xeno
enum Xeno_Kind {
XENO_POINTER,
XENO_AGGREGATE,
XENO_FIRST_PRIMITIVE_TYPE,
XENO_UINT8 = XENO_FIRST_PRIMITIVE_TYPE,
XENO_UINT16,
XENO_UINT32,
XENO_UINT64,
@Urquelle
Urquelle / x64_emitter.cpp
Created January 22, 2019 17:08 — forked from pervognsen/x64_emitter.cpp
x64 machine code emitter
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include <stdint.h>
#define Assert(x) \
if (!(x)) { MessageBoxA(0, #x, "Assertion Failure", MB_OK); __debugbreak(); }
enum Register {
RAX = 0,
#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include <stdio.h>
#include <windows.h>
#pragma warning (disable: 4146)
#include <stdint.h>
#ifdef _DEBUG
#define Assert(x) \
if (!(x)) { MessageBoxA(0, #x, "Assertion Failure", MB_OK); __debugbreak(); }
@Urquelle
Urquelle / mu.cpp
Created January 22, 2019 17:08 — forked from pervognsen/mu.cpp
Mu as of the second stream
#include "mu.h"
#define _CRT_SECURE_NO_WARNINGS
#include <malloc.h>
#define _USE_MATH_DEFINES
#include <math.h>
#define _NO_CRT_STDIO_INLINE
#include <stdio.h>
#include <stdarg.h>
#define NO_STRICT
@Urquelle
Urquelle / gob.h
Created January 22, 2019 17:07 — forked from pervognsen/gob.h
gob.h
// My investigations on the C standard compliance of Gob and related techniques:
// https://gist.github.com/pervognsen/5249a405fe7d76ded1cf08ed50fa9176
#pragma once
#include <stdint.h>
#pragma pack(push, 8)
#if __cplusplus >= 201103L || (__cplusplus && _MSC_VER >= 1900)