runtime: update iterator usage
This commit is contained in:
@@ -156,12 +156,12 @@ bshell_command *bshell_command_find_static(const char *name)
|
||||
fx_foreach(asm_v, assemblies)
|
||||
{
|
||||
fx_assembly *assembly = NULL;
|
||||
fx_value_get_object(&asm_v, &assembly);
|
||||
fx_value_get_object(asm_v, &assembly);
|
||||
fx_iterator *types = fx_assembly_get_types(assembly);
|
||||
fx_foreach(v, types)
|
||||
{
|
||||
fx_type *ty = NULL;
|
||||
fx_value_get_object(&v, &ty);
|
||||
fx_value_get_object(v, &ty);
|
||||
if (fx_type_id_compare(
|
||||
fx_type_get_id(ty),
|
||||
BSHELL_TYPE_COMMAND)
|
||||
|
||||
@@ -59,7 +59,7 @@ enum bshell_status format_object_table(fx_object *object, fx_stream *dest)
|
||||
|
||||
struct bshell_table_ctx ctx;
|
||||
bshell_table_ctx_init(&ctx, dest);
|
||||
fx_iterator *it = fx_iterator_begin(object);
|
||||
const fx_iterator *it = fx_iterator_begin(object);
|
||||
if (!it) {
|
||||
bshell_table_ctx_prepare_columns_from_format(
|
||||
&ctx,
|
||||
@@ -68,17 +68,17 @@ enum bshell_status format_object_table(fx_object *object, fx_stream *dest)
|
||||
bshell_table_ctx_print_headers(&ctx);
|
||||
bshell_table_ctx_print_record(&ctx, &FX_VALUE_OBJECT(object));
|
||||
} else {
|
||||
fx_value first = fx_iterator_get_value(it);
|
||||
if (first.v_type) {
|
||||
const fx_value *first = fx_iterator_get_value(it);
|
||||
if (first) {
|
||||
bshell_table_ctx_prepare_columns_from_format(
|
||||
&ctx,
|
||||
fx_type_get_by_id(first.v_type),
|
||||
fx_type_get_by_id(first->v_type),
|
||||
fmt);
|
||||
}
|
||||
bshell_table_ctx_print_headers(&ctx);
|
||||
fx_foreach(value, it)
|
||||
{
|
||||
bshell_table_ctx_print_record(&ctx, &value);
|
||||
bshell_table_ctx_print_record(&ctx, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ enum bshell_status bshell_table_ctx_prepare_columns_from_object(
|
||||
fx_iterator *it = fx_type_get_properties(record_type);
|
||||
fx_foreach(prop_v, it)
|
||||
{
|
||||
fx_array_push_back(properties, prop_v);
|
||||
fx_array_push_back(properties, *prop_v);
|
||||
}
|
||||
fx_iterator_unref(it);
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ static enum bshell_status write_value(
|
||||
return BSHELL_SUCCESS;
|
||||
}
|
||||
|
||||
fx_iterator *it = fx_iterator_begin(container);
|
||||
const fx_iterator *it = fx_iterator_begin(container);
|
||||
fx_foreach(v, it)
|
||||
{
|
||||
fx_array_push_back(dest, fx_value_copy_return(v));
|
||||
fx_array_push_back(dest, fx_value_ref_copy_return(v));
|
||||
}
|
||||
fx_iterator_unref(it);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user