r24096 by jghali - Fix more compiler warnings

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 24 16:23:13 UTC 2020


Author: jghali
Date: Sat Oct 24 16:23:13 2020
New Revision: 24096

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24096
Log:
Fix more compiler warnings

Modified:
    branches/Version14x/Scribus/scribus/bookmwin.cpp
    branches/Version14x/Scribus/scribus/exif.cpp
    branches/Version14x/Scribus/scribus/fileunzip.cpp
    branches/Version14x/Scribus/scribus/pageitem.cpp
    branches/Version14x/Scribus/scribus/pdflib_core.cpp
    branches/Version14x/Scribus/scribus/printdialog.cpp
    branches/Version14x/Scribus/scribus/pslib.cpp
    branches/Version14x/Scribus/scribus/scfonts.cpp
    branches/Version14x/Scribus/scribus/scimage.cpp
    branches/Version14x/Scribus/scribus/scimgdataloader.cpp
    branches/Version14x/Scribus/scribus/scimgdataloader_psd.cpp
    branches/Version14x/Scribus/scribus/scimgdataloader_tiff.cpp
    branches/Version14x/Scribus/scribus/scribus.cpp
    branches/Version14x/Scribus/scribus/scribusdoc.cpp
    branches/Version14x/Scribus/scribus/smlinestyle.cpp

Modified: branches/Version14x/Scribus/scribus/bookmwin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/bookmwin.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/bookmwin.cpp	(original)
+++ branches/Version14x/Scribus/scribus/bookmwin.cpp	Sat Oct 24 16:23:13 2020
@@ -150,7 +150,6 @@
 	text.clear();
 	title.clear();
 
-	const StoryText& itemText = item->itemText;
 	for (int i = 0; i < item->itemText.length(); ++i)
 	{
 		ch = item->itemText.text(i);

Modified: branches/Version14x/Scribus/scribus/exif.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/exif.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/exif.cpp	(original)
+++ branches/Version14x/Scribus/scribus/exif.cpp	Sat Oct 24 16:23:13 2020
@@ -777,12 +777,12 @@
 //--------------------------------------------------------------------------
 void ExifData::process_SOFn ( const uchar * Data, int marker )
 {
-	int data_precision, num_components;
-
-	data_precision = Data[2];
+//	int data_precision, num_components;
+
+//	data_precision = Data[2];
 	ExifData::Height = Get16m ( Data+3 );
 	ExifData::Width = Get16m ( Data+5 );
-	num_components = Data[7];
+	int num_components = Data[7];
 
 	if ( num_components == 3 )
 		ExifData::IsColor = 1;

Modified: branches/Version14x/Scribus/scribus/fileunzip.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/fileunzip.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/fileunzip.cpp	(original)
+++ branches/Version14x/Scribus/scribus/fileunzip.cpp	Sat Oct 24 16:23:13 2020
@@ -174,14 +174,17 @@
 {
 	QChar p;
 	QString buffer;
+
 	int len = newdir.length();
-	
 	if (len <= 0)
 		return 0;
 	buffer = newdir;
 
-	if (buffer.endsWith("/") || buffer.endsWith("\\"))
-		buffer.left(len - 1);
+	while (buffer.endsWith("/") || buffer.endsWith("\\"))
+		buffer = buffer.left(len - 1);
+
+	if (buffer.length() <= 0)
+		return 0;
 
 	if (mymkdir(buffer) == 0)
 		return 1;

Modified: branches/Version14x/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/pageitem.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/pageitem.cpp	(original)
+++ branches/Version14x/Scribus/scribus/pageitem.cpp	Sat Oct 24 16:23:13 2020
@@ -3561,9 +3561,11 @@
 
 void PageItem::restorePStyle(SimpleState *state, bool isUndo)
 {
-	int styleid = state->getInt("OLD_STYLE");
-	if (!isUndo)
-		styleid = state->getInt("NEW_STYLE");
+	Q_UNUSED(state);
+	Q_UNUSED(isUndo);
+	//int styleid = state->getInt("OLD_STYLE");
+	//if (!isUndo)
+	//	styleid = state->getInt("NEW_STYLE");
 	//will be done later with other text-undo:
 	//	m_Doc->chAbStyle(this, styleid);
 }

Modified: branches/Version14x/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/pdflib_core.cpp	(original)
+++ branches/Version14x/Scribus/scribus/pdflib_core.cpp	Sat Oct 24 16:23:13 2020
@@ -7620,7 +7620,6 @@
 	QString tmp;
 	int ResO;
 	BookMItem* ip;
-	QTreeWidgetItem* pp;
 	QString Inhal = "";
 	QMap<int,QString> Inha;
 	if ((Bvie->topLevelItemCount() != 0) && (Options.Bookmarks) && (BookMinUse))
@@ -7628,7 +7627,6 @@
 		int Basis = ObjCounter - 1;
 		Outlines.Count = Bvie->topLevelItemCount();
 		ip = (BookMItem*)Bvie->topLevelItem(0);
-		pp = Bvie->topLevelItem(0);
 		Outlines.First = ip->ItemNr+Basis;
 		Outlines.Last  = ((BookMItem*) Bvie->topLevelItem(Outlines.Count - 1))->ItemNr+Basis;
 		QTreeWidgetItemIterator it(Bvie);

Modified: branches/Version14x/Scribus/scribus/printdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/printdialog.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/printdialog.cpp	(original)
+++ branches/Version14x/Scribus/scribus/printdialog.cpp	Sat Oct 24 16:23:13 2020
@@ -539,7 +539,6 @@
 	GcR->setChecked(m_doc->Print_Options.doGCR);
 	ClipMarg->setChecked(m_doc->Print_Options.doClip);
 	spotColors->setChecked(!m_doc->Print_Options.useSpotColors);
-	bool psPrinter = PrinterUtil::isPostscriptPrinter(PrintDest->currentText()) || outputToFile();
 	docBleeds->setChecked(m_doc->Print_Options.useDocBleeds);
 	if (docBleeds->isChecked())
 	{

Modified: branches/Version14x/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/pslib.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/pslib.cpp	(original)
+++ branches/Version14x/Scribus/scribus/pslib.cpp	Sat Oct 24 16:23:13 2020
@@ -327,7 +327,6 @@
 bool PSLib::PutInterleavedImageMaskToStream(const QByteArray& image, const QByteArray& mask, bool gray)
 {
 	int pending = 0;
-	int bIndex  = 0;
 	unsigned char bytes[1505];
 	const unsigned char* imageData = (const unsigned char*) image.constData();
 	const unsigned char* maskData  = (const unsigned char*) mask.constData();
@@ -345,7 +344,6 @@
 
 	for (int i = 0; i < pixels; ++i)
 	{
-		bIndex = 4 *i;
 		bytes[pending++] = maskData [i];
 		bytes[pending++] = *imageData++; // cyan/black
 		if (channels > 1)

Modified: branches/Version14x/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scfonts.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scfonts.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scfonts.cpp	Sat Oct 24 16:23:13 2020
@@ -117,8 +117,9 @@
 		return;
 	FT_Library library = NULL;
 	QString pathfile, fullpath;
-	bool error;
-	error = FT_Init_FreeType( &library );
+//	bool error;
+//	error =
+	FT_Init_FreeType( &library );
 	QString pathname(path);
 	if ( !pathname.endsWith("/") )
 		pathname += "/";
@@ -177,12 +178,12 @@
 				ext = ext2;
 			if ((ext == "ttc") || (ext == "dfont") || (ext == "pfa") || (ext == "pfb") || (ext == "ttf") || (ext == "otf"))
 			{
-				error = AddScalableFont(pathfile, library, DocName);
+				AddScalableFont(pathfile, library, DocName);
 			}
 #ifdef Q_OS_MAC
 			else if (ext.isEmpty() && DocName.isEmpty())
 			{
-				error = AddScalableFont(pathfile, library, DocName);
+				bool error = AddScalableFont(pathfile, library, DocName);
 				if (error)
 					error = AddScalableFont(pathfile + "/..namedfork/rsrc",library, DocName);
 			}

Modified: branches/Version14x/Scribus/scribus/scimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scimage.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimage.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimage.cpp	Sat Oct 24 16:23:13 2020
@@ -2149,8 +2149,7 @@
 	// gsRes - is the resolution that ghostscript will render at
 	bool isCMYK = false;
 	bool ret = false;
-	bool inputProfisEmbedded = false;
-	bool stdProof = false;
+//	bool inputProfisEmbedded = false;
 	if (realCMYK != 0)
 		*realCMYK = false;
 	bool bilevel = false;
@@ -2245,7 +2244,7 @@
 		if ((embeddedProfile.size() > 0 ) && (useEmbedded))
 		{
 			inputProf = ScColorMgmtEngine::openProfileFromMem(embeddedProfile);
-			inputProfisEmbedded = true;
+		//	inputProfisEmbedded = true;
 		}
 		else
 		{
@@ -2257,7 +2256,7 @@
 				if (ScCore->InputProfilesCMYK.contains(cmSettings.profileName()) && (cmSettings.profileName() != cmSettings.doc()->CMSSettings.DefaultImageCMYKProfile))
 				{
 					imgInfo.profileName = cmSettings.profileName();
-					inputProfisEmbedded = true;
+				//	inputProfisEmbedded = true;
 					profilePath = ScCore->InputProfilesCMYK[imgInfo.profileName];
 					inputProf = ScColorMgmtEngine::openProfileFromFile(profilePath);
 				}
@@ -2265,7 +2264,7 @@
 				{
 					inputProf = cmSettings.doc()->DocInputImageCMYKProf;
 					imgInfo.profileName = cmSettings.doc()->CMSSettings.DefaultImageCMYKProfile;
-					inputProfisEmbedded = false;
+				//	inputProfisEmbedded = false;
 				}
 			}
 			else if (bilevel && (reqType == CMYKData))
@@ -2274,21 +2273,21 @@
 			{
 				imgInfo.profileName = cmSettings.profileName();
 				profilePath = ScCore->InputProfiles[imgInfo.profileName].toLocal8Bit();
-				inputProfisEmbedded = true;
+				//inputProfisEmbedded = true;
 				inputProf = ScColorMgmtEngine::openProfileFromFile(profilePath);
 			}
 			else
 			{
 				inputProf = cmSettings.doc()->DocInputImageRGBProf;
 				imgInfo.profileName = cmSettings.doc()->CMSSettings.DefaultImageRGBProfile;
-				inputProfisEmbedded = false;
+			//	inputProfisEmbedded = false;
 			}
 		}
 	}
 	else if ((useProf && embeddedProfile.size() > 0) && (useEmbedded))
 	{
 		inputProf = ScColorMgmtEngine::openProfileFromMem(embeddedProfile);
-		inputProfisEmbedded = true;
+	//	inputProfisEmbedded = true;
 	}
 	else if (useProf && isCMYK)
 		inputProf = ScCore->defaultCMYKProfile;
@@ -2370,7 +2369,6 @@
 						else
 							xform = cmSettings.rgbImageProofingTransform();
 						xform.changeBufferFormat(inputProfFormat, Format_BGRA_8);
-						stdProof = true;
 					}
 					else
 						xform = ScColorMgmtEngine::createProofingTransform(inputProf, inputProfFormat,

Modified: branches/Version14x/Scribus/scribus/scimgdataloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scimgdataloader.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader.cpp	Sat Oct 24 16:23:13 2020
@@ -246,7 +246,7 @@
 					s.readRawData(buffer, thsize);
 					QImage imth;
 					imth.loadFromData((const uchar*)buffer, thsize, "JPEG");
-					imth.convertToFormat(QImage::Format_ARGB32);
+					imth = imth.convertToFormat(QImage::Format_ARGB32);
 					if (resID == 0x0409)
 						m_imageInfoRecord.exifInfo.thumbnail = imth.rgbSwapped();
 					else

Modified: branches/Version14x/Scribus/scribus/scimgdataloader_psd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scimgdataloader_psd.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader_psd.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader_psd.cpp	Sat Oct 24 16:23:13 2020
@@ -132,7 +132,6 @@
 bool ScImgDataLoader_PSD::loadPicture(const QString& fn, int /*page*/, int res, bool thumbnail)
 {
 	bool isCMYK = false;
-	float xres = 72.0, yres = 72.0;
 	if (!QFile::exists(fn))
 		return false;
 	bool valid = m_imageInfoRecord.isRequest;
@@ -181,8 +180,6 @@
 			m_imageInfoRecord.colorspace = ColorSpaceGray;
 		else if (header.color_mode == CM_DUOTONE)
 			m_imageInfoRecord.colorspace = ColorSpaceDuotone;
-		xres = m_imageInfoRecord.xres;
-		yres = m_imageInfoRecord.yres;
 		f.close();
 		if (thumbnail)
 		{
@@ -285,7 +282,7 @@
 	uint tmp;
 	uint cdataStart;
 	uint ressourceDataLen;
-	uint startRessource;
+//	uint startRessource;
 
 	s.device()->seek( dataOffset );
 
@@ -481,7 +478,7 @@
 	}
 	s.device()->seek( cdataStart + tmp );
 	s >> ressourceDataLen;
-	startRessource = s.device()->pos();
+//	startRessource = s.device()->pos();
 	if (ressourceDataLen != 0)
 		parseRessourceData(s, header, ressourceDataLen);
 	return true;
@@ -985,8 +982,8 @@
 			startSrcX = 0;
 			startDstX = layerInfo[layer].xpos;
 		}
-		unsigned int startSrcYm, startSrcXm, startDstYm, startDstXm;
-		if (layerInfo[layer].maskYpos < 0)
+		unsigned int startSrcXm; //, startSrcYm, startDstYm, startDstXm;
+	/*	if (layerInfo[layer].maskYpos < 0)
 		{
 			startSrcYm = abs(layerInfo[layer].maskYpos);
 			startDstYm = 0;
@@ -995,16 +992,16 @@
 		{
 			startSrcYm = 0;
 			startDstYm = layerInfo[layer].maskYpos;
-		}
+		}*/
 		if (layerInfo[layer].maskXpos < 0)
 		{
 			startSrcXm = abs(layerInfo[layer].maskXpos);
-			startDstXm = 0;
+	//		startDstXm = 0;
 		}
 		else
 		{
 			startSrcXm = 0;
-			startDstXm = layerInfo[layer].maskXpos;
+	//		startDstXm = layerInfo[layer].maskXpos;
 		}
 		QString layBlend2 = layerInfo[layer].blend;
 		if ((m_imageInfoRecord.isRequest) && (m_imageInfoRecord.RequestProps.contains(layer)))

Modified: branches/Version14x/Scribus/scribus/scimgdataloader_tiff.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scimgdataloader_tiff.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader_tiff.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader_tiff.cpp	Sat Oct 24 16:23:13 2020
@@ -1439,8 +1439,8 @@
 			startSrcX = 0;
 			startDstX = layerInfo[layer].xpos;
 		}
-		unsigned int startSrcYm, startSrcXm, startDstYm, startDstXm;
-		if (layerInfo[layer].maskYpos < 0)
+		unsigned int startSrcXm; //, startSrcYm, startDstYm, startDstXm;
+	/*	if (layerInfo[layer].maskYpos < 0)
 		{
 			startSrcYm = abs(layerInfo[layer].maskYpos);
 			startDstYm = 0;
@@ -1449,16 +1449,16 @@
 		{
 			startSrcYm = 0;
 			startDstYm = layerInfo[layer].maskYpos;
-		}
+		}*/
 		if (layerInfo[layer].maskXpos < 0)
 		{
 			startSrcXm = abs(layerInfo[layer].maskXpos);
-			startDstXm = 0;
+		//	startDstXm = 0;
 		}
 		else
 		{
 			startSrcXm = 0;
-			startDstXm = layerInfo[layer].maskXpos;
+		//	startDstXm = layerInfo[layer].maskXpos;
 		}
 		QString layBlend2 = layerInfo[layer].blend;
 		if ((m_imageInfoRecord.isRequest) && (m_imageInfoRecord.RequestProps.contains(layer)))

Modified: branches/Version14x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribus.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scribus.cpp	Sat Oct 24 16:23:13 2020
@@ -8637,7 +8637,7 @@
 				QMessageBox msgBox;
 				QPushButton *abortButton = msgBox.addButton(QMessageBox::Cancel);
 				QPushButton *lockButton = msgBox.addButton(tr("&Lock All"), QMessageBox::AcceptRole);
-				QPushButton *unlockButton = msgBox.addButton(tr("&Unlock All"), QMessageBox::AcceptRole);
+				msgBox.addButton(tr("&Unlock All"), QMessageBox::AcceptRole);
 				msgBox.setIcon(QMessageBox::Warning);
 				msgBox.setWindowTitle(CommonStrings::trWarning);
 				msgBox.setText( tr("Some objects are locked."));
@@ -8647,7 +8647,6 @@
 				else if (msgBox.clickedButton() == lockButton)
 					lockObject = true;
 				modifyLock = true;
-				unlockButton = NULL;	// just to silence the compiler
 			}
 		}
 		doc->itemSelection_GroupObjects(modifyLock, lockObject);

Modified: branches/Version14x/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.cpp	Sat Oct 24 16:23:13 2020
@@ -5135,11 +5135,9 @@
 		return false;
 	QMap<uint, DocumentSection>::Iterator itprev=sections.begin();
 	QMap<uint, DocumentSection>::Iterator it=itprev;
-	uint currMinIndex = itprev.value().fromindex;
 	uint currMaxIndex = itprev.value().toindex;
 	for ( ; it != sections.end(); ++it )
 	{
-		currMinIndex=it.value().fromindex;
 		currMaxIndex=it.value().toindex;
 
 		if (it.key()!=number)
@@ -5162,14 +5160,12 @@
 
 int ScribusDoc::getSectionKeyForPageIndex(const uint pageIndex) const
 {
-	bool found=false;
 	int retVal=-1;
 	DocumentSectionMap::ConstIterator it = sections.begin();
 	for (; it!= sections.end(); ++it)
 	{
 		if (pageIndex>=it.value().fromindex && pageIndex<=it.value().toindex)
 		{
-			found=true;
 			retVal=it.key();
 			break;
 		}

Modified: branches/Version14x/Scribus/scribus/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24096&path=/branches/Version14x/Scribus/scribus/smlinestyle.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/smlinestyle.cpp	(original)
+++ branches/Version14x/Scribus/scribus/smlinestyle.cpp	Sat Oct 24 16:23:13 2020
@@ -378,7 +378,6 @@
 
 void SMLineStyle::unitChange()
 {
-	double oldRatio = unitRatio_;
 	unitRatio_ = doc_->unitRatio();
 	if (widget_)
 		widget_->unitChange(doc_->unitIndex());




More information about the scribus-commit mailing list