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
| " t.vim by rivten | |
| " ============== | |
| " This is a VERY simple todo manager entirely written in vim | |
| " This is based of the awesome CLI todo manager in python 't' | |
| " The code is here : https://github.com/sjl/t | |
| " This 'plugin' is the most simplistic you would expect. | |
| " `:T` just displays the tasks. | |
| " `:T my_task` to add a task | |
| " `:T -f my_todo_id` to finish a task - `:Tf my_todo_id` is also available | |
| " `:T -e my_todo_id my_new_task_name` to edit a task - `:Te my_todo_id my_new_task_name` is also available |
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
| // Compile this with clang offsetof_ub_test.c -fsanitize=undefined | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #define offsetof_ub(st,m) ((uintptr_t)&(((st*)0)->m)) | |
| #define offsetof(st,m) __builtin_offsetof(st,m) | |
| #define containerof(ptr,type,member)\ | |
| (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - offsetof(type, member))) | |
| #define containerof_ub(ptr,type,member)\ |
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
| u32 ReadU32LittleEndian(u8* Stream) | |
| { | |
| u32 Result = 0; | |
| Result += (u8)(*Stream); | |
| ++Stream; | |
| Result += 256 * (u8)(*Stream); | |
| ++Stream; | |
| Result += 256 * 256 * (u8)(*Stream); | |
| ++Stream; |
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
| bool IsLittleEndian(void) | |
| { | |
| u32 Int = 1; | |
| u8* MemoryAddress = (u8*)∬ | |
| return(*MemoryAddress == 0x01); | |
| } |