| Commit message (Collapse) | Author | Age |
| |
|
|
| |
In 2026 this should be no constraint. Affects only para_gui.
|
| |
|
|
|
| |
This way it can be static, and executables which don't need it don't contain
a copy of this function.
|
| |
|
|
|
| |
Apparently, the documentation of the size parameter was copied from realloc()
or similar.
|
| |
|
|
|
| |
This helps gcc to generate better code thanks to the no alias guarantees
the attribute provides.
|
| |
|
|
|
|
|
|
| |
Generated with
sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h
followed by manually tweaking the result a bit. No license change intended.
|
| |
|
|
|
| |
There is only a single user in audioc.c, and this user can easily avoid the
function by allocating only a single buffer.
|
| |
|
|
|
|
|
|
| |
All but one caller immediately free the result after using it. The exception
is daemon.c, which maintains a copy in struct daemon, and leaks it on exit.
All users can trivially be converted to use the new version, which does not
require to free the result.
|
| |
|
|
|
| |
This was quite hard to read due to the many \a directives. Remove those
and improve the wording.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A medium sized series for the build system which improves the way the git
version string is stored in the executables and man pages. Subsequent patches
of the series remove some warts from the makefile: we no longer use order-only
dependencies and the .PRECIOUS target.
The merge results in a conflict against the "remove regex include" commit
67388cd4fae0. This is trivial to resolve, though.
* refs/heads/t/build:
Doxify version functions.
Doxify OV_EXCLUDE_STATIC_CALLBACKS #define.
Makefile: Fix braino in tarball target.
build: Remove superfluous dependency in Makefile.real.
build: Remove the .PRECIOUS target.
build: Improve clean targets.
build: Get rid of directory order-only dependencies.
build: Compile with -Wunused -Wall also on BSD.
build: Revamp git versioning.
build: Merge version.{c,h} into string.{c,h}.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This rewrites GIT-VERSION-GEN and renames it to version-gen.sh. The
main difference is that the script now generates version.c rather
than version.h, speeding up the build because switching branches
or transitioning from a clean to a dirty work-tree (or vice versa)
changes the version string. Before the patch, all files which included
version.h were recompiled. With the patch applied, only the short
version.c needs to be recompiled.
The generated version,c defines one function which returns the
single-line version string and a second function which returns
the multi-line version information (author, copyright, git URL
etc). This information is now passed to version-gen.sh via environment
variables. The CPP macros we had before are removed.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a preparatory patch for the upcoming revamp of the git
version script. The revamped script generates version.c, a file
which is currently tracked by git. We can easily get rid of it (and
of version.h) since all paraslash executables link in both string.o
and version.o. So let's move the three small functions of version.c
to string.c and their declarations from version.h to string.h.
|
| |/
|
|
| |
Every .c file includes it anyway.
|
| |
|
|
|
|
|
| |
This set but not used variable existed for a long time, but only now
the first compiler, clang-19 on FreeBSD, started to complain.
Streamline the documentation a bit while at it.
|
| |
|
|
|
| |
This can only lead to trouble. If we can't get the path to the home
directory, something is deeply wrong and we really should abort.
|
| |
|
|
|
| |
There is no point in initializing the allocated array manually,
and it does not hurt to initialize also the last element.
|
| |
|
|
|
| |
There is only one caller in client_common.c, so open-code the logic
there and get rid of the public function and the unused error code.
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This series implements a new memory allocation API which checks
for overflows. The first part of the series just renames the main
allocation functions. Later patches in the series implement allocators
which take two size_t arguments (like calloc(3)) and check whether the
multiplication overflows by employing the __builtin_mul_overflow()
primitive supported by gcc and clang. This requires us to bump the
lowest supported gcc and clang version.
* refs/heads/t/overflow:
build: Compile with -ftrapv.
string: Introduce arr_zalloc().
string: Introduce arr_alloc().
string: Introduce arr_realloc() and check for integer overflow.
string: Rename para_calloc() -> zalloc().
string: Rename para_malloc() -> alloc().
string: Overhaul para_strdup().
|
| | |
| |
| |
| |
| |
| | |
Adjust all callers which pass a product of two integers to zalloc()
to call the new function instead and reduce zalloc() to a one-line
wrapper.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Change all callers of alloc() which pass a product of two integers as
the allocation size to call the new function instead. This function
aborts if the multiplication overflows. With arr_alloc() in place,
alloc() reduces to a trivial wrapper which calls new arr_alloc()
with the first argument equal to one.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Use __builtin_mul_overflow() for the check. This builtin was introduced
in gcc-5, so we need to bump the lowest supported version.
Re-implement para_realloc() as a trivial wrapper for arr_realloc()
to simplify and to avoid duplicating the size check.
|
| | |
| |
| |
| |
| | |
Reword the documentation a bit since the function has never been a
wrapper for calloc(3). No code changes.
|
| | |
| |
| |
| |
| |
| |
| | |
Just because it's shorter and matches the naming of the new allocators
we are about to introduce. The bulk of this patch was created with
sed -i 's/para_malloc/alloc/g' *.c *.h yy/mp.y
|
| | |
| |
| |
| |
| |
| |
| |
| | |
We don't need to print an error message because it will be clear what
has happened when the assertion triggers.
Reword the documentation and mention that the memory allocated by
this function must be freed by the caller.
|
| |\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Two little cleanups related to the logging facility and two commits
which add the ll command to para_server and para_audiod.
The merge resulted in a conflict in afs.c due to the earlier merge of
the poll topic branch which replaced all calls to select() by calls
to poll(). The implementation of the ll server command introduced a
new caller of select(), afs_select(), which needs to be replaced by
afs_poll() to resolve the conflict.
* refs/heads/t/ll:
New server command: ll to change the log level at runtime.
New audiod command: ll to change the log level at runtime.
daemon: Kill get_loglevel_by_name().
server/audiod: Don't parse loglevel argument unnecessarily.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Open-code the logic in daemon_set_log_color_or_die() and get the
values from the new SEVERTIES macro rather than duplicating the
severity list in get_loglevel_by_name().
The SEVERTIES macro will turn out to be handy for the ll subcommands of
para_server and para_audiod which are introduced in subsequent commits.
|
| |/
|
|
|
|
| |
The former has only a single caller, the second only two, open-coding
these is actually simpler and more performant because we no longer
scan each path twice and avoid the temporary copy of the path.
|
| |
|
|
|
| |
Make it a no-op if NULL is passed. Also the comment to \param was
slightly incorrect and the code contained an unnecessary cast.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The GPLv2 line does not add any additional information, so drop
it. This leaves a single line of legalese text for most files, which
is about the amount of screen real estate it deserves.
This patch was created with the following script (plus some manual
fixups):
awk '{
if (NR <= 5) {
gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g")
if (gs != $0)
year = gs
next
}
if (NR == 6 && year != "")
printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year)
print
}'
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This series contains an update of Doxyfile to a newer doxygen version
and an overhaul of the source code documentation. Several stale
references have been fixed. Other parts of the documentation have
been improved.
Cooking for almost a month.
* refs/heads/t/doxygen:
aft.c: Trivial spelling/whitespace fixes.
afh: Expand documentation of init function declarations.
filter: Remove duplicate documentation of filter_get().
doxygen: Improve documentation of struct receiver.
doxygen: Add \ref to references.
Improve documentation of mm.c and mm.h.
doxygen: Don't refer to Black Hats Manual.
doxygen: Don't refer to libosl functions.
doxygen: Trivial cleanups.
doxygen: Remove some stale doxygen references.
recv: Explain user data mechanism.
Update to doxygen-1.8.11.
The merge resulted in a few conflicts which were easy to resolve.
|
| | |
| |
| |
| |
| | |
This way doxygen issues a warning if the file/function/structure no
longer exists and a stale reference remains.
|
| | |
| |
| |
| | |
A couple of capitalization and punctuation fixes.
|
| |/
|
|
| |
These headers are already included with para.h.
|
| |
|
|
|
| |
Mention that it is OK to pass NULL, and that the returned array is
NULL terminated.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The best way to add these flags is to use the autoconf helper
AC_USE_SYSTEM_EXTENSIONS. This macro adds defines to config.h, so we
must include config.h (via para.h) before anything else. The two files
for which this matters are fixed by moving the include directive for
para.h to the top.
The AC_USE_SYSTEM_EXTENSIONS macro was introduced in Autoconf 2.60,
which was released ten years ago. The existing AC_PREREQ([2.61])
check in configure.ac makes sure the macro is defined.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Currently we sanitize the status item strings for para_gui in
align_str() of gui.c. This implementation is flawed because it does
not work for wide character strings.
This patch provides an abstraction in string.c which works in both
the UFT-8 and non-UTF-8 case.
The flawed implementation of this function in gui.c is removed and
the surrounding code is changed to call the new function instead.
|
| |
|
|
|
|
|
|
|
| |
Just assume non-printable characters are one character wide. This gives
a more reasonable approximation than the hack we have now.
This patch also renames mutt_wcwidth() to xwcwidth() and
mutt_wcswidth() to xwcswidth() since these functions have nothing in
common with mutt any more.
|
| |
|
|
|
|
| |
Should not matter since we already know the number of wide characters
and never look past the allocated buffer. But let's be conservative
here and allocate space for the terminating null wide character.
|
| |
|
|
|
| |
Public functions should always return a proper error code on
failure. Returning -1 is asking for trouble.
|
| |
|
|
|
|
|
|
| |
This error code is unnecessary because para_atoi64() returns it only
if strtoll(3) did not perform any conversion and we have already a
more descriptive error code for this case: E_ATOI_NO_DIGITS.
Two new comments to para_atoi64() explain this in detail.
|
| | |
|
| |
|
|
|
| |
Much faster for large buffers. Idea: Search for zero byte
only until next cr.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Done with
files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll')
sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files
In previous years we ran a similar script to set the second year in
the range to the current year. This is kind of silly, so let's get
rid of this useless information.
This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in
all file headers, i.e. only the first year (A) is left in. Accurate
information including time stamps for each change can be obtained
from the git history.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mail server on systemlinux.org was down for more than a week
lately, so let's use an alternative official address. This commit
changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de.
Most .c and .h files contain the email address in the copyright header,
so they must all be patched. Three other files contain the address
for a different reason:
* README lists email and git, gitweb and home page URLs
* configure.ac needs it for configure -h
* version.c contains it for the -V option of all commands
|
| |
|
|
|
|
|
|
|
|
| |
In curses_log() we currently we call chop(), which calls strlen()
to find the last character of the given string. This is unnecessary
since xvasprintf() returns this information anyway, we just have to
remember it.
With this change the last user of chop() is gone, so this patch
removes chop() from string.c.
|
| |
|
|
|
|
|
|
|
| |
This year, we're really on time. The changes in this patch were
created by the following silly script:
files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll')
sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files
sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
|
| |
|
|
|
| |
This attribute tells the compiler that the returned pointer cannot
alias any other pointer. This is not the case for para_realloc().
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Was cooking for more than one month.
bf1831 string: Speed up xvasprintf().
bcc083 string: Add discard feature for for_each_line().
e3868d string: Simplify return value of for_each_line().
d1f0f0 string: Simplify for_each_line().
23b121 string: Clean up for_each_line() and related functions.
6256ed string: Replace the for_each_line_modes enum by a bitmap.
14e689 gui: Don't sleep before executing the status command.
e90c6c gui: Speed up add_spaces().
20e2c6 gui: Rename do_exit().
ef0508 gui: Remove superfluous cmd_died.
d7562b gui: Check stdin for readability.
a44fa6 gui: Discard overlong input lines.
Conflicts:
gui.c
|
| | |
| |
| |
| |
| |
| |
| |
| | |
This avoids to call vsnprintf() twice in the common case where the
result is small.
The running time of a simple test case that called this function in
a loop improved from 13s to 8s due to this change.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the new FELF_DISCARD_FIRST flag which instructs
for_each_line() to discard everything up to the next newline.
The new feature is only used by para_gui. When para_gui detects
a partial overlong input line, it ignores this data and passes the
FELF_DISCARD_FIRST flag in subsequent calls to for_each_line(). Hence
output continues at the next line.
|