Change some log functions to take ctx instead of keymap
authorRan Benita <ran234@gmail.com>
Thu, 7 Feb 2013 22:07:28 +0000 (00:07 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 18 Mar 2013 22:20:02 +0000 (22:20 +0000)
They don't need the keymap, only the context.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/compat.c
src/xkbcomp/types.c
src/xkbcomp/xkbcomp-priv.h

index d77dee2..4361abe 100644 (file)
@@ -287,7 +287,7 @@ siText(SymInterpInfo *si, CompatInfo *info)
 static inline bool
 ReportSINotArray(CompatInfo *info, SymInterpInfo *si, const char *field)
 {
-    return ReportNotArray(info->keymap, "symbol interpretation", field,
+    return ReportNotArray(info->keymap->ctx, "symbol interpretation", field,
                           siText(si, info));
 }
 
@@ -311,7 +311,7 @@ ReportLedBadType(CompatInfo *info, LedInfo *ledi, const char *field,
 static inline bool
 ReportLedNotArray(CompatInfo *info, LedInfo *ledi, const char *field)
 {
-    return ReportNotArray(info->keymap, "indicator map", field,
+    return ReportNotArray(info->keymap->ctx, "indicator map", field,
                           xkb_atom_text(info->keymap->ctx, ledi->led.name));
 }
 
@@ -688,7 +688,7 @@ SetInterpField(CompatInfo *info, SymInterpInfo *si, const char *field,
         si->defined |= SI_FIELD_LEVEL_ONE_ONLY;
     }
     else {
-        return ReportBadField(keymap, "symbol interpretation", field,
+        return ReportBadField(keymap->ctx, "symbol interpretation", field,
                               siText(si, info));
     }
 
index 6518482..b1666fa 100644 (file)
@@ -187,7 +187,7 @@ static inline bool
 ReportTypeShouldBeArray(KeyTypesInfo *info, KeyTypeInfo *type,
                         const char *field)
 {
-    return ReportShouldBeArray(info->keymap, "key type", field,
+    return ReportShouldBeArray(info->keymap->ctx, "key type", field,
                                TypeTxt(info, type));
 }
 
index 8b6f0f8..97f8e21 100644 (file)
@@ -78,10 +78,10 @@ LookupKeysym(const char *str, xkb_keysym_t *sym_rtrn);
 /***====================================================================***/
 
 static inline bool
-ReportNotArray(struct xkb_keymap *keymap, const char *type, const char *field,
+ReportNotArray(struct xkb_context *ctx, const char *type, const char *field,
                const char *name)
 {
-    log_err(keymap->ctx,
+    log_err(ctx,
             "The %s %s field is not an array; "
             "Ignoring illegal assignment in %s\n",
             type, field, name);
@@ -89,10 +89,10 @@ ReportNotArray(struct xkb_keymap *keymap, const char *type, const char *field,
 }
 
 static inline bool
-ReportShouldBeArray(struct xkb_keymap *keymap, const char *type,
+ReportShouldBeArray(struct xkb_context *ctx, const char *type,
                     const char *field, const char *name)
 {
-    log_err(keymap->ctx,
+    log_err(ctx,
             "Missing subscript for %s %s; "
             "Ignoring illegal assignment in %s\n",
             type, field, name);
@@ -110,10 +110,10 @@ ReportBadType(struct xkb_context *ctx, const char *type, const char *field,
 }
 
 static inline bool
-ReportBadField(struct xkb_keymap *keymap, const char *type, const char *field,
+ReportBadField(struct xkb_context *ctx, const char *type, const char *field,
                const char *name)
 {
-    log_err(keymap->ctx,
+    log_err(ctx,
             "Unknown %s field %s in %s; "
             "Ignoring assignment to unknown field in %s\n",
             type, field, name, name);