From 6d22edc2d8accdfa1fabdd2722859453cc734990 Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 2 Apr 2015 11:57:19 +0200 Subject: [PATCH] fixed some compiler warnings --- libcore/helpers.c | 2 +- libcore/imagecache.c | 4 +++- libtemplate/parameter.c | 2 +- libtemplate/parameter.h | 2 +- libtemplate/templatefunction.c | 4 +++- libtemplate/templatepixmap.c | 2 -- libtemplate/templateviewlist.c | 1 - views/view.c | 6 ++---- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libcore/helpers.c b/libcore/helpers.c index 3e08e11..5dc5156 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -156,7 +156,7 @@ vector& splitstring::split(char delim, int rep) { string work = data(); string buf = ""; int i = 0; - while (i < work.length()) { + while (i < (int)work.length()) { if (work[i] != delim) buf += work[i]; else if (rep == 1) { diff --git a/libcore/imagecache.c b/libcore/imagecache.c index ad063f6..3d80f9b 100644 --- a/libcore/imagecache.c +++ b/libcore/imagecache.c @@ -91,7 +91,7 @@ cImage *cImageCache::GetLogo(string channelID, int width, int height) { return NULL; bool success = LoadLogo(channel); if (success) { - if (config.limitLogoCache && (channelLogoCache.size() >= config.numLogosMax)) { + if (config.limitLogoCache && ((int)channelLogoCache.size() >= config.numLogosMax)) { //logo cache is full, don't cache anymore if (tempStaticLogo) { delete tempStaticLogo; @@ -245,6 +245,8 @@ string cImageCache::GetIconName(string label, eMenuCategory cat) { return "standardicons/Miscellaneous"; case mcCommand: return "standardicons/Commands"; + default: + break; } //check for standard menu entries for (int i=0; i<16; i++) { diff --git a/libtemplate/parameter.c b/libtemplate/parameter.c index 1479014..1675a8d 100644 --- a/libtemplate/parameter.c +++ b/libtemplate/parameter.c @@ -254,7 +254,7 @@ void cConditionalParameter::Tokenize(void) { } } -bool cConditionalParameter::Evaluate(map < string, int > *intTokens, map < string, string > *stringTokens) { +void cConditionalParameter::Evaluate(map < string, int > *intTokens, map < string, string > *stringTokens) { isTrue = false; bool first = true; for (vector::iterator cond = conditions.begin(); cond != conditions.end(); cond++) { diff --git a/libtemplate/parameter.h b/libtemplate/parameter.h index c92af28..bd20758 100644 --- a/libtemplate/parameter.h +++ b/libtemplate/parameter.h @@ -134,7 +134,7 @@ public: cConditionalParameter(cGlobals *globals, string value); virtual ~cConditionalParameter(void); void Tokenize(void); - bool Evaluate(map < string, int > *intTokens, map < string, string > *stringTokens); + void Evaluate(map < string, int > *intTokens, map < string, string > *stringTokens); bool IsTrue(void) { return isTrue; }; void Debug(void); }; diff --git a/libtemplate/templatefunction.c b/libtemplate/templatefunction.c index 9cd1861..6aa1ddd 100644 --- a/libtemplate/templatefunction.c +++ b/libtemplate/templatefunction.c @@ -316,6 +316,8 @@ bool cTemplateFunction::ReCalculateParameters(void) { case ptRowHeight: SetNumericParameter(type, value); break; + default: + break; } if (!paramValid) { paramsValid = false; @@ -1356,7 +1358,7 @@ int cTemplateFunction::CalculateTextBoxHeight(void) { stringstream sstrTextTall; stringstream sstrTextFull; - for (int i=0; i *string InitIterator(); cTemplateFunction *func = NULL; bool completelyParsed = true; - bool updated = false; while(func = GetNextFunction()) { func->SetStringTokens(stringTokens); func->SetIntTokens(intTokens); @@ -340,7 +339,6 @@ cTemplateFunction *cTemplatePixmap::GetScrollFunction(void) { return NULL; InitIterator(); cTemplateFunction *f = NULL; - bool foundElement = false; while (f = GetNextFunction()) { string funcName = f->GetParameter(ptName); if (!funcName.compare(scrollElement)) { diff --git a/libtemplate/templateviewlist.c b/libtemplate/templateviewlist.c index 0a6cabc..1d5dabe 100644 --- a/libtemplate/templateviewlist.c +++ b/libtemplate/templateviewlist.c @@ -115,7 +115,6 @@ cFont *cTemplateViewList::GetTextAreaFont(void) { if (!listElement) return NULL; - int fontWidth = 0; int numItems = GetNumericParameter(ptNumElements); int listHeight = GetNumericParameter(ptHeight); if (listHeight <= 0) diff --git a/views/view.c b/views/view.c index 344a350..3d7f369 100644 --- a/views/view.c +++ b/views/view.c @@ -360,8 +360,7 @@ void cView::DrawLoop(int numPixmap, cTemplateFunction *func, map < string, vecto int columnWidth = loopFunc->GetNumericParameter(ptColumnWidth); int rowHeight = loopFunc->GetNumericParameter(ptRowHeight); int overflow = loopFunc->GetNumericParameter(ptOverflow); - int maxItems = loopFunc->GetNumericParameter(ptNumElements); - + int x0 = loopX0; int y0 = loopY0; @@ -515,7 +514,6 @@ void cView::DoDrawTextVertical(int num, cTemplateFunction *func, int x0, int y0) int fontSize = func->GetNumericParameter(ptFontSize); int direction = func->GetNumericParameter(ptDirection); tColor clr = func->GetColorParameter(ptColor); - tColor clrBack = clrTransparent; string text = func->GetText(false); cImage *textVertical = imgCache->GetVerticalText(text, clr, fontName, fontSize, direction); if (!textVertical) @@ -649,7 +647,7 @@ void cView::DoDrawFloatingTextBox(int num, cTemplateFunction *func) { std::stringstream sstrTextTall; std::stringstream sstrTextFull; - for (int i=0; i