diff options
| author | 2023-05-04 09:28:36 +0200 | |
|---|---|---|
| committer | 2023-05-04 09:28:36 +0200 | |
| commit | 185aac23876f9ae5d9b613f8b9abd517c3ab3b4d (patch) | |
| tree | 7d7fcf3e99f4acfa05d251a0bec86f899d4a1005 | |
| parent | Added some const here and there. (diff) | |
| download | penes-snac2-185aac23876f9ae5d9b613f8b9abd517c3ab3b4d.tar.gz penes-snac2-185aac23876f9ae5d9b613f8b9abd517c3ab3b4d.tar.xz penes-snac2-185aac23876f9ae5d9b613f8b9abd517c3ab3b4d.zip | |
Added -Wextra to C flags.
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | html.c | 3 | ||||
| -rw-r--r-- | httpd.c | 6 | ||||
| -rw-r--r-- | mastoapi.c | 13 | ||||
| -rw-r--r-- | webfinger.c | 2 |
6 files changed, 27 insertions, 1 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | PREFIX=/usr/local | 1 | PREFIX=/usr/local |
| 2 | PREFIX_MAN=$(PREFIX)/man | 2 | PREFIX_MAN=$(PREFIX)/man |
| 3 | CFLAGS?=-g -Wall | 3 | CFLAGS?=-g -Wall -Wextra |
| 4 | 4 | ||
| 5 | all: snac | 5 | all: snac |
| 6 | 6 | ||
diff --git a/activitypub.c b/activitypub.c index 86d33df..c25b733 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1524,6 +1524,8 @@ int activitypub_post_handler(const xs_dict *req, const char *q_path, | |||
| 1524 | char **body, int *b_size, char **ctype) | 1524 | char **body, int *b_size, char **ctype) |
| 1525 | /* processes an input message */ | 1525 | /* processes an input message */ |
| 1526 | { | 1526 | { |
| 1527 | (void)b_size; | ||
| 1528 | |||
| 1527 | int status = 202; /* accepted */ | 1529 | int status = 202; /* accepted */ |
| 1528 | char *i_ctype = xs_dict_get(req, "content-type"); | 1530 | char *i_ctype = xs_dict_get(req, "content-type"); |
| 1529 | snac snac; | 1531 | snac snac; |
| @@ -1551,6 +1551,9 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 1551 | char *payload, int p_size, | 1551 | char *payload, int p_size, |
| 1552 | char **body, int *b_size, char **ctype) | 1552 | char **body, int *b_size, char **ctype) |
| 1553 | { | 1553 | { |
| 1554 | (void)p_size; | ||
| 1555 | (void)ctype; | ||
| 1556 | |||
| 1554 | int status = 0; | 1557 | int status = 0; |
| 1555 | snac snac; | 1558 | snac snac; |
| 1556 | char *uid, *p_path; | 1559 | char *uid, *p_path; |
| @@ -49,6 +49,8 @@ int server_get_handler(xs_dict *req, char *q_path, | |||
| 49 | { | 49 | { |
| 50 | int status = 0; | 50 | int status = 0; |
| 51 | 51 | ||
| 52 | (void)req; | ||
| 53 | |||
| 52 | /* is it the server root? */ | 54 | /* is it the server root? */ |
| 53 | if (*q_path == '\0') { | 55 | if (*q_path == '\0') { |
| 54 | /* try to open greeting.html */ | 56 | /* try to open greeting.html */ |
| @@ -285,6 +287,8 @@ static jmp_buf on_break; | |||
| 285 | 287 | ||
| 286 | void term_handler(int s) | 288 | void term_handler(int s) |
| 287 | { | 289 | { |
| 290 | (void)s; | ||
| 291 | |||
| 288 | longjmp(on_break, 1); | 292 | longjmp(on_break, 1); |
| 289 | } | 293 | } |
| 290 | 294 | ||
| @@ -401,6 +405,8 @@ static void *background_thread(void *arg) | |||
| 401 | { | 405 | { |
| 402 | time_t purge_time; | 406 | time_t purge_time; |
| 403 | 407 | ||
| 408 | (void)arg; | ||
| 409 | |||
| 404 | /* first purge time */ | 410 | /* first purge time */ |
| 405 | purge_time = time(NULL) + 10 * 60; | 411 | purge_time = time(NULL) + 10 * 60; |
| 406 | 412 | ||
| @@ -175,6 +175,8 @@ const char *login_page = "" | |||
| 175 | int oauth_get_handler(const xs_dict *req, const char *q_path, | 175 | int oauth_get_handler(const xs_dict *req, const char *q_path, |
| 176 | char **body, int *b_size, char **ctype) | 176 | char **body, int *b_size, char **ctype) |
| 177 | { | 177 | { |
| 178 | (void)b_size; | ||
| 179 | |||
| 178 | if (!xs_startswith(q_path, "/oauth/")) | 180 | if (!xs_startswith(q_path, "/oauth/")) |
| 179 | return 0; | 181 | return 0; |
| 180 | 182 | ||
| @@ -227,6 +229,9 @@ int oauth_post_handler(const xs_dict *req, const char *q_path, | |||
| 227 | const char *payload, int p_size, | 229 | const char *payload, int p_size, |
| 228 | char **body, int *b_size, char **ctype) | 230 | char **body, int *b_size, char **ctype) |
| 229 | { | 231 | { |
| 232 | (void)p_size; | ||
| 233 | (void)b_size; | ||
| 234 | |||
| 230 | if (!xs_startswith(q_path, "/oauth/")) | 235 | if (!xs_startswith(q_path, "/oauth/")) |
| 231 | return 0; | 236 | return 0; |
| 232 | 237 | ||
| @@ -815,6 +820,8 @@ int process_auth_token(snac *snac, const xs_dict *req) | |||
| 815 | int mastoapi_get_handler(const xs_dict *req, const char *q_path, | 820 | int mastoapi_get_handler(const xs_dict *req, const char *q_path, |
| 816 | char **body, int *b_size, char **ctype) | 821 | char **body, int *b_size, char **ctype) |
| 817 | { | 822 | { |
| 823 | (void)b_size; | ||
| 824 | |||
| 818 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) | 825 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) |
| 819 | return 0; | 826 | return 0; |
| 820 | 827 | ||
| @@ -1474,6 +1481,9 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1474 | const char *payload, int p_size, | 1481 | const char *payload, int p_size, |
| 1475 | char **body, int *b_size, char **ctype) | 1482 | char **body, int *b_size, char **ctype) |
| 1476 | { | 1483 | { |
| 1484 | (void)p_size; | ||
| 1485 | (void)b_size; | ||
| 1486 | |||
| 1477 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) | 1487 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) |
| 1478 | return 0; | 1488 | return 0; |
| 1479 | 1489 | ||
| @@ -1898,6 +1908,9 @@ int mastoapi_put_handler(const xs_dict *req, const char *q_path, | |||
| 1898 | const char *payload, int p_size, | 1908 | const char *payload, int p_size, |
| 1899 | char **body, int *b_size, char **ctype) | 1909 | char **body, int *b_size, char **ctype) |
| 1900 | { | 1910 | { |
| 1911 | (void)p_size; | ||
| 1912 | (void)b_size; | ||
| 1913 | |||
| 1901 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) | 1914 | if (!xs_startswith(q_path, "/api/v1/") && !xs_startswith(q_path, "/api/v2/")) |
| 1902 | return 0; | 1915 | return 0; |
| 1903 | 1916 | ||
diff --git a/webfinger.c b/webfinger.c index f56b6f2..765c469 100644 --- a/webfinger.c +++ b/webfinger.c | |||
| @@ -104,6 +104,8 @@ int webfinger_get_handler(d_char *req, char *q_path, | |||
| 104 | { | 104 | { |
| 105 | int status; | 105 | int status; |
| 106 | 106 | ||
| 107 | (void)b_size; | ||
| 108 | |||
| 107 | if (strcmp(q_path, "/.well-known/webfinger") != 0) | 109 | if (strcmp(q_path, "/.well-known/webfinger") != 0) |
| 108 | return 0; | 110 | return 0; |
| 109 | 111 | ||