commit 185aac2
default
·
2023-05-04 07:28:36 +0000 UTC
parent 753eadf
Added -Wextra to C flags.
6 files changed,
+27,
-1
M
Makefile
+1,
-1
1@@ -1,6 +1,6 @@
2 PREFIX=/usr/local
3 PREFIX_MAN=$(PREFIX)/man
4-CFLAGS?=-g -Wall
5+CFLAGS?=-g -Wall -Wextra
6
7 all: snac
8
+2,
-0
1@@ -1524,6 +1524,8 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path,
2 char **body, int *b_size, char **ctype)
3 /* processes an input message */
4 {
5+ (void)b_size;
6+
7 int status = 202; /* accepted */
8 char *i_ctype = xs_dict_get(req, "content-type");
9 snac snac;
M
html.c
+3,
-0
1@@ -1551,6 +1551,9 @@ int html_post_handler(const xs_dict *req, const char *q_path,
2 char *payload, int p_size,
3 char **body, int *b_size, char **ctype)
4 {
5+ (void)p_size;
6+ (void)ctype;
7+
8 int status = 0;
9 snac snac;
10 char *uid, *p_path;
M
httpd.c
+6,
-0
1@@ -49,6 +49,8 @@ int server_get_handler(xs_dict *req, char *q_path,
2 {
3 int status = 0;
4
5+ (void)req;
6+
7 /* is it the server root? */
8 if (*q_path == '\0') {
9 /* try to open greeting.html */
10@@ -285,6 +287,8 @@ static jmp_buf on_break;
11
12 void term_handler(int s)
13 {
14+ (void)s;
15+
16 longjmp(on_break, 1);
17 }
18
19@@ -401,6 +405,8 @@ static void *background_thread(void *arg)
20 {
21 time_t purge_time;
22
23+ (void)arg;
24+
25 /* first purge time */
26 purge_time = time(NULL) + 10 * 60;
27
+13,
-0
1@@ -175,6 +175,8 @@ const char *login_page = ""
2 int oauth_get_handler(const xs_dict *req, const char *q_path,
3 char **body, int *b_size, char **ctype)
4 {
5+ (void)b_size;
6+
7 if (!xs_startswith(q_path, "/oauth/"))
8 return 0;
9
10@@ -227,6 +229,9 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
11 const char *payload, int p_size,
12 char **body, int *b_size, char **ctype)
13 {
14+ (void)p_size;
15+ (void)b_size;
16+
17 if (!xs_startswith(q_path, "/oauth/"))
18 return 0;
19
20@@ -815,6 +820,8 @@ int process_auth_token(snac *snac, const xs_dict *req)
21 int mastoapi_get_handler(const xs_dict *req, const char *q_path,
22 char **body, int *b_size, char **ctype)
23 {
24+ (void)b_size;
25+
26 if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/"))
27 return 0;
28
29@@ -1474,6 +1481,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
30 const char *payload, int p_size,
31 char **body, int *b_size, char **ctype)
32 {
33+ (void)p_size;
34+ (void)b_size;
35+
36 if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/"))
37 return 0;
38
39@@ -1898,6 +1908,9 @@ int mastoapi_put_handler(const xs_dict *req, const char *q_path,
40 const char *payload, int p_size,
41 char **body, int *b_size, char **ctype)
42 {
43+ (void)p_size;
44+ (void)b_size;
45+
46 if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/"))
47 return 0;
48
+2,
-0
1@@ -104,6 +104,8 @@ int webfinger_get_handler(d_char *req, char *q_path,
2 {
3 int status;
4
5+ (void)b_size;
6+
7 if (strcmp(q_path, "/.well-known/webfinger") != 0)
8 return 0;
9