qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, blauwirbel@gmail.com,
	Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-trivial] [PATCH 03/11] vnc: add missing static and remove unused functions
Date: Sun, 14 Oct 2012 19:58:51 +0000	[thread overview]
Message-ID: <d57a1e01b220160e15a35c76fb15d9054d26b2ef.1350244587.git.blauwirbel@gmail.com> (raw)
In-Reply-To: <cover.1350244587.git.blauwirbel@gmail.com>
In-Reply-To: <cover.1350244587.git.blauwirbel@gmail.com>

Add missing 'static' qualifiers. Remove unused functions
vnc_stop_worker_thread(), vnc_has_job() and vnc_jobs_clear().

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 console.h     |    2 --
 ui/vnc-jobs.c |   46 +++++-----------------------------------------
 ui/vnc-jobs.h |    4 ----
 ui/vnc.c      |   14 +++++++-------
 ui/vnc.h      |    5 -----
 5 files changed, 12 insertions(+), 59 deletions(-)

diff --git a/console.h b/console.h
index f990684..b848e20 100644
--- a/console.h
+++ b/console.h
@@ -377,10 +377,8 @@ void cocoa_display_init(DisplayState *ds, int full_screen);
 
 /* vnc.c */
 void vnc_display_init(DisplayState *ds);
-void vnc_display_close(DisplayState *ds);
 int vnc_display_open(DisplayState *ds, const char *display);
 void vnc_display_add_client(DisplayState *ds, int csock, int skipauth);
-int vnc_display_disable_login(DisplayState *ds);
 char *vnc_display_local_addr(DisplayState *ds);
 #ifdef CONFIG_VNC
 int vnc_display_password(DisplayState *ds, const char *password);
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 087b84d..c779796 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -126,29 +126,6 @@ static bool vnc_has_job_locked(VncState *vs)
     return false;
 }
 
-bool vnc_has_job(VncState *vs)
-{
-    bool ret;
-
-    vnc_lock_queue(queue);
-    ret = vnc_has_job_locked(vs);
-    vnc_unlock_queue(queue);
-    return ret;
-}
-
-void vnc_jobs_clear(VncState *vs)
-{
-    VncJob *job, *tmp;
-
-    vnc_lock_queue(queue);
-    QTAILQ_FOREACH_SAFE(job, &queue->jobs, next, tmp) {
-        if (job->vs == vs || !vs) {
-            QTAILQ_REMOVE(&queue->jobs, job, next);
-        }
-    }
-    vnc_unlock_queue(queue);
-}
-
 void vnc_jobs_join(VncState *vs)
 {
     vnc_lock_queue(queue);
@@ -320,6 +297,11 @@ static void *vnc_worker_thread(void *arg)
     return NULL;
 }
 
+static bool vnc_worker_thread_running(void)
+{
+    return queue; /* Check global queue */
+}
+
 void vnc_start_worker_thread(void)
 {
     VncJobQueue *q;
@@ -331,21 +313,3 @@ void vnc_start_worker_thread(void)
     qemu_thread_create(&q->thread, vnc_worker_thread, q, QEMU_THREAD_DETACHED);
     queue = q; /* Set global queue */
 }
-
-bool vnc_worker_thread_running(void)
-{
-    return queue; /* Check global queue */
-}
-
-void vnc_stop_worker_thread(void)
-{
-    if (!vnc_worker_thread_running())
-        return ;
-
-    /* Remove all jobs and wake up the thread */
-    vnc_lock_queue(queue);
-    queue->exit = true;
-    vnc_unlock_queue(queue);
-    vnc_jobs_clear(NULL);
-    qemu_cond_broadcast(&queue->cond);
-}
diff --git a/ui/vnc-jobs.h b/ui/vnc-jobs.h
index 86e6d88..59f66bc 100644
--- a/ui/vnc-jobs.h
+++ b/ui/vnc-jobs.h
@@ -34,14 +34,10 @@
 VncJob *vnc_job_new(VncState *vs);
 int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h);
 void vnc_job_push(VncJob *job);
-bool vnc_has_job(VncState *vs);
-void vnc_jobs_clear(VncState *vs);
 void vnc_jobs_join(VncState *vs);
 
 void vnc_jobs_consume_buffer(VncState *vs);
 void vnc_start_worker_thread(void);
-bool vnc_worker_thread_running(void);
-void vnc_stop_worker_thread(void);
 
 /* Locks */
 static inline int vnc_trylock_display(VncDisplay *vd)
diff --git a/ui/vnc.c b/ui/vnc.c
index 33e6386..bde896b 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -479,12 +479,12 @@ void buffer_reserve(Buffer *buffer, size_t len)
     }
 }
 
-int buffer_empty(Buffer *buffer)
+static int buffer_empty(Buffer *buffer)
 {
     return buffer->offset == 0;
 }
 
-uint8_t *buffer_end(Buffer *buffer)
+static uint8_t *buffer_end(Buffer *buffer)
 {
     return buffer->buffer + buffer->offset;
 }
@@ -1376,17 +1376,17 @@ void vnc_flush(VncState *vs)
     vnc_unlock_output(vs);
 }
 
-uint8_t read_u8(uint8_t *data, size_t offset)
+static uint8_t read_u8(uint8_t *data, size_t offset)
 {
     return data[offset];
 }
 
-uint16_t read_u16(uint8_t *data, size_t offset)
+static uint16_t read_u16(uint8_t *data, size_t offset)
 {
     return ((data[offset] & 0xFF) << 8) | (data[offset + 1] & 0xFF);
 }
 
-int32_t read_s32(uint8_t *data, size_t offset)
+static int32_t read_s32(uint8_t *data, size_t offset)
 {
     return (int32_t)((data[offset] << 24) | (data[offset + 1] << 16) |
                      (data[offset + 2] << 8) | data[offset + 3]);
@@ -2761,7 +2761,7 @@ void vnc_display_init(DisplayState *ds)
 }
 
 
-void vnc_display_close(DisplayState *ds)
+static void vnc_display_close(DisplayState *ds)
 {
     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
 
@@ -2783,7 +2783,7 @@ void vnc_display_close(DisplayState *ds)
 #endif
 }
 
-int vnc_display_disable_login(DisplayState *ds)
+static int vnc_display_disable_login(DisplayState *ds)
 {
     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
 
diff --git a/ui/vnc.h b/ui/vnc.h
index 068c2fc..c89f693 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -493,9 +493,6 @@ void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting);
 
 
 /* Buffer I/O functions */
-uint8_t read_u8(uint8_t *data, size_t offset);
-uint16_t read_u16(uint8_t *data, size_t offset);
-int32_t read_s32(uint8_t *data, size_t offset);
 uint32_t read_u32(uint8_t *data, size_t offset);
 
 /* Protocol stage functions */
@@ -507,8 +504,6 @@ void start_auth_vnc(VncState *vs);
 
 /* Buffer management */
 void buffer_reserve(Buffer *buffer, size_t len);
-int buffer_empty(Buffer *buffer);
-uint8_t *buffer_end(Buffer *buffer);
 void buffer_reset(Buffer *buffer);
 void buffer_free(Buffer *buffer);
 void buffer_append(Buffer *buffer, const void *data, size_t len);
-- 
1.7.2.5



  parent reply	other threads:[~2012-10-14 20:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-14 19:58 [Qemu-trivial] [PATCH 00/11] static patches Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 01/11] target-sparc: make do_unaligned_access static Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 02/11] vl.c: add missing static Blue Swirl
2012-10-14 19:58 ` Blue Swirl [this message]
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 04/11] tap-win32: avoid a warning Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 05/11] m48t59: remove unused m48t59_set_addr Blue Swirl
2012-10-15  0:04   ` [Qemu-trivial] [Qemu-devel] " Andreas Färber
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 06/11] sun4c: remove unused functions Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 07/11] slirp: remove unused function u_sleep Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 08/11] ppc: add missing static and remove unused functions Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 09/11] target-ppc: make some functions static Blue Swirl
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 10/11] arm: add missing static and remove unused functions Blue Swirl
2012-10-14 20:09   ` Peter Maydell
2012-10-14 20:33     ` Blue Swirl
2012-10-14 20:35       ` Peter Maydell
2012-10-14 20:49         ` Blue Swirl
2012-10-14 20:55           ` Peter Maydell
2012-10-19 16:43             ` Blue Swirl
2012-10-15  0:01       ` [Qemu-trivial] [Qemu-devel] " Andreas Färber
2012-10-14 19:58 ` [Qemu-trivial] [PATCH 11/11] exec: make some functions static Blue Swirl
2012-10-14 20:06 ` [Qemu-trivial] [PATCH 00/11] static patches Blue Swirl
2012-10-14 20:32   ` [Qemu-trivial] [Qemu-devel] " malc
2012-10-14 20:41     ` Blue Swirl
2012-10-19  8:38 ` [Qemu-trivial] " Stefan Hajnoczi
2012-10-19 17:49   ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d57a1e01b220160e15a35c76fb15d9054d26b2ef.1350244587.git.blauwirbel@gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).