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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-11-12 18:55:45 +00:00
parent 34f99d2f08
commit 0a0fea05ad

View file

@ -126,7 +126,12 @@ int do_counting(void);
void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges) void flip_ranges(struct range_t *__restrict ranges, struct range_t *__restrict tmp_ranges)
__attribute__ ((nonnull(1, 2))); __attribute__ ((nonnull(1, 2)));
/* support functions */ /* 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); double strtod_or_err(const char *__restrict str, const char *__restrict errmesg);
void print_version(void) __attribute__ ((noreturn)); void print_version(void) __attribute__ ((noreturn));
void usage(int status) __attribute__ ((noreturn)); void usage(int status) __attribute__ ((noreturn));