Constify static content.
authorEmil Mikulic <emikulic@gmail.com>
Mon, 28 Mar 2016 03:22:36 +0000 (14:22 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Mon, 28 Mar 2016 03:23:24 +0000 (14:23 +1100)
This moves it from data pages to text pages.

http.c
static/c-ify.c

diff --git a/http.c b/http.c
index f1c93d8..f32dce0 100644 (file)
--- a/http.c
+++ b/http.c
@@ -542,7 +542,7 @@ static_style_css(struct connection *conn)
 {
 #include "stylecss.h"
 
 {
 #include "stylecss.h"
 
-    conn->reply = style_css;
+    conn->reply = (char*)style_css;
     conn->reply_length = style_css_len;
     conn->reply_dont_free = 1;
     conn->mime_type = mime_type_css;
     conn->reply_length = style_css_len;
     conn->reply_dont_free = 1;
     conn->mime_type = mime_type_css;
@@ -556,7 +556,7 @@ static_graph_js(struct connection *conn)
 {
 #include "graphjs.h"
 
 {
 #include "graphjs.h"
 
-    conn->reply = graph_js;
+    conn->reply = (char*)graph_js;
     conn->reply_length = graph_js_len;
     conn->reply_dont_free = 1;
     conn->mime_type = mime_type_js;
     conn->reply_length = graph_js_len;
     conn->reply_dont_free = 1;
     conn->mime_type = mime_type_js;
index 908a274..2d86ca3 100644 (file)
@@ -11,7 +11,7 @@ main(int argc, char **argv)
                exit(EXIT_FAILURE);
        }
        printf("/* this file was automatically generated */\n"
                exit(EXIT_FAILURE);
        }
        printf("/* this file was automatically generated */\n"
-              "static char %s[] =", argv[1]);
+              "static const char %s[] =", argv[1]);
        eol = 1;
        while ((c = getchar()) != EOF) {
                if (eol) {
        eol = 1;
        while ((c = getchar()) != EOF) {
                if (eol) {