[sawfish] x-atom-name accepts full 32 unsigned int. Previously only 30 bits are treated, if the architecture i



commit e582150cd033d15357ee6b11358a8038ff7078c0
Author: Teika kazura <teika lavabit com>
Date:   Sun Jun 20 21:43:02 2010 +0900

    x-atom-name accepts full 32 unsigned int. Previously only 30 bits are
    treated, if the architecture is 32-bit.

 man/news.texi   |    8 ++++++++
 src/functions.c |   13 +++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/man/news.texi b/man/news.texi
index eca6a50..d7f6f7a 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -13,6 +13,14 @@ they occurred between. For more detailed information see the
 
 @itemize @bullet
 
+ item Bug Fixes
+ itemize @minus
+ item Atom handling fix on 32-bit architecture. [Teika Kazura]
+
+Function @code{x-atom-name} now accepts all 32 bits. Previously only
+30 bits are treated, if the architecture is 32-bit.
+ end itemize
+
 @item New Features
 @itemize @minus
 @item New frame parts @code{border-width} and @code{border-color}
diff --git a/src/functions.c b/src/functions.c
index 6047f5c..9c0817c 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -43,6 +43,7 @@
 #include "sawfish.h"
 #include <string.h>
 #include <X11/Xatom.h>
+#include <stdint.h>
 
 /* Number of outstanding server grabs made; only when this is zero is
    the server ungrabbed. */
@@ -922,8 +923,16 @@ Return the symbol with the same name as the X atom identified by the
 integer ATOM.
 ::end:: */
 {
-    rep_DECLARE1(atom, rep_INTP);
-    return x_atom_symbol (rep_INT(atom));
+  if(rep_INTP(atom)){
+    return x_atom_symbol(rep_INT(atom));
+  }
+  if(rep_INTEGERP(atom)){
+    return x_atom_symbol((uint32_t) rep_get_long_uint(atom));
+  }
+  /* This always returns an error. */
+  rep_DECLARE1(atom, rep_INTEGERP);
+  /* Just to make compiler silent. */
+  return Qnil;
 }
 
 DEFUN("root-window-id", Froot_window_id, Sroot_window_id, (void), rep_Subr0) /*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]