Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/conf_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ int main(int argc, char **argv) {
cfuconf_t *conf = NULL;
char *error = NULL;

argc = argc;
argv = argv;
(void)argc;
(void)argv;

if (cfuconf_parse_file(file_path, &conf, &error) < 0) {
fprintf(stderr, "Error loading conf file: %s\n", error);
Expand Down
4 changes: 2 additions & 2 deletions examples/conf_example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ int main(int argc, char **argv) {
" SetVar Test4 Val4\n"
"</test_container>\n";

argc = argc;
argv = argv;
(void)argc;
(void)argv;

if (cfuconf_parse_buffer(buffer, &conf, &error) < 0) {
fprintf(stderr, "Error loading conf buffer: %s\n", error);
Expand Down
10 changes: 5 additions & 5 deletions examples/hash_usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ strncasecmp(const char *s1, const char *s2, size_t n)

static int
remove_func(void *key, size_t key_size, void *data, size_t data_size, void *arg) {
data_size = data_size;
data = data;
arg = arg;
(void)data_size;
(void)data;
(void)arg;

if (key_size > 7) {
if (!strncasecmp(key, "content", 7)) {
Expand All @@ -55,8 +55,8 @@ int main(int argc, char **argv) {
char list[32][2][32];
size_t i;

argc = argc;
argv = argv;
(void)argc;
(void)argv;

cfuhash_set_flag(hash, CFUHASH_FROZEN_UNTIL_GROWS);

Expand Down
18 changes: 10 additions & 8 deletions examples/large_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
* Change log:
*/

#include "cfuhash.h"
#include "cfutimer.h"
#include <sys/types.h>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>

#include "cfuhash.h"
#include "cfutimer.h"

static
void free_data(void *data) {
free(data);
Expand All @@ -24,7 +26,7 @@ dup_str(const char *str) {
return ns;
}

static u_int32_t
static uint32_t
hash_func1(const void *key, size_t length) {
size_t i = length;
unsigned int hash = 0;
Expand All @@ -48,7 +50,7 @@ hash_func1(const void *key, size_t length) {
c -= a; c -= b; c ^= (b>>15); \
}

typedef u_int32_t ub4;
typedef uint32_t ub4;

static unsigned int
hash_func_tc(const void *key, size_t length)
Expand Down Expand Up @@ -96,7 +98,7 @@ hash_func_tc(const void *key, size_t length)


static int
time_it(cfuhash_function_t hf, double *elapsed_time, u_int32_t num_tests) {
time_it(cfuhash_function_t hf, double *elapsed_time, uint32_t num_tests) {
cfuhash_table_t *hash = cfuhash_new_with_initial_size(30);
char key[32];
char value[32];
Expand Down Expand Up @@ -133,10 +135,10 @@ time_it(cfuhash_function_t hf, double *elapsed_time, u_int32_t num_tests) {

int main(int argc, char **argv) {
double elapsed_time = 0;
u_int32_t num_tests = 3000000;
uint32_t num_tests = 3000000;

argc = argc;
argv = argv;
(void)argc;
(void)argv;

printf("mutex is %lu bytes\n", sizeof(pthread_mutex_t));

Expand Down
4 changes: 2 additions & 2 deletions examples/opt_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ int main(int argc, char **argv) {
char *help = NULL;
int i = 0;

argc = argc;
argv = argv;
(void)argc;
(void)argv;

cfuopt_add_entry(opt, "verbose|v!", &verbose, "Verbosity", "");
cfuopt_add_entry(opt, "file|f:s", &file, "File to load", "FILE");
Expand Down
2 changes: 1 addition & 1 deletion examples/strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char **argv) {
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\r\n");
cfustring_t **header_lines = NULL;

argc = argc; argv = argv; /* avoid compiler warnings */
(void)argc; (void)argv; /* avoid compiler warnings */

cfustring_append(buf, "test^*string%2^*3");
strings = cfustring_split_to_c_str(buf, &num_strings, 0, "%", "^*", NULL);
Expand Down
16 changes: 8 additions & 8 deletions src/cfuconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,9 @@ print_sub_container_foreach_fn(void *name, size_t key_size, void *data, size_t d
void *arg) {
directive_foreach_ds *ds = (directive_foreach_ds *)arg;

name = name;
key_size = key_size;
data_size = data_size;
(void)name;
(void)key_size;
(void)data_size;

print_indent(ds->depth, ds->fp);
fprintf(ds->fp, "container %s '%s'\n", ds->name, (char *)name);
Expand All @@ -754,8 +754,8 @@ print_container_foreach_fn(void *name, size_t key_size, void *data, size_t data_
memcpy(new_ds, ds, sizeof(directive_foreach_ds));
new_ds->name = name;

key_size = key_size;
data_size = data_size;
(void)key_size;
(void)data_size;

cfuhash_foreach((cfuhash_table_t *)data, print_sub_container_foreach_fn, new_ds);
free(new_ds);
Expand All @@ -769,7 +769,7 @@ print_directive_list_foreach_fn(void *data, size_t data_size, void *arg) {
directive_foreach_ds *ds = (directive_foreach_ds *)arg;
char *str = NULL;

data_size = data_size;
(void)data_size;
if (!val_list) return 0;
assert(cfu_is_list(val_list));
str = cfulist_join(val_list, ", ");
Expand All @@ -785,8 +785,8 @@ print_conf_foreach_directive(void *name, size_t key_size, void *data, size_t dat
cfulist_t *this_directive_list = data;
directive_foreach_ds *new_ds = calloc(1, sizeof(directive_foreach_ds));

key_size = key_size;
data_size = data_size;
(void)key_size;
(void)data_size;

new_ds->fp = ds->fp;
new_ds->depth = ds->depth;
Expand Down
4 changes: 2 additions & 2 deletions src/cfuhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,8 +813,8 @@ typedef struct _pretty_print_arg {
static int
_pretty_print_foreach(void *key, size_t key_size, void *data, size_t data_size, void *arg) {
_pretty_print_arg *parg = (_pretty_print_arg *)arg;
key_size = key_size;
data_size = data_size;
(void)key_size;
(void)data_size;
parg->count += fprintf(parg->fp, "\t\"%s\" => \"%s\",\n", (char *)key, (char *)data);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cfulist.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ static int
_join_foreach_fn(void *data, size_t data_size, void *arg) {
_join_foreach_struct *stuff = (_join_foreach_struct *)arg;

data_size = data_size;
(void)data_size;
if (stuff->count) cfustring_append(stuff->string, stuff->delimiter);
stuff->count++;
cfustring_append(stuff->string, (char *)data);
Expand Down
18 changes: 9 additions & 9 deletions src/cfuopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct _add_entry_struct {
static int
_add_to_option_map(void *data, size_t data_size, void *arg) {
struct _add_entry_struct *es = (struct _add_entry_struct *)arg;
data_size = data_size;
(void)data_size;

cfuhash_put(es->context->option_map, (char *)data, (void *)es->entry);

Expand Down Expand Up @@ -300,7 +300,7 @@ typedef struct {
static int
_update_extra(void *data, size_t data_size, void *arg) {
_update_extra_ds *ds = (_update_extra_ds *)arg;
data_size = data_size;
(void)data_size;
ds->argv[ds->count] = (char *)data;
ds->count++;

Expand All @@ -320,7 +320,7 @@ cfuopt_parse(cfuopt_t *context, int *argc, char ***argv, char **error) {
cfuopt_list_entry_t *entry = NULL;
size_t extra_count = 0;

error = error;
(void)error;

if (!context) return;
if (*argc < 1) return;
Expand Down Expand Up @@ -461,9 +461,9 @@ _cfuopt_pretty_print_foreach(void *key, size_t key_size, void *data, size_t data
cfuopt_list_entry_t *list_entry = data;
char *str = NULL;

key_size = key_size;
data_size = data_size;
arg = arg;
(void)key_size;
(void)data_size;
(void)arg;
ARG_TYPE_TO_STR(list_entry->arg_type, str);
printf("%s=%p (%s - %s) => %s, \"%s\"\n", name, (void *)list_entry, (list_entry->required ? "required" : "optional"), str, list_entry->description, list_entry->arg_description);

Expand All @@ -486,7 +486,7 @@ _param_map_fn(void *data, size_t data_size, void *arg, size_t *new_data_size) {
size_t len = 0;
cfuopt_list_entry_t *opt = (cfuopt_list_entry_t *)arg;

data_size = data_size;
(void)data_size;
if (!name) return NULL;
len = strlen(name);
*new_data_size = -1;
Expand Down Expand Up @@ -536,7 +536,7 @@ _find_foreach_fn(void *data, size_t data_size, void *arg) {
param_full_list = cfulist_map(opt->param_names, _param_map_fn, opt);
desc = cfulist_join(param_full_list, ", ");

data_size = data_size;
(void)data_size;

cfulist_destroy_with_free_fn(param_full_list, _simple_list_free_fn);

Expand Down Expand Up @@ -576,7 +576,7 @@ _get_help_lines(void *data, size_t data_size, void *arg) {
const char *desc = NULL;
char *line = NULL;

data_size = data_size;
(void)data_size;

left_col = desc_ds->desc;

Expand Down