Skip to content

Commit ac35a86

Browse files
committed
code: avoid more warnings (empty functions, cast)
Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 02c0df2 commit ac35a86

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/util.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,9 @@ apr_hash_t *oidc_util_spaced_string_to_hashtable(apr_pool_t *pool, const char *s
16571657
*/
16581658
apr_byte_t oidc_util_spaced_string_equals(apr_pool_t *pool, const char *a, const char *b) {
16591659

1660+
const void *k = NULL;
1661+
void *v = NULL;
1662+
16601663
/* parse both entries as hash tables */
16611664
apr_hash_t *ht_a = oidc_util_spaced_string_to_hashtable(pool, a);
16621665
apr_hash_t *ht_b = oidc_util_spaced_string_to_hashtable(pool, b);
@@ -1668,9 +1671,7 @@ apr_byte_t oidc_util_spaced_string_equals(apr_pool_t *pool, const char *a, const
16681671
/* then loop over all entries */
16691672
apr_hash_index_t *hi;
16701673
for (hi = apr_hash_first(NULL, ht_a); hi; hi = apr_hash_next(hi)) {
1671-
const char *k;
1672-
const char *v;
1673-
apr_hash_this(hi, (const void **)&k, NULL, (void **)&v);
1674+
apr_hash_this(hi, &k, NULL, &v);
16741675
if (apr_hash_get(ht_b, k, APR_HASH_KEY_STRING) == NULL)
16751676
return FALSE;
16761677
}

test/stub.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
AP_DECLARE(void)
1919
ap_hook_check_authn(ap_HOOK_check_user_id_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder,
2020
int type) {
21+
// comment explaining why the method is empty
2122
}
2223

2324
AP_DECLARE(apr_status_t)
@@ -142,25 +143,30 @@ AP_DECLARE(int) ap_hook_auth_checker(request_rec *r) {
142143

143144
AP_DECLARE(void)
144145
ap_hook_fixups(int (*handler)(request_rec *r), const char *const *aszPre, const char *const *aszSucc, int nOrder) {
146+
// comment explaining why the method is empty
145147
}
146148

147149
AP_DECLARE(void)
148150
ap_hook_insert_filter(void (*insert_filter)(request_rec *r), const char *const *aszPre, const char *const *aszSucc,
149151
int nOrder) {
152+
// comment explaining why the method is empty
150153
}
151154

152155
AP_DECLARE(void)
153156
ap_hook_post_config(int (*post_config)(apr_pool_t *pool, apr_pool_t *p1, apr_pool_t *p2, server_rec *s),
154157
const char *const *aszPre, const char *const *aszSucc, int nOrder) {
158+
// comment explaining why the method is empty
155159
}
156160

157161
AP_DECLARE(void)
158162
ap_hook_child_init(void (*child_init)(apr_pool_t *p, server_rec *s), const char *const *aszPre,
159163
const char *const *aszSucc, int nOrder) {
164+
// comment explaining why the method is empty
160165
}
161166

162167
AP_DECLARE(void)
163168
ap_hook_handler(int (*handler)(request_rec *r), const char *const *aszPre, const char *const *aszSucc, int nOrder) {
169+
// comment explaining why the method is empty
164170
}
165171

166172
AP_DECLARE(int) ap_is_initial_req(request_rec *r) {
@@ -219,6 +225,7 @@ ap_log_rerror(const char *file, int line, int level, apr_status_t status, const
219225
}
220226

221227
AP_DECLARE(void) ap_note_auth_failure(request_rec *r) {
228+
// comment explaining why the method is empty
222229
}
223230

224231
AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket) {
@@ -236,14 +243,14 @@ const char *ap_run_http_scheme(const request_rec *r) {
236243
}
237244

238245
AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct) {
246+
// comment explaining why the method is empty
239247
}
240248

241249
AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, void *struct_ptr, int arg) {
242250
return "";
243251
}
244252

245253
AP_DECLARE_NONSTD(const char *) ap_set_string_slot(cmd_parms *cmd, void *struct_ptr, const char *arg) {
246-
247254
return "";
248255
}
249256

0 commit comments

Comments
 (0)