[Spice-commits] 4 commits - client/cache.hpp client/canvas.h client/cursor.cpp client/jpeg_decoder.cpp client/red_client.h client/red_peer.cpp client/shared_cache.hpp client/x11 server/red_worker.c
Daniel P. Berrange
berrange at kemper.freedesktop.org
Wed Apr 25 06:03:39 PDT 2012
client/cache.hpp | 6 +++---
client/canvas.h | 2 +-
client/cursor.cpp | 2 +-
client/jpeg_decoder.cpp | 3 +--
client/red_client.h | 2 +-
client/red_peer.cpp | 2 +-
client/shared_cache.hpp | 2 +-
client/x11/platform.cpp | 13 ++++++-------
server/red_worker.c | 8 +++++---
9 files changed, 20 insertions(+), 20 deletions(-)
New commits:
commit ef78242e19e8d0599c74aa34fad0fbb5a56cdb20
Author: Daniel P. Berrange <berrange at redhat.com>
Date: Wed Apr 25 11:29:43 2012 +0100
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 at redhat.com>
diff --git a/client/canvas.h b/client/canvas.h
index cd6a89b..7702568 100644
--- a/client/canvas.h
+++ b/client/canvas.h
@@ -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);
}
diff --git a/client/jpeg_decoder.cpp b/client/jpeg_decoder.cpp
index 2b2d5e4..c85902f 100644
--- a/client/jpeg_decoder.cpp
+++ b/client/jpeg_decoder.cpp
@@ -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)
diff --git a/client/red_client.h b/client/red_client.h
index a2f00c4..c4b418a 100644
--- a/client/red_client.h
+++ b/client/red_client.h
@@ -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);
}
diff --git a/client/red_peer.cpp b/client/red_peer.cpp
index 10640c8..d2a6098 100644
--- a/client/red_peer.cpp
+++ b/client/red_peer.cpp
@@ -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();
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 0669b69..14c6e0c 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -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)
diff --git a/server/red_worker.c b/server/red_worker.c
index e271ae5..297b168 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -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;
commit 49e2b2679f8fdbcddab0e1c022189966d7a7d103
Author: Daniel P. Berrange <berrange at redhat.com>
Date: Wed Apr 25 11:20:42 2012 +0100
Fix typo in is_equal_brush
The 3 part of the conditional in the is_equal_brush method
compared the b1->u.color field to itself, instead of b2->u.color
Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
diff --git a/server/red_worker.c b/server/red_worker.c
index fc74924..e271ae5 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -2346,7 +2346,7 @@ static int is_equal_brush(SpiceBrush *b1, SpiceBrush *b2)
{
return b1->type == b2->type &&
b1->type == SPICE_BRUSH_TYPE_SOLID &&
- b1->u.color == b1->u.color;
+ b1->u.color == b2->u.color;
}
// partial imp
commit 6d7d9bc12d92e14f291d818fc46303f15e045e33
Author: Daniel P. Berrange <berrange at redhat.com>
Date: Wed Apr 25 10:51:10 2012 +0100
Fix printf format specifiers for i686 hosts
Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
diff --git a/client/cache.hpp b/client/cache.hpp
index 42e6873..e267f42 100644
--- a/client/cache.hpp
+++ b/client/cache.hpp
@@ -45,7 +45,7 @@ public:
while (*item) {
if ((*item)->id == id) {
- THROW("%s id %lu, double insert", Treat::name(), id);
+ THROW("%s id %" PRIu64 ", double insert", Treat::name(), id);
}
item = &(*item)->next;
}
@@ -61,7 +61,7 @@ public:
}
if (!item) {
- THROW("%s id %lu, not found", Treat::name(), id);
+ THROW("%s id %" PRIu64 ", not found", Treat::name(), id);
}
return Treat::get(item->data);
}
@@ -79,7 +79,7 @@ public:
}
item = &(*item)->next;
}
- THROW("%s id %lu, not found", Treat::name(), id);
+ THROW("%s id %" PRIu64 ", not found", Treat::name(), id);
}
void clear()
diff --git a/client/cursor.cpp b/client/cursor.cpp
index 0584b88..0fbf366 100644
--- a/client/cursor.cpp
+++ b/client/cursor.cpp
@@ -64,7 +64,7 @@ CursorData::CursorData(SpiceCursor& cursor, int data_size)
}
if (data_size < expected_size) {
- THROW("access violation 0x%lx %u", (uintptr_t)cursor.data, expected_size);
+ THROW("access violation 0x%" PRIuPTR " %u", (uintptr_t)cursor.data, expected_size);
}
_data = new uint8_t[expected_size];
memcpy(_data, cursor.data, expected_size);
diff --git a/client/shared_cache.hpp b/client/shared_cache.hpp
index b9c3fd9..450116c 100644
--- a/client/shared_cache.hpp
+++ b/client/shared_cache.hpp
@@ -159,7 +159,7 @@ public:
}
item = &(*item)->next;
}
- THROW("%s id %lu, not found", Treat::name(), id);
+ THROW("%s id %" PRIu64 ", not found", Treat::name(), id);
}
void clear()
commit 3bbc53521ee2fdc177f2756297c0f4038368cef6
Author: Daniel P. Berrange <berrange at redhat.com>
Date: Wed Apr 25 10:50:58 2012 +0100
Add missing struct field initializers
Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index f35d537..0669b69 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -128,12 +128,12 @@ struct clipboard_format_info {
static struct clipboard_format_info clipboard_formats[] = {
{ VD_AGENT_CLIPBOARD_UTF8_TEXT, { "UTF8_STRING",
- "text/plain;charset=UTF-8", "text/plain;charset=utf-8", NULL }, },
- { VD_AGENT_CLIPBOARD_IMAGE_PNG, { "image/png", NULL }, },
+ "text/plain;charset=UTF-8", "text/plain;charset=utf-8", NULL }, { 0 }, 0},
+ { VD_AGENT_CLIPBOARD_IMAGE_PNG, { "image/png", NULL }, { 0 }, 0},
{ VD_AGENT_CLIPBOARD_IMAGE_BMP, { "image/bmp", "image/x-bmp",
- "image/x-MS-bmp", "image/x-win-bitmap", NULL }, },
- { VD_AGENT_CLIPBOARD_IMAGE_TIFF, { "image/tiff", NULL }, },
- { VD_AGENT_CLIPBOARD_IMAGE_JPG, { "image/jpeg", NULL }, },
+ "image/x-MS-bmp", "image/x-win-bitmap", NULL }, { 0 }, 0},
+ { VD_AGENT_CLIPBOARD_IMAGE_TIFF, { "image/tiff", NULL }, { 0 }, 0},
+ { VD_AGENT_CLIPBOARD_IMAGE_JPG, { "image/jpeg", NULL }, { 0 }, 0},
};
#define clipboard_format_count ((int)(sizeof(clipboard_formats)/sizeof(clipboard_formats[0])))
More information about the Spice-commits
mailing list