It was using uint32, even though it was declared as an unsigned int.
This orphans uint32, so purged.
fort_SOURCES += config/string_array.h config/string_array.c
fort_SOURCES += config/types.h
fort_SOURCES += config/uint.c config/uint.h
-fort_SOURCES += config/uint32.c config/uint32.h
fort_SOURCES += config/work_offline.c config/work_offline.h
fort_SOURCES += crypto/base64.h crypto/base64.c
#include "config/init_tals.h"
#include "config/str.h"
#include "config/uint.h"
-#include "config/uint32.h"
#include "config/work_offline.h"
/**
}, {
.id = 3001,
.name = "rsync.priority",
- .type = >_uint32, /* TODO (#78) this is not u32 */
+ .type = >_uint,
.offset = offsetof(struct rpki_config, rsync.priority),
.doc = "Priority of execution to fetch repositories files, a higher value means higher priority",
.min = 0,
array->array[i] = pstrdup(values[i]);
}
-void
-string_array_cleanup(struct string_array *array)
+static void
+__string_array_free(struct string_array *array)
{
size_t i;
+
for (i = 0; i < array->length; i++)
free(array->array[i]);
free(array->array);
-}
-static void
-__string_array_free(struct string_array *array)
-{
- string_array_cleanup(array);
array->array = NULL;
array->length = 0;
}
extern const struct global_type gt_string_array;
void string_array_init(struct string_array *, char const *const *, size_t);
-void string_array_cleanup(struct string_array *);
#endif /* SRC_CONFIG_STRING_ARRAY_H_ */
#include <string.h>
#include "log.h"
-void
+static void
print_uint(struct option_field const *field, void *value)
{
pr_op_info("%s: %u", field->name, *((unsigned int *) value));
}
-int
+static int
parse_argv_uint(struct option_field const *field, char const *str,
void *result)
{
return 0;
}
-int
+static int
parse_json_uint(struct option_field const *opt, json_t *json, void *result)
{
json_int_t value;
extern const struct global_type gt_uint;
-void print_uint(struct option_field const *, void *);
-int parse_argv_uint(struct option_field const *, char const *, void *);
-int parse_json_uint(struct option_field const *, struct json_t *, void *);
-
#endif /* SRC_CONFIG_UINT_H_ */
+++ /dev/null
-#include "config/uint32.h"
-
-#include <getopt.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include "log.h"
-#include "config/uint.h"
-
-void
-print_uint32(struct option_field const *field, void *value)
-{
- pr_op_info("%s: %u", field->name, *((uint32_t *) value));
-}
-
-int
-parse_argv_uint32(struct option_field const *field, char const *str,
- void *result)
-{
- unsigned int tmp;
- int error;
-
- error = parse_argv_uint(field, str, &tmp);
- if (error)
- return error;
-
- /* Range already validated (from field->min and field->max). */
- *((uint32_t *) result) = tmp;
- return 0;
-}
-
-int
-parse_json_uint32(struct option_field const *opt, json_t *json, void *result)
-{
- unsigned int tmp;
- int error;
-
- error = parse_json_uint(opt, json, &tmp);
- if (error)
- return error;
-
- /* Range already validated (from opt->min and opt->max). */
- *((uint32_t *) result) = tmp;
- return 0;
-}
-
-const struct global_type gt_uint32 = {
- .has_arg = required_argument,
- .size = sizeof(uint32_t),
- .print = print_uint32,
- .parse.argv = parse_argv_uint32,
- .parse.json = parse_json_uint32,
- .arg_doc = "<32-bit unsigned integer>",
-};
+++ /dev/null
-#ifndef SRC_CONFIG_UINT32_H_
-#define SRC_CONFIG_UINT32_H_
-
-#include "config/types.h"
-
-extern const struct global_type gt_uint32;
-
-void print_uint32(struct option_field const *, void *);
-int parse_argv_uint32(struct option_field const *, char const *, void *);
-int parse_json_uint32(struct option_field const *, json_t *, void *);
-
-#endif /* SRC_CONFIG_UINT32_H_ */