This file contains hidden or 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> | |
| int main() { | |
| uint64_t n[2] = {0xaabbccddeeff1122, 0x1122334455667788}; | |
| for (int i = 0; i < 2; ++i) { | |
| printf("at address: %lx\t number: %lx\n", (size_t)&n[i], n[i]); | |
| for (int k = 0; k < 8; ++k) { | |
| uint8_t* c = ((uint8_t*)(&n[i])) + k; | |
| printf("at address: %lx\t number: %x\n", (size_t)c, *c); |
This file contains hidden or 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
| # | |
| # Brotli implementation for static compilation with musl-libc | |
| # Compiled with: --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static --dynlibOverrideAll --passL:lib/libbrotli.a | |
| # | |
| type | |
| BrotliEncoderMode = enum | |
| BROTLI_MODE_GENERIC = 0.cint | |
| BROTLI_MODE_TEXT = 1.cint | |
| BROTLI_MODE_FONT = 2.cint |
This file contains hidden or 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
| # by Chris Collazo | |
| # Released to the public domain | |
| import std/parseopt | |
| # `short` is optional | |
| proc get_option*(oparser: var OptParser, name: string, default: string, short: string = ""): string = | |
| for kind, key, val in oparser.getopt(): | |
| if kind == cmdLongOption and key == name: | |
| return val |
This file contains hidden or 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
| # Inputs: | |
| # node: The JsonNode that represents the object you're querying. | |
| # key/keys: The key you're looking for, or the sequence of key steps if your value is deeply nested. | |
| # default: The default value should the key not be found. | |
| # Examples: | |
| # let enable_raytracing: bool = settings_json_node.get_json_value("enable_raytracing", false) | |
| # let enable_raytracing: bool = settings_json_node.get_json_value(@["settings", "graphics", "enable_raytracing"], false) | |
| proc get_json_value*[T: bool | float | int | string | JsonNode](node: JsonNode, keys: seq[string], default: T): T = |