diff --git a/src/modules/systemlib/param/param_shmem.c b/src/modules/systemlib/param/param_shmem.c index f789da1464..fbc5e1c0ea 100644 --- a/src/modules/systemlib/param/param_shmem.c +++ b/src/modules/systemlib/param/param_shmem.c @@ -307,6 +307,8 @@ param_count(void) unsigned param_count_used(void) { + //TODO FIXME: all params used right now +#if 0 unsigned count = 0; // ensure the allocation has been done @@ -322,6 +324,9 @@ param_count_used(void) } return count; +#else + return get_param_info_count(); +#endif } param_t @@ -378,6 +383,8 @@ param_get_index(param_t param) int param_get_used_index(param_t param) { + // TODO FIXME: the used bit is not supported right now, therefore just count all. +#if 0 /* this tests for out of bounds and does a constant time lookup */ if (!param_used(param)) { return -1; @@ -388,6 +395,7 @@ param_get_used_index(param_t param) for (unsigned i = 0; i < (unsigned)size_param_changed_storage_bytes; i++) { for (unsigned j = 0; j < bits_per_allocation_unit; j++) { + if (param_changed_storage[i] & (1 << j)) { if ((unsigned)param == i * bits_per_allocation_unit + j) { @@ -398,8 +406,11 @@ param_get_used_index(param_t param) } } } - return -1; +#else + return param; +#endif + } const char *