Hello community, here is the log from the commit of package IccXML for openSUSE:Factory checked in at 2014-09-10 17:02:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/IccXML (Old) and /work/SRC/openSUSE:Factory/.IccXML.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "IccXML" Changes: -------- --- /work/SRC/openSUSE:Factory/IccXML/IccXML.changes 2012-05-10 14:32:05.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.IccXML.new/IccXML.changes 2014-09-10 17:03:17.000000000 +0200 @@ -1,0 +2,5 @@ +Wed Sep 03 12:00:01 UTC 2014 - k...@gmx.de + +- update to 0.9.8 + +------------------------------------------------------------------- Old: ---- IccXML-0.9.6.tar.gz New: ---- IccXML-0.9.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ IccXML.spec ++++++ --- /var/tmp/diff_new_pack.XY2wt3/_old 2014-09-10 17:03:18.000000000 +0200 +++ /var/tmp/diff_new_pack.XY2wt3/_new 2014-09-10 17:03:18.000000000 +0200 @@ -1,8 +1,8 @@ # # spec file for package IccXML # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. -# Copyright (c) 2011-2012 Kai-Uwe Behrmann +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011-2014 Kai-Uwe Behrmann # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,18 +17,22 @@ # -Version: 0.9.6 +Name: IccXML +Version: 0.9.8 Release: 0 -Source: IccXML-0.9.6.tar.gz +Source: %{name}-%{version}.tar.gz Summary: Color Management XML tools - -Name: IccXML License: BSD-3-Clause Group: Development/Libraries/Other + Url: http://sourceforge.net/projects/iccxml/ BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: gcc-c++ libSampleICC-devel libSampleICC1 libxml2-devel pkgconfig +BuildRequires: gcc-c++ +BuildRequires: libSampleICC-devel +BuildRequires: libSampleICC1 +BuildRequires: libxml2-devel +BuildRequires: pkgconfig %package -n lib%{name}2 Summary: Colour Management Libraries ++++++ IccXML-0.9.6.tar.gz -> IccXML-0.9.8.tar.gz ++++++ ++++ 32083 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/ChangeLog new/IccXML-0.9.8/ChangeLog --- old/IccXML-0.9.6/ChangeLog 2011-04-22 14:49:00.000000000 +0200 +++ new/IccXML-0.9.8/ChangeLog 2014-09-03 10:03:28.000000000 +0200 @@ -1,3 +1,18 @@ +2014-04-23 Max Drhak + * 0.9.8 Release + * Fix Bug in parsing Unknown tag types + * Changes needed to support updates in IccProfLib 1.6.8 + * Changed #ifdef WIN32 to #if defined(WIN32) || defined(WIN64) + * Added std::string interface to icFixXml + * Increased size of lines in icXmlDumpHexData + * Added support for "Now" to icGetDateTimeValue parsing + * Added icGetChildText for safe extraction of xml child node text + +2012-08-31 Max Derhak + * 0.9.7 Release + * Moved CIccUTF16String to SampleICC's IccProfLib + * Changes needed to support updates in IccProfLib 1.6.7 + 2010-12-07 Max Derhak * 0.9.6 Release * Fixed bug relative to UTF16 to UTF8 conversion. Replaced diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/CmdLine/IccFromXml/IccFromXml.cpp new/IccXML-0.9.8/CmdLine/IccFromXml/IccFromXml.cpp --- old/IccXML-0.9.6/CmdLine/IccFromXml/IccFromXml.cpp 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/CmdLine/IccFromXml/IccFromXml.cpp 2014-09-03 10:03:28.000000000 +0200 @@ -14,7 +14,7 @@ int main(int argc, char* argv[]) { if (argc<=2) { - printf("\nSampleIcc Version " ICCPROFLIBVER ", ICCXML Version " ICCLIBXMLVER "\nUsage: IccFromXml xml_file saved_profile_file {-v{=[relax_ng_schema_file - optional]}}\n"); + printf("\nSampleIcc Version " ICCPROFLIBVER ", ICCXML Version " ICCLIBXMLVER "\nUsage: IccFromXml xml_file saved_profile_file {-noid -v{=[relax_ng_schema_file - optional]}}\n"); return -1; } @@ -25,18 +25,22 @@ std::string reason; std::string szRelaxNGDir; + bool bNoId = false; const char* szRelaxNGFileName = "SampleIccRELAX.rng"; - - if (argc > 3) {// user possibly specified schema validation - if (!strncmp(argv[3], "-v", 2) || !strncmp(argv[3], "-V", 2)) { - if (argv[3][2]=='=') { - szRelaxNGDir = argv[3]+3; + int i; + for (i=3; i<argc; i++) { + if (!stricmp(argv[i], "-noid")) { + bNoId = true; + } + else if (!strncmp(argv[i], "-v", 2) || !strncmp(argv[i], "-V", 2)) {// user specified schema validation + if (argv[i][2]=='=') { + szRelaxNGDir = argv[i]+3; } else { std::string path = argv[0]; // current directory where program is called -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) if (path != "IccFromXml.exe") { //current directory is not path where program is located path = path.substr(0,path.find_last_of("\\")); path += "\\"; @@ -64,7 +68,7 @@ if (!profile.LoadXml(argv[1], szRelaxNGDir.c_str(), &reason)) { printf("Unable to Parse '%s'\n", argv[1]); printf("%s", reason.c_str()); -#ifndef WIN32 +#if defined(WIN32) || defined(WIN64) printf("\n"); #endif return -1; @@ -79,7 +83,7 @@ if (profile.m_Header.profileID.ID8[i]) break; } - if (SaveIccProfile(argv[2], &profile, i<16 ? icAlwaysWriteID : icVersionBasedID)) { + if (SaveIccProfile(argv[2], &profile, bNoId ? icNeverWriteID : (i<16 ? icAlwaysWriteID : icVersionBasedID))) { printf("Profile parsed and saved correctly\n"); } else { @@ -94,7 +98,7 @@ if (profile.m_Header.profileID.ID8[i]) break; } - if (SaveIccProfile(argv[2], &profile, i<16 ? icAlwaysWriteID : icVersionBasedID)) { + if (SaveIccProfile(argv[2], &profile, bNoId ? icNeverWriteID : (i<16 ? icAlwaysWriteID : icVersionBasedID))) { printf("Profile parsed. Profile is invalid, but saved correctly\n"); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/CmdLine/IccToXml/IccToXml.cpp new/IccXML-0.9.8/CmdLine/IccToXml/IccToXml.cpp --- old/IccXML-0.9.6/CmdLine/IccToXml/IccToXml.cpp 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/CmdLine/IccToXml/IccToXml.cpp 2014-09-03 10:03:28.000000000 +0200 @@ -27,18 +27,29 @@ return -1; } +// printf("File Opened\n"); +// fflush(stdout); + if (!profile.Read(&srcIO)) { printf("Unable to read '%s'\n", argv[1]); return -1; } +// printf("File read\n"); +// fflush(stdout); + std::string xml; + xml.reserve(30000000); if (!profile.ToXml(xml)) { printf("Unable to convert '%s' to xml\n", argv[1]); return -1; } +// printf("Profile converted\n"); +// fflush(stdout); + + if (!dstIO.Open(argv[2], "w")) { printf("unable to open '%s'\n", argv[2]); return -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccLibXMLVer.h new/IccXML-0.9.8/IccLibXML/IccLibXMLVer.h --- old/IccXML-0.9.6/IccLibXML/IccLibXMLVer.h 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/IccLibXML/IccLibXMLVer.h 2014-09-03 10:03:28.000000000 +0200 @@ -1,4 +1,4 @@ #ifndef ICCLIBXMLVER -#define ICCLIBXMLVER "0.9.1" -#define ICCPROFLIBLIBXMLVER "1.6.2" +#define ICCLIBXMLVER "0.9.8" +#define ICCPROFLIBLIBXMLVER "1.6.8" #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccMpeXml.cpp new/IccXML-0.9.8/IccLibXML/IccMpeXml.cpp --- old/IccXML-0.9.6/IccLibXML/IccMpeXml.cpp 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/IccLibXML/IccMpeXml.cpp 2014-09-03 10:03:28.000000000 +0200 @@ -66,7 +66,7 @@ #include <cstring> /* C strings strcpy, memcpy ... */ -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) #include <windows.h> #ifdef GetClassName #undef GetClassName diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccMpeXml.h new/IccXML-0.9.8/IccLibXML/IccMpeXml.h --- old/IccXML-0.9.6/IccLibXML/IccMpeXml.h 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/IccLibXML/IccMpeXml.h 2014-09-03 10:03:28.000000000 +0200 @@ -78,7 +78,7 @@ virtual bool ToXml(std::string &xml, std::string blanks="") = 0; virtual bool ParseXml(xmlNode *pNode, std::string &parseStr) = 0; - virtual const char *GetExtClassName() { return "CIccMpeXml"; } + virtual const char *GetExtClassName() const { return "CIccMpeXml"; } }; class CIccMpeXmlUnknown : public CIccMpeUnknown, public CIccMpeXml @@ -86,7 +86,7 @@ public: virtual ~CIccMpeXmlUnknown() {} - virtual const char *GetClassName() { return "CIccTagXmlUnknown"; } + virtual const char *GetClassName() const { return "CIccTagXmlUnknown"; } virtual IIccExtensionMpe *GetExtension() { return this; } @@ -99,7 +99,7 @@ public: virtual ~CIccMpeXmlCurveSet() {} - virtual const char *GetClassName() { return "CIccMpeXmlCurveSet"; } + virtual const char *GetClassName() const { return "CIccMpeXmlCurveSet"; } virtual IIccExtensionMpe *GetExtension() { return this; } @@ -115,7 +115,7 @@ public: virtual ~CIccMpeXmlMatrix() {} - virtual const char *GetClassName() { return "CIccMpeXmlMatrix"; } + virtual const char *GetClassName() const { return "CIccMpeXmlMatrix"; } virtual IIccExtensionMpe *GetExtension() { return this; } @@ -128,7 +128,7 @@ public: virtual ~CIccMpeXmlCLUT() {} - virtual const char *GetClassName() { return "CIccMpeXmlCLUT"; } + virtual const char *GetClassName() const { return "CIccMpeXmlCLUT"; } virtual IIccExtensionMpe *GetExtension() { return this; } @@ -141,7 +141,7 @@ public: virtual ~CIccMpeXmlBAcs() {} - virtual const char *GetClassName() { return "CIccMpeXmlBAcs"; } + virtual const char *GetClassName() const { return "CIccMpeXmlBAcs"; } virtual IIccExtensionMpe *GetExtension() { return this; } @@ -154,7 +154,7 @@ public: virtual ~CIccMpeXmlEAcs() {} - virtual const char *GetClassName() { return "CIccMpeXmlEAcs"; } + virtual const char *GetClassName() const { return "CIccMpeXmlEAcs"; } virtual IIccExtensionMpe *GetExtension() { return this; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccProfileXml.cpp new/IccXML-0.9.8/IccLibXML/IccProfileXml.cpp --- old/IccXML-0.9.6/IccLibXML/IccProfileXml.cpp 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/IccLibXML/IccProfileXml.cpp 2014-09-03 10:03:28.000000000 +0200 @@ -257,7 +257,7 @@ icUInt32Number units; for (i=0; i<8; i++) { - units = (icUInt32Number)(v / divisor + 0.5); + units = (icUInt32Number)(v / divisor + 0.001); v-= divisor * units; divisor /= 10.0f; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccTagXml.cpp new/IccXML-0.9.8/IccLibXML/IccTagXml.cpp --- old/IccXML-0.9.6/IccLibXML/IccTagXml.cpp 2011-04-22 14:49:00.000000000 +0200 +++ new/IccXML-0.9.8/IccLibXML/IccTagXml.cpp 2014-09-03 13:27:56.000000000 +0200 @@ -85,6 +85,11 @@ bool CIccTagXmlUnknown::ParseXml(xmlNode *pNode, std::string &parseStr) { + const char *tagType = icXmlAttrValue(pNode->parent, "type"); + if (tagType) { + m_nType = (icTagTypeSignature)icGetSigVal(tagType); + } + pNode = icXmlFindNode(pNode, "UnknownData"); if (pNode && pNode->children && pNode->children->content) { @@ -742,7 +747,7 @@ template <class T, icTagTypeSignature Tsig> -const icChar* CIccTagXmlFixedNum<T, Tsig>::GetClassName() +const icChar* CIccTagXmlFixedNum<T, Tsig>::GetClassName() const { if (Tsig==icSigS15Fixed16ArrayType) return "CIccTagXmlS15Fixed16"; @@ -837,7 +842,7 @@ template class CIccTagXmlFixedNum<icU16Fixed16Number, icSigU16Fixed16ArrayType>; template <class T, icTagTypeSignature Tsig> -const icChar *CIccTagXmlNum<T, Tsig>::GetClassName() +const icChar *CIccTagXmlNum<T, Tsig>::GetClassName() const { if (sizeof(T)==sizeof(icUInt8Number)) return "CIccTagXmlUInt8"; @@ -1058,7 +1063,7 @@ { icUInt8Number *ptr = m_pData; char buf[60]; - char *szFlag = "ASCII"; + const char *szFlag = "ASCII"; if (m_nDataFlag == 1) szFlag = "binary"; @@ -1385,16 +1390,16 @@ for (pDescNode = pNode->children; pDescNode; pDescNode=pDescNode->next) { if (pDescNode->type == XML_ELEMENT_NODE) { if (!icXmlStrCmp(pDescNode->name, "DeviceManufacturerSignature")){ - p.m_deviceMfg = icXmlStrToSig((const icChar*)pDescNode->children->content); + p.m_deviceMfg = icXmlStrToSig(icGetChildText(pDescNode)); } else if (!icXmlStrCmp(pDescNode->name, "DeviceModelSignature")){ - p.m_deviceModel = icXmlStrToSig((const icChar*)pDescNode->children->content); + p.m_deviceModel = icXmlStrToSig(icGetChildText(pDescNode)); } else if (!icXmlStrCmp(pDescNode->name, "DeviceAttributes")){ p.m_attributes = icGetDeviceAttrValue(pDescNode); } else if (!icXmlStrCmp(pDescNode->name, "Technology")){ - p.m_technology = (icTechnologySignature)icXmlStrToSig((const icChar*)pDescNode->children->content); + p.m_technology = (icTechnologySignature)icXmlStrToSig(icGetChildText(pDescNode)); } else if (!icXmlStrCmp(pDescNode->name, "DeviceManufacturer")) { xmlNode *pDevManNode = icXmlFindNode(pDescNode->children, "multiLocalizedUnicodeType"); @@ -2093,7 +2098,7 @@ xml += blanks + " "; for (i=0; i<(int)m_nNumParam; i++) { - sprintf(buf, " %.8f", icFtoD(m_Param[i])); + sprintf(buf, " %.8f", m_dParam[i]); xml += buf; } xml += "\n"; @@ -2141,10 +2146,10 @@ } icUInt32Number j; - icS15Fixed16Number *params = GetParams(); + icFloatNumber *dParams = GetParams(); icFloatNumber *dataBuf = data.GetBuf(); for (j=0; j<data.GetSize(); j++) { - params[j] = icDtoF(dataBuf[j]); + dParams[j] = dataBuf[j]; } xmlAttr *reserved2 = icXmlFindAttr(pCurveNode, "Reserved"); @@ -3193,12 +3198,12 @@ std::string bufstr; xml += blanks + " <DictEntry Name=\""; - xml += icFixXml(fix, icUtf16ToUtf8(bufstr, (icUInt16Number*)nv->m_sName.c_str(), (int)nv->m_sName.size())); + xml += icFixXml(fix, nv->m_sName.ToUtf8(bufstr)); xml += "\""; if (nv->IsValueSet()) { xml += " Value=\""; - xml += icFixXml(fix, icUtf16ToUtf8(bufstr, (icUInt16Number*)nv->GetValue().c_str(), (int)nv->GetValue().size())); + xml += icFixXml(fix, nv->GetValue().ToUtf8(bufstr)); xml += "\""; } @@ -3251,16 +3256,13 @@ return false; ptr.ptr = pDesc; - str = icXmlAttrValue(pNode, "Name", ""); - str.ToWString(pDesc->m_sName); + pDesc->m_sName = icXmlAttrValue(pNode, "Name", ""); pAttr = icXmlFindAttr(pNode, "Value"); if (pAttr) { - std::wstring wstr; str = icXmlAttrValue(pAttr, ""); - str.ToWString(wstr); - pDesc->SetValue(wstr); + pDesc->SetValue(str); } xmlNode *pChild; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccTagXml.h new/IccXML-0.9.8/IccLibXML/IccTagXml.h --- old/IccXML-0.9.6/IccLibXML/IccTagXml.h 2010-12-01 10:51:00.000000000 +0100 +++ new/IccXML-0.9.8/IccLibXML/IccTagXml.h 2014-09-03 10:03:28.000000000 +0200 @@ -76,8 +76,8 @@ public: virtual ~CIccTagXml(void) {} - virtual const char *GetExtClassName() { return "CIccTagXml"; } - virtual const char *GetExtDerivedClassName() { return ""; } + virtual const char *GetExtClassName() const { return "CIccTagXml"; } + virtual const char *GetExtDerivedClassName() const { return ""; } virtual bool ToXml(std::string &xml, std::string blanks="") = 0; virtual bool ParseXml(xmlNode *pNode, std::string &parseStr) = 0; @@ -89,7 +89,7 @@ CIccTagXmlUnknown(icTagTypeSignature nType) { m_nType = nType; } virtual ~CIccTagXmlUnknown() {} - virtual const char *GetClassName() { return "CIccTagXmlUnknown"; } + virtual const char *GetClassName() const { return "CIccTagXmlUnknown"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -106,7 +106,7 @@ virtual CIccTag* NewCopy() const {return new CIccTagXmlText(*this);} - virtual const char *GetClassName() { return "CIccTagXmlText"; } + virtual const char *GetClassName() const { return "CIccTagXmlText"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -123,7 +123,7 @@ virtual CIccTag* NewCopy() const {return new CIccTagXmlTextDescription(*this);} - virtual const char *GetClassName() { return "CIccTagXmlTextDescription"; } + virtual const char *GetClassName() const { return "CIccTagXmlTextDescription"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -136,7 +136,7 @@ public: virtual ~CIccTagXmlSignature() {} - virtual const char *GetClassName() { return "CIccTagXmlSignature"; } + virtual const char *GetClassName() const { return "CIccTagXmlSignature"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -149,7 +149,7 @@ public: virtual ~CIccTagXmlNamedColor2() {} - virtual const char *GetClassName() { return "CIccTagXmlNamedColor2"; } + virtual const char *GetClassName() const { return "CIccTagXmlNamedColor2"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -162,7 +162,7 @@ public: virtual ~CIccTagXmlXYZ() {} - virtual const char *GetClassName() { return "CIccTagXmlXYZ"; } + virtual const char *GetClassName() const { return "CIccTagXmlXYZ"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -175,7 +175,7 @@ public: virtual ~CIccTagXmlChromaticity() {} - virtual const char *GetClassName() { return "CIccTagXmlChromaticity"; } + virtual const char *GetClassName() const { return "CIccTagXmlChromaticity"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -189,7 +189,7 @@ public: virtual ~CIccTagXmlFixedNum() {} - virtual const char *GetClassName(); + virtual const char *GetClassName() const; virtual IIccExtensionTag *GetExtension() { return this; } @@ -207,7 +207,7 @@ public: virtual ~CIccTagXmlNum() {} - virtual const char *GetClassName(); + virtual const char *GetClassName() const; virtual IIccExtensionTag *GetExtension() { return this; } @@ -225,7 +225,7 @@ public: virtual ~CIccTagXmlMeasurement() {} - virtual const char *GetClassName() { return "CIccTagXmlMeasurement"; } + virtual const char *GetClassName() const { return "CIccTagXmlMeasurement"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -238,7 +238,7 @@ public: virtual ~CIccTagXmlMultiLocalizedUnicode() {} - virtual const char *GetClassName() { return "CIccTagXmlMultiLocalizedUnicode"; } + virtual const char *GetClassName() const { return "CIccTagXmlMultiLocalizedUnicode"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -251,7 +251,7 @@ public: virtual ~CIccTagXmlData() {} - virtual const char *GetClassName() { return "CIccTagXmlData"; } + virtual const char *GetClassName() const { return "CIccTagXmlData"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -264,7 +264,7 @@ public: virtual ~CIccTagXmlDateTime() {} - virtual const char *GetClassName() { return "CIccTagXmlDateTime"; } + virtual const char *GetClassName() const { return "CIccTagXmlDateTime"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -277,7 +277,7 @@ public: virtual ~CIccTagXmlColorantOrder() {} - virtual const char *GetClassName() { return "CIccTagXmlColorantOrder"; } + virtual const char *GetClassName() const { return "CIccTagXmlColorantOrder"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -290,7 +290,7 @@ public: virtual ~CIccTagXmlColorantTable() {} - virtual const char *GetClassName() { return "CIccTagXmlColorantTable"; } + virtual const char *GetClassName() const { return "CIccTagXmlColorantTable"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -303,7 +303,7 @@ public: virtual ~CIccTagXmlViewingConditions() {} - virtual const char *GetClassName() { return "CIccTagXmlViewingConditions"; } + virtual const char *GetClassName() const { return "CIccTagXmlViewingConditions"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -316,7 +316,7 @@ public: virtual ~CIccTagXmlProfileSeqDesc() {} - virtual const char *GetClassName() { return "CIccTagXmlProfileSeqDesc"; } + virtual const char *GetClassName() const { return "CIccTagXmlProfileSeqDesc"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -329,7 +329,7 @@ public: virtual ~CIccTagXmlResponseCurveSet16() {} - virtual const char *GetClassName() { return "CIccTagXmlResponseCurveSet16"; } + virtual const char *GetClassName() const { return "CIccTagXmlResponseCurveSet16"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -342,7 +342,7 @@ public: virtual ~CIccCurveXml() {} - virtual const char *GetExtDerivedClassName() { return "CIccCurveXml"; } + virtual const char *GetExtDerivedClassName() const { return "CIccCurveXml"; } virtual bool ToXml(std::string &xml, icConvertType nType, std::string blanks) = 0; virtual bool ParseXml(xmlNode *pNode, icConvertType nType, std::string &parseStr) = 0; @@ -353,7 +353,7 @@ public: virtual ~CIccTagXmlCurve() {} - virtual const char *GetClassName() { return "CIccTagXmlCurve"; } + virtual const char *GetClassName() const { return "CIccTagXmlCurve"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -368,7 +368,7 @@ public: virtual ~CIccTagXmlParametricCurve() {} - virtual const char *GetClassName() { return "CIccTagXmlParametricCurve"; } + virtual const char *GetClassName() const { return "CIccTagXmlParametricCurve"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -383,7 +383,7 @@ public: virtual ~CIccTagXmlLutAtoB() {} - virtual const char *GetClassName() { return "CIccTagXmlLutAtoB"; } + virtual const char *GetClassName() const { return "CIccTagXmlLutAtoB"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -396,7 +396,7 @@ public: virtual ~CIccTagXmlLutBtoA() {} - virtual const char *GetClassName() { return "CIccTagXmlLutBtoA"; } + virtual const char *GetClassName() const { return "CIccTagXmlLutBtoA"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -409,7 +409,7 @@ public: virtual ~CIccTagXmlLut8() {} - virtual const char *GetClassName() { return "CIccTagXmlLut8"; } + virtual const char *GetClassName() const { return "CIccTagXmlLut8"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -422,7 +422,7 @@ public: virtual ~CIccTagXmlLut16() {} - virtual const char *GetClassName() { return "CIccTagXmlLut16"; } + virtual const char *GetClassName() const { return "CIccTagXmlLut16"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -435,7 +435,7 @@ public: virtual ~CIccTagXmlMultiProcessElement() {} - virtual const char *GetClassName() { return "CIccTagXmlMultiProcessElement"; } + virtual const char *GetClassName() const { return "CIccTagXmlMultiProcessElement"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -453,7 +453,7 @@ public: virtual ~CIccTagXmlProfileSequenceId() {} - virtual const char *GetClassName() { return "CIccTagXmlProfileSequenceId"; } + virtual const char *GetClassName() const { return "CIccTagXmlProfileSequenceId"; } virtual IIccExtensionTag *GetExtension() { return this; } @@ -466,7 +466,7 @@ public: virtual ~CIccTagXmlDict() {} - virtual const char *GetClassName() { return "CIccTagXmlDict"; } + virtual const char *GetClassName() const { return "CIccTagXmlDict"; } virtual IIccExtensionTag *GetExtension() { return this; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccUtilXml.cpp new/IccXML-0.9.8/IccLibXML/IccUtilXml.cpp --- old/IccXML-0.9.6/IccLibXML/IccUtilXml.cpp 2011-04-22 14:49:00.000000000 +0200 +++ new/IccXML-0.9.8/IccLibXML/IccUtilXml.cpp 2014-09-03 13:53:08.000000000 +0200 @@ -63,8 +63,9 @@ #include "IccUtilXml.h" #include "IccConvertUTF.h" +#include <time.h> -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) #include <windows.h> #ifdef GetClassName #undef GetClassName @@ -72,7 +73,7 @@ #endif #include <cstring> /* C strings strcpy, memcpy ... */ -icTagSigType tagSignatureMap[] ={ +const icTagSigType tagSignatureMap[] ={ { icSigChromaticityType , "chromaticityType"}, { icSigColorantOrderType , "colorantOrderType"}, { icSigColorantTableType , "colorantTableType"}, @@ -109,173 +110,38 @@ #define tagSignatureMapSize (sizeof(tagSignatureMap)/sizeof(tagSignatureMap[0])) -CIccUTF16String::CIccUTF16String() -{ - m_alloc=64; - m_len = 0; - m_str = (icUInt16Number*)calloc(m_alloc, sizeof(icUInt16Number)); -} - -CIccUTF16String::CIccUTF16String(const icUInt16Number *uzStr) -{ - m_len = WStrlen(uzStr); - m_alloc = AllocSize(m_len); - - m_str = (icUInt16Number *)malloc(m_alloc*sizeof(icUInt16Number)); - memcpy(m_str, uzStr, m_len+1*sizeof(icUInt16Number)); -} - -CIccUTF16String::CIccUTF16String(const char *szStr) -{ - size_t sizeSrc = strlen(szStr); - - if (sizeSrc) { - m_alloc = AllocSize(sizeSrc*2); - m_str = (UTF16 *)calloc(m_alloc, sizeof(icUInt16Number)); //overallocate to allow for up to 4 bytes per character - UTF16 *szDest = m_str; - icConvertUTF8toUTF16((const UTF8 **)&szStr, (const UTF8 *)&szStr[sizeSrc], &szDest, &szDest[m_alloc], lenientConversion); - if (m_str[0]==0xfeff) { - size_t i; - for (i=1; m_str[i]; i++) - m_str[i-1] = m_str[i]; - m_str[i-1] = 0; - } - m_len = WStrlen(m_str); - } - else { - m_alloc = 64; - m_len = 0; - m_str = (icUInt16Number*)calloc(m_alloc, sizeof(icUInt16Number)); - } -} - -CIccUTF16String::CIccUTF16String(const CIccUTF16String &str) -{ - m_alloc = str.m_alloc; - m_len = str.m_len; - m_str = (icUInt16Number*)malloc(m_alloc*sizeof(icUInt16Number)); - - memcpy(m_str, str.m_str, (m_alloc)*sizeof(icUInt16Number)); -} - -CIccUTF16String::~CIccUTF16String() -{ - free(m_str); -} - -void CIccUTF16String::Clear() -{ - m_len = 0; - m_str[0] = 0; -} - -void CIccUTF16String::Resize(size_t len) -{ - if (len>m_alloc) { - size_t nAlloc = AllocSize(len); - - m_str = (icUInt16Number*)realloc(m_str, m_alloc*sizeof(icUInt16Number)); - } - - if (len>m_len) { - memset(&m_str[m_len], 0x0020, (len-m_len)*sizeof(icUInt16Number)); - } - m_len = len; - m_str[m_len] = 0; -} - -size_t CIccUTF16String::WStrlen(const icUInt16Number *uzStr) -{ - size_t n=0; - while(uzStr[n]) n++; - - return n; -} - -CIccUTF16String& CIccUTF16String::operator=(const CIccUTF16String &wstr) -{ - if (m_alloc<=wstr.m_alloc) { - m_str = (icUInt16Number*)realloc(m_str, m_alloc*sizeof(icUInt16Number)); - m_alloc = wstr.m_alloc; - } - m_len = wstr.m_len; - - memcpy(m_str, wstr.m_str, (m_len+1)*sizeof(icUInt16Number)); - - return *this; -} - -CIccUTF16String& CIccUTF16String::operator=(const char *szStr) -{ - FromUtf8(szStr, 0); - - return *this; -} - -CIccUTF16String& CIccUTF16String::operator=(const icUInt16Number *uzStr) -{ - size_t n = WStrlen(uzStr); - size_t nAlloc = AllocSize(n); - - if (m_alloc<=nAlloc) { - m_str = (icUInt16Number*)realloc(m_str, m_alloc*sizeof(icUInt16Number)); - m_alloc =nAlloc; - } - m_len = n; - - memcpy(m_str, uzStr, (m_len+1)*sizeof(icUInt16Number)); - - return *this; -} -void CIccUTF16String::FromUtf8(const char *szStr, size_t sizeSrc) +const char *icFixXml(std::string &buf, const char *szStr) { - if (!sizeSrc) - sizeSrc = strlen(szStr); - - if (sizeSrc) { - size_t nAlloc = AllocSize(sizeSrc*2); - if (m_alloc<=nAlloc) { - m_str = (icUInt16Number*)realloc(m_str, m_alloc*sizeof(icUInt16Number)); - m_alloc = nAlloc; - } - UTF16 *szDest = m_str; - icConvertUTF8toUTF16((const UTF8 **)&szStr, (const UTF8 *)&szStr[sizeSrc], &szDest, &szDest[m_alloc], lenientConversion); - if (m_str[0]==0xfeff) { - size_t i; - for (i=1; m_str[i]; i++) - m_str[i-1] = m_str[i]; - m_str[i-1] = 0; + buf = ""; + while (*szStr) { + switch (*szStr) { + case '\'': + buf += "'"; + break; + case '&': + buf += "&"; + break; + case '\"': + buf += """; + break; + case '<': + buf += "<"; + break; + case '>': + buf += ">"; + break; + default: + buf += *szStr; } - m_len = WStrlen(m_str); - } - else { - m_len = 0; - m_str[0] = 0; - } -} - -const char *CIccUTF16String::ToUtf8(std::string &buf) -{ - return icUtf16ToUtf8(buf, m_str, (int)m_len); -} - -const wchar_t *CIccUTF16String::ToWString(std::wstring &buf) -{ - size_t i; - - buf.clear(); - - for (i=0; i<m_len; i++) { - buf += (wchar_t)m_str[i]; + szStr++; } return buf.c_str(); } - -char *icFixXml(char *szDest, const char *szStr) +const char *icFixXml(char *szDest, const char *szStr) { char *ptr = szDest; @@ -311,40 +177,9 @@ return szDest; } -const char *icUtf16ToUtf8(std::string &buf, const icUInt16Number *szSrc, int sizeSrc/*=0*/) -{ - if (!sizeSrc) { - sizeSrc = (int)CIccUTF16String::WStrlen(szSrc); - } - - int n = sizeSrc*4; - - if (n) { - char *szBuf = (char *)malloc(n+1); - char *szDest = szBuf; - icConvertUTF16toUTF8(&szSrc, &szSrc[sizeSrc], (UTF8**)&szDest, (UTF8*)&szDest[n+1], lenientConversion); - *szDest= '\0'; - - buf = szBuf; - free(szBuf); - } - else { - buf.clear(); - } - - return buf.c_str(); -} - -const unsigned short *icUtf8ToUtf16(CIccUTF16String &buf, const char *szSrc, int sizeSrc/*=0*/) -{ - buf.FromUtf8(szSrc, sizeSrc); - - return buf.c_str(); -} - const char *icAnsiToUtf8(std::string &buf, const char *szSrc) { -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) size_t len = strlen(szSrc)+1; wchar_t *szUnicodeBuf = (wchar_t*)malloc(len*sizeof(icUInt16Number)*2); char *szBuf = (char*)malloc(len*2); @@ -369,7 +204,7 @@ const char *icUtf8ToAnsi(std::string &buf, const char *szSrc) { -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) size_t len = strlen(szSrc)+1; wchar_t *szUnicodeBuf = (wchar_t*)malloc(len*sizeof(icUInt16Number)*2); char *szBuf = (char*)malloc(len*2); @@ -607,7 +442,7 @@ icUInt32Number i; for (i=0; i<nBufSize; i++, ptr++) { - if (!(i%16)) { + if (!(i%32)) { if (i) xml += "\n"; xml += blanks; @@ -685,7 +520,7 @@ template <class T, icTagTypeSignature Tsig> bool CIccXmlArrayType<T, Tsig>::ParseArray(xmlNode *pNode) { - char *scanType = (Tsig == icSigFloatArrayType ? "f" : "n"); + const char *scanType = (Tsig == icSigFloatArrayType ? "f" : "n"); icUInt32Number n = icXmlNodeCount(pNode, scanType); if (n) { @@ -1152,21 +987,46 @@ icDateTimeNumber icGetDateTimeValue(const icChar* str) { - unsigned int day=0, month=0, year=0, hours=0, minutes=0, seconds=0; icDateTimeNumber dateTime; - - sscanf(str, "%d-%02d-%02dT%02d:%02d:%02d", &year, &month, &day, &hours, &minutes, &seconds); - dateTime.year = year; - dateTime.month = month; - dateTime.day = day; - dateTime.hours = hours; - dateTime.minutes = minutes; - dateTime.seconds = seconds; - + if (!stricmp(str, "Now")) { + struct tm *newtime; + time_t long_time; + + time( &long_time ); /* Get time as long integer. */ + newtime = gmtime( &long_time ); + + dateTime.year = newtime->tm_year+1900; + dateTime.month = newtime->tm_mon+1; + dateTime.day = newtime->tm_mday; + dateTime.hours = newtime->tm_hour; + dateTime.minutes = newtime->tm_min; + dateTime.seconds = newtime->tm_sec; + + } + else { + unsigned int day=0, month=0, year=0, hours=0, minutes=0, seconds=0; + + sscanf(str, "%d-%02d-%02dT%02d:%02d:%02d", &year, &month, &day, &hours, &minutes, &seconds); + + dateTime.year = year; + dateTime.month = month; + dateTime.day = day; + dateTime.hours = hours; + dateTime.minutes = minutes; + dateTime.seconds = seconds; + } + return dateTime; } +const icChar *icGetChildText(xmlNode *pNode) +{ + if (pNode && pNode->children && pNode->content) + return (const char*)pNode->content; + return ""; +} + icUInt64Number icGetDeviceAttrValue(xmlNode *pNode) { icUInt64Number devAttr = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/IccLibXML/IccUtilXml.h new/IccXML-0.9.8/IccLibXML/IccUtilXml.h --- old/IccXML-0.9.6/IccLibXML/IccUtilXml.h 2011-04-22 14:49:00.000000000 +0200 +++ new/IccXML-0.9.8/IccLibXML/IccUtilXml.h 2014-09-03 13:52:22.000000000 +0200 @@ -69,49 +69,14 @@ #include "IccXmlConfig.h" #include "libxml/parser.h" #include <vector> +#include <string> -class CIccUTF16String -{ -public: - CIccUTF16String(); - CIccUTF16String(const icUInt16Number *uzStr); - CIccUTF16String(const char *szStr); - CIccUTF16String(const CIccUTF16String &str); - virtual ~CIccUTF16String(); - - void Clear(); - size_t Size() { return m_len; } - void Resize(size_t len); - - CIccUTF16String& operator=(const CIccUTF16String &wstr); - CIccUTF16String& operator=(const char *szStr); - CIccUTF16String& operator=(const icUInt16Number *uzStr); - - icUInt16Number operator[](size_t nIndex) { return m_str[nIndex]; } - - const icUInt16Number *c_str() { return m_str; } - - void FromUtf8(const char *szStr, size_t sizeSrc=0); - const char *ToUtf8(std::string &buf); - const wchar_t *ToWString(std::wstring &buf); - static size_t WStrlen(const icUInt16Number *uzStr); - -protected: - static size_t AllocSize(size_t n) { return (((n+64)/64)*64); } - size_t m_alloc; - size_t m_len; - icUInt16Number *m_str; -}; - - -char *icFixXml(char *szDest, const char *szStr); +const char *icFixXml(char *szDest, const char *szStr); +const char *icFixXml(std::string &buf, const char *szStr); const char *icAnsiToUtf8(std::string &buf, const char *szSrc); const char *icUtf8ToAnsi(std::string &buf, const char *szSrc); -const char *icUtf16ToUtf8(std::string &buf, const icUInt16Number *szSrc, int sizeSrc=0); -const unsigned short *icUtf8ToUtf16(CIccUTF16String &buf, const char *szSrc, int sizeSrc=0); - bool icCLUTToXml(std::string &xml, CIccCLUT *pCLUT, icConvertType nType, std::string blanks, bool bSaveGridPoints=false, const char *szExtraAttrs="", const char *szName="CLUT"); icFloatNumber icXmlStrToFloat(const xmlChar *szStr); @@ -180,6 +145,7 @@ icIlluminant icGetIlluminantValue(const icChar *str); const icChar* icGetStandardObserverName(icStandardObserver str); icDateTimeNumber icGetDateTimeValue(const icChar *str); +const icChar* icGetChildText(xmlNode *pNode); icUInt64Number icGetDeviceAttrValue(xmlNode *pNode); icColorantEncoding icGetColorantValue(const icChar* str); icMeasurementUnitSig icGetMeasurementValue(const icChar* str); @@ -189,9 +155,9 @@ typedef struct { icTagTypeSignature tagSig; - icChar* szTagType; + const icChar* szTagType; } icTagSigType; -#endif //_ICCUTILXML_H \ No newline at end of file +#endif //_ICCUTILXML_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/IccXML-0.9.6/configure.ac new/IccXML-0.9.8/configure.ac --- old/IccXML-0.9.6/configure.ac 2011-04-22 14:49:00.000000000 +0200 +++ new/IccXML-0.9.8/configure.ac 2014-09-03 10:11:09.000000000 +0200 @@ -6,7 +6,7 @@ ICCXML_MAJOR_VERSION=0 ICCXML_MINOR_VERSION=9 -ICCXML_MICRO_VERSION=6 +ICCXML_MICRO_VERSION=8 ICCXML_VERSION=$ICCXML_MAJOR_VERSION.$ICCXML_MINOR_VERSION.${ICCXML_MICRO_VERSION} AC_SUBST(ICCXML_VERSION) -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org