mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-29 00:41:33 +00:00
Add some more 'noreturn' annotations
Methods which longjump, unconditionally raise an exception, or call _exit() cannot return control to the caller so should be annotated with 'noreturn' Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
49e2b2679f
commit
ef78242e19
@ -252,7 +252,7 @@ public:
|
||||
/* TODO: unite with the window debug callbacks? */
|
||||
class GlzDecoderCanvasDebug: public GlzDecoderDebug {
|
||||
public:
|
||||
virtual void error(const std::string& str)
|
||||
virtual SPICE_GNUC_NORETURN void error(const std::string& str)
|
||||
{
|
||||
throw Exception(str);
|
||||
}
|
||||
|
||||
@ -52,10 +52,9 @@ extern "C" {
|
||||
{
|
||||
}
|
||||
|
||||
static jpeg_boolean jpeg_decoder_fill_input_buffer(j_decompress_ptr cinfo)
|
||||
static SPICE_GNUC_NORETURN jpeg_boolean jpeg_decoder_fill_input_buffer(j_decompress_ptr cinfo)
|
||||
{
|
||||
PANIC("no more data for jpeg");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void jpeg_decoder_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
||||
|
||||
@ -99,7 +99,7 @@ private:
|
||||
|
||||
class GlzDecoderWindowDebug: public GlzDecoderDebug {
|
||||
public:
|
||||
virtual void error(const std::string& str)
|
||||
virtual SPICE_GNUC_NORETURN void error(const std::string& str)
|
||||
{
|
||||
throw Exception(str);
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "debug.h"
|
||||
#include "platform_utils.h"
|
||||
|
||||
static void ssl_error()
|
||||
static void SPICE_GNUC_NORETURN ssl_error()
|
||||
{
|
||||
unsigned long last_error = ERR_peek_last_error();
|
||||
|
||||
|
||||
@ -3167,11 +3167,10 @@ static int x_error_handler(Display* display, XErrorEvent* error_event)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int x_io_error_handler(Display* display)
|
||||
static SPICE_GNUC_NORETURN int x_io_error_handler(Display* display)
|
||||
{
|
||||
LOG_ERROR("x io error on %s", XDisplayString(display));
|
||||
_exit(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static XVisualInfo* get_x_vis_info(int screen)
|
||||
|
||||
@ -5274,7 +5274,8 @@ static int red_display_free_some_independent_glz_drawables(DisplayChannelClient
|
||||
/******************************************************
|
||||
* Encoders callbacks
|
||||
*******************************************************/
|
||||
static SPICE_GNUC_PRINTF(2, 3) void quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
|
||||
static SPICE_GNUC_NORETURN SPICE_GNUC_PRINTF(2, 3) void
|
||||
quic_usr_error(QuicUsrContext *usr, const char *fmt, ...)
|
||||
{
|
||||
EncoderData *usr_data = &(((QuicData *)usr)->data);
|
||||
va_list ap;
|
||||
@ -5287,7 +5288,8 @@ static SPICE_GNUC_PRINTF(2, 3) void quic_usr_error(QuicUsrContext *usr, const ch
|
||||
longjmp(usr_data->jmp_env, 1);
|
||||
}
|
||||
|
||||
static SPICE_GNUC_PRINTF(2, 3) void lz_usr_error(LzUsrContext *usr, const char *fmt, ...)
|
||||
static SPICE_GNUC_NORETURN SPICE_GNUC_PRINTF(2, 3) void
|
||||
lz_usr_error(LzUsrContext *usr, const char *fmt, ...)
|
||||
{
|
||||
EncoderData *usr_data = &(((LzData *)usr)->data);
|
||||
va_list ap;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user