Hi,

On Sun, Dec 07, 2008 at 03:47:26PM -0500, Davin Flatten wrote:
> Hello-
> 
> Let me preface this post saying I am not a C programming expert.  I am
> working on setting up an environment to do some pacemaker GUI development.
> I am using the tip of the Heartbeat dev Mercurial repository.  My platform
> is CentOS 5.2.
> 
> There seems to be a pointer definition inconsistancy in the pils library
> that is causing warnings on the build, and thus errors.  It seems that the
> definition of PILPluginImportSet using g_malloc when the PILPluginImports
> defintion using the standard alloc definition.  This is also true for the
> mrealloc definition below.
> 
> I changed the defintions to use the glib2.0 format and that fixed the
> problem, but I am unsure if this might break builds on other platforms.
> Either way attached is the diff of the changes I made if you wish to apply
> them.
> 
> P.S. A warning/error is also created by tools/send_arp.linux.c by not
> declaring const on the char *device="eth0" declaration.

The patch you supplied didn't work on opensuse 11.0. Could you
try the one attached here.

Thanks,

Dejan

> Thanks!
> Davin Flatten


> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

diff -r f343aa2db1a4 include/pils/plugin.h.in
--- a/include/pils/plugin.h.in	Wed Dec 10 17:25:09 2008 +0100
+++ b/include/pils/plugin.h.in	Wed Dec 10 21:52:11 2008 +0100
@@ -442,9 +442,9 @@
 	,	void*	plugin_private);
 
 	void	(*log)	(PILLogLevel priority, const char * fmt, ...);
-	void*	(*alloc)(size_t size);
-	void*	(*mrealloc)(void * ptr, size_t size);
-	void	(*mfree)(void* space);
+	gpointer (*alloc)(gsize size);
+	gpointer (*mrealloc)(gpointer space, gsize size);
+	void	(*mfree)(gpointer space);
 	char*	(*mstrdup)(const char *s);
 };
 
@@ -465,8 +465,8 @@
 
 /* Change memory allocation functions right after creating universe */
 void PilPluginUnivSetMemalloc(PILPluginUniv*
-,	void*	(*alloc)(size_t size)
-,	void*	(*mrealloc)(void *, size_t size)
+,	gpointer (*alloc)(gsize size)
+,	gpointer (*mrealloc)(gpointer, gsize size)
 ,	void	(*mfree)(void* space)
 ,	char*	(*mstrdup)(const char *s));
 
diff -r f343aa2db1a4 lib/pils/pils.c
--- a/lib/pils/pils.c	Wed Dec 10 17:25:09 2008 +0100
+++ b/lib/pils/pils.c	Wed Dec 10 21:52:11 2008 +0100
@@ -492,8 +492,8 @@
 /* Change memory allocation functions immediately  after creating universe */
 void
 PilPluginUnivSetMemalloc(PILPluginUniv* u
-,	void*	(*allocfun)(size_t size)
-,	void*	(*reallocfun)(void * ptr, size_t size)
+,	gpointer	(*allocfun)(gsize size)
+,	gpointer 	(*reallocfun)(gpointer ptr, gsize size)
 ,	void	(*freefun)(void* space)
 ,	char*	(*strdupfun)(const char *s))
 {
diff -r f343aa2db1a4 tools/send_arp.linux.c
--- a/tools/send_arp.linux.c	Wed Dec 10 17:25:09 2008 +0100
+++ b/tools/send_arp.linux.c	Wed Dec 10 21:52:11 2008 +0100
@@ -35,7 +35,7 @@
 static void usage(void) __attribute__((noreturn));
 
 int quit_on_reply=0;
-char *device = NULL;
+const char *device = NULL;
 int ifindex;
 char *source;
 struct in_addr src, dst;
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to