[PATCH libxkbcommon 06/11] Remove unneeded assignments and variables

Ran Benita ran234 at gmail.com
Sat Feb 25 02:13:31 PST 2012


Signed-off-by: Ran Benita <ran234 at gmail.com>
---
 src/geom.c             |    1 -
 src/maprules.c         |    2 --
 src/xkbcomp/alias.c    |    1 -
 src/xkbcomp/geometry.c |    6 +-----
 src/xkbcomp/keymap.c   |    2 +-
 5 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/geom.c b/src/geom.c
index 6dd610f..87b1f78 100644
--- a/src/geom.c
+++ b/src/geom.c
@@ -86,7 +86,6 @@ XkbcComputeRowBounds(struct xkb_geometry * geom, struct xkb_section * section, s
     if (!geom || !section || !row)
         return False;
 
-    pos = 0;
     bounds = &row->bounds;
     bzero(bounds, sizeof(struct xkb_bounds));
 
diff --git a/src/maprules.c b/src/maprules.c
index 3fab183..894f202 100644
--- a/src/maprules.c
+++ b/src/maprules.c
@@ -174,7 +174,6 @@ Bool	endOfFile,spacePending,slashPending,inComment;
 			PR_DEBUG("The '!' legal only at start of line\n");
 			PR_DEBUG("Line containing '!' ignored\n");
 			line->num_line= 0;
-			inComment= 0;
 			break;
 		    }
 
@@ -521,7 +520,6 @@ squeeze_spaces(char *p1)
 static Bool
 MakeMultiDefs(XkbRF_MultiDefsPtr mdefs, XkbRF_VarDefsPtr defs)
 {
-
    bzero((char *)mdefs,sizeof(XkbRF_MultiDefsRec));
    mdefs->model = defs->model;
    mdefs->options = _XkbDupString(defs->options);
diff --git a/src/xkbcomp/alias.c b/src/xkbcomp/alias.c
index 79c1263..fa27102 100644
--- a/src/xkbcomp/alias.c
+++ b/src/xkbcomp/alias.c
@@ -230,7 +230,6 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
         *info_in = NULL;
         return True;
     }
-    status = Success;
     if (toGeom)
     {
         if (!xkb->geom)
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index 8e425a1..ddb2765 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -565,8 +565,6 @@ DupSectionInfo(SectionInfo * into, SectionInfo * from, GeometryInfo * info)
 
     defs = into->defs;
     *into = *from;
-    into->defs.fileID = defs.fileID;
-    into->defs.merge = defs.merge;
     into->defs.next = NULL;
     into->dfltRow.defs.fileID = defs.fileID;
     into->dfltRow.defs.merge = defs.merge;
@@ -1879,7 +1877,6 @@ SetSectionField(SectionInfo * si,
     ExprResult tmp;
 
     pField = NULL;
-    def = 0;
     if (uStrCaseCmp(field, "priority") == 0)
     {
         if (arrayNdx != NULL)
@@ -2601,10 +2598,8 @@ HandleOverlayDef(OverlayDef * def,
 static Bool
 HandleComplexKey(KeyDef * def, KeyInfo * key, GeometryInfo * info)
 {
-    RowInfo *row;
     ExprDef *expr;
 
-    row = key->row;
     for (expr = def->expr; expr != NULL; expr = (ExprDef *) expr->common.next)
     {
         if (expr->op == OpAssign)
@@ -2636,6 +2631,7 @@ HandleComplexKey(KeyDef * def, KeyInfo * key, GeometryInfo * info)
         }
         else
         {
+            RowInfo *row = key->row;
             switch (expr->type)
             {
             case TypeInt:
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 2c2420d..16e0dfa 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -172,7 +172,7 @@ CompileKeymap(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
         }
         ACTION("Description of %s not compiled\n",
                 XkbcConfigText(mainType));
-        ok = False;
+        return False;
     }
     ok = BindIndicators(xkb, True, unbound, NULL);
     return ok;
-- 
1.7.9.2



More information about the xorg-devel mailing list