[systemd-commits] 3 commits - src/libsystemd-terminal src/locale src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Tue Sep 23 06:31:49 PDT 2014


 src/libsystemd-terminal/grdev-internal.h |    4 ++--
 src/libsystemd-terminal/grdev.c          |   28 ++++++++++++++--------------
 src/locale/localed.c                     |    6 +++---
 src/shared/label.c                       |    3 ++-
 4 files changed, 21 insertions(+), 20 deletions(-)

New commits:
commit e78af5ffe53a0d24854d721d1166a60f8ed0dfb6
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Thu Sep 4 12:30:46 2014 -0400

    localed: rename write_data_x11 to x11_write_data
    
    Other functions in this file follow this pattern,
    we have vconsole_write_data and locale_write_data.

diff --git a/src/locale/localed.c b/src/locale/localed.c
index 2252080..1d5be71 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -430,7 +430,7 @@ static int vconsole_write_data(Context *c) {
         return write_env_file_label("/etc/vconsole.conf", l);
 }
 
-static int write_data_x11(Context *c) {
+static int x11_write_data(Context *c) {
         _cleanup_fclose_ FILE *f = NULL;
         _cleanup_free_ char *temp_path = NULL;
         int r;
@@ -605,7 +605,7 @@ static int vconsole_convert_to_x11(Context *c, sd_bus *bus) {
         if (modified) {
                 int r;
 
-                r = write_data_x11(c);
+                r = x11_write_data(c);
                 if (r < 0) {
                         log_error("Failed to set X11 keyboard layout: %s", strerror(-r));
                         return r;
@@ -1050,7 +1050,7 @@ static int method_set_x11_keyboard(sd_bus *bus, sd_bus_message *m, void *userdat
                     free_and_strdup(&c->x11_options, options) < 0)
                         return -ENOMEM;
 
-                r = write_data_x11(c);
+                r = x11_write_data(c);
                 if (r < 0) {
                         log_error("Failed to set X11 keyboard layout: %s", strerror(-r));
                         return sd_bus_error_set_errnof(error, r, "Failed to set X11 keyboard layout: %s", strerror(-r));

commit 493d521d9ffe706741665a88ea14929913ea2eaf
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Sep 23 09:22:40 2014 -0400

    Fix warning about unused variable with !SELINUX
    
    src/shared/label.c:255:15: warning: unused variable 'l' [-Wunused-variable]
             char *l = NULL;
                   ^

diff --git a/src/shared/label.c b/src/shared/label.c
index 02b41f0..b6af38d 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -252,9 +252,10 @@ fail:
 
 int label_get_our_label(char **label) {
         int r = -EOPNOTSUPP;
-        char *l = NULL;
 
 #ifdef HAVE_SELINUX
+        char *l = NULL;
+
         r = getcon(&l);
         if (r < 0)
                 return r;

commit 0508a4dfb8300000fcfc5fa5147582e5feebf1a8
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Sep 23 09:22:33 2014 -0400

    terminal: fix spelling mistake

diff --git a/src/libsystemd-terminal/grdev-internal.h b/src/libsystemd-terminal/grdev-internal.h
index ee18269..f455dd4 100644
--- a/src/libsystemd-terminal/grdev-internal.h
+++ b/src/libsystemd-terminal/grdev-internal.h
@@ -60,7 +60,7 @@ enum {
 };
 
 struct grdev_tile {
-        LIST_FIELDS(grdev_tile, childs_by_node);
+        LIST_FIELDS(grdev_tile, children_by_node);
         grdev_tile *parent;
         grdev_display *display;
 
@@ -79,7 +79,7 @@ struct grdev_tile {
                 } leaf;
 
                 struct {
-                        size_t n_childs;
+                        size_t n_children;
                         LIST_HEAD(grdev_tile, child_list);
                 } node;
         };
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
index e34112e..c5ea524 100644
--- a/src/libsystemd-terminal/grdev.c
+++ b/src/libsystemd-terminal/grdev.c
@@ -54,10 +54,10 @@ static inline grdev_tile *tile_leftmost(grdev_tile *tile) {
 }
 
 #define TILE_FOREACH(_root, _i) \
-        for (_i = tile_leftmost(_root); _i; _i = tile_leftmost(_i->childs_by_node_next) ? : _i->parent)
+        for (_i = tile_leftmost(_root); _i; _i = tile_leftmost(_i->children_by_node_next) ? : _i->parent)
 
 #define TILE_FOREACH_SAFE(_root, _i, _next) \
-        for (_i = tile_leftmost(_root); _i && ((_next = tile_leftmost(_i->childs_by_node_next) ? : _i->parent), true); _i = _next)
+        for (_i = tile_leftmost(_root); _i && ((_next = tile_leftmost(_i->children_by_node_next) ? : _i->parent), true); _i = _next)
 
 static void tile_link(grdev_tile *tile, grdev_tile *parent) {
         grdev_display *display;
@@ -73,8 +73,8 @@ static void tile_link(grdev_tile *tile, grdev_tile *parent) {
 
         assert(!display || !display->enabled);
 
-        ++parent->node.n_childs;
-        LIST_PREPEND(childs_by_node, parent->node.child_list, tile);
+        ++parent->node.n_children;
+        LIST_PREPEND(children_by_node, parent->node.child_list, tile);
         tile->parent = parent;
 
         if (display) {
@@ -105,10 +105,10 @@ static void tile_unlink(grdev_tile *tile) {
 
         assert(parent->type == GRDEV_TILE_NODE);
         assert(parent->display == display);
-        assert(parent->node.n_childs > 0);
+        assert(parent->node.n_children > 0);
 
-        --parent->node.n_childs;
-        LIST_REMOVE(childs_by_node, parent->node.child_list, tile);
+        --parent->node.n_children;
+        LIST_REMOVE(children_by_node, parent->node.child_list, tile);
         tile->parent = NULL;
 
         if (display) {
@@ -127,14 +127,14 @@ static void tile_unlink(grdev_tile *tile) {
          * we must take care to not leave them around. Therefore, whenever we
          * unlink any part of a tree, we also destroy the parent, in case it's
          * now stale.
-         * Parents are stale if they have no childs and either have no display
+         * Parents are stale if they have no children and either have no display
          * or if they are intermediate nodes (i.e, they have a parent).
          * This means, you can easily create trees, but you can never partially
          * move or destruct them so far. They're always reduced to minimal form
          * if you cut them. This might change later, but so far we didn't need
          * partial destruction or the ability to move whole trees. */
 
-        if (parent->node.n_childs < 1 && (parent->parent || !parent->display))
+        if (parent->node.n_children < 1 && (parent->parent || !parent->display))
                 grdev_tile_free(parent);
 }
 
@@ -207,7 +207,7 @@ grdev_tile *grdev_tile_free(grdev_tile *tile) {
         case GRDEV_TILE_NODE:
                 assert(!tile->parent);
                 assert(!tile->display);
-                assert(tile->node.n_childs == 0);
+                assert(tile->node.n_children == 0);
 
                 break;
         }
@@ -472,10 +472,10 @@ static void display_cache_targets(grdev_display *display) {
 
         assert(display);
 
-        /* depth-first with childs before parent */
+        /* depth-first with children before parent */
         for (tile = tile_leftmost(display->tile);
              tile;
-             tile = tile_leftmost(tile->childs_by_node_next) ? : tile->parent) {
+             tile = tile_leftmost(tile->children_by_node_next) ? : tile->parent) {
                 if (tile->type == GRDEV_TILE_LEAF) {
                         grdev_pipe *p;
 
@@ -504,7 +504,7 @@ static void display_cache_targets(grdev_display *display) {
                 } else {
                         grdev_tile *child, *l;
 
-                        /* We're now at a node with all it's childs already
+                        /* We're now at a node with all its children already
                          * computed (depth-first, child before parent). We
                          * first need to know the size of our tile, then we
                          * recurse into all leafs and update their cache. */
@@ -512,7 +512,7 @@ static void display_cache_targets(grdev_display *display) {
                         tile->cache_w = 0;
                         tile->cache_h = 0;
 
-                        LIST_FOREACH(childs_by_node, child, tile->node.child_list) {
+                        LIST_FOREACH(children_by_node, child, tile->node.child_list) {
                                 if (child->x + child->cache_w > tile->cache_w)
                                         tile->cache_w = child->x + child->cache_w;
                                 if (child->y + child->cache_h > tile->cache_h)



More information about the systemd-commits mailing list