[gtk/wip/otte/json: 26/38] jsonparser: Remove line number tracking
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/json: 26/38] jsonparser: Remove line number tracking
- Date: Sat, 4 Dec 2021 19:52:53 +0000 (UTC)
commit c05ecc2f21a311e5f32421fa0f2415184b2f6327
Author: Benjamin Otte <otte redhat com>
Date: Sun Nov 28 17:22:45 2021 +0100
jsonparser: Remove line number tracking
We can parse the document manually if we're interested.
gtk/json/gtkjsonparser.c | 22 ----------------------
1 file changed, 22 deletions(-)
---
diff --git a/gtk/json/gtkjsonparser.c b/gtk/json/gtkjsonparser.c
index 79d8352125..d0ca31c93f 100644
--- a/gtk/json/gtkjsonparser.c
+++ b/gtk/json/gtkjsonparser.c
@@ -29,9 +29,6 @@ struct _GtkJsonReader
{
const guchar *data;
const guchar *end;
-
- gsize lines;
- const guchar *line_start;
};
typedef enum {
@@ -131,8 +128,6 @@ gtk_json_reader_init (GtkJsonReader *reader,
{
reader->data = data;
reader->end = data + size;
- reader->lines = 0;
- reader->line_start = data;
}
static gboolean
@@ -158,16 +153,9 @@ gtk_json_reader_skip_whitespace (GtkJsonReader *reader)
{
case ' ':
case '\t':
- reader->data++;
- break;
case '\r':
- if (gtk_json_reader_remaining (reader) >= 2 && reader->data[1] == '\n')
- reader->data++;
- G_GNUC_FALLTHROUGH;
case '\n':
reader->data++;
- reader->lines++;
- reader->line_start = reader->data;
break;
default:
return;
@@ -258,16 +246,6 @@ gtk_json_reader_parse_string (GtkJsonReader *reader,
case '\0':
goto end;
- case '\r':
- if (reader->data + 1 < reader->end && reader->data[1] == '\n')
- reader->data++;
- G_GNUC_FALLTHROUGH;
- case '\n':
- reader->data++;
- reader->lines++;
- reader->line_start = reader->data;
- break;
-
case '"':
if (!g_utf8_validate ((const char *) last, reader->data - last, (const char **) &reader->data))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]