Commit dbab5bf9 authored by Daniel Salzman's avatar Daniel Salzman

qp-trie: change qp_trie_it_key key length type to size_t

parent d64bc472
......@@ -90,14 +90,9 @@ inline static void hattrie_iter_free(hattrie_iter_t *it)
qp_trie_it_free(it);
}
inline static const char* hattrie_iter_key(hattrie_iter_t *it, size_t *plen)
inline static const char* hattrie_iter_key(hattrie_iter_t *it, size_t *len)
{
// it's a bit cumbersome to change the type of `plen` safely
uint32_t len32;
const char *res = qp_trie_it_key(it, &len32);
if (plen)
*plen = len32;
return res;
return qp_trie_it_key(it, len);
}
inline static value_t* hattrie_iter_val(hattrie_iter_t *it)
......
......@@ -811,7 +811,7 @@ void qp_trie_it_free(qp_trie_it_t *it)
free(it);
}
const char* qp_trie_it_key(qp_trie_it_t *it, uint32_t *len)
const char* qp_trie_it_key(qp_trie_it_t *it, size_t *len)
{
assert(it && it->len);
node_t *t = it->stack[it->len - 1];
......
......@@ -17,7 +17,6 @@
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "libknot/mm_ctx.h"
......@@ -96,7 +95,7 @@ bool qp_trie_it_finished(qp_trie_it_t *it);
void qp_trie_it_free(qp_trie_it_t *it);
/*! \brief Return pointer to the key of the current element. */
const char* qp_trie_it_key(qp_trie_it_t *it, uint32_t *len);
const char* qp_trie_it_key(qp_trie_it_t *it, size_t *len);
/*! \brief Return pointer to the value of the current element (writable). */
value_t* qp_trie_it_val(qp_trie_it_t *it);
......@@ -277,9 +277,8 @@ static void mark_changed_zones(knot_zonedb_t *zonedb, hattrie_t *changed)
hattrie_iter_t *it = hattrie_iter_begin(changed);
for (; !hattrie_iter_finished(it); hattrie_iter_next(it)) {
size_t len;
const knot_dname_t *name =
(const knot_dname_t *)hattrie_iter_key(it, &len);
(const knot_dname_t *)hattrie_iter_key(it, NULL);
zone_t *zone = knot_zonedb_find(zonedb, name);
if (zone != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment