summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-05-27 00:10:30 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-05-27 00:10:30 -0400
commit81e8aa0f6a4eeedde2415629e2a27330deeaf8dc (patch)
tree6d18ed0c128499b5787f8dfaf9069960c520dd1d
parentbff4258fcd13dfa9ab692e3a88c001c770582dc5 (diff)
Depend on external libffi; fix bugs in array macros
-rw-r--r--Makefile.am13
-rw-r--r--dbus.c5
-rw-r--r--libnul.h79
-rw-r--r--prefix-test.c7
4 files changed, 55 insertions, 49 deletions
diff --git a/Makefile.am b/Makefile.am
index 6d3d9a9..3ea924c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = libnul.la
-AM_CFLAGS=-Ilibffi/include @DEP_CFLAGS@
+AM_CFLAGS=@DEP_CFLAGS@
libnul_la_SOURCES = \
invoke.c \
@@ -16,16 +16,7 @@ libnul_la_SOURCES = \
file-utils.c \
libnul.h
-clean-local:
- cd libffi && $(MAKE) $(AM_MAKEFLAGS) clean
-distclean-local:
- cd libffi && $(MAKE) $(AM_MAKEFLAGS) distclean
-mostlyclean-local:
- cd libffi && $(MAKE) $(AM_MAKEFLAGS) mostlyclean
-libffi/libffi_convenience.la:
- cd libffi && $(MAKE) $(AM_MAKEFLAGS) all
-
-libnul_la_LIBADD = @DEP_LIBS@ libffi/libffi_convenience.la
+libnul_la_LIBADD = @DEP_LIBS@
libnul_la_LDFLAGS = -no-undefined
diff --git a/dbus.c b/dbus.c
index eaef12f..191c2f1 100644
--- a/dbus.c
+++ b/dbus.c
@@ -726,10 +726,15 @@ nul_dbus_method (const char *name,
member->n_inputs = 0;
member->n_outputs = 0;
+ g_print ("first \n");
for (p = member->parameters; *p; ++p)
{
nul_dbus_parameter_t *par = *p;
+ g_print ("reading %p\n", p);
+ g_print ("asdf \n");
+ g_print ("%s\n", par->name);
+
g_assert (*p != NULL);
g_assert (par != NULL);
diff --git a/libnul.h b/libnul.h
index 29f068e..f3b7665 100644
--- a/libnul.h
+++ b/libnul.h
@@ -458,28 +458,31 @@ nul_bool_t elf_file_owns_symbol (elf_file_t *parser,
((type *)nul_garray_new(sizeof(type)))
#define _nul_array_append_impl(array,value) \
- ((typeof (array)) \
- nul_garray_append(array, ({ \
- typeof (value) __nul_temp = value; \
- _NUL_TYPE_CHECK_ARRAY(array,value); \
- &__nul_temp; \
- })))
+ ({ typeof (value) __nul_temp = value; \
+ ((typeof (array)) \
+ nul_garray_append(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(array,value); \
+ &__nul_temp; \
+ }))); \
+ })
#define _nul_array_remove_impl(array,value) \
- ((typeof (array)) \
- nul_garray_remove(array, ({ \
- typeof (value) __nul_temp = (value); \
- _NUL_TYPE_CHECK_ARRAY(array,value); \
- &__nul_temp; \
- })))
+ ({ typeof (value) __nul_temp = value; \
+ ((typeof (array)) \
+ nul_garray_remove(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(array,value); \
+ &__nul_temp; \
+ }))); \
+ })
#define _nul_array_remove_fast_impl(array,value) \
- ((typeof (array)) \
- nul_garray_remove_fast(array, ({ \
- typeof (value) __nul_temp = (value); \
- _NUL_TYPE_CHECK_ARRAY(array,value); \
- &__nul_temp; \
- })))
+ ({ typeof (value) __nul_temp = value; \
+ ((typeof (array)) \
+ nul_garray_remove_fast(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(array,value); \
+ &__nul_temp; \
+ }))); \
+ })
/* Prefix arrays */
@@ -489,27 +492,31 @@ nul_bool_t elf_file_owns_symbol (elf_file_t *parser,
NUL_STRUCT_OFFSET(type,member)))
#define _nul_prefix_array_append_impl(array,member,value) \
- ((typeof (array)) \
- nul_garray_append(array, ({ \
- typeof (value) __nul_temp = (value); \
- _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)); \
- &__nul_temp; \
- })))
-#define _nul_prefix_array_remove_impl(array,member,value) \
- ((typeof (array)) \
- nul_garray_remove(array, ({ \
- typeof (value) __nul_temp = (value); \
- _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)) \
+ ({ typeof (value) __nul_temp = (value); \
+ ((typeof (array)) \
+ nul_garray_append(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)); \
&__nul_temp; \
- })))
+ }))); \
+ })
+
+#define _nul_prefix_array_remove_impl(array,member,value) \
+ ({ typeof (value) __nul_temp = (value); \
+ ((typeof (array)) \
+ nul_garray_remove(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)) \
+ &__nul_temp; \
+ }))); \
+ })
#define _nul_prefix_array_remove_fast_impl(array,member,value) \
- ((typeof (array)) \
- nul_garray_remove_fast(array, ({ \
- typeof (value) __nul_temp = (value); \
- _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)) \
- &__nul_temp; \
- })))
+ ({ typeof (value) __nul_temp = (value); \
+ ((typeof (array)) \
+ nul_garray_remove_fast(array, ({ \
+ _NUL_TYPE_CHECK_ARRAY(&((array)->member)[0], (value)) \
+ &__nul_temp; \
+ }))); \
+ })
#define _nul_prefix_array_len_impl(array,member) \
({ (void)((array)->member); \
diff --git a/prefix-test.c b/prefix-test.c
index ca1659d..9c5df1d 100644
--- a/prefix-test.c
+++ b/prefix-test.c
@@ -23,10 +23,13 @@ main (void)
prefixed->b = 0xbbbbbbbb;
prefixed->x = "HI!";
- is = nul_array_append (is, i);
-
+ is = nul_array_append (is, 2334);
+
for (i = 0; i < 128; ++i)
+ {
prefixed = nul_prefix_array_append (prefixed, data, i);
+ printf ("%d\n", prefixed->data[i]);
+ }
for (i = 0; i < nul_garray_len (prefixed); ++i)
printf ("%d\n", prefixed->data[i]);