[oe-commits] Khem Raj : cluster-glue_1.0.5.bb: Fix compilation w.r.t. using constant cast using gcc 4.5

git version control git at git.openembedded.org
Wed Oct 27 01:24:19 UTC 2010


Module: openembedded.git
Branch: master
Commit: b3125ddae3c5466f0f73ad1a68ec00825204b2ee
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=b3125ddae3c5466f0f73ad1a68ec00825204b2ee

Author: Khem Raj <raj.khem at gmail.com>
Date:   Tue Oct 26 14:02:03 2010 -0700

cluster-glue_1.0.5.bb: Fix compilation w.r.t. using constant cast using gcc 4.5

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 recipes/linux-ha/cluster-glue/fix-const-cast.patch |   99 +++++++++++++++++++-
 recipes/linux-ha/cluster-glue_1.0.5.bb             |    2 +-
 2 files changed, 97 insertions(+), 4 deletions(-)

diff --git a/recipes/linux-ha/cluster-glue/fix-const-cast.patch b/recipes/linux-ha/cluster-glue/fix-const-cast.patch
index 6532caa..b913db2 100644
--- a/recipes/linux-ha/cluster-glue/fix-const-cast.patch
+++ b/recipes/linux-ha/cluster-glue/fix-const-cast.patch
@@ -2,6 +2,7 @@ This patch gets rid of new warning introduced with gcc 4.5
 Warning is explained here
 http://gcc.gnu.org/viewcvs/trunk/gcc/doc/invoke.texi?r1=148037&r2=148053&diff_format=h
 
+-Khem
 
 Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/apcsmart.c
 ===================================================================
@@ -15,13 +16,105 @@ Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/apcsmart.c
  static char **
  apcsmart_hostlist(StonithPlugin * s)
  {
-@@ -719,7 +718,8 @@ apcsmart_hostlist(StonithPlugin * s)
+@@ -719,7 +718,7 @@ apcsmart_hostlist(StonithPlugin * s)
  	}
  	ERRIFNOTCONFIGED(s,NULL);
  
 -	return OurImports->CopyHostList((const char **)ad->hostlist);
-+/*	return OurImports->CopyHostList((const char **)(ad->hostlist));*/
-+	return OurImports->CopyHostList((__extension__(union {char ** a; const char** b;})(ad->hostlist)).b);
++	return OurImports->CopyHostList(CONST_CAST(ad->hostlist));
  }
  
  static gboolean
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/external.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/external.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/external.c
+@@ -539,8 +539,7 @@ external_get_confignames(StonithPlugin*
+ 		free(files);
+ 		sd->confignames[dircount] = NULL;
+ 	}
+-
+-	return (const char **)sd->confignames;
++	return CONST_CAST(sd->confignames);
+ }
+ 
+ /*
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/rhcs.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/rhcs.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/rhcs.c
+@@ -702,8 +702,7 @@ rhcs_get_confignames(StonithPlugin* p)
+ 		free(files);
+ 		sd->confignames[dircount] = NULL;
+ 	}
+-
+-	return (const char **)sd->confignames;
++	return CONST_CAST(sd->confignames);
+ }
+ 
+ /*
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/meatware.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/meatware.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/meatware.c
+@@ -136,7 +136,7 @@ meatware_hostlist(StonithPlugin  *s)
+ 		return(NULL);
+ 	}
+ 
+-	return OurImports->CopyHostList((const char **)nd->hostlist);
++	return OurImports->CopyHostList(CONST_CAST(nd->hostlist));
+ }
+ 
+ /*
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/null.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/null.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/null.c
+@@ -126,7 +126,7 @@ null_hostlist(StonithPlugin  *s)
+ 	struct pluginDevice*	nd = (struct pluginDevice*)s;
+ 
+ 	ERRIFWRONGDEV(s, NULL);
+-	return OurImports->CopyHostList((const char**)nd->hostlist);
++	return OurImports->CopyHostList(CONST_CAST(nd->hostlist));
+ }
+ 
+ 
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/rcd_serial.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/rcd_serial.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/rcd_serial.c
+@@ -347,7 +347,7 @@ rcd_serial_hostlist(StonithPlugin  *s)
+ 		return(NULL);
+ 	}
+ 
+-	return OurImports->CopyHostList((const char **)rcd->hostlist);
++	return OurImports->CopyHostList(CONST_CAST(rcd->hostlist));
+ }
+ 
+ /*
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/ssh.c
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/ssh.c
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/ssh.c
+@@ -161,7 +161,7 @@ ssh_hostlist(StonithPlugin  *s)
+ 		return(NULL);
+ 	}
+ 
+-	return OurImports->CopyHostList((const char **)sd->hostlist);
++	return OurImports->CopyHostList(CONST_CAST(sd->hostlist));
+ }
+ 
+ 
+Index: Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/stonith_plugin_common.h
+===================================================================
+--- Reusable-Cluster-Components-glue-1.0.5.orig/lib/plugins/stonith/stonith_plugin_common.h
++++ Reusable-Cluster-Components-glue-1.0.5/lib/plugins/stonith/stonith_plugin_common.h
+@@ -123,5 +123,8 @@
+     return; \
+   }
+ 
++#define CONST_CAST(s) \
++    (__extension__(union {char ** a; const char** b;})(s)).b
++
+ #endif
+ 
diff --git a/recipes/linux-ha/cluster-glue_1.0.5.bb b/recipes/linux-ha/cluster-glue_1.0.5.bb
index 7207a63..b4d5c59 100644
--- a/recipes/linux-ha/cluster-glue_1.0.5.bb
+++ b/recipes/linux-ha/cluster-glue_1.0.5.bb
@@ -6,7 +6,7 @@ is not the cluster messaging layer (Heartbeat), nor the cluster resource manager
 LICENSE = "GPL"
 DEPENDS = "libxml2 libtool glib-2.0 bzip2 util-linux-ng"
 
-PR = "r2"
+PR = "r3"
 
 SRC_URI = " \
 	http://hg.linux-ha.org/glue/archive/glue-${PV}.tar.bz2;name=tar \





More information about the Openembedded-commits mailing list