nostrdb/build: fix additional compiler errors

When trying to build from rust

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-10 19:04:40 -08:00
committed by Daniel D’Aquino
parent 9f6da8eb79
commit 4ca156fd83
2 changed files with 6 additions and 5 deletions

View File

@@ -1671,7 +1671,7 @@ static int ndb_ingester_process_event(secp256k1_context *ctx,
ndb_client_event_from_json(ev->json, ev->len, &fce, buf, bufsize, &cb) :
ndb_ws_event_from_json(ev->json, ev->len, &tce, buf, bufsize, &cb);
if (note_size == -42) {
if ((int)note_size == -42) {
// we already have this!
//ndb_debug("already have id??\n");
goto cleanup;
@@ -2256,6 +2256,7 @@ static int ndb_write_note_fulltext_index(struct ndb_txn *txn,
static int ndb_parse_search_words(void *ctx, const char *word_str, int word_len, int word_index)
{
(void)word_index;
struct ndb_search_words *words = ctx;
struct ndb_word *word;
@@ -3066,7 +3067,7 @@ static int ndb_queue_write_version(struct ndb *ndb, uint64_t version)
static int ndb_run_migrations(struct ndb *ndb)
{
uint64_t version, latest_version, i;
int64_t version, latest_version, i;
latest_version = sizeof(MIGRATIONS) / sizeof(MIGRATIONS[0]);
@@ -3259,7 +3260,7 @@ static inline int cursor_push_tag(struct cursor *cur, struct ndb_tag *tag)
}
int ndb_builder_init(struct ndb_builder *builder, unsigned char *buf,
int bufsize)
size_t bufsize)
{
struct ndb_note *note;
int half, size, str_indices_size;
@@ -4240,7 +4241,7 @@ int ndb_stat(struct ndb *ndb, struct ndb_stat *stat)
common_kind = ndb_kind_to_common_kind(note->kind);
// uncommon kind? just count them in bulk
if (common_kind == -1) {
if ((int)common_kind == -1) {
stat->other_kinds.count++;
stat->other_kinds.key_size += k.mv_size;
stat->other_kinds.value_size += v.mv_size;

View File

@@ -364,7 +364,7 @@ int ndb_parse_json_note(struct ndb_json_parser *, struct ndb_note **);
int ndb_client_event_from_json(const char *json, int len, struct ndb_fce *fce, unsigned char *buf, int bufsize, struct ndb_id_cb *cb);
int ndb_ws_event_from_json(const char *json, int len, struct ndb_tce *tce, unsigned char *buf, int bufsize, struct ndb_id_cb *);
int ndb_note_from_json(const char *json, int len, struct ndb_note **, unsigned char *buf, int buflen);
int ndb_builder_init(struct ndb_builder *builder, unsigned char *buf, int bufsize);
int ndb_builder_init(struct ndb_builder *builder, unsigned char *buf, size_t bufsize);
int ndb_builder_finalize(struct ndb_builder *builder, struct ndb_note **note, struct ndb_keypair *privkey);
int ndb_builder_set_content(struct ndb_builder *builder, const char *content, int len);
void ndb_builder_set_created_at(struct ndb_builder *builder, uint64_t created_at);