qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jes.Sorensen@redhat.com
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com
Subject: [Qemu-devel] [PATCH 11/14] Remove unused function arguments
Date: Mon, 30 Aug 2010 17:35:44 +0200	[thread overview]
Message-ID: <1283182547-26116-12-git-send-email-Jes.Sorensen@redhat.com> (raw)
In-Reply-To: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 json-parser.c |   39 +++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/json-parser.c b/json-parser.c
index 70b9b6f..68ff9c1 100644
--- a/json-parser.c
+++ b/json-parser.c
@@ -91,7 +91,7 @@ static int token_is_escape(QObject *obj, const char *value)
 /**
  * Error handler
  */
-static void parse_error(JSONParserContext *ctxt, QObject *token, const char *msg, ...)
+static void parse_error(const char *msg, ...)
 {
     va_list ap;
     va_start(ap, msg);
@@ -165,7 +165,7 @@ static int hex2decimal(char ch)
  *      \t
  *      \u four-hex-digits 
  */
-static QString *qstring_from_escaped_str(JSONParserContext *ctxt, QObject *token)
+static QString *qstring_from_escaped_str(QObject *token)
 {
     const char *ptr = token_get_value(token);
     QString *str;
@@ -232,8 +232,7 @@ static QString *qstring_from_escaped_str(JSONParserContext *ctxt, QObject *token
                     if (qemu_isxdigit(*ptr)) {
                         unicode_char |= hex2decimal(*ptr) << ((3 - i) * 4);
                     } else {
-                        parse_error(ctxt, token,
-                                    "invalid hex escape sequence in string");
+                        parse_error("invalid hex escape sequence in string");
                         goto out;
                     }
                     ptr++;
@@ -243,7 +242,7 @@ static QString *qstring_from_escaped_str(JSONParserContext *ctxt, QObject *token
                 qstring_append(str, utf8_char);
             }   break;
             default:
-                parse_error(ctxt, token, "invalid escape sequence in string");
+                parse_error("invalid escape sequence in string");
                 goto out;
             }
         } else {
@@ -274,19 +273,19 @@ static int parse_pair(JSONParserContext *ctxt, QDict *dict, QList **tokens, va_l
     peek = qlist_peek(working);
     key = parse_value(ctxt, &working, ap);
     if (!key || qobject_type(key) != QTYPE_QSTRING) {
-        parse_error(ctxt, peek, "key is not a string in object");
+        parse_error("key is not a string in object");
         goto out;
     }
 
     token = qlist_pop(working);
     if (!token_is_operator(token, ':')) {
-        parse_error(ctxt, token, "missing : in object pair");
+        parse_error("missing : in object pair");
         goto out;
     }
 
     value = parse_value(ctxt, &working, ap);
     if (value == NULL) {
-        parse_error(ctxt, token, "Missing value in dict");
+        parse_error("Missing value in dict");
         goto out;
     }
 
@@ -331,7 +330,7 @@ static QObject *parse_object(JSONParserContext *ctxt, QList **tokens, va_list *a
         token = qlist_pop(working);
         while (!token_is_operator(token, '}')) {
             if (!token_is_operator(token, ',')) {
-                parse_error(ctxt, token, "expected separator in dict");
+                parse_error("expected separator in dict");
                 goto out;
             }
             qobject_decref(token);
@@ -384,7 +383,7 @@ static QObject *parse_array(JSONParserContext *ctxt, QList **tokens, va_list *ap
 
         obj = parse_value(ctxt, &working, ap);
         if (obj == NULL) {
-            parse_error(ctxt, token, "expecting value");
+            parse_error("expecting value");
             goto out;
         }
 
@@ -393,7 +392,7 @@ static QObject *parse_array(JSONParserContext *ctxt, QList **tokens, va_list *ap
         token = qlist_pop(working);
         while (!token_is_operator(token, ']')) {
             if (!token_is_operator(token, ',')) {
-                parse_error(ctxt, token, "expected separator in list");
+                parse_error("expected separator in list");
                 goto out;
             }
 
@@ -402,7 +401,7 @@ static QObject *parse_array(JSONParserContext *ctxt, QList **tokens, va_list *ap
 
             obj = parse_value(ctxt, &working, ap);
             if (obj == NULL) {
-                parse_error(ctxt, token, "expecting value");
+                parse_error("expecting value");
                 goto out;
             }
 
@@ -431,7 +430,7 @@ out:
     return NULL;
 }
 
-static QObject *parse_keyword(JSONParserContext *ctxt, QList **tokens)
+static QObject *parse_keyword(QList **tokens)
 {
     QObject *token, *ret;
     QList *working = qlist_copy(*tokens);
@@ -447,7 +446,7 @@ static QObject *parse_keyword(JSONParserContext *ctxt, QList **tokens)
     } else if (token_is_keyword(token, "false")) {
         ret = QOBJECT(qbool_from_int(false));
     } else {
-        parse_error(ctxt, token, "invalid keyword `%s'", token_get_value(token));
+        parse_error("invalid keyword `%s'", token_get_value(token));
         goto out;
     }
 
@@ -464,7 +463,7 @@ out:
     return NULL;
 }
 
-static QObject *parse_escape(JSONParserContext *ctxt, QList **tokens, va_list *ap)
+static QObject *parse_escape(QList **tokens, va_list *ap)
 {
     QObject *token = NULL, *obj;
     QList *working = qlist_copy(*tokens);
@@ -507,7 +506,7 @@ out:
     return NULL;
 }
 
-static QObject *parse_literal(JSONParserContext *ctxt, QList **tokens)
+static QObject *parse_literal(QList **tokens)
 {
     QObject *token, *obj;
     QList *working = qlist_copy(*tokens);
@@ -515,7 +514,7 @@ static QObject *parse_literal(JSONParserContext *ctxt, QList **tokens)
     token = qlist_pop(working);
     switch (token_get_type(token)) {
     case JSON_STRING:
-        obj = QOBJECT(qstring_from_escaped_str(ctxt, token));
+        obj = QOBJECT(qstring_from_escaped_str(token));
         break;
     case JSON_INTEGER:
         obj = QOBJECT(qint_from_int(strtoll(token_get_value(token), NULL, 10)));
@@ -550,13 +549,13 @@ static QObject *parse_value(JSONParserContext *ctxt, QList **tokens, va_list *ap
         obj = parse_array(ctxt, tokens, ap);
     }
     if (obj == NULL) {
-        obj = parse_escape(ctxt, tokens, ap);
+        obj = parse_escape(tokens, ap);
     }
     if (obj == NULL) {
-        obj = parse_keyword(ctxt, tokens);
+        obj = parse_keyword(tokens);
     } 
     if (obj == NULL) {
-        obj = parse_literal(ctxt, tokens);
+        obj = parse_literal(tokens);
     }
 
     return obj;
-- 
1.7.2.2

  parent reply	other threads:[~2010-08-30 15:36 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 15:35 [Qemu-devel] [PATCH 00/14] gcc extra warning fixes Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 01/14] Remove unused argument for nbd_client() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 02/14] Respect return value from nbd_client() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 03/14] Fix repeated typo: was "end if list" instead of "end of list" Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 04/14] Zero initialize timespec struct explicitly Jes.Sorensen
2010-08-30 15:43   ` [Qemu-devel] " Anthony Liguori
2010-08-30 15:55     ` Jes Sorensen
2010-08-30 17:04       ` malc
2010-08-30 16:56     ` malc
2010-08-30 17:38       ` Jes Sorensen
2010-08-30 17:41         ` Anthony Liguori
2010-08-30 17:43         ` malc
2010-08-30 15:35 ` [Qemu-devel] [PATCH 05/14] Remove unused argument for check_for_block_signature() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 06/14] Remove unused argument for encrypt_sectors() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 07/14] Remove unused argument for get_whole_cluster() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 08/14] Remove unused argument for qcow2_encrypt_sectors() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 09/14] Remove unused arguments for add_aio_request() and free_aio_req() Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy Jes.Sorensen
2010-08-30 15:39   ` [Qemu-devel] " Anthony Liguori
2010-08-30 15:43     ` Jes Sorensen
2010-08-30 15:48       ` Anthony Liguori
2010-08-30 15:53         ` Jes Sorensen
2010-08-30 17:12           ` Avi Kivity
2010-08-30 16:55         ` Nathan Froyd
2010-08-30 18:00           ` Jes Sorensen
2010-08-30 17:06         ` malc
2010-08-30 19:32         ` Richard Henderson
2010-08-30 15:42   ` Paolo Bonzini
2010-08-30 16:15     ` Anthony Liguori
2010-08-30 16:18       ` Paolo Bonzini
2010-08-30 16:29         ` Anthony Liguori
2010-08-30 16:35           ` Paolo Bonzini
2010-08-30 18:05           ` Jes Sorensen
2010-08-30 15:35 ` Jes.Sorensen [this message]
2010-08-30 16:24   ` [Qemu-devel] Re: [PATCH 11/14] Remove unused function arguments Paolo Bonzini
2010-08-30 17:13     ` Anthony Liguori
2010-08-30 15:35 ` [Qemu-devel] [PATCH 12/14] size_t is unsigned, so (foo >= 0) is always true Jes.Sorensen
2010-08-30 15:41   ` [Qemu-devel] " Anthony Liguori
2010-08-30 15:35 ` [Qemu-devel] [PATCH 13/14] Change DPRINTF() to do{}while(0) to avoid compiler warning Jes.Sorensen
2010-08-30 15:35 ` [Qemu-devel] [PATCH 14/14] load_multiboot(): get_image_size() returns int Jes.Sorensen
2010-08-30 19:25 ` [Qemu-devel] [PATCH 00/14] gcc extra warning fixes Blue Swirl
2010-08-31  7:21   ` Jes Sorensen
2010-08-31 17:43     ` Blue Swirl
  -- strict thread matches above, loose matches on Subject: below --
2010-08-30 15:59 [Qemu-devel] [PATCH 00/14] gcc extra warning fixes v2 Jes.Sorensen
2010-08-30 15:59 ` [Qemu-devel] [PATCH 11/14] Remove unused function arguments Jes.Sorensen

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=1283182547-26116-12-git-send-email-Jes.Sorensen@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=kwolf@redhat.com \
    --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).