diff --git a/librb/include/rb_helper.h b/librb/include/rb_helper.h index 0b4a90865..01868b678 100644 --- a/librb/include/rb_helper.h +++ b/librb/include/rb_helper.h @@ -58,5 +58,5 @@ void rb_helper_write_flush(rb_helper *helper); void rb_helper_run(rb_helper *helper); void rb_helper_close(rb_helper *helper); int rb_helper_read(rb_helper *helper, void *buf, size_t bufsize); -void rb_helper_loop(rb_helper *helper, long delay); +void rb_helper_loop(rb_helper *helper, long delay) __attribute__((noreturn)); #endif diff --git a/librb/include/rb_lib.h b/librb/include/rb_lib.h index 7646718e6..2a817408b 100644 --- a/librb/include/rb_lib.h +++ b/librb/include/rb_lib.h @@ -215,14 +215,14 @@ typedef void die_cb(const char *buffer); char *rb_ctime(const time_t, char *, size_t); char *rb_date(const time_t, char *, size_t); void rb_lib_log(const char *, ...); -void rb_lib_restart(const char *, ...); +void rb_lib_restart(const char *, ...) __attribute__((noreturn)); void rb_lib_die(const char *, ...); void rb_set_time(void); const char *rb_lib_version(void); void rb_lib_init(log_cb * xilog, restart_cb * irestart, die_cb * idie, int closeall, int maxfds, size_t dh_size, size_t fd_heap_size); -void rb_lib_loop(long delay); +void rb_lib_loop(long delay) __attribute__((noreturn)); time_t rb_current_time(void); const struct timeval *rb_current_time_tv(void); diff --git a/librb/include/rb_memory.h b/librb/include/rb_memory.h index 1bc7af098..222b5c8d9 100644 --- a/librb/include/rb_memory.h +++ b/librb/include/rb_memory.h @@ -33,7 +33,7 @@ #include -void rb_outofmemory(void); +void rb_outofmemory(void) __attribute__((noreturn)); static inline void * rb_malloc(size_t size) diff --git a/librb/src/balloc.c b/librb/src/balloc.c index 71b36cabf..2cbe4350f 100644 --- a/librb/src/balloc.c +++ b/librb/src/balloc.c @@ -58,6 +58,8 @@ #include #include +static void _rb_bh_fail(const char *reason, const char *file, int line) __attribute__((noreturn)); + static uintptr_t offset_pad; /* status information for an allocated block in heap */ diff --git a/librb/src/commio.c b/librb/src/commio.c index b40a5cc2d..252e6e9d2 100644 --- a/librb/src/commio.c +++ b/librb/src/commio.c @@ -1345,16 +1345,13 @@ rb_inet_ntop_sock(struct sockaddr *src, char *dst, unsigned int size) { case AF_INET: return (rb_inet_ntop(AF_INET, &((struct sockaddr_in *)src)->sin_addr, dst, size)); - break; #ifdef RB_IPV6 case AF_INET6: return (rb_inet_ntop (AF_INET6, &((struct sockaddr_in6 *)src)->sin6_addr, dst, size)); - break; #endif default: return NULL; - break; } } diff --git a/librb/src/crypt.c b/librb/src/crypt.c index 9344e988d..b2e372401 100644 --- a/librb/src/crypt.c +++ b/librb/src/crypt.c @@ -46,16 +46,12 @@ rb_crypt(const char *key, const char *salt) { case '1': return rb_md5_crypt(key, salt); - break; case '5': return rb_sha256_crypt(key, salt); - break; case '6': return rb_sha512_crypt(key, salt); - break; default: return NULL; - break; }; } else @@ -536,7 +532,7 @@ rb_do_des(uint32_t l_in, uint32_t r_in, uint32_t *l_out, uint32_t *r_out, int co * l_in, r_in, l_out, and r_out are in pseudo-"big-endian" format. */ uint32_t l, r, *kl, *kr, *kl1, *kr1; - uint32_t f, r48l, r48r; + uint32_t f = 0, r48l, r48r; int round; if(count == 0) @@ -748,9 +744,6 @@ rb_des_crypt(const char *key, const char *setting) * edited for clarity and style only. */ -#define MD5_BLOCK_LENGTH 64 -#define MD5_DIGEST_LENGTH 16 -#define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1) #define MD5_SIZE 16 static void diff --git a/librb/src/linebuf.c b/librb/src/linebuf.c index 33977f808..77fe9b7d8 100644 --- a/librb/src/linebuf.c +++ b/librb/src/linebuf.c @@ -31,10 +31,6 @@ static rb_bh *rb_linebuf_heap; static int bufline_count = 0; -#ifndef LINEBUF_HEAP_SIZE -#define LINEBUF_HEAP_SIZE 2048 -#endif - /* * rb_linebuf_init * diff --git a/librb/src/patricia.c b/librb/src/patricia.c index 9db07138d..fe02c73c3 100644 --- a/librb/src/patricia.c +++ b/librb/src/patricia.c @@ -27,10 +27,6 @@ * #define PATRICIA_DEBUG 1 */ -#define PREFIX_HEAP_COUNT 1024 -#define NODE_HEAP_COUNT 1024 -#define PATRICIA_HEAP_COUNT 128 - void rb_init_patricia(void) {