terminal: make utf8 decoder return length

System Internals / systemd - David Herrmann [gmail.com] - 3 October 2014 08:57 UTC

Lets return the parsed length in term_utf8_decode() instead of a buffer pointer. Store the pointer in the passed argument.

This makes it adhere to the systemd coding-style, were we always avoid returning pointers, but store them in output arguments. In this case, the storage is not allocated, so it doesn't fit 100% to this idiom, but still looks much nicer.

f1f5b2a terminal: make utf8 decoder return length
src/libsystemd-terminal/subterm.c | 4 +--
src/libsystemd-terminal/term-parser.c | 24 +++++++-------
src/libsystemd-terminal/term-screen.c | 4 +--
src/libsystemd-terminal/term.h | 2 +-
src/libsystemd-terminal/test-term-parser.c | 49 ++++++++++++++--------------
5 files changed, 43 insertions(+), 40 deletions(-)

Upstream: github.com


  • Share