See decode -h
.
- Tested with clang and gcc.
- Tested on macos 10.13 and Arch Linux 4.13.
- Uses the C99 standard (for
_Bool
). - Edit the
Makefile
to change settings.
Compile everything that's out of date. The default compiler is clang
.
Remove all binaries, object files and other output files.
Runs the command with the default settings.
Runs the command with default settings plus enable verbose output.
Show the help text.
Format all source files and shows changes via a git diff to make individual decisions. Requires astyle and git.
Create a symlink pointing to the binary. Default target is /usr/local/bin
.
Watches the source files for changes, recompiles and runs the binaries as necessary. Requires hr and entr.
Watches source and markdown files for changes, regenerates the documentation with Doxygen. Requires doxygen and entr.
Run to detect memory leaks. Removes PID from the report
file to allow proper usage of git diff
. Requires Valgrind and sponge
from the moreutils.
All code not written by me is in the vendor
folder.
- klib, MIT licensed
- specifically
khash.h
for a hash map storing the count of the occurrences for the decoded words. - reasoning: fast, single file (header only), independent libraries; used in big projects (e.g. Neovim)
- specifically
- warning: function declaration isn't a prototype
- fixes
warning: this function declaration is not a prototype
void func()
takes an arbitrary number of arguments, usevoid func(void)
for 0 arguments- This is different to C++ which uses
void func()
for functions with 0 arguments!
- fixes
- implicit conversions
- return value of malloc
- No cast is needed on
malloc()
in C; however, it is in C++!
- No cast is needed on
- Uninitialised value was created by a stack allocation valgrind C
get header search path for clang:
echo | clang -v -E -x c -
add paths to .ycm_extra_conf.py
.
- input file characters not exclusively ones and zeroes
- input file characters outside the defined ASCII range (A-Z + space)
- input file characters not resolvable
- any file not writeable (chowned by root)
- can't handle words longer than
MAXWORDSIZE
defined inhelpers.c
- order of words with same count is semi-random (based on hash table)
- assumes there's enough memory available to store entire decoded file