]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/basic/hashmap.c
siphash24: change result argument to uint64_t 1916/head
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 16 Nov 2015 08:21:20 +0000 (09:21 +0100)
committerDaniel Mack <daniel@zonque.org>
Mon, 16 Nov 2015 14:20:29 +0000 (15:20 +0100)
commitdbe81cbd2a93088236a2e4e41eeb33378940f7b9
tree8aec120af6f424803074d35827fbfb5048d8a9cf
parent8dd85afe761885a9c47173cdafd1b7f9b36d08e6
siphash24: change result argument to uint64_t

Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which
enforce pointer alignment this fixes crashes when we previously cast an
unaligned array to uint64_t*, and on others this should at least improve
performance as the compiler now aligns these properly.

This also simplifies the code in most cases by getting rid of typecasts. The
only place which we can't change is struct duid's en.id, as that is _packed_
and public API, so we can't enforce alignment of the "id" field and have to
use memcpy instead.
17 files changed:
src/basic/hashmap.c
src/basic/siphash24.c
src/basic/siphash24.h
src/import/pull-common.c
src/journal/journald-rate-limit.c
src/libsystemd-network/dhcp-identifier.c
src/libsystemd-network/network-internal.c
src/libsystemd-network/network-internal.h
src/libsystemd-network/sd-dhcp-server.c
src/libsystemd-network/sd-ipv4ll.c
src/libsystemd-network/test-dhcp-server.c
src/libsystemd/sd-bus/bus-bloom.c
src/network/networkd-ipv4ll.c
src/network/networkd-netdev.c
src/nspawn/nspawn-network.c
src/test/test-siphash24.c
src/udev/net/link-config.c