Commit 13f030baf2dc1201068abd0b5f91792c3f5906bc

Ran Benita 2012-06-29T22:25:27

Tiny reformatting Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index f041f70..49f7d4c 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -34,7 +34,7 @@ unsigned int warningLevel = 0;
 #define ISEMPTY(str) (!(str) || (strlen(str) == 0))
 
 static XkbFile *
-XkbKeymapFileFromComponents(struct xkb_context *ctx,
+keymap_file_from_components(struct xkb_context *ctx,
                             const struct xkb_component_names *ktcsg)
 {
     XkbFile *keycodes, *types, *compat, *symbols;
@@ -63,37 +63,6 @@ XkbKeymapFileFromComponents(struct xkb_context *ctx,
                          &keycodes->common, 0);
 }
 
-_X_EXPORT struct xkb_keymap *
-xkb_map_new_from_names(struct xkb_context *ctx,
-                       const struct xkb_rule_names *rmlvo,
-                       enum xkb_map_compile_flags flags)
-{
-    struct xkb_component_names *kkctgs;
-    struct xkb_keymap *keymap;
-
-    if (!rmlvo || ISEMPTY(rmlvo->rules) || ISEMPTY(rmlvo->layout)) {
-        ERROR("rules and layout required to generate XKB keymap\n");
-        return NULL;
-    }
-
-    kkctgs = xkb_components_from_rules(ctx, rmlvo);
-    if (!kkctgs) {
-        ERROR("failed to generate XKB components from rules \"%s\"\n",
-              rmlvo->rules);
-        return NULL;
-    }
-
-    keymap = xkb_map_new_from_kccgst(ctx, kkctgs, 0);
-
-    free(kkctgs->keycodes);
-    free(kkctgs->types);
-    free(kkctgs->compat);
-    free(kkctgs->symbols);
-    free(kkctgs);
-
-    return keymap;
-}
-
 static struct xkb_keymap *
 compile_keymap(struct xkb_context *ctx, XkbFile *file)
 {
@@ -137,7 +106,8 @@ xkb_map_new_from_kccgst(struct xkb_context *ctx,
         return NULL;
     }
 
-    if (!(file = XkbKeymapFileFromComponents(ctx, kccgst))) {
+    file = keymap_file_from_components(ctx, kccgst);
+    if (!file) {
         ERROR("failed to generate parsed XKB file from components\n");
         return NULL;
     }
@@ -146,6 +116,37 @@ xkb_map_new_from_kccgst(struct xkb_context *ctx,
 }
 
 _X_EXPORT struct xkb_keymap *
+xkb_map_new_from_names(struct xkb_context *ctx,
+                       const struct xkb_rule_names *rmlvo,
+                       enum xkb_map_compile_flags flags)
+{
+    struct xkb_component_names *kkctgs;
+    struct xkb_keymap *keymap;
+
+    if (!rmlvo || ISEMPTY(rmlvo->rules) || ISEMPTY(rmlvo->layout)) {
+        ERROR("rules and layout required to generate XKB keymap\n");
+        return NULL;
+    }
+
+    kkctgs = xkb_components_from_rules(ctx, rmlvo);
+    if (!kkctgs) {
+        ERROR("failed to generate XKB components from rules \"%s\"\n",
+              rmlvo->rules);
+        return NULL;
+    }
+
+    keymap = xkb_map_new_from_kccgst(ctx, kkctgs, 0);
+
+    free(kkctgs->keycodes);
+    free(kkctgs->types);
+    free(kkctgs->compat);
+    free(kkctgs->symbols);
+    free(kkctgs);
+
+    return keymap;
+}
+
+_X_EXPORT struct xkb_keymap *
 xkb_map_new_from_string(struct xkb_context *ctx,
                         const char *string,
                         enum xkb_keymap_format format,