From 6fe7fbdc6b24c25458be456e16c622969e989f16 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 3 Jan 2015 18:50:20 +0100 Subject: Remove dead / unused code Again: Compiler happy, we are happy. --- src/FbTk/TextureRender.cc | 33 +++++-------------------------- src/FbTk/XmbFontImp.cc | 50 ----------------------------------------------- 2 files changed, 5 insertions(+), 78 deletions(-) diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc index 5429003..0571b16 100644 --- a/src/FbTk/TextureRender.cc +++ b/src/FbTk/TextureRender.cc @@ -181,29 +181,6 @@ void prepareLinearTable(size_t size, FbTk::RGBA* rgba, } } -void prepareSquareTable(size_t size, FbTk::RGBA* rgba, - const FbTk::Color* from, const FbTk::Color* to, double scale) { - - - const double r = from->red(); - const double g = from->green(); - const double b = from->blue(); - - const double delta_r = (to->red() - r); - const double delta_g = (to->green() - g); - const double delta_b = (to->blue() - b); - - double s; - size_t i; - for (i = 0; i < size; ++i) { - s = 1.0 - ((double)(i + 1) / (double)size); - s *= s; - rgba[i].r = static_cast(scale * (r + (s * delta_r))); - rgba[i].g = static_cast(scale * (g + (s * delta_g))); - rgba[i].b = static_cast(scale * (b + (s * delta_b))); - } -} - // // // To + . From + . @@ -591,17 +568,17 @@ void renderEllipticGradient(bool interlaced, double _y; double d; - for (i = 0, y = 0; y < height; ++y) { - for (x = 0; x < width; ++x, ++i) { + for (i = 0, y = 0; y < static_cast(height); ++y) { + for (x = 0; x < static_cast(width); ++x, ++i) { _x = x - w2; _y = y - h2; d = ((_x * _x * sw) + (_y * _y * sh)) / 2.0; - rgba[i].r = (unsigned char)(r - (d * dr)); - rgba[i].g = (unsigned char)(g - (d * dg)); - rgba[i].b = (unsigned char)(b - (d * db)); + rgba[i].r = static_cast(r - (d * dr)); + rgba[i].g = static_cast(g - (d * dg)); + rgba[i].b = static_cast(b - (d * db)); pseudoInterlace(rgba[i], interlaced, y); } diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index e73670c..557708a 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc @@ -51,56 +51,6 @@ using std::string; namespace { -const char *getFontSize(const char *pattern, int *size) { - const char *p; - const char *p2=0; - int n=0; - - for (p=pattern; 1; p++) { - if (!*p) { - if (p2!=0 && n>1 && n<72) { - *size = n; return p2+1; - } else { - *size = 16; return 0; - } - } else if (*p=='-') { - if (n>1 && n<72 && p2!=0) { - *size = n; - return p2+1; - } - p2=p; n=0; - } else if (*p>='0' && *p<='9' && p2!=0) { - n *= 10; - n += *p-'0'; - } else { - p2=0; n=0; - } - } -} - -const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) { - const char *p, *v; - char *p2; - va_list va; - - va_start(va, bufsiz); - buf[bufsiz-1] = 0; - buf[bufsiz-2] = '*'; - while((v = va_arg(va, char *)) != 0) { - p = FbTk::StringUtil::strcasestr(pattern, v); - if (p) { - strncpy(buf, p+1, bufsiz-2); - p2 = strchr(buf, '-'); - if (p2) *p2=0; - va_end(va); - return p; - } - } - va_end(va); - strncpy(buf, "*", bufsiz); - return 0; -} - XFontSet createFontSet(const char *fontname, bool& utf8mode) { Display *display = FbTk::App::instance()->display(); XFontSet fs; -- cgit v0.11.2