diff options
author | vkalintiris <vasilis@netdata.cloud> | 2021-03-10 10:37:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 10:37:47 +0200 |
commit | adec24dffa763654bfa8cfa9ae3bd53296c2c24f (patch) | |
tree | 63f5307373399ed797e2721fadfa2f83971a61b9 /registry | |
parent | 86ca37683eac5ffd4172c5e62652409087791999 (diff) |
Rename struct avl to avl_element and the typedef to avl_t (#10735)
Before:
```
struct foobar {
avl avl;
...
}
```
After:
```
struct foobar {
avl_t avl;
...
};
```
Which makes figuring out the type from field name easier.
Diffstat (limited to 'registry')
-rw-r--r-- | registry/registry_person.c | 4 | ||||
-rw-r--r-- | registry/registry_person.h | 2 | ||||
-rw-r--r-- | registry/registry_url.c | 6 | ||||
-rw-r--r-- | registry/registry_url.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/registry/registry_person.c b/registry/registry_person.c index 268b0bd136..fae1520c4f 100644 --- a/registry/registry_person.c +++ b/registry/registry_person.c @@ -32,7 +32,7 @@ inline REGISTRY_PERSON_URL *registry_person_url_index_find(REGISTRY_PERSON *p, c inline REGISTRY_PERSON_URL *registry_person_url_index_add(REGISTRY_PERSON *p, REGISTRY_PERSON_URL *pu) { debug(D_REGISTRY, "Registry: registry_person_url_index_add('%s', '%s')", p->guid, pu->url->url); - REGISTRY_PERSON_URL *tpu = (REGISTRY_PERSON_URL *)avl_insert(&(p->person_urls), (avl *)(pu)); + REGISTRY_PERSON_URL *tpu = (REGISTRY_PERSON_URL *)avl_insert(&(p->person_urls), (avl_t *)(pu)); if(tpu != pu) error("Registry: registry_person_url_index_add('%s', '%s') already exists as '%s'", p->guid, pu->url->url, tpu->url->url); @@ -41,7 +41,7 @@ inline REGISTRY_PERSON_URL *registry_person_url_index_add(REGISTRY_PERSON *p, RE inline REGISTRY_PERSON_URL *registry_person_url_index_del(REGISTRY_PERSON *p, REGISTRY_PERSON_URL *pu) { debug(D_REGISTRY, "Registry: registry_person_url_index_del('%s', '%s')", p->guid, pu->url->url); - REGISTRY_PERSON_URL *tpu = (REGISTRY_PERSON_URL *)avl_remove(&(p->person_urls), (avl *)(pu)); + REGISTRY_PERSON_URL *tpu = (REGISTRY_PERSON_URL *)avl_remove(&(p->person_urls), (avl_t *)(pu)); if(!tpu) error("Registry: registry_person_url_index_del('%s', '%s') deleted nothing", p->guid, pu->url->url); else if(tpu != pu) diff --git a/registry/registry_person.h b/registry/registry_person.h index 9a4aa959b9..42419bfe9b 100644 --- a/registry/registry_person.h +++ b/registry/registry_person.h @@ -10,7 +10,7 @@ // for each PERSON-URL pair we keep this struct registry_person_url { - avl avl; // binary tree node + avl_t avl; // binary tree node REGISTRY_URL *url; // de-duplicated URL REGISTRY_MACHINE *machine; // link the MACHINE of this URL diff --git a/registry/registry_url.c b/registry/registry_url.c index 9ac3ce10c5..559799d8fe 100644 --- a/registry/registry_url.c +++ b/registry/registry_url.c @@ -13,11 +13,11 @@ int registry_url_compare(void *a, void *b) { } inline REGISTRY_URL *registry_url_index_add(REGISTRY_URL *u) { - return (REGISTRY_URL *)avl_insert(&(registry.registry_urls_root_index), (avl *)(u)); + return (REGISTRY_URL *)avl_insert(&(registry.registry_urls_root_index), (avl_t *)(u)); } inline REGISTRY_URL *registry_url_index_del(REGISTRY_URL *u) { - return (REGISTRY_URL *)avl_remove(&(registry.registry_urls_root_index), (avl *)(u)); + return (REGISTRY_URL *)avl_remove(&(registry.registry_urls_root_index), (avl_t *)(u)); } REGISTRY_URL *registry_url_get(const char *url, size_t urllen) { @@ -33,7 +33,7 @@ REGISTRY_URL *registry_url_get(const char *url, size_t urllen) { strncpyz(n->url, url, n->len); n->hash = simple_hash(n->url); - REGISTRY_URL *u = (REGISTRY_URL *)avl_search(&(registry.registry_urls_root_index), (avl *)n); + REGISTRY_URL *u = (REGISTRY_URL *)avl_search(&(registry.registry_urls_root_index), (avl_t *)n); if(!u) { debug(D_REGISTRY, "Registry: registry_url_get('%s', %zu): allocating %zu bytes", url, urllen, sizeof(REGISTRY_URL) + urllen); u = callocz(1, sizeof(REGISTRY_URL) + urllen); // no need for +1, 1 is already in REGISTRY_URL diff --git a/registry/registry_url.h b/registry/registry_url.h index c684f1c35e..0cc364fdfe 100644 --- a/registry/registry_url.h +++ b/registry/registry_url.h @@ -12,7 +12,7 @@ // we store them here and we keep pointers elsewhere struct registry_url { - avl avl; + avl_t avl; uint32_t hash; // the index hash uint32_t links; // the number of links to this URL - when none is left, we free it |