fx.collections: update interface implementations
This commit is contained in:
+10
-3
@@ -1,6 +1,7 @@
|
||||
#include <fx/bitop.h>
|
||||
#include <fx/collections/bitmap.h>
|
||||
#include <fx/stream.h>
|
||||
#include <fx/value.h>
|
||||
#include <string.h>
|
||||
|
||||
#define BITS_PER_WORD (8 * sizeof(bitmap_word_t))
|
||||
@@ -306,10 +307,14 @@ static void bitmap_fini(fx_object *obj, void *priv)
|
||||
struct fx_bitmap_p *map = priv;
|
||||
}
|
||||
|
||||
static void bitmap_to_string(const fx_object *obj, fx_stream *out)
|
||||
static fx_status bitmap_to_string(
|
||||
const fx_value *obj,
|
||||
fx_stream *out,
|
||||
const char *format)
|
||||
{
|
||||
const struct fx_bitmap_p *map
|
||||
= fx_object_get_private(obj, FX_TYPE_BITMAP);
|
||||
const struct fx_bitmap_p *map = fx_object_get_private(
|
||||
obj->v_object,
|
||||
FX_TYPE_BITMAP);
|
||||
|
||||
unsigned char *bytes = (unsigned char *)map->map_words;
|
||||
size_t nr_bytes = map->map_nr_words * sizeof(bitmap_word_t);
|
||||
@@ -339,6 +344,8 @@ static void bitmap_to_string(const fx_object *obj, fx_stream *out)
|
||||
|
||||
fx_stream_write_fmt(out, NULL, "%c", (c & mask) ? '1' : '0');
|
||||
}
|
||||
|
||||
return FX_SUCCESS;
|
||||
}
|
||||
|
||||
/*** CLASS DEFINITION *********************************************************/
|
||||
|
||||
Reference in New Issue
Block a user