From 0a0fea05ada7cd72c8b6204f02abc1a36a4dbdbc Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 12 Nov 2012 18:55:45 +0000 Subject: [PATCH] xstrstr: add function attributes The pointers arguments are never null, and the function should be optimized as much as possible. Signed-off-by: Sami Kerola --- src/dhcpd-pools.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h index b2b4561..b14a25b 100644 --- a/src/dhcpd-pools.h +++ b/src/dhcpd-pools.h @@ -126,7 +126,12 @@ int do_counting(void); void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges) __attribute__ ((nonnull(1, 2))); /* support functions */ -int xstrstr(const char *__restrict a, const char *__restrict b, int len); +int xstrstr(const char *__restrict a, const char *__restrict b, int len) + __attribute__ ((nonnull(1, 2))) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) + __attribute__ ((__hot__)) +#endif + ; double strtod_or_err(const char *__restrict str, const char *__restrict errmesg); void print_version(void) __attribute__ ((noreturn)); void usage(int status) __attribute__ ((noreturn));