qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 5/7] Move buffer functions up
Date: Fri, 30 Jan 2009 15:38:11 +0100	[thread overview]
Message-ID: <1233326293-8591-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1233326293-8591-5-git-send-email-agraf@suse.de>

We will need to use buffer functions in code that will end up being
below the current buffer functions. In order to not introduce any
function stub defines, let's just move them up.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 vnc.c |   66 ++++++++++++++++++++++++++++++++--------------------------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/vnc.c b/vnc.c
index 31ea131..b3b4bfd 100644
--- a/vnc.c
+++ b/vnc.c
@@ -263,6 +263,39 @@ static void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h,
     vnc_write_s32(vs, encoding);
 }
 
+static void buffer_reserve(Buffer *buffer, size_t len)
+{
+    if ((buffer->capacity - buffer->offset) < len) {
+	buffer->capacity += (len + 1024);
+	buffer->buffer = qemu_realloc(buffer->buffer, buffer->capacity);
+	if (buffer->buffer == NULL) {
+	    fprintf(stderr, "vnc: out of memory\n");
+	    exit(1);
+	}
+    }
+}
+
+static int buffer_empty(Buffer *buffer)
+{
+    return buffer->offset == 0;
+}
+
+static uint8_t *buffer_end(Buffer *buffer)
+{
+    return buffer->buffer + buffer->offset;
+}
+
+static void buffer_reset(Buffer *buffer)
+{
+	buffer->offset = 0;
+}
+
+static void buffer_append(Buffer *buffer, const void *data, size_t len)
+{
+    memcpy(buffer->buffer + buffer->offset, data, len);
+    buffer->offset += len;
+}
+
 static void vnc_dpy_resize(DisplayState *ds)
 {
     int size_changed;
@@ -598,39 +631,6 @@ static int vnc_listen_poll(void *opaque)
     return 0;
 }
 
-static void buffer_reserve(Buffer *buffer, size_t len)
-{
-    if ((buffer->capacity - buffer->offset) < len) {
-	buffer->capacity += (len + 1024);
-	buffer->buffer = qemu_realloc(buffer->buffer, buffer->capacity);
-	if (buffer->buffer == NULL) {
-	    fprintf(stderr, "vnc: out of memory\n");
-	    exit(1);
-	}
-    }
-}
-
-static int buffer_empty(Buffer *buffer)
-{
-    return buffer->offset == 0;
-}
-
-static uint8_t *buffer_end(Buffer *buffer)
-{
-    return buffer->buffer + buffer->offset;
-}
-
-static void buffer_reset(Buffer *buffer)
-{
-	buffer->offset = 0;
-}
-
-static void buffer_append(Buffer *buffer, const void *data, size_t len)
-{
-    memcpy(buffer->buffer + buffer->offset, data, len);
-    buffer->offset += len;
-}
-
 /* audio */
 static void audio_capture_notify(void *opaque, audcnotification_e cmd)
 {
-- 
1.6.0.2

  reply	other threads:[~2009-01-30 14:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 14:38 [Qemu-devel] [PATCH 0/7] Add zlib support to VNC server Alexander Graf
2009-01-30 14:38 ` [Qemu-devel] [PATCH 1/7] Split VNC defines to vnc.h Alexander Graf
2009-01-30 14:38   ` [Qemu-devel] [PATCH 2/7] Use VNC protocol defines Alexander Graf
2009-01-30 14:38     ` [Qemu-devel] [PATCH 3/7] Fix invalid #if in vnc.c when debugging is enabled Alexander Graf
2009-01-30 14:38       ` [Qemu-devel] [PATCH 4/7] Add some tight awareness to vnc.c Alexander Graf
2009-01-30 14:38         ` Alexander Graf [this message]
2009-01-30 14:38           ` [Qemu-devel] [PATCH 6/7] Move the framebuffer update package out Alexander Graf
2009-01-30 14:38             ` [Qemu-devel] [PATCH 7/7] Add zlib encoding support Alexander Graf
2009-02-02 15:58   ` [Qemu-devel] Re: [PATCH 1/7] Split VNC defines to vnc.h Anthony Liguori

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=1233326293-8591-6-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=qemu-devel@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).