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

[XaraXtreme-dev] Patch for warnings (1)



On Gentoo linux PPC (GCC4.1.1) I get several warnings where a struct
has itself an aggregate member and isnitialised by assignment.

This patch shows the problem.

Ben
Index: Kernel/colcontx.cpp
===================================================================
--- Kernel/colcontx.cpp	(revision 1401)
+++ Kernel/colcontx.cpp	(working copy)
@@ -152,10 +152,10 @@ CC_IMPLEMENT_MEMDUMP(ColourContextGreyT,
 
 ColourContextArray ColourContext::GlobalDefaultContext = 
 {
+	{ NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL
+	NULL, NULL, NULL, NULL }
 };
 
 
Index: wxOil/colourmat.cpp
===================================================================
--- wxOil/colourmat.cpp	(revision 1401)
+++ wxOil/colourmat.cpp	(working copy)
@@ -163,11 +163,11 @@ ColourMatrix ColourMatrix::Boost(double 
 	{
 		double cc = (1.0-d)/2.0; // Add constant boost to centre colour change
 		elements_t e = {
-			d,   0.0, 0.0, 0.0, 0.0,
+			{ d,   0.0, 0.0, 0.0, 0.0,
 			0.0, d,   0.0, 0.0, 0.0,
 			0.0, 0.0, d,   0.0, 0.0,
 			0.0, 0.0, 0.0, 1.0, 0.0,
-			cc,  cc,  cc,  0.0, 1.0
+			cc,  cc,  cc,  0.0, 1.0 }
 			};
 		r.elements = e;
 	}
@@ -194,11 +194,11 @@ ColourMatrix ColourMatrix::Whiten()
 {
 	ColourMatrix r;
 	elements_t e = {
-		0.0, 0.0, 0.0, 0.0, 0.0,
+		{ 0.0, 0.0, 0.0, 0.0, 0.0,
 		0.0, 0.0, 0.0, 0.0, 0.0,
 		0.0, 0.0, 0.0, 0.0, 0.0,
 		0.0, 0.0, 0.0, 1.0, 0.0,
-		1.0, 1.0, 1.0, 0.0, 1.0
+		1.0, 1.0, 1.0, 0.0, 1.0 }
 		};
 	r.elements=e;
 	return r;
@@ -224,11 +224,11 @@ ColourMatrix ColourMatrix::Grey()
 {
 	ColourMatrix r;
 	elements_t e = {
-		0.1, 0.1, 0.1, 0.0, 0.0,
+		{ 0.1, 0.1, 0.1, 0.0, 0.0,
 		0.1, 0.1, 0.1, 0.0, 0.0,
 		0.1, 0.1, 0.1, 0.0, 0.0,
 		0.0, 0.0, 0.0, 1.0, 0.0,
-		0.6, 0.6, 0.6, 0.0, 1.0
+		0.6, 0.6, 0.6, 0.0, 1.0 }
 		};
 	r.elements=e;
 	return r;
Index: wxOil/grndrgn.cpp
===================================================================
--- wxOil/grndrgn.cpp	(revision 1401)
+++ wxOil/grndrgn.cpp	(working copy)
@@ -6835,7 +6835,7 @@ INT32 GRenderRegion::StrokePathToPath(
 	CapStyles CapS = (LineCaps==LineCapButt) ? CAPS_BUTT : (LineCaps==LineCapRound) ? CAPS_ROUND : CAPS_SQUARE;
 	JoinStyles JoinS = (LineJoin==MitreJoin) ? JOIN_MITER :	(LineJoin==RoundJoin) ? JOIN_ROUND : JOIN_BEVEL;
 
-	DASH GDash = { 0, 0, 0 };
+	DASH GDash = { 0, 0, { 0 } };
 
 	if(Dash)
 		memcpy(&GDash,Dash,sizeof(GDash));