size_t countries_length = be32toh(header->countries_length);
DEBUG(db->ctx, "Reading countries section from %jd (%zu bytes)\n",
- countries_offset, countries_length);
+ (intmax_t)countries_offset, countries_length);
if (countries_length > 0) {
db->countries_v0 = mmap(NULL, countries_length, PROT_READ,
if ((size_t)pos >= db->countries_count)
return -EINVAL;
- DEBUG(db->ctx, "Fetching country at position %jd\n", pos);
+ DEBUG(db->ctx, "Fetching country at position %jd\n", (intmax_t)pos);
int r;
switch (db->version) {
// Increase stack size
int s = ++e->network_stack_depth;
- DEBUG(e->ctx, "Added node %jd to stack (%d)\n", offset, depth);
+ DEBUG(e->ctx, "Added node %jd to stack (%d)\n", (intmax_t)offset, depth);
e->network_stack[s].offset = offset;
e->network_stack[s].i = i;
in6_addr_set_bit(&enumerator->network_address,
(node->depth > 0) ? node->depth - 1 : 0, node->i);
- DEBUG(enumerator->ctx, "Looking at node %jd\n", node->offset);
+ DEBUG(enumerator->ctx, "Looking at node %jd\n", (intmax_t)node->offset);
enumerator->networks_visited[node->offset]++;
// Pop node from top of the stack
if (__loc_database_node_is_leaf(n)) {
off_t network_index = be32toh(n->network);
- DEBUG(enumerator->ctx, "Node has a network at %jd\n", network_index);
+ DEBUG(enumerator->ctx, "Node has a network at %jd\n", (intmax_t)network_index);
// Fetch the network object
r = loc_database_fetch_network(enumerator->db, network,
static int loc_database_write_countries(struct loc_writer* writer,
struct loc_database_header_v0* header, off_t* offset, FILE* f) {
- DEBUG(writer->ctx, "Countries section starts at %jd bytes\n", *offset);
+ DEBUG(writer->ctx, "Countries section starts at %jd bytes\n", (intmax_t)*offset);
header->countries_offset = htobe32(*offset);
size_t countries_length = 0;