These minipatches are courtesy of cgcc.
char *file; /* File where this serial number was found. */
};
-ARRAY_LIST(serial_numbers, struct serial_number)
+STATIC_ARRAY_LIST(serial_numbers, struct serial_number)
struct subject_name {
struct rfc5280_name *name;
char *file; /* File where this subject name was found. */
};
-ARRAY_LIST(subjects, struct subject_name)
+STATIC_ARRAY_LIST(subjects, struct subject_name)
/**
* Cached certificate data.
-#include "config/uint.h"
+#include "config/uint32.h"
#include <getopt.h>
#include <errno.h>
DEFINE_ARRAY_LIST_STRUCT(name, elem_type); \
DEFINE_ARRAY_LIST_FUNCTIONS(name, elem_type, )
+#define STATIC_ARRAY_LIST(name, elem_type) \
+ DEFINE_ARRAY_LIST_STRUCT(name, elem_type); \
+ DEFINE_ARRAY_LIST_FUNCTIONS(name, elem_type, static)
+
#define ARRAYLIST_FOREACH(list, node, index) for ( \
(index) = 0, (node) = (list)->array; \
(index) < (list)->len; \
*cond_met = 1;
if (config_get_work_offline()) {
- response_code = 0; /* Not 200 code, but also not an error */
+ *response_code = 0; /* Not 200 code, but also not an error */
return 0;
}
int
http_download_file(struct rpki_uri *uri, http_write_cb cb)
{
- long response = 0;
- long cond_met = 0;
+ long response;
+ long cond_met;
return __http_download_file(uri, cb, &response, 0, &cond_met);
}
int
http_download_file_with_ims(struct rpki_uri *uri, http_write_cb cb, long value)
{
- long response = 0;
- long cond_met = 0;
+ long response;
+ long cond_met;
int error;
error = __http_download_file(uri, cb, &response, value, &cond_met);
#include "log.h"
#include "config/types.h"
-int
+static int
find_json(struct json_t *root, char const *full_name, json_t **result)
{
struct {
json_to_config(struct json_t *root)
{
struct option_field const *opt;
- struct json_t *child;
+ struct json_t *child = NULL;
int error;
FOREACH_OPTION(get_option_metadatas(), opt, AVAILABILITY_JSON) {
return error;
}
-int
+static int
__main(int argc, char **argv)
{
int error;
return error;
}
-int
+static int
__certificate_get_resources(X509 *cert, struct resources *resources,
int addr_nid, int asn_nid, int bad_addr_nid, int bad_asn_nid,
char const *policy_rfc, char const *bad_ext_rfc, bool allow_asn_inherit)
#include "crypto/base64.h"
#include "rtr/db/vrp.h"
-char addr_buf[INET6_ADDRSTRLEN];
+static char addr_buf[INET6_ADDRSTRLEN];
static int
load_output_file(char const *output, FILE **result, bool *fopen)
#include "object/ghostbusters.h"
#include "object/roa.h"
-ARRAY_LIST(uris, struct rpki_uri *)
+STATIC_ARRAY_LIST(uris, struct rpki_uri *)
/** A Repository Publication Point (RFC 6481), as described by some manifest. */
struct rpp {
pp->references++;
}
-void
+static void
__uri_refput(struct rpki_uri **uri)
{
uri_refput(*uri);
DEFINE_METADATA(router_key, free);
DEFINE_METADATA(error_report, error_report_destroy);
-struct pdu_metadata const *const pdu_metadatas[] = {
+static struct pdu_metadata const *const pdu_metadatas[] = {
/* 0 */ &serial_notify_meta,
/* 1 */ &serial_query_meta,
/* 2 */ &reset_query_meta,
unsigned int references;
};
-ARRAY_LIST(al_filter_prefix, struct slurm_prefix_wrap)
-ARRAY_LIST(al_assertion_prefix, struct slurm_prefix_wrap)
-ARRAY_LIST(al_filter_bgpsec, struct slurm_bgpsec_wrap)
-ARRAY_LIST(al_assertion_bgpsec, struct slurm_bgpsec_wrap)
+STATIC_ARRAY_LIST(al_filter_prefix, struct slurm_prefix_wrap)
+STATIC_ARRAY_LIST(al_assertion_prefix, struct slurm_prefix_wrap)
+STATIC_ARRAY_LIST(al_filter_bgpsec, struct slurm_bgpsec_wrap)
+STATIC_ARRAY_LIST(al_assertion_bgpsec, struct slurm_bgpsec_wrap)
struct slurm_lists {
struct al_filter_prefix filter_pfx_al;
struct slurm_csum_list csum_list;
};
-char addr_buf[INET6_ADDRSTRLEN];
+static char addr_buf[INET6_ADDRSTRLEN];
static void
slurm_bgpsec_wrap_refget(struct slurm_bgpsec_wrap *elem)
}
-int
+static int
validate_base64url_encoded(const char *encoded)
{
/*
}
}
-void
-sarray_destroy(struct sorted_array *sarray)
-{
- free(sarray->array);
- free(sarray);
-}
-
/* Does not check boundaries. */
static void *
get_nth_element(struct sorted_array *sarray, unsigned int index)