diff --git a/lib/libnet/network_interfaces.cpp b/lib/libnet/network_interfaces.cpp index 5a4bc14f0..f97b2b9fe 100644 --- a/lib/libnet/network_interfaces.cpp +++ b/lib/libnet/network_interfaces.cpp @@ -24,6 +24,7 @@ #include #include #include +#include /* * Known bugs: diff --git a/lib/libupnpclient/UPNPDevice.cpp b/lib/libupnpclient/UPNPDevice.cpp index 67eb72cbb..98660c2b9 100644 --- a/lib/libupnpclient/UPNPDevice.cpp +++ b/lib/libupnpclient/UPNPDevice.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "upnpclient.h" #include diff --git a/lib/libupnpclient/UPNPSocket.cpp b/lib/libupnpclient/UPNPSocket.cpp index 31f779a76..5c3bcbe6e 100644 --- a/lib/libupnpclient/UPNPSocket.cpp +++ b/lib/libupnpclient/UPNPSocket.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include "upnpclient.h" diff --git a/src/driver/pictureviewer/gif.cpp b/src/driver/pictureviewer/gif.cpp index 3e2c837d4..a37238772 100644 --- a/src/driver/pictureviewer/gif.cpp +++ b/src/driver/pictureviewer/gif.cpp @@ -6,6 +6,7 @@ #ifdef FBV_SUPPORT_GIF #include "pictureviewer.h" #include + #include #include #include #include diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index d0aa23b0c..39ca3203d 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -5,7 +5,7 @@ #include "pv_config.h" #include "driver/framebuffer.h" - +#include #include #include #include @@ -587,7 +587,7 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width, if (buffer == NULL) { printf("%s: Error: malloc\n", mode_str.c_str()); - return false; + return 0; } #ifdef FBV_SUPPORT_PNG if ((name.find(".png") == (name.length() - 4)) && (fh_png_id(name.c_str()))) diff --git a/src/driver/shutdown_count.cpp b/src/driver/shutdown_count.cpp index c9219f583..9bf77c2f1 100644 --- a/src/driver/shutdown_count.cpp +++ b/src/driver/shutdown_count.cpp @@ -34,6 +34,7 @@ #include #include +#include SHTDCNT::SHTDCNT() diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4c981d36f..1fb5be216 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -75,6 +75,7 @@ #include #include #include +#include #if 0 #ifdef ENABLE_LIRC diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 40a99f109..b6bc1afb2 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1209,8 +1209,9 @@ int CChannelList::numericZap(int key) } return res; } - - int sx = 4 * g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(widest_number) + 14; + size_t maxchansize = MaxChanNr().size(); + int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(widest_number); + int sx = maxchansize * fw + (fw/2); int sy = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight() + 6; int ox = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - sx)/2; @@ -1225,14 +1226,14 @@ int CChannelList::numericZap(int key) while(1) { if (lastchan != chn) { snprintf((char*) &valstr, sizeof(valstr), "%d", chn); - while(strlen(valstr) < 4) - strcat(valstr,"-"); //"_" + while(strlen(valstr) < maxchansize) + strcat(valstr,"-"); //"_" frameBuffer->paintBoxRel(ox, oy, sx, sy, COL_INFOBAR_PLUS_0); - for (int i = 3; i >= 0; i--) { + for (int i = maxchansize-1; i >= 0; i--) { valstr[i+ 1] = 0; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+7+ i*((sx-14)>>2), oy+sy-3, sx, &valstr[i], COL_INFOBAR); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+fw/3+ i*fw, oy+sy-3, sx, &valstr[i], COL_INFOBAR); } showInfo(chn); @@ -1960,17 +1961,7 @@ void CChannelList::paintHead() void CChannelList::paint() { - zapit_list_it_t chan_it; - std::stringstream ss; - std::string chan_width; - int chan_nr_max = 1; - unsigned int nr = 0; - for (chan_it=chanlist.begin(); chan_it!=chanlist.end(); ++chan_it) { - chan_nr_max = std::max(chan_nr_max, chanlist[nr++]->number); - } - ss << chan_nr_max; - ss >> chan_width; - numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(chan_width.c_str()); + numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(MaxChanNr().c_str()); liststart = (selected/listmaxshow)*listmaxshow; updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow)); @@ -2034,3 +2025,17 @@ bool CChannelList::SameTP(CZapitChannel * channel) } return iscurrent; } +std::string CChannelList::MaxChanNr() +{ + zapit_list_it_t chan_it; + std::stringstream ss; + std::string maxchansize; + int chan_nr_max = 1; + unsigned int nr = 0; + for (chan_it=chanlist.begin(); chan_it!=chanlist.end(); ++chan_it) { + chan_nr_max = std::max(chan_nr_max, chanlist[nr++]->number); + } + ss << chan_nr_max; + ss >> maxchansize; + return maxchansize; +} diff --git a/src/gui/channellist.h b/src/gui/channellist.h index e723ac72a..1159d6646 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -96,6 +96,7 @@ private: void hide(); void showChannelLogo(); void calcSize(); + std::string MaxChanNr(); public: CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false, bool new_mode_active = false ); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index fb36e479a..9bfc94f0e 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -47,6 +47,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 6449d5fea..dee035330 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index fdecf0735..219926767 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 7f1bb4b4d..1d0f8a193 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index dff2e4448..bdd13f175 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -59,14 +59,15 @@ #include #include #include "neutrino.h" -#include #include // for statfs -#include #include #include +#include +#include #include #include #include +#include #include extern CPictureViewer * g_PicViewer; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 7e0a785a5..a455736b3 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3c467fd18..373e2e031 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include #include diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 151f1520e..4d2d1586c 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include extern cVideo * videoDecoder; diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 11c0a3507..ddef565df 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -11,6 +11,7 @@ // C #include #include +#include // C++ #include diff --git a/src/nhttpd/yhttpd_core/ylanguage.cpp b/src/nhttpd/yhttpd_core/ylanguage.cpp index 80bde852b..38c67f9df 100644 --- a/src/nhttpd/yhttpd_core/ylanguage.cpp +++ b/src/nhttpd/yhttpd_core/ylanguage.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // yhttpd #include diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 5f648ea6b..94fb344bd 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -21,6 +21,8 @@ #include #include #include +#include + // system #include #include diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index 64aad7195..c010a0f74 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -7,6 +7,8 @@ #include #include #include +#include + // c++ #include // system diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index 76098536f..d78912640 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -14,6 +14,8 @@ #include #include #include +#include + // yhttpd #include "yhttpd.h" #include "ysocket.h" diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index c0a36ec8c..1e0d42b02 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -45,6 +45,7 @@ #include #include #include +#include // yhttpd #include "yconfig.h" #include "ytypes_globals.h" diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.cpp b/src/nhttpd/yhttpd_mods/mod_weblog.cpp index 8f467b6f5..4d25f6e3f 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.cpp +++ b/src/nhttpd/yhttpd_mods/mod_weblog.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "mod_weblog.h" #include "helper.h" diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index dbdcd0c99..cc58d4b98 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -23,6 +23,7 @@ #include #include /* u_char */ #include +#include #include "configure_network.h" #include "libnet.h" /* netGetNameserver, netSetNameserver */ #include "network_interfaces.h" /* getInetAttributes, setInetAttributes */ diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 141b6cca6..12ce8c80d 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -28,6 +28,7 @@ #include #include #include +#include //#define SAVE_DEBUG