[libxkbcommon] Pull request - many changes

Ran Benita ran234 at gmail.com
Sat Mar 3 14:40:12 PST 2012


Hi,

[I know the normal procedure is to send the patches for review in
reasonable chunks to the list, however I won't have time the following
weeks, and I don't want them to get lost. So I'll try my luck now.]

I set up a github repository with my libxkbcommon patches. The first few
were sent to the list and some were reviewed (up to branch 'fixes'). The
next one's were not (branch 'fixes-cont').

The changes made are:
* Fix all compiler warnings.
* Fix a few static analyzer warnings.
* Clean up legacy code patterns (e.g. checking NULL before free, not
  using strdup, char* instead of void*, bzero instead of memset).
* Reimport libX11's makekeys.
* Constifying and removing some globals.
* Fixing all memory leaks and making valgrind happy.
* Fixing a couple of bugs (if nothing else, please cherry-pick commit
  e4b4d6b!).
* And some other small cleanups.

The intention is to have a clean slate before doing some actual
changes to libxkbcommon (which I hope to do when I have time in the
future).

Thanks,
Ran

The following changes since commit 1ab058bbb345245088f54315227fe0cf52ae54ed:

  Fix typo in ExprResolveKeyCode (2012-02-20 17:47:46 +0000)

are available in the git repository at:

  git at github.com:bluetech/libxkbcommon.git fixes-cont

for you to fetch changes up to e4b4d6b0510075fe62234f66185bf619c70fc126:

  Fix "Could not resolve keysym" errors (2012-03-04 00:04:04 +0200)

----------------------------------------------------------------
Ran Benita (46):
      Remove unused debug #defines
      Remove unused includes of "tokens.h"
      Remove ancient compatibility check
      makekeys: make buf local to main()
      makekeys: clear const and shadow warnings
      Remove unneeded assignments and variables
      Fix possible null dereferences
      Fix all constness warnings
      Fix an incorrect sizeof
      Fix warnings in scanner and parser
      Fix remaining warnings
      makekeys: Fix build/target word size mismatch when cross-compiling
      When makekeys fails to find a good hash, print error instead of divide-by-zero
      makekeys: Receive the keysym files as arguments
      makekeys: update to match the rest of libX11 makekeys
      Use yacc-generated header instead of tokens.h
      Don't check for NULL before free()
      Use strdup instead of strlen + malloc + strcpy
      Remove all uses of the register keyword
      Remove return's at the end of void functions
      Use memset instead of bzero
      Use strchr instead of index
      Remove useless casts
      Use limits.h to find min/max short value
      Constify global tables
      Constify some more text functions
      Use global tables for action string handling
      Remove unused global type tokens
      Make the sections array local to the keymap compiling function
      Remove unneeded freeing mechanisms
      Don't cache parsed files
      Don't cache loaded rules files
      Add function to free XkbFile's
      Free XkbFile's when no longer needed
      Don't leak the various *Info's names when overriding them
      Don't leak the "minimum"/"maximum" string
      Don't leak KeyNamesInfo
      Don't leak ActionInfo's
      Don't leak DoodadInfo's from GeometryInfo
      Don't leak the scanner's buffer
      Fix other misc leaks
      Free scanFile when no longer needed
      Free IncludePath when no longer needed
      Free all atoms along with keymap
      Refactor XkbFindFileInPath
      Fix "Could not resolve keysym" errors

 configure.ac             |   25 ++-
 makekeys/Makefile.am     |    3 +
 makekeys/makekeys.c      |  228 +++++++++---------------
 src/Makefile.am          |    4 +-
 src/XKBcommonint.h       |    2 +-
 src/alloc.c              |  109 ++++--------
 src/atom.c               |   28 ++-
 src/galloc.c             |  361 ++++++++++++--------------------------
 src/geom.c               |   18 +-
 src/keysym.c             |   18 +-
 src/malloc.c             |  143 ++++------------
 src/maprules.c           |  196 ++++++++++-----------
 src/text.c               |   29 ++--
 src/xkb.c                |    7 +-
 src/xkballoc.h           |    6 +-
 src/xkbcomp/.gitignore   |    1 +
 src/xkbcomp/Makefile.am  |    4 +-
 src/xkbcomp/action.c     |  428 ++++++++++++++++------------------------------
 src/xkbcomp/action.h     |    2 +-
 src/xkbcomp/alias.c      |   22 +--
 src/xkbcomp/compat.c     |   51 +++---
 src/xkbcomp/expr.c       |   41 +++--
 src/xkbcomp/expr.h       |   12 +-
 src/xkbcomp/geometry.c   |  130 ++++++--------
 src/xkbcomp/indicators.c |   87 ++++------
 src/xkbcomp/keycodes.c   |   59 +++----
 src/xkbcomp/keycodes.h   |    2 +-
 src/xkbcomp/keymap.c     |   15 +-
 src/xkbcomp/keytypes.c   |   63 +++----
 src/xkbcomp/listing.c    |    5 +-
 src/xkbcomp/misc.c       |   74 ++++----
 src/xkbcomp/parseutils.c |  235 +++++++++++++++++++++----
 src/xkbcomp/parseutils.h |   23 +--
 src/xkbcomp/symbols.c    |  148 +++++++---------
 src/xkbcomp/tokens.h     |  105 ------------
 src/xkbcomp/utils.c      |   10 +-
 src/xkbcomp/utils.h      |    8 +-
 src/xkbcomp/vmod.c       |   15 +-
 src/xkbcomp/xkbcomp.c    |   82 ++++-----
 src/xkbcomp/xkbparse.y   |   11 +-
 src/xkbcomp/xkbpath.c    |  164 +++++-------------
 src/xkbcomp/xkbpath.h    |   17 +-
 src/xkbcomp/xkbscan.l    |   50 +++---
 src/xkbgeom.h            |    2 +-
 src/xkbmisc.h            |   21 ++-
 src/xkbrules.h           |   10 +-
 test/xkey.sh             |    2 +-
 47 files changed, 1244 insertions(+), 1832 deletions(-)
 delete mode 100644 src/xkbcomp/tokens.h


More information about the xorg-devel mailing list