Commit graph

5 commits

Author SHA1 Message Date
uncrustify
0756d25872 util: run uncrustify
This is the result of running

     $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h

in the util directory
2021-03-13 08:45:34 -04:00
David Bremner
ad9c2e91a0 util/zlib-extra: de-inline gzerror_str
It turns out that putting inline functions in C header files is not a
good idea, and can cause linking problems if the compiler decides not
to inline them.  In principle this is solvable by using a "static
inline" declaration, but this potentially makes a copy in every
compilation unit. Since we don't actually care about the performance
of this function, just use a non-inline function.
2020-04-28 10:35:44 -03:00
David Bremner
2c1f783f5f don't pass NULL as second parameter to gzerror
Although (as of 1.2.11) zlib checks this parameter before writing to
it, the docs don't promise to keep doing so, so be safe.
2020-04-13 17:13:55 -03:00
David Bremner
152b6cac5d util: make remaining headers includable from C++
libnotmuch_util.a is supposed to be usable from the library and the
CLI, but much the library is compiled as C++. Add in appropriate
wrapping to prevent symbol mangling. These wrappers already existed in
string-util.h; it seems better to be consistent.
2019-03-11 22:26:50 -03:00
David Bremner
85d9219a62 util: add gz_readline
The idea is to provide a more or less drop in replacement for readline
to read from zlib/gzip streams.  Take the opportunity to replace
malloc with talloc.
2014-04-12 07:59:44 -03:00