asm: update bluelib api usage
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#include "assembler.h"
|
||||
|
||||
#include <blue/core/hash.h>
|
||||
#include <blue/object/dict.h>
|
||||
#include <blue/object/number.h>
|
||||
#include <blue/object/string.h>
|
||||
#include <blue/ds/dict.h>
|
||||
#include <blue/ds/number.h>
|
||||
#include <blue/ds/string.h>
|
||||
#include <ivy/asm/bin.h>
|
||||
#include <ivy/ident.h>
|
||||
#include <ivy/selector.h>
|
||||
@@ -35,7 +35,7 @@ static enum ivy_status init_scope(
|
||||
static ivy_extended_data_key get_cached_string(
|
||||
struct constpool_assembler_scope *scope, const char *s)
|
||||
{
|
||||
b_number *key = B_NUMBER(b_dict_at(scope->s_strings, s));
|
||||
b_number *key = b_dict_at(scope->s_strings, s);
|
||||
if (!key) {
|
||||
return IVY_EX_DATA_KEY_NULL;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ static ivy_extended_data_key write_string(struct ivy_assembler *as, const char *
|
||||
size_t len = strlen(s);
|
||||
|
||||
struct ivy_bin_string str = {0};
|
||||
str.s_hash = b_i32_htob((uint32_t)b_hash_string(s));
|
||||
str.s_hash = b_i32_htob((uint32_t)b_hash_cstr(s));
|
||||
str.s_len = b_i32_htob((uint32_t)len);
|
||||
|
||||
key = assembler_write_extended_data(as, &str, sizeof str);
|
||||
@@ -101,11 +101,12 @@ static ivy_extended_data_key write_selector(
|
||||
ivy_extended_data_key *arg_handles
|
||||
= calloc(nr_args, sizeof(ivy_extended_data_key));
|
||||
|
||||
b_queue_iterator it = {0};
|
||||
b_queue_foreach (&it, &sel->sel_args) {
|
||||
b_queue_entry *entry = b_queue_first(&sel->sel_args);
|
||||
while (entry) {
|
||||
struct ivy_selector_arg *arg
|
||||
= b_unbox(struct ivy_selector_arg, it.entry, arg_entry);
|
||||
= b_unbox(struct ivy_selector_arg, entry, arg_entry);
|
||||
arg_handles[i++] = write_string(as, arg->arg_label);
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
ivy_extended_data_key selector_handle
|
||||
@@ -130,11 +131,12 @@ static ivy_extended_data_key write_ident(
|
||||
|
||||
ivy_extended_data_key *part_handles
|
||||
= calloc(nr_parts, sizeof(ivy_extended_data_key));
|
||||
b_queue_iterator it = {0};
|
||||
b_queue_foreach (&it, &id->id_parts) {
|
||||
b_queue_entry *entry = b_queue_first(&id->id_parts);
|
||||
while (entry) {
|
||||
struct ivy_ident_part *arg
|
||||
= b_unbox(struct ivy_ident_part, it.entry, p_entry);
|
||||
= b_unbox(struct ivy_ident_part, entry, p_entry);
|
||||
part_handles[i++] = write_string(as, arg->p_str);
|
||||
entry = b_queue_next(entry);
|
||||
}
|
||||
|
||||
dat.id_nr_parts = (uint8_t)nr_parts;
|
||||
|
||||
Reference in New Issue
Block a user