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
| // Note that functions initiated with static inline will be transformed into inline by the compiler | |
| // (tested on gcc and clang), and yet, the _Generic keyword is capable of identifying them correctly. | |
| // | |
| // (https://godbolt.org/z/Mo4rYsKn1) | |
| #include <math.h> | |
| #include <stdio.h> | |
| // global |
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
| // This allocation system is an old implementation I created inspired by the | |
| // system used by DOOM. It employs a freelist-based approach to allocate memory | |
| // in two different arenas. It is capable of allocating, deallocating, | |
| // identifying double frees, and detecting corrupted memory pointers. | |
| // Additionally, it can determine whether the pointer was returned by any of the | |
| // available arenas. | |
| // It is a straightforward implementation and has not undergone extensive | |
| // testing, so there may be potential issues. However, I hope it proves useful | |
| // to you in some way. Feel free to use and modify it as you see fit. | |
| // |
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> | |
| #ifdef _WIN32 | |
| #include <sys/timeb.h> | |
| #else | |
| #include <sys/time.h> | |
| #endif | |
| #include <cstdlib> | |
| #include <time.h> | |
| double sillygettime(void) { |
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
| /* | |
| * Writing a TGA image using a Lehmer Pseudo Random Number Generator | |
| * implementation (modified) for 32bits | |
| * | |
| * How to compile: | |
| * $ gcc *.c -o create_tga_image | |
| * | |
| * Binary options: | |
| * You can change the image's width and height using the -w and -h flags, | |
| * respectively. It is possible to adjust the x and y PRN salt used by |