mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-15 05:57:26 +03:00
busctl: use size_t for set size
Also reduce the scope of variables.
This commit is contained in:
parent
d82267e567
commit
bc1f1eba77
@ -369,9 +369,6 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
|
||||
}
|
||||
|
||||
static void print_subtree(const char *prefix, const char *path, char **l) {
|
||||
const char *vertical, *space;
|
||||
char **n;
|
||||
|
||||
/* We assume the list is sorted. Let's first skip over the
|
||||
* entry we are looking at. */
|
||||
for (;;) {
|
||||
@ -384,11 +381,13 @@ static void print_subtree(const char *prefix, const char *path, char **l) {
|
||||
l++;
|
||||
}
|
||||
|
||||
vertical = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL));
|
||||
space = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_SPACE));
|
||||
const char
|
||||
*vertical = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)),
|
||||
*space = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_SPACE));
|
||||
|
||||
for (;;) {
|
||||
bool has_more = false;
|
||||
char **n;
|
||||
|
||||
if (!*l || !path_startswith(*l, path))
|
||||
break;
|
||||
@ -973,8 +972,8 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply_xml = NULL;
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
_cleanup_(member_set_freep) Set *members = NULL;
|
||||
unsigned name_width, type_width, signature_width, result_width, j, k = 0;
|
||||
Member *m, **sorted = NULL;
|
||||
unsigned name_width, type_width, signature_width, result_width;
|
||||
Member *m;
|
||||
const char *xml;
|
||||
int r;
|
||||
|
||||
@ -1098,7 +1097,8 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
signature_width = strlen("SIGNATURE");
|
||||
result_width = strlen("RESULT/VALUE");
|
||||
|
||||
sorted = newa(Member*, set_size(members));
|
||||
Member **sorted = newa(Member*, set_size(members));
|
||||
size_t k = 0;
|
||||
|
||||
SET_FOREACH(m, members) {
|
||||
if (argv[3] && !streq(argv[3], m->interface))
|
||||
@ -1135,7 +1135,7 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
(int) result_width, "RESULT/VALUE",
|
||||
"FLAGS");
|
||||
|
||||
for (j = 0; j < k; j++) {
|
||||
for (size_t j = 0; j < k; j++) {
|
||||
_cleanup_free_ char *ellipsized = NULL;
|
||||
const char *rv;
|
||||
bool is_interface;
|
||||
|
Loading…
x
Reference in New Issue
Block a user