This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
neels gerrit-no-reply at lists.osmocom.orgneels has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/25461 )
Change subject: stat_item: cosmetic: s/desc/group_desc in osmo_stat_item_group_alloc()
......................................................................
stat_item: cosmetic: s/desc/group_desc in osmo_stat_item_group_alloc()
There also is an osmo_stat_item_desc, so the name 'desc' makes it hard
to read the code / the upcoming refactoring patches. It is an
osmo_stat_item_group_desc, so call it group_desc.
Related: SYS#5542
Change-Id: I07bc011450549a44ebf043e7d8a70718ddfd900e
---
M include/osmocom/core/stat_item.h
M src/stat_item.c
2 files changed, 10 insertions(+), 10 deletions(-)
Approvals:
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/core/stat_item.h b/include/osmocom/core/stat_item.h
index 402a7ae..e600ecd 100644
--- a/include/osmocom/core/stat_item.h
+++ b/include/osmocom/core/stat_item.h
@@ -77,7 +77,7 @@
struct osmo_stat_item_group *osmo_stat_item_group_alloc(
void *ctx,
- const struct osmo_stat_item_group_desc *desc,
+ const struct osmo_stat_item_group_desc *group_desc,
unsigned int idx);
static inline void osmo_stat_item_group_udp_idx(
diff --git a/src/stat_item.c b/src/stat_item.c
index 87cbfea..1788746 100644
--- a/src/stat_item.c
+++ b/src/stat_item.c
@@ -94,7 +94,7 @@
* \param[in] idx Index of new stat item group
*/
struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx,
- const struct osmo_stat_item_group_desc *desc,
+ const struct osmo_stat_item_group_desc *group_desc,
unsigned int idx)
{
unsigned int group_size;
@@ -105,7 +105,7 @@
struct osmo_stat_item_group *group;
group_size = sizeof(struct osmo_stat_item_group) +
- desc->num_items * sizeof(struct osmo_stat_item *);
+ group_desc->num_items * sizeof(struct osmo_stat_item *);
if (!ctx)
ctx = tall_stat_item_ctx;
@@ -114,15 +114,15 @@
if (!group)
return NULL;
- group->desc = desc;
+ group->desc = group_desc;
group->idx = idx;
/* Get combined size of all items */
- for (item_idx = 0; item_idx < desc->num_items; item_idx++) {
+ for (item_idx = 0; item_idx < group_desc->num_items; item_idx++) {
unsigned int size;
size = sizeof(struct osmo_stat_item) +
sizeof(struct osmo_stat_item_value) *
- desc->item_desc[item_idx].num_values;
+ group_desc->item_desc[item_idx].num_values;
/* Align to pointer size */
size = (size + sizeof(void *) - 1) & ~(sizeof(void *) - 1);
@@ -139,18 +139,18 @@
}
/* Update item pointers */
- for (item_idx = 0; item_idx < desc->num_items; item_idx++) {
+ for (item_idx = 0; item_idx < group_desc->num_items; item_idx++) {
struct osmo_stat_item *item = (struct osmo_stat_item *)
((uint8_t *)items + (unsigned long)group->items[item_idx]);
unsigned int i;
group->items[item_idx] = item;
- item->last_offs = desc->item_desc[item_idx].num_values - 1;
+ item->last_offs = group_desc->item_desc[item_idx].num_values - 1;
item->stats_next_id = 1;
- item->desc = &desc->item_desc[item_idx];
+ item->desc = &group_desc->item_desc[item_idx];
for (i = 0; i <= item->last_offs; i++) {
- item->values[i].value = desc->item_desc[item_idx].default_value;
+ item->values[i].value = group_desc->item_desc[item_idx].default_value;
item->values[i].id = OSMO_STAT_ITEM_NOVALUE_ID;
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25461
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I07bc011450549a44ebf043e7d8a70718ddfd900e
Gerrit-Change-Number: 25461
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210920/99aa2c1f/attachment.htm>