[Spice-devel] [PATCH 03/12] add missing static

Christophe Fergeau cfergeau at redhat.com
Fri Apr 22 09:43:01 PDT 2011


---
 client/jpeg_decoder.cpp   |    2 +-
 client/red_channel.cpp    |    2 +-
 common/quic_family_tmpl.c |    4 ++--
 server/mjpeg_encoder.c    |    6 +++---
 server/red_channel.c      |   10 +++++-----
 server/red_dispatcher.c   |    5 +++--
 server/red_worker.c       |   12 ++++++------
 server/reds.c             |   16 ++++++++--------
 8 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/client/jpeg_decoder.cpp b/client/jpeg_decoder.cpp
index 74cb758..4bc4f18 100644
--- a/client/jpeg_decoder.cpp
+++ b/client/jpeg_decoder.cpp
@@ -48,7 +48,7 @@ static void op_decode(SpiceJpegDecoder *decoder,
 
 extern "C" {
 
-    void jpeg_decoder_init_source(j_decompress_ptr cinfo)
+    static void jpeg_decoder_init_source(j_decompress_ptr cinfo)
     {
     }
 
diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index bcd7051..d8dcc42 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -45,7 +45,7 @@ RedChannelBase::~RedChannelBase()
 {
 }
 
-const char *spice_link_error_string(int err)
+static const char *spice_link_error_string(int err)
 {
     switch (err) {
         case SPICE_LINK_ERR_OK: return "no error";
diff --git a/common/quic_family_tmpl.c b/common/quic_family_tmpl.c
index 7a32f2d..fbefe89 100644
--- a/common/quic_family_tmpl.c
+++ b/common/quic_family_tmpl.c
@@ -56,8 +56,8 @@ static void FNAME(golomb_coding)(const BYTE n, const unsigned int l, unsigned in
     }
 }
 
-unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned int bits,
-                                    unsigned int * const codewordlen)
+static unsigned int FNAME(golomb_decoding)(const unsigned int l, const unsigned int bits,
+                                           unsigned int * const codewordlen)
 {
     if (bits > VNAME(family).notGRprefixmask[l]) { /*GR*/
         const unsigned int zeroprefix = cnt_l_zeroes(bits);       /* leading zeroes in codeword */
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index bae7bd2..30f15ef 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -74,16 +74,16 @@ size_t mjpeg_encoder_get_frame_stride(MJpegEncoder *encoder)
     return encoder->stride;
 }
 
-void init_destination(j_compress_ptr cinfo)
+static void init_destination(j_compress_ptr cinfo)
 {
 }
 
-boolean empty_output_buffer(j_compress_ptr cinfo)
+static boolean empty_output_buffer(j_compress_ptr cinfo)
 {
     return FALSE;
 }
 
-void term_destination(j_compress_ptr cinfo)
+static void term_destination(j_compress_ptr cinfo)
 {
 }
 
diff --git a/server/red_channel.c b/server/red_channel.c
index 9012b0d..a700d20 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -201,7 +201,7 @@ static void red_peer_handle_outgoing(RedsStream *stream, OutgoingHandler *handle
     }
 }
 
-void red_channel_on_output(void *opaque, int n)
+static void red_channel_on_output(void *opaque, int n)
 {
     RedChannel *channel = opaque;
 
@@ -401,11 +401,11 @@ error:
     return NULL;
 }
 
-void do_nothing_disconnect(RedChannel *red_channel)
+static void do_nothing_disconnect(RedChannel *red_channel)
 {
 }
 
-int do_nothing_handle_message(RedChannel *red_channel, SpiceDataHeader *header, uint8_t *msg)
+static int do_nothing_handle_message(RedChannel *red_channel, SpiceDataHeader *header, uint8_t *msg)
 {
     return TRUE;
 }
@@ -475,14 +475,14 @@ void red_channel_init_outgoing_messages_window(RedChannel *channel)
     red_channel_push(channel);
 }
 
-void red_channel_handle_migrate_flush_mark(RedChannel *channel)
+static void red_channel_handle_migrate_flush_mark(RedChannel *channel)
 {
     if (channel->handle_migrate_flush_mark) {
         channel->handle_migrate_flush_mark(channel);
     }
 }
 
-void red_channel_handle_migrate_data(RedChannel *channel, uint32_t size, void *message)
+static void red_channel_handle_migrate_data(RedChannel *channel, uint32_t size, void *message)
 {
     if (!channel->handle_migrate_data) {
         return;
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 19d6e8d..56446ab 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -388,8 +388,9 @@ static void qxl_worker_stop(QXLWorker *qxl_worker)
     ASSERT(message == RED_WORKER_MESSAGE_READY);
 }
 
-void qxl_worker_loadvm_commands(QXLWorker *qxl_worker,
-                                struct QXLCommandExt *ext, uint32_t count)
+static void qxl_worker_loadvm_commands(QXLWorker *qxl_worker,
+                                       struct QXLCommandExt *ext,
+                                       uint32_t count)
 {
     RedDispatcher *dispatcher = (RedDispatcher *)qxl_worker;
     RedWorkerMessage message = RED_WORKER_MESSAGE_LOADVM_COMMANDS;
diff --git a/server/red_worker.c b/server/red_worker.c
index a9452fb..7fc1b96 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1043,7 +1043,7 @@ static inline void validate_surface(RedWorker *worker, uint32_t surface_id)
     PANIC_ON(!worker->surfaces[surface_id].context.canvas);
 }
 
-char *draw_type_to_str(uint8_t type)
+static char *draw_type_to_str(uint8_t type)
 {
     switch (type) {
     case QXL_DRAW_FILL:
@@ -4131,7 +4131,7 @@ static CursorItem *get_cursor_item(RedWorker *worker, RedCursorCmd *cmd, uint32_
     return cursor_item;
 }
 
-void qxl_process_cursor(RedWorker *worker, RedCursorCmd *cursor_cmd, uint32_t group_id)
+static void qxl_process_cursor(RedWorker *worker, RedCursorCmd *cursor_cmd, uint32_t group_id)
 {
     CursorItem *item = get_cursor_item(worker, cursor_cmd, group_id);
     int cursor_show = FALSE;
@@ -8975,7 +8975,7 @@ static int display_channel_handle_message(RedChannel *channel, uint32_t size, ui
     }
 }
 
-int common_channel_config_socket(RedChannel *channel)
+static int common_channel_config_socket(RedChannel *channel)
 {
     int flags;
     int delay_val;
@@ -9005,16 +9005,16 @@ static void free_common_channel_from_listener(EventListener *ctx)
 
     free(common);
 }
-void worker_watch_update_mask(SpiceWatch *watch, int event_mask)
+static void worker_watch_update_mask(SpiceWatch *watch, int event_mask)
 {
 }
 
-SpiceWatch *worker_watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
+static SpiceWatch *worker_watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
 {
     return NULL; // apparently allowed?
 }
 
-void worker_watch_remove(SpiceWatch *watch)
+static void worker_watch_remove(SpiceWatch *watch)
 {
 }
 
diff --git a/server/reds.c b/server/reds.c
index 99a3176..5927a69 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -388,7 +388,7 @@ static void reds_link_free(RedLinkInfo *link)
 
 #ifdef RED_STATISTICS
 
-void insert_stat_node(StatNodeRef parent, StatNodeRef ref)
+static void insert_stat_node(StatNodeRef parent, StatNodeRef ref)
 {
     SpiceStatNode *node = &reds->stat->nodes[ref];
     uint32_t pos = INVALID_STAT_REF;
@@ -457,7 +457,7 @@ StatNodeRef stat_add_node(StatNodeRef parent, const char *name, int visible)
     return ref;
 }
 
-void stat_remove(SpiceStatNode *node)
+static void stat_remove(SpiceStatNode *node)
 {
     pthread_mutex_lock(&reds->stat_lock);
     node->flags &= ~SPICE_STAT_NODE_FLAG_ENABLED;
@@ -583,7 +583,7 @@ static void reds_reset_vdp()
     state->write_filter.discard_all = TRUE;
 }
 
-int reds_main_channel_connected()
+static int reds_main_channel_connected(void)
 {
     return !!reds->main_channel;
 }
@@ -746,7 +746,7 @@ static void reds_push_tokens()
     reds->agent_state.num_tokens = 0;
 }
 
-static int write_to_vdi_port();
+static int write_to_vdi_port(void);
 
 static void vdi_port_write_timer_start()
 {
@@ -805,7 +805,7 @@ static int write_to_vdi_port()
 
 static int read_from_vdi_port(void);
 
-void vdi_read_buf_release(uint8_t *data, void *opaque)
+static void vdi_read_buf_release(uint8_t *data, void *opaque)
 {
     VDIReadBuf *buf = (VDIReadBuf *)opaque;
 
@@ -1390,7 +1390,7 @@ static void reds_channel_set_common_caps(Channel *channel, int cap, int active)
     }
 }
 
-void reds_channel_init_auth_caps(Channel *channel)
+static void reds_channel_init_auth_caps(Channel *channel)
 {
     if (sasl_enabled) {
         reds_channel_set_common_caps(channel, SPICE_COMMON_CAP_AUTH_SASL, TRUE);
@@ -1721,7 +1721,7 @@ static int sync_write_u32(RedsStream *s, uint32_t n)
     return sync_write(s, &n, sizeof(uint32_t));
 }
 
-ssize_t reds_stream_sasl_write(RedsStream *s, const void *buf, size_t nbyte)
+static ssize_t reds_stream_sasl_write(RedsStream *s, const void *buf, size_t nbyte)
 {
     ssize_t ret;
 
@@ -3100,7 +3100,7 @@ static void reds_mig_finished(int completed)
     }
 }
 
-void reds_mig_switch(void)
+static void reds_mig_switch(void)
 {
     main_channel_push_migrate_switch(reds->main_channel);
 }
-- 
1.7.4.4



More information about the Spice-devel mailing list