This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#define NUM_SAMPLES 44100 | |
#define PI 3.14159265 | |
// ------ NOTE IDS ------ | |
#define C_ 0 | |
#define CS 1 | |
#define D_ 2 |
This file contains 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 <stdint.h> | |
#include <stdlib.h> | |
#include "../../lib/umka/src/umka_api.h" | |
#include <string.h> | |
#ifdef __unix__ | |
#include <dirent.h> | |
// 0 : DirectoryPath : str | |
// R : DirPtr : ^void |
This file contains 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
// DOES NOT WORK ON NEGATIVE VALUES !! :P | |
#include <stdio.h> | |
union MyFloat { | |
float fv; | |
struct { | |
unsigned mantissa: 23; | |
unsigned exponent: 8; | |
unsigned sign: 1; |
This file contains 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 <emmintrin.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#include <immintrin.h> | |
#include <time.h> | |
#define Benchmark(name, times) for (int t = 1; t;) for (double final; t;) for(clock_t start = clock(); t; final = (double)(clock()-start) / CLOCKS_PER_SEC, printf(" <%s> %gs / %dtimes = %gs\n", name, final, times, final/times), t = 0) for (int i = 0; i < times; ++i) | |
#define Utf8_BYTES_PER_ASCII 32 |
This file contains 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
static inline size_t Utf8_Fetch(uint32_t *out, const char *s_) | |
{ | |
const unsigned char *s = (const unsigned char*)s_; | |
if ((*s & 0xC0) != 0xC0) { | |
*out = *s; | |
return *s > 0; | |
} | |
const static size_t clas[32] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,2,2,2,2,3,3,4,5}; | |
size_t cl = clas[*s>>3]; |
This file contains 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
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif | |
let colors_name = "handmade-hero" |
This file contains 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
// vim: noet | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
size_t th_utf8_decode_beta(uint32_t *out, const char *s_) { | |
const unsigned char *s = (const unsigned char*)s_; | |
if ((*s & 0xC0) != 0xC0) { | |
*out = *s; |
This file contains 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 <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdbool.h> | |
#include <math.h> | |
#include "../lib.h" | |
typedef enum { | |
SHUT, |
This file contains 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 <stdlib.h> | |
#include <stdio.h> | |
#include <ctype.h> | |
#include "../lib.h" | |
typedef struct { | |
char *source; | |
char *dest; | |
} conn_t; |
This file contains 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 <stdio.h> | |
#include <inttypes.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
char* read_file(const char *path) { | |
FILE *f = fopen(path, "rb"); | |
if (f == NULL) |
NewerOlder