summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed.c2
-rw-r--r--sfeed_opml_import.c2
-rw-r--r--sfeed_web.c2
-rw-r--r--sfeed_xmlenc.c2
-rw-r--r--xml.h9
5 files changed, 11 insertions, 6 deletions
diff --git a/sfeed.c b/sfeed.c
index fef4e5c..2f5830e 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -878,7 +878,7 @@ main(int argc, char *argv[])
parser.xmltagstart = xmltagstart;
parser.xmltagstartparsed = xmltagstartparsed;
- parser.getnext = getchar;
+ /* NOTE: getnext is defined in xml.h for inline optimization */
xml_parse(&parser);
return 0;
diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c
index 361b80f..4108b20 100644
--- a/sfeed_opml_import.c
+++ b/sfeed_opml_import.c
@@ -97,7 +97,7 @@ main(void)
"# list of feeds to fetch:\n"
"feeds() {\n"
" # feed <name> <feedurl> [basesiteurl] [encoding]\n", stdout);
- parser.getnext = getchar;
+ /* NOTE: getnext is defined in xml.h for inline optimization */
xml_parse(&parser);
fputs("}\n", stdout);
diff --git a/sfeed_web.c b/sfeed_web.c
index 11291d9..676e211 100644
--- a/sfeed_web.c
+++ b/sfeed_web.c
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
parser.xmltagstart = xmltagstart;
parser.xmltagstartparsed = xmltagstartparsed;
- parser.getnext = getchar;
+ /* NOTE: getnext is defined in xml.h for inline optimization */
xml_parse(&parser);
return found > 0 ? 0 : 1;
diff --git a/sfeed_xmlenc.c b/sfeed_xmlenc.c
index 683e853..2677468 100644
--- a/sfeed_xmlenc.c
+++ b/sfeed_xmlenc.c
@@ -47,7 +47,7 @@ main(void)
parser.xmlattr = xmlattr;
parser.xmltagstart = xmltagstart;
- parser.getnext = getchar;
+ /* NOTE: getnext is defined in xml.h for inline optimization */
xml_parse(&parser);
return 0;
diff --git a/xml.h b/xml.h
index f74d525..5334758 100644
--- a/xml.h
+++ b/xml.h
@@ -27,9 +27,14 @@ typedef struct xmlparser {
size_t, int);
#ifndef GETNEXT
-#define GETNEXT (x)->getnext
-#endif
+ /* GETNEXT overridden for sfeed to reduce function call overhead and
+ further context optimizations. */
+ #define GETNEXT getchar
+#if 0
+ #define GETNEXT (x)->getnext
int (*getnext)(void);
+#endif
+#endif
/* current tag */
char tag[1024];