[Xcb-commit] libxcb: 10 commits - acinclude.m4 .autom4te.cfg configure.ac .gitignore m4 Makefile.am src tests
Peter Harris
peterh at kemper.freedesktop.org
Tue Aug 20 06:37:14 PDT 2013
.autom4te.cfg | 3 +
.gitignore | 41 ++++++---------
Makefile.am | 2
acinclude.m4 | 142 ------------------------------------------------------
configure.ac | 32 ++++--------
m4/xcb.m4 | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/c_client.py | 12 ++--
tests/.gitignore | 3 +
tests/Makefile.am | 2
9 files changed, 187 insertions(+), 192 deletions(-)
New commits:
commit c52f2891b43ae77008f63700982f800371458f4d
Author: Daniel Martin <consume.noise at gmail.com>
Date: Sun Aug 11 13:25:18 2013 +0200
tests: Add files to .gitignore
Add check_all.log, check_all.trs and test-suite.log to tests/.gitignore.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
diff --git a/tests/.gitignore b/tests/.gitignore
index 9d27cc5..7d19f3b 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,3 +1,6 @@
CheckLog.html
CheckLog_xcb.xml
check_all
+check_all.log
+check_all.trs
+test-suite.log
commit a8d11c36edf5c49b718664dd7206f36be150f694
Author: Daniel Martin <consume.noise at gmail.com>
Date: Thu Jul 25 11:09:26 2013 +0200
Sort gitignore, adjust pattern for config.h
Don't ignore the files config.h and config.h.in, adjust the pattern to
ignore config.h*. This matches an additional config.h.in~ too.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/.gitignore b/.gitignore
index c0dc485..0981ed2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,24 +1,23 @@
+*.la
+*.lo
+*.loT
+*.o
+*.pc
+*.tar.bz2
+*.tar.gz
+.deps
+.dirstamp
+.libs
+Makefile
+Makefile.in
aclocal.m4
build-aux
-libtool
-m4/l*.m4
-mkinstalldirs
-config.h
-config.h.in
+config.h*
config.log
config.status
configure
configure.lineno
-.deps
-.dirstamp
-.libs
-*.lo
-*.loT
-*.la
-Makefile
-Makefile.in
+libtool
+m4/l*.m4
+mkinstalldirs
stamp-h1
-*.o
-*.pc
-*.tar.bz2
-*.tar.gz
commit cbe54c97b3f0e4d40e0ee18796f8077cb4a6c16a
Author: Daniel Martin <consume.noise at gmail.com>
Date: Thu Jul 25 10:56:30 2013 +0200
Use m4 directory
- Follow the suggestion by libtoolize:
"Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
rerunning libtoolize, to keep the correct libtool macros in-tree.
Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am."
and add the macro and define.
- Create the m4 directory and move acinclude.m4 as xcb.m4 there.
- Ignore the m4 files libtoolize copies into the m4 directory
(m4/l*.m4).
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/.gitignore b/.gitignore
index 046e7f5..c0dc485 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
aclocal.m4
build-aux
libtool
+m4/l*.m4
mkinstalldirs
config.h
config.h.in
diff --git a/Makefile.am b/Makefile.am
index 1f88b72..961595b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+ACLOCAL_AMFLAGS=-I m4
+
SUBDIRS=src tests doc
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index ad24bc2..0000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,142 +0,0 @@
-dnl Detection and configuration of the visibility feature of gcc
-dnl Vincent Torri 2006-02-11
-dnl
-dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Check the visibility feature of gcc
-dnl
-AC_DEFUN([XCB_CHECK_VISIBILITY],
-[
-AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
-
-save_CFLAGS=${CFLAGS}
-CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#pragma GCC visibility push(hidden)
-extern void f(int);
-#pragma GCC visibility pop
- ]],
- [[]]
- )],
- [AC_DEFINE(
- GCC_HAS_VISIBILITY,
- [],
- [Defined if GCC supports the visibility feature])
- m4_if([$1], [], [:], [$1])
- AC_MSG_RESULT(yes)],
- [m4_if([$2], [], [:], [$2])
- AC_MSG_RESULT(no)])
-
-CFLAGS=${save_CFLAGS}
-])
-
-dnl Configure script for doxygen
-dnl Vincent Torri 2006-05-11
-dnl
-dnl XCB_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN.
-dnl
-AC_DEFUN([XCB_CHECK_DOXYGEN],
-[
-DOXYGEN="doxygen"
-
-dnl
-dnl Disable the build of the documentation
-dnl
-AC_ARG_ENABLE(
- [build_docs],
- AC_HELP_STRING(
- [--disable-build-docs],
- [Disable the build of the documentation]),
- [if test x"$enableval" != x"yes" ; then
- enable_build_docs="no"
- else
- enable_build_docs="yes"
- fi],
- [enable_build_docs="yes"])
-
-if test "$enable_build_docs" = "no" ; then
- BUILD_DOCS=no
-else
-dnl
-dnl Get the prefix where doxygen is installed.
-dnl
-AC_ARG_WITH(
- [doxygen],
- AC_HELP_STRING(
- [--with-doxygen=FILE],
- [doxygen program to use (eg /usr/bin/doxygen)]),
- dnl
- dnl Check the given doxygen program.
- dnl
- [DOXYGEN=${withval}
- AC_CHECK_PROG(
- [BUILD_DOCS],
- [${DOXYGEN}],
- [yes],
- [no])
- if test $BUILD_DOCS = no; then
- echo "WARNING:"
- echo "The doxygen program you specified:"
- echo "$DOXYGEN"
- echo "was not found. Please check the path and make sure "
- echo "the program exists and is executable."
- AC_MSG_WARN(
- [Warning: no doxygen detected. Documentation will not be built])
- fi],
- [AC_CHECK_PROG(
- [BUILD_DOCS],
- [${DOXYGEN}],
- [yes],
- [no])
- if test ${BUILD_DOCS} = no; then
- echo "WARNING:"
- echo "The doxygen program was not found in your execute"
- echo "You may have doxygen installed somewhere not covered by your path."
- echo ""
- echo "If this is the case make sure you have the packages installed, AND"
- echo "that the doxygen program is in your execute path (see your"
- echo "shell manual page on setting the \$PATH environment variable), OR"
- echo "alternatively, specify the program to use with --with-doxygen."
- AC_MSG_WARN(
- [Warning: no doxygen detected. Documentation will not be built])
- fi])
- AC_PATH_PROG(DOT, dot, no)
- if test "$DOT" = "no"; then
- AC_MSG_WARN([Warning: no dot detected. Documentation will not be built])
- BUILD_DOCS="no"
- fi
-fi
-AC_MSG_CHECKING([whether documentation is built])
-AC_MSG_RESULT([${BUILD_DOCS}])
-
-dnl
-dnl Substitution
-dnl
-AC_SUBST([DOXYGEN])
-
-AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
-
-])
-
-dnl Detection and configuration of the visibility feature of gcc
-dnl Vincent Torri 2006-02-11
-dnl
-dnl XCB_EXTENSION(name, default)
-dnl set the X extension
-dnl
-AC_DEFUN([XCB_EXTENSION],
-[
-pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
-pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
-
-AC_ARG_ENABLE(DOWN,
- [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
- [BUILD_[]UP=$enableval],
- [BUILD_[]UP=$2])
-
-AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
-])
-
-dnl End of acinclude.m4
diff --git a/configure.ac b/configure.ac
index 1aff958..6c107bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,7 @@ AC_INIT([libxcb],
1.9,
[xcb at lists.freedesktop.org])
AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([xcb.pc.in])
# Initialize Automake
diff --git a/m4/xcb.m4 b/m4/xcb.m4
new file mode 100644
index 0000000..ad24bc2
--- /dev/null
+++ b/m4/xcb.m4
@@ -0,0 +1,142 @@
+dnl Detection and configuration of the visibility feature of gcc
+dnl Vincent Torri 2006-02-11
+dnl
+dnl XCB_CHECK_VISIBILITY([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Check the visibility feature of gcc
+dnl
+AC_DEFUN([XCB_CHECK_VISIBILITY],
+[
+AC_MSG_CHECKING([whether ${CC} supports symbol visibility])
+
+save_CFLAGS=${CFLAGS}
+CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#pragma GCC visibility push(hidden)
+extern void f(int);
+#pragma GCC visibility pop
+ ]],
+ [[]]
+ )],
+ [AC_DEFINE(
+ GCC_HAS_VISIBILITY,
+ [],
+ [Defined if GCC supports the visibility feature])
+ m4_if([$1], [], [:], [$1])
+ AC_MSG_RESULT(yes)],
+ [m4_if([$2], [], [:], [$2])
+ AC_MSG_RESULT(no)])
+
+CFLAGS=${save_CFLAGS}
+])
+
+dnl Configure script for doxygen
+dnl Vincent Torri 2006-05-11
+dnl
+dnl XCB_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN.
+dnl
+AC_DEFUN([XCB_CHECK_DOXYGEN],
+[
+DOXYGEN="doxygen"
+
+dnl
+dnl Disable the build of the documentation
+dnl
+AC_ARG_ENABLE(
+ [build_docs],
+ AC_HELP_STRING(
+ [--disable-build-docs],
+ [Disable the build of the documentation]),
+ [if test x"$enableval" != x"yes" ; then
+ enable_build_docs="no"
+ else
+ enable_build_docs="yes"
+ fi],
+ [enable_build_docs="yes"])
+
+if test "$enable_build_docs" = "no" ; then
+ BUILD_DOCS=no
+else
+dnl
+dnl Get the prefix where doxygen is installed.
+dnl
+AC_ARG_WITH(
+ [doxygen],
+ AC_HELP_STRING(
+ [--with-doxygen=FILE],
+ [doxygen program to use (eg /usr/bin/doxygen)]),
+ dnl
+ dnl Check the given doxygen program.
+ dnl
+ [DOXYGEN=${withval}
+ AC_CHECK_PROG(
+ [BUILD_DOCS],
+ [${DOXYGEN}],
+ [yes],
+ [no])
+ if test $BUILD_DOCS = no; then
+ echo "WARNING:"
+ echo "The doxygen program you specified:"
+ echo "$DOXYGEN"
+ echo "was not found. Please check the path and make sure "
+ echo "the program exists and is executable."
+ AC_MSG_WARN(
+ [Warning: no doxygen detected. Documentation will not be built])
+ fi],
+ [AC_CHECK_PROG(
+ [BUILD_DOCS],
+ [${DOXYGEN}],
+ [yes],
+ [no])
+ if test ${BUILD_DOCS} = no; then
+ echo "WARNING:"
+ echo "The doxygen program was not found in your execute"
+ echo "You may have doxygen installed somewhere not covered by your path."
+ echo ""
+ echo "If this is the case make sure you have the packages installed, AND"
+ echo "that the doxygen program is in your execute path (see your"
+ echo "shell manual page on setting the \$PATH environment variable), OR"
+ echo "alternatively, specify the program to use with --with-doxygen."
+ AC_MSG_WARN(
+ [Warning: no doxygen detected. Documentation will not be built])
+ fi])
+ AC_PATH_PROG(DOT, dot, no)
+ if test "$DOT" = "no"; then
+ AC_MSG_WARN([Warning: no dot detected. Documentation will not be built])
+ BUILD_DOCS="no"
+ fi
+fi
+AC_MSG_CHECKING([whether documentation is built])
+AC_MSG_RESULT([${BUILD_DOCS}])
+
+dnl
+dnl Substitution
+dnl
+AC_SUBST([DOXYGEN])
+
+AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
+
+])
+
+dnl Detection and configuration of the visibility feature of gcc
+dnl Vincent Torri 2006-02-11
+dnl
+dnl XCB_EXTENSION(name, default)
+dnl set the X extension
+dnl
+AC_DEFUN([XCB_EXTENSION],
+[
+pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
+pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
+
+AC_ARG_ENABLE(DOWN,
+ [AS_HELP_STRING([--enable-[]DOWN], [Build XCB $1 Extension (default: $2)])],
+ [BUILD_[]UP=$enableval],
+ [BUILD_[]UP=$2])
+
+AM_CONDITIONAL(BUILD_[]UP, [test "x$BUILD_[]UP" = "xyes"])
+])
+
+dnl End of acinclude.m4
commit 6746ab1549d34a146c8383ed5acdabf0d48c1889
Author: Daniel Martin <consume.noise at gmail.com>
Date: Wed Jul 24 14:13:41 2013 +0200
Use build-aux as autom4te cache directory
Remove the generated directory ./autom4te.cache by reusing ./build-aux
as cache directory.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/.autom4te.cfg b/.autom4te.cfg
new file mode 100644
index 0000000..36e4354
--- /dev/null
+++ b/.autom4te.cfg
@@ -0,0 +1,3 @@
+begin-language: "Autoconf-without-aclocal-m4"
+args: --cache=build-aux
+end-language: "Autoconf-without-aclocal-m4"
diff --git a/.gitignore b/.gitignore
index 62cd76e..046e7f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
aclocal.m4
-autom4te.cache
build-aux
libtool
mkinstalldirs
commit b6d8c8fe61f25e4eb7b43d3d9b1de81a1f0638a3
Author: Daniel Martin <consume.noise at gmail.com>
Date: Wed Jul 24 14:08:38 2013 +0200
Set AC_CONFIG_AUX_DIR to build-aux
Do not clutter the project directory with generated/copied auxiliary
files, save them in ./build-aux.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/.gitignore b/.gitignore
index a922ee4..62cd76e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,18 +1,12 @@
aclocal.m4
autom4te.cache
-compile
-depcomp
-install-sh
+build-aux
libtool
-ltmain.sh
-missing
mkinstalldirs
-config.guess
config.h
config.h.in
config.log
config.status
-config.sub
configure
configure.lineno
.deps
diff --git a/configure.ac b/configure.ac
index 75af4ea..1aff958 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@ AC_PREREQ([2.60])
AC_INIT([libxcb],
1.9,
[xcb at lists.freedesktop.org])
+AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([xcb.pc.in])
# Initialize Automake
commit e3b34ad346efcaf0fd28b95e68d99388276802bc
Author: Daniel Martin <consume.noise at gmail.com>
Date: Wed Jul 24 19:22:44 2013 +0200
Remove second AC_PREREQ, require version 2.60
Remove a second AC_PREREQ and bump the required autoconf version to
2.60.
Version 2.59c was a testing release, published in April 2006. Version
2.60 was the stable release afterwards, released in June 2006.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/configure.ac b/configure.ac
index 3ad5f7b..75af4ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
# Initialize Autoconf
-AC_PREREQ(2.57)
+AC_PREREQ([2.60])
AC_INIT([libxcb],
1.9,
[xcb at lists.freedesktop.org])
@@ -138,13 +138,6 @@ AC_SUBST(CWARNFLAGS)
XCB_CHECK_VISIBILITY()
-# htmldir is not defined prior to autoconf 2.59c, so on earlier versions
-# set an equivalent value.
-AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
- ['${datadir}/doc/${PACKAGE_TARNAME}'],
- ['${datadir}/doc/${PACKAGE}'])
-])])
-
XCB_CHECK_DOXYGEN()
AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE(HAVE_GETADDRINFO, 1, [getaddrinfo() function is available])], )
commit 50fb3a6312dd0b6b613fc886ffd6827952d1e286
Author: Daniel Martin <consume.noise at gmail.com>
Date: Wed Jul 24 12:51:04 2013 +0200
Initialize automake earlier (bugfix for #66413)
This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66413
Bug 66413 - libxcb 1.9.1: Fails to build on Arch Linux: \
/home/<user>/install-sh: No such file or directory
Without that patch the search path for `install-sh` will become $HOME
and the `install` target will fail, when DESTDIR doesn't exist in
advance. (occured with automake 1.14 and autoconf 2.69)
Initial patch by: Alain Kalker <a.c.kalker at gmail.com>
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
Reviewed-by: Uli Schlachter <psychon at znc.in>
Tested-By: Ran Benita <ran234 at gmail.com>
diff --git a/configure.ac b/configure.ac
index 72bd4f0..3ad5f7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,15 +7,16 @@ AC_INIT([libxcb],
1.9,
[xcb at lists.freedesktop.org])
AC_CONFIG_SRCDIR([xcb.pc.in])
-# Set common system defines for POSIX extensions, such as _GNU_SOURCE
-# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
-# to avoid autoconf errors.
-AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+# Set common system defines for POSIX extensions, such as _GNU_SOURCE
+# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
+# to avoid autoconf errors.
+AC_USE_SYSTEM_EXTENSIONS
+
AM_PATH_PYTHON([2.6])
PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
commit dd01db570c34dd3e2e0f5d07b8d40c837fa51057
Author: Daniel Martin <consume.noise at gmail.com>
Date: Mon Dec 31 11:57:49 2012 +0100
Make xsltproc optional
Fix Bug 23863 - xcb still checks for xsltproc:
https://bugs.freedesktop.org/show_bug.cgi?id=23863
xsltproc is used to generate the optional html page for `check` results,
only. So, it's not a hard build dependency.
Additionally, use yes/no instead of true/false in the HTML_CHECK_RESULT
variable for consistent output after a configure run.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Josh Triplett <josh at joshtriplett.org>
diff --git a/configure.ac b/configure.ac
index 482f85b..72bd4f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,15 +27,12 @@ AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_PROG_CC
-AC_PATH_PROG(XSLTPROC, xsltproc, no)
-if test "$XSLTPROC" = "no"; then
- AC_MSG_ERROR([XCB requires xsltproc.])
-fi
-
-HTML_CHECK_RESULT=false
+XSLTPROC=no
+HTML_CHECK_RESULT=no
if test x"$HAVE_CHECK" = xyes; then
+ AC_PATH_PROG(XSLTPROC, xsltproc, no)
if test x"$XSLTPROC" != xno; then
- HTML_CHECK_RESULT=true
+ HTML_CHECK_RESULT=yes
fi
fi
AC_SUBST(HTML_CHECK_RESULT)
@@ -258,6 +255,7 @@ echo ""
echo " Configuration"
echo " XDM support.........: ${have_xdmcp}"
echo " Build unit tests....: ${HAVE_CHECK}"
+echo " with html results.: ${HTML_CHECK_RESULT}"
echo " XCB buffer size.....: ${xcb_queue_buffer_size}"
echo ""
echo " X11 extensions"
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 20bdc72..ceef722 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,7 +14,7 @@ check_all_SOURCES = check_all.c check_suites.h check_public.c
check-local: check-TESTS
$(RM) CheckLog.html
- if test x$(HTML_CHECK_RESULT) = xtrue; then \
+ if test x$(HTML_CHECK_RESULT) = xyes; then \
$(XSLTPROC) $(srcdir)/CheckLog.xsl CheckLog*.xml > CheckLog.html; \
else \
touch CheckLog.html; \
commit 0289348f2c4ed3b1b286c51df19d82c6787c2b36
Author: Daniel Martin <consume.noise at gmail.com>
Date: Fri Dec 28 23:25:16 2012 +0100
c_client.py: Do not create pointers in unions
Do not create pointers in unions for fields of variadic length.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Ran Benita <ran234 at gmail.com>
diff --git a/src/c_client.py b/src/c_client.py
index 2aba741..a6f8edd 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1787,12 +1787,12 @@ def _c_complex(self):
for field in struct_fields:
length = len(field.c_field_type)
# account for '*' pointer_spec
- if not field.type.fixed_size():
+ if not field.type.fixed_size() and not self.is_union:
length += 1
maxtypelen = max(maxtypelen, length)
def _c_complex_field(self, field, space=''):
- if (field.type.fixed_size() or
+ if (field.type.fixed_size() or self.is_union or
# in case of switch with switch children, don't make the field a pointer
# necessary for unserialize to work
(self.is_switch and field.type.is_switch)):
commit b9efd2a09a45616f6238e4da49b8f2127b6ec6d9
Author: Daniel Martin <consume.noise at gmail.com>
Date: Wed Jan 9 12:52:15 2013 +0100
c_client.py: Always initialize xcb_align_to
to get rid of:
warning: 'xcb_align_to' may be used uninitialized in this function
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
Reviewed-by: Peter Harris <pharris at opentext.com>
diff --git a/src/c_client.py b/src/c_client.py
index c477bab..2aba741 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1132,11 +1132,11 @@ def _c_serialize(context, self):
_c(' %s *xcb_out = *_buffer;', self.c_type)
_c(' unsigned int xcb_out_pad = -sizeof(%s) & 3;', self.c_type)
_c(' unsigned int xcb_buffer_len = sizeof(%s) + xcb_out_pad;', self.c_type)
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
else:
_c(' char *xcb_out = *_buffer;')
_c(' unsigned int xcb_buffer_len = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
prefix = [('_aux', '->', self)]
aux_ptr = 'xcb_out'
@@ -1159,7 +1159,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_buffer_len = 0;')
_c(' unsigned int xcb_block_len = 0;')
_c(' unsigned int xcb_pad = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
elif 'sizeof' == context:
param_names = [p[2] for p in params]
@@ -1204,7 +1204,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_buffer_len = 0;')
_c(' unsigned int xcb_block_len = 0;')
_c(' unsigned int xcb_pad = 0;')
- _c(' unsigned int xcb_align_to;')
+ _c(' unsigned int xcb_align_to = 0;')
_c('')
for t in temp_vars:
More information about the xcb-commit
mailing list