diff mbox series

[v4,3/3] mongoose: Fix compile warnings and add SPDX

Message ID 20211019112531.94233-3-james.hilliard1@gmail.com
State Changes Requested
Headers show
Series [v4,1/3] mongoose: Update to version 7.4 | expand

Commit Message

James Hilliard Oct. 19, 2021, 11:25 a.m. UTC
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 mongoose/mongoose.c | 14 ++++++++------
 mongoose/mongoose.h |  2 ++
 2 files changed, 10 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/mongoose/mongoose.c b/mongoose/mongoose.c
index 84978f6..403b471 100644
--- a/mongoose/mongoose.c
+++ b/mongoose/mongoose.c
@@ -2,6 +2,8 @@ 
 // Copyright (c) 2013-2021 Cesanta Software Limited
 // All rights reserved
 //
+// SPDX-License-Identifier: GPL-2.0-only
+//
 // This software is dual-licensed: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
 // published by the Free Software Foundation. For the terms of this
@@ -177,7 +179,7 @@  static size_t mg_dns_parse_name_depth(const uint8_t *s, size_t len, size_t ofs,
   return i;
 }
 
-size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst,
+static size_t mg_dns_parse_name(const uint8_t *s, size_t n, size_t ofs, char *dst,
                          size_t dstlen) {
   return mg_dns_parse_name_depth(s, n, ofs, dst, dstlen, 0);
 }
@@ -303,7 +305,7 @@  static void dns_cb(struct mg_connection *c, int ev, void *ev_data,
   (void) fn_data;
 }
 
-void mg_dns_send(struct mg_connection *c, const struct mg_str *name,
+static void mg_dns_send(struct mg_connection *c, const struct mg_str *name,
                  uint16_t txnid, bool ipv6) {
   struct {
     struct mg_dns_header header;
@@ -922,7 +924,7 @@  struct mg_str *mg_http_get_header(struct mg_http_message *h, const char *name) {
   return NULL;
 }
 
-void mg_http_parse_headers(const char *s, const char *end,
+static void mg_http_parse_headers(const char *s, const char *end,
                            struct mg_http_header *h, int max_headers) {
   int i;
   for (i = 0; i < max_headers; i++) {
@@ -1122,7 +1124,7 @@  static void restore_http_cb(struct mg_connection *c) {
   c->pfn = http_cb;
 }
 
-char *mg_http_etag(char *buf, size_t len, size_t size, time_t mtime) {
+static char *mg_http_etag(char *buf, size_t len, size_t size, time_t mtime) {
   snprintf(buf, len, "\"%lx." MG_INT64_FMT "\"", (unsigned long) mtime,
            (int64_t) size);
   return buf;
@@ -2575,7 +2577,7 @@  static uint32_t blk0(union char64long16 *block, int i) {
   z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); \
   w = rol(w, 30);
 
-void mg_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) {
+static void mg_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) {
   uint32_t a, b, c, d, e;
   union char64long16 block[1];
 
@@ -2973,7 +2975,7 @@  static void mg_set_non_blocking_mode(SOCKET fd) {
 #endif
 }
 
-SOCKET mg_open_listener(const char *url, struct mg_addr *addr) {
+static SOCKET mg_open_listener(const char *url, struct mg_addr *addr) {
   SOCKET fd = INVALID_SOCKET;
   int s_err = 0;  // Memoized socket error, in case closesocket() overrides it
   memset(addr, 0, sizeof(*addr));
diff --git a/mongoose/mongoose.h b/mongoose/mongoose.h
index 55a828c..16e6a67 100644
--- a/mongoose/mongoose.h
+++ b/mongoose/mongoose.h
@@ -2,6 +2,8 @@ 
 // Copyright (c) 2013-2021 Cesanta Software Limited
 // All rights reserved
 //
+// SPDX-License-Identifier: GPL-2.0-only
+//
 // This software is dual-licensed: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
 // published by the Free Software Foundation. For the terms of this