diff options
author | Marti Maria <info@littlecms.com> | 2017-08-02 10:55:41 +0200 |
---|---|---|
committer | Marti Maria <info@littlecms.com> | 2017-08-02 10:55:41 +0200 |
commit | 55df275dc58fc817a59bf52c1b2bb564433c3999 (patch) | |
tree | 3c1d9b0dad8b01c11a0e9f6e56f7fd11cc09182b /src/cmsnamed.c | |
parent | 89ed1ad22961150f2044290ebbdee8d477223345 (diff) | |
download | lcms2-55df275dc58fc817a59bf52c1b2bb564433c3999.tar.gz |
Get rid of warnings when compiling as C++ with -Wall
Thanks to Noel Carboni for suggesting & providing a proof that it could
be done
Diffstat (limited to 'src/cmsnamed.c')
-rw-r--r-- | src/cmsnamed.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/cmsnamed.c b/src/cmsnamed.c index 13ae249..42bd365 100644 --- a/src/cmsnamed.c +++ b/src/cmsnamed.c @@ -127,7 +127,7 @@ int SearchMLUEntry(cmsMLU* mlu, cmsUInt16Number LanguageCode, cmsUInt16Number Co for (i=0; i < mlu ->UsedEntries; i++) { if (mlu ->Entries[i].Country == CountryCode && - mlu ->Entries[i].Language == LanguageCode) return i; + mlu ->Entries[i].Language == LanguageCode) return (int) i; } // Not found @@ -185,7 +185,7 @@ static cmsUInt16Number strTo16(const char str[3]) { const cmsUInt8Number* ptr8 = (const cmsUInt8Number*)str; - cmsUInt16Number n = ((cmsUInt16Number) ptr8[1] << 8) | ptr8[0]; + cmsUInt16Number n = (cmsUInt16Number) (((cmsUInt16Number) ptr8[1] << 8) | ptr8[0]); return _cmsAdjustEndianess16(n); } @@ -326,7 +326,7 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu, cmsUInt16Number* UsedLanguageCode, cmsUInt16Number* UsedCountryCode) { cmsUInt32Number i; - cmsInt32Number Best = -1; + int Best = -1; _cmsMLUentry* v; if (mlu == NULL) return NULL; @@ -339,7 +339,7 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu, if (v -> Language == LanguageCode) { - if (Best == -1) Best = i; + if (Best == -1) Best = (int) i; if (v -> Country == CountryCode) { @@ -605,10 +605,10 @@ cmsBool CMSEXPORT cmsAppendNamedColor(cmsNAMEDCOLORLIST* NamedColorList, } for (i=0; i < NamedColorList ->ColorantCount; i++) - NamedColorList ->List[NamedColorList ->nColors].DeviceColorant[i] = Colorant == NULL? 0 : Colorant[i]; + NamedColorList ->List[NamedColorList ->nColors].DeviceColorant[i] = Colorant == NULL ? (cmsUInt16Number)0 : Colorant[i]; for (i=0; i < 3; i++) - NamedColorList ->List[NamedColorList ->nColors].PCS[i] = PCS == NULL ? 0 : PCS[i]; + NamedColorList ->List[NamedColorList ->nColors].PCS[i] = PCS == NULL ? (cmsUInt16Number) 0 : PCS[i]; if (Name != NULL) { @@ -661,13 +661,14 @@ cmsBool CMSEXPORT cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cm // Search for a given color name (no prefix or suffix) cmsInt32Number CMSEXPORT cmsNamedColorIndex(const cmsNAMEDCOLORLIST* NamedColorList, const char* Name) { - int i, n; + cmsUInt32Number i; + cmsUInt32Number n; if (NamedColorList == NULL) return -1; n = cmsNamedColorCount(NamedColorList); for (i=0; i < n; i++) { if (cmsstrcasecmp(Name, NamedColorList->List[i].Name) == 0) - return i; + return (cmsInt32Number) i; } return -1; |