[Spice-devel] [spice-server v3] Make various functions static

Christophe Fergeau cfergeau at redhat.com
Tue Apr 4 10:38:54 UTC 2017


- glz_enc_dictionary_reset
- monitors_config_new
- red_channel_any_blocked
- red_channel_no_item_being_sent
- red_client_get_channel

are only used in the file where they are defined, so they can as well be
static.

Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
---
Changes since v2:
- do not make reds_stream_write() static


 server/display-channel.c  | 2 +-
 server/display-channel.h  | 2 --
 server/glz-encoder-dict.c | 5 ++++-
 server/glz-encoder-dict.h | 3 ---
 server/red-channel.c      | 5 +++--
 server/red-channel.h      | 5 -----
 server/red-client.c       | 2 +-
 server/red-client.h       | 1 -
 8 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index a35145c..0d5b972 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -153,7 +153,7 @@ static void monitors_config_debug(MonitorsConfig *mc)
                     mc->heads[i].width, mc->heads[i].height);
 }
 
-MonitorsConfig* monitors_config_new(QXLHead *heads, ssize_t nheads, ssize_t max)
+static MonitorsConfig* monitors_config_new(QXLHead *heads, ssize_t nheads, ssize_t max)
 {
     MonitorsConfig *mc;
 
diff --git a/server/display-channel.h b/server/display-channel.h
index 796b020..436cd33 100644
--- a/server/display-channel.h
+++ b/server/display-channel.h
@@ -141,8 +141,6 @@ typedef struct RedMonitorsConfigItem {
     MonitorsConfig *monitors_config;
 } RedMonitorsConfigItem;
 
-MonitorsConfig*            monitors_config_new                       (QXLHead *heads, ssize_t nheads,
-                                                                      ssize_t max);
 MonitorsConfig *           monitors_config_ref                       (MonitorsConfig *config);
 void                       monitors_config_unref                     (MonitorsConfig *config);
 
diff --git a/server/glz-encoder-dict.c b/server/glz-encoder-dict.c
index 1f81a6d..4b0a422 100644
--- a/server/glz-encoder-dict.c
+++ b/server/glz-encoder-dict.c
@@ -26,6 +26,8 @@
 #include "glz-encoder-dict.h"
 #include "glz-encoder-priv.h"
 
+static void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr);
+
 /* turning all used images to free ones. If they are alive, calling the free_image callback for
    each one */
 static inline void __glz_dictionary_window_reset_images(SharedDictionary *dict)
@@ -201,7 +203,8 @@ GlzEncDictContext *glz_enc_dictionary_restore(GlzEncDictRestoreData *restore_dat
     return ((GlzEncDictContext *)ret);
 }
 
-void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr)
+/*  NOTE - you should use this routine only when no encoder uses the dictionary. */
+static void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr)
 {
     SharedDictionary *dict = (SharedDictionary *)opaque_dict;
     dict->cur_usr = usr;
diff --git a/server/glz-encoder-dict.h b/server/glz-encoder-dict.h
index f333412..313ef9a 100644
--- a/server/glz-encoder-dict.h
+++ b/server/glz-encoder-dict.h
@@ -60,9 +60,6 @@ void glz_enc_dictionary_get_restore_data(GlzEncDictContext *opaque_dict,
 GlzEncDictContext *glz_enc_dictionary_restore(GlzEncDictRestoreData *restore_data,
                                               GlzEncoderUsrContext *usr);
 
-/*  NOTE - you should use this routine only when no encoder uses the dictionary. */
-void glz_enc_dictionary_reset(GlzEncDictContext *opaque_dict, GlzEncoderUsrContext *usr);
-
 /* image: the context returned by the encoder when the image was encoded.
    NOTE - you should use this routine only when no encoder uses the dictionary.*/
 void glz_enc_dictionary_remove_image(GlzEncDictContext *opaque_dict,
diff --git a/server/red-channel.c b/server/red-channel.c
index 91c0dee..2163066 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -538,7 +538,8 @@ bool red_channel_all_blocked(RedChannel *channel)
     return TRUE;
 }
 
-bool red_channel_any_blocked(RedChannel *channel)
+/* return TRUE if any of the connected clients to this channel are blocked */
+static bool red_channel_any_blocked(RedChannel *channel)
 {
     GListIter iter;
     RedChannelClient *rcc;
@@ -551,7 +552,7 @@ bool red_channel_any_blocked(RedChannel *channel)
     return FALSE;
 }
 
-bool red_channel_no_item_being_sent(RedChannel *channel)
+static bool red_channel_no_item_being_sent(RedChannel *channel)
 {
     GListIter iter;
     RedChannelClient *rcc;
diff --git a/server/red-channel.h b/server/red-channel.h
index 38289c4..cc11639 100644
--- a/server/red-channel.h
+++ b/server/red-channel.h
@@ -178,11 +178,6 @@ void red_channel_pipes_add_empty_msg(RedChannel *channel, int msg_type);
 /* return TRUE if all of the connected clients to this channel are blocked */
 bool red_channel_all_blocked(RedChannel *channel);
 
-/* return TRUE if any of the connected clients to this channel are blocked */
-bool red_channel_any_blocked(RedChannel *channel);
-
-bool red_channel_no_item_being_sent(RedChannel *channel);
-
 // TODO: unstaticed for display/cursor channels. they do some specific pushes not through
 // adding elements or on events. but not sure if this is actually required (only result
 // should be that they ""try"" a little harder, but if the event system is correct it
diff --git a/server/red-client.c b/server/red-client.c
index 2918911..264f1c9 100644
--- a/server/red-client.c
+++ b/server/red-client.c
@@ -226,7 +226,7 @@ void red_client_destroy(RedClient *client)
 
 
 /* client->lock should be locked */
-RedChannelClient *red_client_get_channel(RedClient *client, int type, int id)
+static RedChannelClient *red_client_get_channel(RedClient *client, int type, int id)
 {
     GListIter iter;
     RedChannelClient *rcc;
diff --git a/server/red-client.h b/server/red-client.h
index 28c4eb4..20e2dc2 100644
--- a/server/red-client.h
+++ b/server/red-client.h
@@ -48,7 +48,6 @@ void red_client_destroy(RedClient *client);
 
 gboolean red_client_add_channel(RedClient *client, RedChannelClient *rcc, GError **error);
 void red_client_remove_channel(RedChannelClient *rcc);
-RedChannelClient *red_client_get_channel(RedClient *client, int type, int id);
 
 MainChannelClient *red_client_get_main(RedClient *client);
 // main should be set once before all the other channels are created
-- 
2.9.3



More information about the Spice-devel mailing list