summaryrefslogtreecommitdiffstats
path: root/src/schemes/view-source.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-01 16:53:48 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-01 16:53:48 (EDT)
commit696a6c5fa1aae3da1d39ab0b380c7afcb1c7c4fe (patch)
treeac45d55333f60fc4621a126382437a7006ef68f1 /src/schemes/view-source.c
parentf5e8c373a15375c9bb7bdca756479bad8720671f (diff)
downloadmarquee-696a6c5fa1aae3da1d39ab0b380c7afcb1c7c4fe.zip
marquee-696a6c5fa1aae3da1d39ab0b380c7afcb1c7c4fe.tar.gz
marquee-696a6c5fa1aae3da1d39ab0b380c7afcb1c7c4fe.tar.bz2
view-source: Convert static const document var to macro
Fixes: CC src/schemes/marquee-view-source.o src/schemes/view-source.c: In function ‘respond’: src/schemes/view-source.c:75:4: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] uri, escaped_data), -1, g_free); ^
Diffstat (limited to 'src/schemes/view-source.c')
-rw-r--r--src/schemes/view-source.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/schemes/view-source.c b/src/schemes/view-source.c
index b6cce86..8fa1d63 100644
--- a/src/schemes/view-source.c
+++ b/src/schemes/view-source.c
@@ -36,28 +36,28 @@ typedef struct {
gulong handler_id;
} DataSignalData;
-static const gchar *document =
- "<!doctype html>\n"
- "<html dir=\"%s\">\n"
- "<head>\n"
- "<meta charset=\"utf-8\">\n"
- "<title>Source of %s</title>\n"
- "<link rel=\"stylesheet\" type=\"text/css\" "
- "media=\"all\" "
- "href=\"view-source:resources/prism/"
- "prism.css\">\n"
- "<script src=\"view-source:resources/prism/"
- "prism.js\"></script>\n"
- "</head>\n"
- "<body style=\"margin: 0;\">\n"
- "<pre style=\"overflow: visible; width: 100%; "
- "margin: 0;\">\n"
- "<code class=\"language-markup line-numbers\" "
- "style=\"overflow: visible;\">"
- "%s</code>\n"
- "</pre>\n"
- "</body>\n"
- "</html>\n";
+#define DOCUMENT \
+ "<!doctype html>\n" \
+ "<html dir=\"%s\">\n" \
+ "<head>\n" \
+ "<meta charset=\"utf-8\">\n" \
+ "<title>Source of %s</title>\n" \
+ "<link rel=\"stylesheet\" type=\"text/css\" " \
+ "media=\"all\" " \
+ "href=\"view-source:resources/prism/" \
+ "prism.css\">\n" \
+ "<script src=\"view-source:resources/prism/" \
+ "prism.js\"></script>\n" \
+ "</head>\n" \
+ "<body style=\"margin: 0;\">\n" \
+ "<pre style=\"overflow: visible; width: 100%; " \
+ "margin: 0;\">\n" \
+ "<code class=\"language-markup line-numbers\" "\
+ "style=\"overflow: visible;\">" \
+ "%s</code>\n" \
+ "</pre>\n" \
+ "</body>\n" \
+ "</html>\n"
static void
respond(WebKitURISchemeRequest *request, const gchar *uri, guchar *data,
@@ -69,7 +69,7 @@ respond(WebKitURISchemeRequest *request, const gchar *uri, guchar *data,
escaped_data = g_markup_escape_text((gchar *) data, length);
stream = g_memory_input_stream_new_from_data(
- g_strdup_printf(document,
+ g_strdup_printf(DOCUMENT,
gtk_widget_get_default_direction() ==
GTK_TEXT_DIR_RTL ? "rtl" : "ltr",
uri, escaped_data), -1, g_free);