r15103 by fschmid - Removed a bunch of warnings when compiling in "Release" mode.

scribus-commit scribus-commit at lists.scribus.net
Mon May 24 12:31:11 CEST 2010


Revision: 15103
Author: fschmid
Date: 2010-05-24T10:24:11.087263Z
Commit message: Removed a bunch of warnings when compiling in "Release" mode.

Changeset: 
M  /trunk/Scribus/scribus/pdflib_core.cpp
M  /trunk/Scribus/scribus/scimage.cpp
M  /trunk/Scribus/scribus/scpainter.cpp
M  /trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
M  /trunk/Scribus/scribus/hyphen.c
M  /trunk/Scribus/scribus/scribusXml.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/pdf_analyzer.cpp
M  /trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
M  /trunk/Scribus/scribus/scimgdataloader_pict.cpp
M  /trunk/Scribus/scribus/ui/gradientmanager.cpp

Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp	(revision 15102)
+++ scribus/pdflib_core.cpp	(revision 15103)
@@ -6220,13 +6220,15 @@
 {
 	QStack<PageItem*> groupStack;
 	QString tmp2 = "", tmpOut;
-	ScPattern *pat;
+	ScPattern *pat = NULL;
 	if (kind == 0)
 		pat = &doc.docPatterns[currItem->pattern()];
 	else if (kind == 1)
 		pat = &doc.docPatterns[currItem->strokePattern()];
 	else if (kind == 2)
 		pat = &doc.docPatterns[currItem->patternMask()];
+	else
+		return false;
 	for (int em = 0; em < pat->items.count(); ++em)
 	{
 		PageItem* item = pat->items.at(em);
Index: scribus/scimgdataloader_pict.cpp
===================================================================
--- scribus/scimgdataloader_pict.cpp	(revision 15102)
+++ scribus/scimgdataloader_pict.cpp	(revision 15103)
@@ -1343,7 +1343,9 @@
 					QRgb *q = (QRgb*)(image.scanLine(rr));
 					for (uint xx = 0; xx < (uint) pixCols; xx++)
 					{
-						uchar r, g, b;
+						uchar r = 0;
+						uchar g = 0;
+						uchar b = 0;
 						uchar a = 255;
 						if (component_count == 3)
 						{
Index: scribus/scribusXml.cpp
===================================================================
--- scribus/scribusXml.cpp	(revision 15102)
+++ scribus/scribusXml.cpp	(revision 15103)
@@ -1308,17 +1308,17 @@
 	QString currentView;
 	QString gradName;
 	QString StrokePattern;
-	double patternScaleXS;
-	double patternScaleYS;
-	double patternOffsetXS;
-	double patternOffsetYS;
-	double patternRotationS;
-	double patternSkewXS;
-	double patternSkewYS;
-	double patternSpace;
-	bool patternMirrorX;
-	bool patternMirrorY;
-	bool atPath;
+	double patternScaleXS = 1.0;
+	double patternScaleYS = 1.0;
+	double patternOffsetXS = 0.0;
+	double patternOffsetYS = 0.0;
+	double patternRotationS = 0.0;
+	double patternSkewXS = 0.0;
+	double patternSkewYS = 0.0;
+	double patternSpace = 0.0;
+	bool patternMirrorX = false;
+	bool patternMirrorY = false;
+	bool atPath = false;
 	QString gradNameS;
 	QString gradNameM;
 	while(!sReader.atEnd() && !sReader.hasError())
@@ -1793,17 +1793,17 @@
 	QString inlineImageExt;
 	QString gradName;
 	QString StrokePattern;
-	double patternScaleXS;
-	double patternScaleYS;
-	double patternOffsetXS;
-	double patternOffsetYS;
-	double patternRotationS;
-	double patternSkewXS;
-	double patternSkewYS;
-	double patternSpace;
-	bool patternMirrorXS;
-	bool patternMirrorYS;
-	bool atPath;
+	double patternScaleXS = 1.0;
+	double patternScaleYS = 1.0;
+	double patternOffsetXS = 0.0;
+	double patternOffsetYS = 0.0;
+	double patternRotationS = 0.0;
+	double patternSkewXS = 0.0;
+	double patternSkewYS = 0.0;
+	double patternSpace = 0.0;
+	bool patternMirrorXS = false;
+	bool patternMirrorYS = false;
+	bool atPath = false;
 	QString gradNameS;
 	QString gradNameM;
 	int lowResType = 1;
Index: scribus/pdf_analyzer.cpp
===================================================================
--- scribus/pdf_analyzer.cpp	(revision 15102)
+++ scribus/pdf_analyzer.cpp	(revision 15103)
@@ -272,7 +272,7 @@
 					{
 					currGS.dashPattern.first.clear();
 					PdfArray dashArr = args[0].GetArray();
-					for (int i=0; i<dashArr.size(); ++i)
+					for (uint i=0; i<dashArr.size(); ++i)
 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
 					currGS.dashPattern.second = args[0].GetNumber();
 					}
@@ -689,7 +689,7 @@
 	{
 		PdfArray arr = bmObj->GetArray();
 		currGS.blendModes.clear();
-		for(int i=0; i<arr.GetSize(); ++i)
+		for(uint i=0; i<arr.GetSize(); ++i)
 			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
 			hasTransparency = true;
@@ -745,7 +745,7 @@
 	{
 		PdfArray dashArr = dObj->GetArray()[0];
 		currGS.dashPattern.first.clear();
-		for (int i=0; i<dashArr.GetSize(); ++i)
+		for (uint i=0; i<dashArr.GetSize(); ++i)
 			currGS.dashPattern.first.append(dashArr[i].GetNumber());
 		currGS.dashPattern.second = dObj->GetArray()[1].GetNumber();
 	}
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp	(revision 15102)
+++ scribus/scpainter.cpp	(revision 15103)
@@ -1344,11 +1344,11 @@
 		}
 		else if (fillMode == 2)
 		{
-			cairo_pattern_t *pat;
-			cairo_surface_t *img;
-			cairo_t *cr;
+			cairo_pattern_t *pat = NULL;
+			cairo_surface_t *img = NULL;
+			cairo_t *cr = NULL;
 #ifdef HAVE_PRIVATE_CAIRO
-			cairo_pattern_t *mpat;
+			cairo_pattern_t *mpat = NULL;
 #endif
 			if (fill_gradient.type() == VGradient::fourcolor)
 			{
Index: scribus/scimage.cpp
===================================================================
--- scribus/scimage.cpp	(revision 15102)
+++ scribus/scimage.cpp	(revision 15103)
@@ -2528,6 +2528,8 @@
 				// imgInfo = pDataLoader->imageInfoRecord();
 			}
 			break;
+		default:	// just to silence compiler
+			break;
 		}
 	}
 //	if (((reqType == CMYKData) || ((reqType == RawData) && isCMYK)) && !bilevel)
Index: scribus/ui/gradientmanager.cpp
===================================================================
--- scribus/ui/gradientmanager.cpp	(revision 15102)
+++ scribus/ui/gradientmanager.cpp	(revision 15103)
@@ -233,7 +233,11 @@
 		int numEntrys = 0;
 		int entryCount = 0;
 		int stopCount = 0;
-		double left, middle, right, r0, g0, b0, a0, r1, g1, b1, a1, oldr1, oldg1, oldb1, olda1;
+		double left, middle, right, r0, g0, b0, a0, r1, g1, b1, a1;
+		double oldr1 = 0.0;
+		double oldg1 = 0.0;
+		double oldb1 = 0.0;
+		double olda1 = 0.0;
 		tmp = ts.readLine();
 		if (tmp.startsWith("GIMP Gradient"))
 		{
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 15102)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 15103)
@@ -2464,6 +2464,7 @@
 		if (pagenr > -2) 
 			currItem->OwnPage = pagenr;
 		break;
+	case PageItem::Symbol:
 	case PageItem::Multiple:
 		Q_ASSERT(false);
 		break;
Index: scribus/plugins/import/pct/importpct.cpp
===================================================================
--- scribus/plugins/import/pct/importpct.cpp	(revision 15102)
+++ scribus/plugins/import/pct/importpct.cpp	(revision 15103)
@@ -1863,7 +1863,9 @@
 					QRgb *q = (QRgb*)(image.scanLine(rr));
 					for (uint xx = 0; xx < (uint) pixCols; xx++)
 					{
-						uchar r, g, b;
+						uchar r = 0;
+						uchar g = 0;
+						uchar b = 0;
 						uchar a = 255;
 						if (component_count == 3)
 						{
Index: scribus/plugins/import/xar/importxar.cpp
===================================================================
--- scribus/plugins/import/xar/importxar.cpp	(revision 15102)
+++ scribus/plugins/import/xar/importxar.cpp	(revision 15103)
@@ -2872,7 +2872,7 @@
 
 void XarPlug::createPolygonItem(int type)
 {
-	int z;
+	int z = -1;
 	XarStyle *gc = m_gc.top();
 	if (type == 0)
 		z = m_Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, CommonStrings::None, gc->StrokeCol, true);
@@ -2880,12 +2880,14 @@
 		z = m_Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, gc->FillCol, CommonStrings::None, true);
 	else if (type == 2)
 		z = m_Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, true);
+	else
+		return;
 	finishItem(z);
 }
 
 void XarPlug::createPolylineItem(int type)
 {
-	int z;
+	int z = -1;
 	XarStyle *gc = m_gc.top();
 	if (type == 0)
 		z = m_Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, CommonStrings::None, gc->StrokeCol, true);
@@ -2893,6 +2895,8 @@
 		z = m_Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, gc->FillCol, CommonStrings::None, true);
 	else if (type == 2)
 		z = m_Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, baseX, baseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, true);
+	else
+		return;
 	finishItem(z);
 //	PageItem *ite = m_Doc->Items->at(z);
 //	qDebug() << "Item" << ite->itemName() << type;
@@ -3031,7 +3035,14 @@
 	quint32 count = len / 9;
 	qint32 x, y;
 	quint8  verb, val;
-	double co1, co2, cx1, cy1, cx2, cy2, cx3, cy3;
+	double co1 = 0.0;
+	double co2 = 0.0;
+	double cx1 = 0.0;
+	double cy1 = 0.0;
+	double cx2 = 0.0;
+	double cy2 = 0.0;
+	double cx3 = 0.0;
+	double cy3 = 0.0;
 	FPoint currentPoint, startPoint;
 	int bezCount = 0;
 	bool closed = false;
Index: scribus/hyphen.c
===================================================================
--- scribus/hyphen.c	(revision 15102)
+++ scribus/hyphen.c	(revision 15103)
@@ -231,7 +231,8 @@
   char buf[80];
   char word[80];
   char pattern[80];
-  int state_num, last_state;
+  int state_num = 0;
+  int last_state;
   int i, j;
   char ch;
   int found;




More information about the scribus-commit mailing list