Commit Graph

18 Commits

Author SHA1 Message Date
Willy Tarreau
64755bf856 Revert "DEV: coccinelle: Add rule to use chunk_istcat() instead of chunk_strncat()"
This reverts commit b9656e4837. It's
not needed anymore since 49b0482ed ("CLEANUP: chunk: remove misleading
chunk_strncat() function").
2021-11-08 13:42:03 +01:00
Tim Duesterhus
b9656e4837 DEV: coccinelle: Add rule to use chunk_istcat() instead of chunk_strncat()
This replaces `chunk_strncat()` with `chunk_istcat()` if the parameters are the
ist's `.ptr` and `.len`.
2021-11-08 12:08:26 +01:00
Tim Duesterhus
755d2419a4 DEV: coccinelle: Add rule to use chunk_istcat() instead of chunk_memcat()
This replaces `chunk_memcat()` with `chunk_istcat()` if the parameters are the
ist's `.ptr` and `.len`.
2021-11-08 12:08:26 +01:00
Tim Duesterhus
9b80a6ca8f DEV: coccinelle: Add rule to use isttrim() where possible
This replaces `if (i.len > e) i.len = e;` by `isttrim(i, e)`.
2021-11-08 12:08:26 +01:00
Tim Duesterhus
958f50454a DEV: coccinelle: Add rule to use istend() where possible
This replaces `i.ptr + i.len` by `istend()`.
2021-11-08 07:58:18 +01:00
Tim Duesterhus
9c523f1042 DEV: coccinelle: Remove unused expression e
Introduced in ef00c533e1.
2021-11-08 07:58:18 +01:00
Tim Duesterhus
ef00c533e1 DEV: coccinelle: Add rule to use istnext() where possible
This matches both `istadv(..., 1)` as well as raw `.ptr++` uses.
2021-11-05 07:48:38 +01:00
Tim Duesterhus
cc17a6e1d3 DEV: coccinelle: Add ha_free.cocci
Taken from 61cfdf4fd8.
2021-11-05 07:48:38 +01:00
Tim Duesterhus
e6c04507d8 DEV: coccinelle: Add realloc_leak.cocci
This coccinelle patch finds locations where the return value of `realloc()` is
assigned to the pointer passed to `realloc()`. This calls will leak memory if
`realloc()` returns `NULL`.
2021-10-28 09:45:48 +02:00
Tim Duesterhus
bce9108a1f DEV: coccinelle: Add strcmp.cocci
see e5ff14100a
2021-10-18 07:17:04 +02:00
Tim Duesterhus
ecf55968a1 DEV: coccinelle: Add xalloc_cast.cocci
This remove's C++ style casts from the return value of malloc/calloc.

see 403fd722ac
2021-09-17 17:22:05 +02:00
Tim Duesterhus
02fa646a37 DEV: coccinelle: Add bug_on.cocci
This replaces an if + ABORT_NOW() by BUG_ON(). It might change behavior,
because BUG_ON will result in a no-op if not enabled.
2021-09-17 17:22:05 +02:00
Tim Duesterhus
63ee0e4c01 DEV: coccinelle: Add xalloc_size.cocci
This commits the Coccinelle patch to clean up sizeof handling for malloc/calloc.
2021-09-17 17:22:05 +02:00
Tim Duesterhus
c1af0bae69 DEV: coccinelle: Add ist.cocci
This commits the Coccinelle patch to clean up ist handling.
2021-09-17 17:22:05 +02:00
Willy Tarreau
cd430b9b7b CLEANUP: dev/flags: remove useless test in the stdin number parser
The test on "if (err)" after parsing a number was meant to be
"if (*err)" but in practise it will always be true since we at least
have a '\n' there, so no need for testing before writing zero.
This fixes issue #1211.
2021-04-03 15:29:10 +02:00
Willy Tarreau
21ef8b9064 BUILD: makefile: integrate the hpack tools
The few hpack development tools are now integrated into the main
makefile, which allows to remove the original one which was causing
lots of build warnings. A README was added to explain how to build
instead.
2021-04-02 17:48:42 +02:00
Willy Tarreau
339eb0b002 DEV: flags: replace the unneeded makefile with a README
The makefile was not suited anymore as it didn't consider all
required compiler options and was causing way too many build
warnings with modern compilers. Let's just remove it and indicate
that this has to be built from the top of the project.
2021-04-02 17:48:42 +02:00
Willy Tarreau
074ebcde29 CONTRIB: move some dev-specific tools to dev/
The following directories were moved from contrib/ to dev/ to make their
use case a bit clearer. In short, only developers are expected to ever
go there. The makefile was updated to build and clean from these ones.

base64/  flags/  hpack/  plug_qdisc/  poll/  tcploop/  trace/
2021-04-02 17:48:42 +02:00