bandb/bandb.c: misc cleanup for compiler warnings

bandb.c:243:1: warning: function 'error_cb' could be declared with
               attribute 'noreturn' [-Wmissing-noreturn]

bandb.c:289:1: warning: function 'db_error_cb' could be declared with
               attribute 'noreturn' [-Wmissing-noreturn]

bandb.c:293:13: warning: signed shift result (0x80000000) sets the sign
                bit of the shift expression's type ('int') and becomes
                negative [-Wshift-sign-overflow]
This commit is contained in:
Aaron Jones 2017-07-31 01:01:22 +00:00
parent 81ae0a7d1b
commit a8517ee77c
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012

View file

@ -238,7 +238,7 @@ parse_request(rb_helper *helper)
}
static void
static void __attribute__((noreturn))
error_cb(rb_helper *helper)
{
if(in_transaction)
@ -284,13 +284,13 @@ setup_signals(void)
}
static void
static void __attribute__((noreturn))
db_error_cb(const char *errstr)
{
char buf[256];
rb_snprintf(buf, sizeof(buf), "! :%s", errstr);
rb_helper_write(bandb_helper, "%s", buf);
rb_sleep(2 << 30, 0);
rb_sleep(1 << 30, 0);
exit(1);
}