Consolidate EOF error codes. Currently we have ~15 error codes which indicate an EOF condition. One should suffice, so drop all codes except the generic E_EOF and use that everywhere.
Merge topic branch t/overflow into master 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().
Rename ->{pre,post}_select methods to ->{pre,post}_monitor. The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
string: Rename para_calloc() -> zalloc(). Reword the documentation a bit since the function has never been a wrapper for calloc(3). No code changes.
string: Rename para_malloc() -> alloc(). 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
list.h: Convert INIT_LIST_HEAD macro to inline function. Inline functions are easier to read and write, and we get type safety.
Shorten copyright notice. 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 }'
doxygen: Add \ref to references. This way doxygen issues a warning if the file/function/structure no longer exists and a stale reference remains.
Update year in copyright headers. 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.
doc: Change email address to maan@tuebingen.mpg.de 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
Fix memory leak in btr_splice_out_node(). Commit 072391fc (Improve btr_splice_out_node(), 2013-03) modified this function to take a pointer to a buffer tree node pointer so that the node pointer can be invalidated after it is spliced out. However, this also means the caller can no longer free its resources. Hence we must free the btrn in btr_splice_out_node() in order to avoid memory leaks.
Change copyright year to 2014. 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
btr: Simplify btr_node_status(). This changes btr_node_status() to check for errors before looking at queue sizes. In certain cases this avoids to call the possibly expensive btr_get_output_queue_size(). If no more input is going to arrive for an internal node whose output queue is full, btr_node_status() now returns EOF immediately, which is better than the previous scheme where we waited for the output queue to become empty before returning EOF.
buffer_tree: Improve btr_splice_out_node(). This changes btr_splice_out_node() to take a pointer to a btrn, just like btr_remove_node(). This allows to set the variable to NULL after the node has been spliced out. The callers are updated accordingly.
Merge branch 't/misc_cleanups' Was cooking since 2013-08-04. 3f97ae buffer_tree: Improve documentation of btr_no_parent(). fb9209 Avoid gcc warning on FreeBSD. 778af7 command.c: Avoid declaration after statement. 61c957 extract_v4_addr(): Don't return a structure. 1d7937 command.c: Remove pointless initialization. c17ede crypt.c: Remove condition which is always true. a12ecb ipc: Close proc fd. 01d37b Make log functions static. 0ba631 score: Improve documentation of score_update(). d6cf71 GIT-VERSION-GEN: Don't include output of git update-index.
btr: splice-out fix. When splicing out a node we set the ->parent pointer of all child nodes to the parent of the given node, and move each child to the ->children list of the parent. Except when there is no parent. If the given node was a root node (or an internal node whose parent vanished), we leave the ->children list untouched. In this case the assertion a few lines later triggers and aborts the program. Fix this by removing the nodes from the list. Such nodes have become root nodes themselves, so they should not be on any list of children.
buffer_tree: Improve documentation of btr_no_parent().
buffer_tree.c: Add documentation of btr_parent(). This function was introduced in commit 37e0dfe7 (check_wav: Ask parent nodes before falling back to defaults) without documentation.
Merge branch 't/allow_zero_btr_add' Was cooking for over a month.
Change copyright year to 2013. Better late than never.