]> granicus.if.org Git - apache/commitdiff
* modules/metadata/mod_mime_magic.c: Constify some constant
authorJoe Orton <jorton@apache.org>
Thu, 27 Jun 2019 09:22:48 +0000 (09:22 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 27 Jun 2019 09:22:48 +0000 (09:22 +0000)
  data, remove unused "suf_recursion" field.  No functional
  change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862202 13f79535-47bb-0310-9956-ffa450edef68

modules/metadata/mod_mime_magic.c

index d144621db161635a066b40e3fa5d6bd819b65b2a..a6dc49ed0039986f1bde42ce8a1864879a456a78 100644 (file)
@@ -257,7 +257,7 @@ static int fsmagic(request_rec *r, const char *fn);
 #define L_MAIL    8   /* Electronic mail */
 #define L_NEWS    9   /* Usenet Netnews */
 
-static const char *types[] =
+static const char *const types[] =
 {
     "text/html",             /* HTML */
     "text/plain",            /* "c program text", */
@@ -462,7 +462,6 @@ typedef struct {
 typedef struct {
     magic_rsl *head;          /* result string list */
     magic_rsl *tail;
-    unsigned suf_recursion;   /* recursion depth in suffix check */
 } magic_req_rec;
 
 /*
@@ -2044,12 +2043,12 @@ static int ascmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes)
  * - uncompress old into new, using method, return sizeof new
  */
 
-static struct {
-    char *magic;
+static const struct {
+    const char *magic;
     apr_size_t maglen;
-    char *argv[3];
+    const char *argv[3];
     int silent;
-    char *encoding;  /* MUST be lowercase */
+    const char *encoding;  /* MUST be lowercase */
 } compr[] = {
 
     /* we use gzip here rather than uncompress because we have to pass
@@ -2077,7 +2076,7 @@ static struct {
     },
 };
 
-static int ncompr = sizeof(compr) / sizeof(compr[0]);
+#define ncompr (sizeof(compr) / sizeof(compr[0]))
 
 static int zmagic(request_rec *r, unsigned char *buf, apr_size_t nbytes)
 {