diff --git a/data/inetradio/radio-stations.xml b/data/inetradio/radio-stations.xml
index 629d9f353..1f13e4d83 100644
--- a/data/inetradio/radio-stations.xml
+++ b/data/inetradio/radio-stations.xml
@@ -20,93 +20,28 @@
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-| Copyright (C) 2010-2013 Stefan Seyfried
+| Copyright (C) 2010-2013, 2017 Stefan Seyfried
|
| netfile - remote file access mapper
|
@@ -140,6 +140,9 @@ known bugs:
#undef fseek
#endif
+/* somewhat safe, 0-terminated sprintf and strcpy */
+#define SPRINTF(a, b...) snprintf(a, sizeof(a)-1, b)
+#define STRCPY(a, b) { strncpy(a, b, sizeof(a)-1); a[sizeof(a)-1] = 0; }
@@ -178,7 +181,7 @@ magic_t known_magic[] =
char err_txt[2048]; /* human readable error message */
char redirect_url[2048]; /* new url if we've been redirected (HTTP 301/302) */
static int debug = 0; /* print debugging output or not */
-static char logfile[255]; /* redirect errors from stderr */
+static char logfile[256]; /* redirect errors from stderr */
static int retry_num = 2 /*10*/; /* number of retries for failed connections */
static int enable_metadata = 0; /* allow shoutcast meta data streaming */
static int got_opts = 0; /* is set to 1 if getOpts() was executed */
@@ -250,7 +253,7 @@ void getOpts()
if((ptr = strstr(buf, "logfile=")))
{
- strcpy(logfile, strchr(ptr, '=') + 1);
+ STRCPY(logfile, strchr(ptr, '=') + 1);
CRLFCut(logfile);
freopen(logfile, "w", stderr);
}
@@ -288,7 +291,7 @@ int ConnectToServer(char *hostname, int port)
if(fd == -1)
{
- strcpy(err_txt, strerror(errno));
+ STRCPY(err_txt, strerror(errno));
return -1;
}
@@ -305,7 +308,7 @@ int ConnectToServer(char *hostname, int port)
{
if(errno != EINPROGRESS) {
close(fd);
- strcpy(err_txt, strerror(errno));
+ STRCPY(err_txt, strerror(errno));
dprintf(stderr, "error connecting to %s: %s\n", hostname, err_txt);
return -1;
}
@@ -318,7 +321,7 @@ int ConnectToServer(char *hostname, int port)
int ret = poll(&pfd, 1, 5000);
if(ret != 1) {
- strcpy(err_txt, strerror(errno));
+ STRCPY(err_txt, strerror(errno));
dprintf(stderr, "error connecting to %s: %s\n", hostname, err_txt);
close(fd);
return -1;
@@ -339,7 +342,7 @@ int ConnectToServer(char *hostname, int port)
int request_file(URL *url)
{
- char str[255], *ptr;
+ char str[256], *ptr;
int slot;
ID3 id3;
memset(&id3, 0, sizeof(ID3));
@@ -386,18 +389,18 @@ int request_file(URL *url)
if (url->logindata[0])
{
- sprintf(str, "Authorization: Basic %s\r\n", url->logindata);
+ SPRINTF(str, "Authorization: Basic %s\r\n", url->logindata);
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
}
- snprintf(str, sizeof(str)-1, "Accept: */*\r\n");
+ strcpy(str, "Accept: */*\r\n");
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
if(enable_metadata)
{
- snprintf(str, sizeof(str)-1, "Icy-MetaData: 1\r\n");
+ strcpy(str, "Icy-MetaData: 1\r\n");
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
}
@@ -464,32 +467,32 @@ int request_file(URL *url)
int meta_int;
CSTATE tmp;
- sprintf(str, "GET %s HTTP/1.0\r\n", url->file);
+ SPRINTF(str, "GET %s HTTP/1.0\r\n", url->file);
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
- sprintf(str, "Host: %s\r\n", url->host);
+ SPRINTF(str, "Host: %s\r\n", url->host);
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
if(enable_metadata)
{
- sprintf(str, "icy-metadata: 1\r\n");
+ strcpy(str, "icy-metadata: 1\r\n");
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
}
- sprintf(str, "User-Agent: %s\r\n", "RealPlayer/4.0");
+ SPRINTF(str, "User-Agent: %s\r\n", "RealPlayer/4.0");
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
if (url->logindata[0])
{
- sprintf(str, "Authorization: Basic %s\r\n", url->logindata);
+ SPRINTF(str, "Authorization: Basic %s\r\n", url->logindata);
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
}
- sprintf(str, "\r\n"); /* end of headers to send */
+ strcpy(str, "\r\n"); /* end of headers to send */
dprintf(stderr, "> %s", str);
send(url->fd, str, strlen(str), 0);
@@ -623,14 +626,14 @@ int parse_response(URL *url, void * /*opt*/, CSTATE *state)
case 301: /* 'file moved' error */
case 302: /* 'file not found' error */
errno = ENOENT;
- strcpy(err_txt, ptr);
+ STRCPY(err_txt, ptr);
getHeaderStr("Location", redirect_url);
return -1 * response;
break;
case 404: /* 'file not found' error */
errno = ENOENT;
- strcpy(err_txt, ptr);
+ STRCPY(err_txt, ptr);
return -1;
break;
@@ -831,7 +834,7 @@ FILE *f_open(const char *filename, const char *acctype)
if(ptr)
*ptr = 0;
- sprintf(url.url, "%s", buf);
+ STRCPY(url.url, buf);
}
else
return NULL;
@@ -907,7 +910,7 @@ FILE *f_open(const char *filename, const char *acctype)
/* no free cache slot ? return an error */
if(i == CACHEENTMAX)
{
- sprintf(err_txt, "no more free cache slots. Too many open files.\n");
+ strcpy(err_txt, "no more free cache slots. Too many open files.\n");
return NULL;
}
@@ -993,9 +996,9 @@ FILE *f_open(const char *filename, const char *acctype)
/* create either a shoutcast or an icecast query */
if(url.access_mode == MODE_SCAST)
- sprintf(buf2, "http://classic.shoutcast.com/directory/?orderby=listeners&s=%s", url.host);
+ SPRINTF(buf2, "http://classic.shoutcast.com/directory/?orderby=listeners&s=%s", url.host);
else
- sprintf(buf2, "http://www.icecast.org/streamlist.php?search=%s", url.host);
+ SPRINTF(buf2, "http://www.icecast.org/streamlist.php?search=%s", url.host);
//findme
// ICECAST: it ain't that simple. Icecast doesn't work yet */
@@ -1004,7 +1007,7 @@ FILE *f_open(const char *filename, const char *acctype)
if(!_fd)
{
- sprintf(err_txt, "%s database query failed\nfailed action: %s",
+ SPRINTF(err_txt, "%s database query failed\nfailed action: %s",
((url.access_mode == MODE_SCAST) ? "shoutcast" : "icecast"), buf2);
return NULL;
}
@@ -1016,17 +1019,18 @@ FILE *f_open(const char *filename, const char *acctype)
if(!ptr)
{
- sprintf(err_txt, "failed to find station number");
+ strcpy(err_txt, "failed to find station number");
dprintf(stderr, "%s\n", buf2);
return NULL;
}
- sprintf(url.host, "%d", atoi(ptr + 3));
+ SPRINTF(url.host, "%d", atoi(ptr + 3));
}
/* create the correct url from the station number */
CRLFCut(url.host);
- sprintf(url.url, "http://classic.shoutcast.com/sbin/shoutcast-playlist.pls?rn=%s&file=filename.pls", url.host);
+ SPRINTF(url.url, "http://classic.shoutcast.com/sbin/shoutcast-playlist.pls?rn=%s&file=filename.pls", url.host);
+ /* fall through */
case MODE_PLS: {
char *ptr2, /*buf[4096], use local buf from function */ servers[25][1024];
@@ -1061,7 +1065,7 @@ FILE *f_open(const char *filename, const char *acctype)
if(!ptr)
{
dprintf(stderr, "Ups! Playlist doesn't seem to contain any URL !\nbuffer:%s\n", buf);
- sprintf(err_txt, "Ups! Playlist doesn't seem to contain any URL !");
+ strcpy(err_txt, "Ups! Playlist doesn't seem to contain any URL !");
return NULL;
}
@@ -1088,7 +1092,7 @@ FILE *f_open(const char *filename, const char *acctype)
const char* const chptr = strstr(servers[i], "://");
if(chptr)
{
- sprintf(url.url, "icy%s", chptr);
+ snprintf(url.url, sizeof(url.url)-1, "icy%s", chptr);
fd = f_open(url.url, "r");
}
}
diff --git a/src/driver/pictureviewer/Makefile.am b/src/driver/pictureviewer/Makefile.am
index eac9fabea..e6316e290 100644
--- a/src/driver/pictureviewer/Makefile.am
+++ b/src/driver/pictureviewer/Makefile.am
@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/lib/libconfigfile \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_pictureviewer.a
diff --git a/src/driver/pictureviewer/crw.cpp b/src/driver/pictureviewer/crw.cpp
index e081aba57..1de75cdc7 100644
--- a/src/driver/pictureviewer/crw.cpp
+++ b/src/driver/pictureviewer/crw.cpp
@@ -173,7 +173,7 @@ int fh_crw_load(const char *filename,unsigned char **buffer,int* xp,int* /*yp*/)
struct jpeg_decompress_struct *ciptr;
struct r_crw_jpeg_error_mgr emgr;
unsigned char *bp;
- int px/*,py*/,c,x=*xp;
+ int px/*,py*/,c,x=*xp, ix;
FILE *fh;
JSAMPLE *lb;
@@ -195,21 +195,22 @@ int fh_crw_load(const char *filename,unsigned char **buffer,int* xp,int* /*yp*/)
jpeg_stdio_src(ciptr,fh);
jpeg_read_header(ciptr,TRUE);
ciptr->out_color_space=JCS_RGB;
- if(x==(int)ciptr->image_width)
+ ix = (int)ciptr->image_width;
+ if (x == ix)
ciptr->scale_denom=1;
#if __cplusplus < 201103
- else if(abs(x*2 - ciptr->image_width) < 2)
+ else if (abs(x*2 - ix) < 2)
ciptr->scale_denom=2;
- else if(abs(x*4 - ciptr->image_width) < 4)
+ else if (abs(x*4 - ix) < 4)
ciptr->scale_denom=4;
- else if(abs(x*8 - ciptr->image_width) < 8)
+ else if (abs(x*8 - ix) < 8)
ciptr->scale_denom=8;
#else
- else if(std::abs(x*2 - ciptr->image_width) < 2)
+ else if (std::abs(x*2 - ix) < 2)
ciptr->scale_denom=2;
- else if(std::abs(x*4 - ciptr->image_width) < 4)
+ else if (std::abs(x*4 - ix) < 4)
ciptr->scale_denom=4;
- else if(std::abs(x*8 - ciptr->image_width) < 8)
+ else if (std::abs(x*8 - ix) < 8)
ciptr->scale_denom=8;
#endif
else
diff --git a/src/driver/pictureviewer/jpeg.cpp b/src/driver/pictureviewer/jpeg.cpp
index accb8a512..a61c91229 100644
--- a/src/driver/pictureviewer/jpeg.cpp
+++ b/src/driver/pictureviewer/jpeg.cpp
@@ -72,7 +72,7 @@ int fh_jpeg_load(const char *filename,unsigned char **buffer,int* x,int* y)
struct jpeg_decompress_struct *ciptr;
struct r_jpeg_error_mgr emgr;
unsigned char *bp;
- int px,py,c;
+ int px,py,c, ix;
FILE *fh;
JSAMPLE *lb;
@@ -94,21 +94,22 @@ int fh_jpeg_load(const char *filename,unsigned char **buffer,int* x,int* y)
jpeg_read_header(ciptr,TRUE);
ciptr->out_color_space=JCS_RGB;
ciptr->dct_method=JDCT_FASTEST;
- if(*x==(int)ciptr->image_width)
+ ix = (int)ciptr->image_width;
+ if(*x == ix)
ciptr->scale_denom=1;
#if __cplusplus < 201103
- else if(abs(*x*2 - ciptr->image_width) < 2)
+ else if (abs(*x*2 - ix) < 2)
ciptr->scale_denom=2;
- else if(abs(*x*4 - ciptr->image_width) < 4)
+ else if (abs(*x*4 - ix) < 4)
ciptr->scale_denom=4;
- else if(abs(*x*8 - ciptr->image_width) < 8)
+ else if (abs(*x*8 - ix) < 8)
ciptr->scale_denom=8;
#else
- else if(std::abs(*x*2 - ciptr->image_width) < 2)
+ else if (std::abs(*x*2 - ix) < 2)
ciptr->scale_denom=2;
- else if(std::abs(*x*4 - ciptr->image_width) < 4)
+ else if (std::abs(*x*4 - ix) < 4)
ciptr->scale_denom=4;
- else if(std::abs(*x*8 - ciptr->image_width) < 8)
+ else if (std::abs(*x*8 - ix) < 8)
ciptr->scale_denom=8;
#endif
else
diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp
index 6374b477e..a97def1fa 100644
--- a/src/driver/radiotext.cpp
+++ b/src/driver/radiotext.cpp
@@ -289,6 +289,7 @@ if (i < 0) { fprintf(stderr, "RT %s: i < 0 (%d)\n", __FUNCTION__, i); break; }
switch (val) {
case 0x0a: // RT
have_radiotext = true;
+ /* fall through */
case 0x46: // RTplus-Tags
case 0xda: // RASS
case 0x07: // PTY
diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp
index 96b521cbe..d4a3307da 100644
--- a/src/driver/rcinput.cpp
+++ b/src/driver/rcinput.cpp
@@ -473,7 +473,7 @@ int CRCInput::addTimer(uint64_t Interval, bool oneshot, bool correct_time )
_newtimer.correct_time = correct_time;
-printf("adding timer %d (0x%lu, 0x%lu)\n", _newtimer.id, _newtimer.times_out, Interval);
+//printf("adding timer %d (0x%" PRIx64 ", 0x%" PRIx64 ")\n", _newtimer.id, _newtimer.times_out, Interval);
std::vector::iterator e;
for ( e= timers.begin(); e!= timers.end(); ++e )
@@ -486,7 +486,7 @@ printf("adding timer %d (0x%lu, 0x%lu)\n", _newtimer.id, _newtimer.times_out, In
void CRCInput::killTimer(uint32_t &id)
{
-printf("killing timer %d\n", id);
+//printf("killing timer %d\n", id);
if(id == 0)
return;
diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp
index 285efba55..0d4b73f89 100644
--- a/src/driver/screenshot.cpp
+++ b/src/driver/screenshot.cpp
@@ -274,6 +274,7 @@ bool CScreenShot::SaveFile()
break;
default:
printf("CScreenShot::SaveFile unsupported format %d, using jpeg\n", format);
+ /* fall through */
case FORMAT_JPG:
ret = SaveJpg();
break;
@@ -513,6 +514,7 @@ void CScreenShot::MakeFileName(const t_channel_id channel_id)
break;
default:
printf("CScreenShot::MakeFileName unsupported format %d, using jpeg\n", format);
+ /* fall through */
case FORMAT_JPG:
strcat(fname, ".jpg");
break;
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am
index e8e307320..d0c9103fc 100644
--- a/src/gui/Makefile.am
+++ b/src/gui/Makefile.am
@@ -38,6 +38,7 @@ AM_CPPFLAGS += \
@CURL_CFLAGS@ \
@FREETYPE_CFLAGS@ \
@AVFORMAT_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libtimerlist.a libneutrino_gui.a libneutrino_gui2.a
diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp
index 9d0435cf8..f427c249f 100644
--- a/src/gui/audioplayer.cpp
+++ b/src/gui/audioplayer.cpp
@@ -4,7 +4,7 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Copyright (C) 2002-2008 the tuxbox project contributors
Copyright (C) 2008 Novell, Inc. Author: Stefan Seyfried
- Copyright (C) 2011-2013 Stefan Seyfried
+ Copyright (C) 2011-2013,2015,2017 Stefan Seyfried
Copyright (C) 2017 Sven Hoefer
License: GPL
@@ -890,7 +890,7 @@ int CAudioPlayerGui::show()
smsKey = m_SMSKeyInput.handleMsg(msg);
//printf(" new key: %c", smsKey);
/* show a hint box with current char (too slow at the moment?)*/
- char selectedKey[1];
+ char selectedKey[2];
sprintf(selectedKey,"%c",smsKey);
int x1=(g_settings.screen_EndX- g_settings.screen_StartX)/2 + g_settings.screen_StartX-50;
int y1=(g_settings.screen_EndY- g_settings.screen_StartY)/2 + g_settings.screen_StartY;
@@ -1170,9 +1170,13 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons
if (line[0] != '#')
{
//printf("chunk: line = %s\n", line);
- ptr = strstr(line, "http://");
- if (ptr != NULL)
- {
+ const char *schemes[] = {"http://", "https://", NULL };
+ const char **scheme = schemes;
+ while (*scheme) {
+ ptr = strstr(line, *scheme);
+ scheme++;
+ if (ptr == NULL)
+ continue;
char *tmp;
// strip \n and \r characters from url
tmp = strchr(line, '\r');
@@ -1182,6 +1186,7 @@ void CAudioPlayerGui::processPlaylistUrl(const char *url, const char *name, cons
if (tmp != NULL)
*tmp = '\0';
addUrl2Playlist(ptr, name, logo, tim);
+ break;
}
}
}
diff --git a/src/gui/bedit/Makefile.am b/src/gui/bedit/Makefile.am
index 5dd05af1e..269ac532a 100644
--- a/src/gui/bedit/Makefile.am
+++ b/src/gui/bedit/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/lib/xmltree \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_gui_bedit.a
diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am
index e43158b13..3364ad773 100644
--- a/src/gui/components/Makefile.am
+++ b/src/gui/components/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/lib/xmltree \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_gui_components.a
diff --git a/src/gui/imdb.cpp b/src/gui/imdb.cpp
index 3ce74cbfb..45d2c4480 100644
--- a/src/gui/imdb.cpp
+++ b/src/gui/imdb.cpp
@@ -33,6 +33,7 @@
#include
#include
#include
+#include
#include
#include
@@ -246,20 +247,20 @@ std::string CIMDB::googleIMDb(std::string s)
void CIMDB::initMap( std::map& my )
{
+ string errMsg = "";
Json::Value root;
- Json::Reader reader;
std::ostringstream ss;
std::ifstream fh(imdb_outfile.c_str(),std::ifstream::in);
ss << fh.rdbuf();
std::string filedata = ss.str();
- bool parsedSuccess = reader.parse(filedata,root,false);
+ bool parsedSuccess = parseJsonFromString(filedata, &root, &errMsg);
if(!parsedSuccess)
{
std::cout << "Failed to parse JSON\n";
- std::cout << reader.getFormattedErrorMessages() << std::endl;
+ std::cout << errMsg << std::endl;
my["Response"] = "False"; // we fake a false response
return;
diff --git a/src/gui/lua/lua_threads_copy.cpp b/src/gui/lua/lua_threads_copy.cpp
index a7d140018..6dba1651f 100644
--- a/src/gui/lua/lua_threads_copy.cpp
+++ b/src/gui/lua/lua_threads_copy.cpp
@@ -119,6 +119,7 @@ int CLLThread::llthread_copy_value(llthread_copy_state *state, int depth, int id
lua_pushcfunction(state->to_L, fn);
break;
}
+ /* else fall through */
case LUA_TUSERDATA:
case LUA_TTHREAD:
default:
diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp
index 1b9e38e36..7f3930a3c 100644
--- a/src/gui/motorcontrol.cpp
+++ b/src/gui/motorcontrol.cpp
@@ -350,7 +350,9 @@ void CMotorControl::motorStep(bool west)
case STEP_MODE_AUTO:
moving = 1;
paintStatus();
+ /* fall through */
default:
+ /* what is STEP_MODE_OFF supposed to do? */
g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, 40, 0);
}
}
diff --git a/src/gui/moviebrowser/Makefile.am b/src/gui/moviebrowser/Makefile.am
index 46379f2ca..438c3ac84 100644
--- a/src/gui/moviebrowser/Makefile.am
+++ b/src/gui/moviebrowser/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/lib/xmltree \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_gui_moviebrowser.a
diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp
index 3ef88b065..2de63200f 100644
--- a/src/gui/moviebrowser/mb.cpp
+++ b/src/gui/moviebrowser/mb.cpp
@@ -2586,8 +2586,8 @@ bool CMovieBrowser::onDelete(bool cursor_only)
getSelectedFiles(filelist, movielist);
- printf("CMovieBrowser::onDelete(%s) filelist size: %lu\n", cursor_only ? "true" : "false", filelist.size());
- printf("CMovieBrowser::onDelete(%s) movielist size: %lu\n", cursor_only ? "true" : "false", movielist.size());
+ printf("CMovieBrowser::onDelete(%s) filelist size: %zd\n", cursor_only ? "true" : "false", filelist.size());
+ printf("CMovieBrowser::onDelete(%s) movielist size: %zd\n", cursor_only ? "true" : "false", movielist.size());
if (cursor_only || (filelist.empty() || movielist.empty()))
{
@@ -2602,8 +2602,8 @@ bool CMovieBrowser::onDelete(bool cursor_only)
filelist.push_back(m_movieSelectionHandler->file);
movielist.push_back(m_movieSelectionHandler);
- printf("CMovieBrowser::onDelete(%s) filelist size: %lu\n", cursor_only ? "true" : "false", filelist.size());
- printf("CMovieBrowser::onDelete(%s) movielist size: %lu\n", cursor_only ? "true" : "false", movielist.size());
+ printf("CMovieBrowser::onDelete(%s) filelist size: %zd\n", cursor_only ? "true" : "false", filelist.size());
+ printf("CMovieBrowser::onDelete(%s) movielist size: %zd\n", cursor_only ? "true" : "false", movielist.size());
}
MI_MOVIE_LIST dellist;
diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp
index 207020eab..5c1e29647 100644
--- a/src/gui/screensetup.cpp
+++ b/src/gui/screensetup.cpp
@@ -173,6 +173,7 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &)
( g_settings.screen_EndY != y_coord[1] ) ) &&
(ShowMsg(LOCALE_VIDEOMENU_SCREENSETUP, LOCALE_MESSAGEBOX_DISCARD, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbCancel) == CMsgBox::mbrCancel))
break;
+ /* falls through */
case CRCInput::RC_timeout:
loop = false;
diff --git a/src/gui/subchannel_select.cpp b/src/gui/subchannel_select.cpp
index 36867ce1c..b6d688180 100644
--- a/src/gui/subchannel_select.cpp
+++ b/src/gui/subchannel_select.cpp
@@ -108,6 +108,8 @@ int CSubChannelSelectMenu::getNVODMenu(CMenuWidget* menu)
}
count++;
+ if (count > 9999)
+ break;
}
if ( g_RemoteControl->are_subchannels ) {
diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am
index 838ba162f..6a0c88bd5 100644
--- a/src/gui/widget/Makefile.am
+++ b/src/gui/widget/Makefile.am
@@ -10,6 +10,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/lib/libconfigfile \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a
diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp
index 374945621..12546df59 100644
--- a/src/gui/widget/menue.cpp
+++ b/src/gui/widget/menue.cpp
@@ -820,6 +820,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
switch ( rv ) {
case menu_return::RETURN_EXIT_ALL:
retval = menu_return::RETURN_EXIT_ALL;
+ /* fall through */
case menu_return::RETURN_EXIT:
msg = CRCInput::RC_timeout;
break;
@@ -910,6 +911,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
break;
case CRCInput::RC_up:
dir = -1;
+ /* fall through */
default: /* fallthrough or RC_down => dir = 1 */
pos += dir;
if (pos < 0 || pos >= (int)items.size())
@@ -946,16 +948,12 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
break;
}
case (CRCInput::RC_left):
- {
- if(hasItem() && selected > -1 && (int)items.size() > selected) {
- CMenuItem* itemX = items[selected];
- if (!itemX->isMenueOptionChooser()) {
- if (g_settings.menu_left_exit)
- msg = CRCInput::RC_timeout;
- break;
- }
- }
+ if (hasItem() && selected > -1 && (int)items.size() > selected) {
+ CMenuItem* itemX = items[selected];
+ if (!itemX->isMenueOptionChooser() && g_settings.menu_left_exit)
+ msg = CRCInput::RC_timeout;
}
+ break;
case (CRCInput::RC_right):
case (CRCInput::RC_ok):
{
@@ -978,6 +976,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
switch ( rv ) {
case menu_return::RETURN_EXIT_ALL:
retval = menu_return::RETURN_EXIT_ALL;
+ /* fall through */
case menu_return::RETURN_EXIT:
msg = CRCInput::RC_timeout;
break;
diff --git a/src/neutrino.cpp b/src/neutrino.cpp
index 6de0d58e2..6251c58d2 100644
--- a/src/neutrino.cpp
+++ b/src/neutrino.cpp
@@ -1950,6 +1950,7 @@ void CNeutrinoApp::SetChannelMode(int newmode)
break;
default:
newmode = LIST_MODE_PROV;
+ /* fall through */
case LIST_MODE_PROV:
if(mode == mode_radio)
bouquetList = RADIObouquetList;
diff --git a/src/nhttpd/tuxboxapi/Makefile.am b/src/nhttpd/tuxboxapi/Makefile.am
index 2376c052c..9bae88869 100644
--- a/src/nhttpd/tuxboxapi/Makefile.am
+++ b/src/nhttpd/tuxboxapi/Makefile.am
@@ -16,6 +16,7 @@ AM_CPPFLAGS += \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
@AVFORMAT_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libnhttpd_tuxboxapi.a
diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp
index 03141e128..fe7908014 100644
--- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp
+++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp
@@ -806,7 +806,7 @@ std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler *, std::strin
in >> ymount >> ylocal_dir >> yfstype;
in.ignore(std::numeric_limits::max(), '\n');
yfstype = trim(yfstype);
- if( (yfstype == "nfs") << (yfstype == "ftp") || (yfstype == "lufsd") )
+ if( (yfstype == "nfs") || (yfstype == "ftp") || (yfstype == "lufsd") )
{
mounts=ylocal_dir +" on "+ ymount + " ("+yfstype+")";
ysel = ((j==0) ? "checked=\"checked\"" : "");
diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp
index 2d4a88d4d..57acb79b6 100644
--- a/src/nhttpd/yhttpd_core/yhook.cpp
+++ b/src/nhttpd/yhttpd_core/yhook.cpp
@@ -283,7 +283,7 @@ std::string CyhookHandler::BuildHeader(bool cache) {
case HTTP_MOVED_PERMANENTLY:
// Status HTTP_*_TEMPORARILY (redirection)
result += string_printf("Location: %s\r\n", NewURL.c_str());
- // NO break HERE !!!
+ // fall through
default:
time_t timer = time(0);
diff --git a/src/system/Makefile.am b/src/system/Makefile.am
index 916037323..63fb188f2 100644
--- a/src/system/Makefile.am
+++ b/src/system/Makefile.am
@@ -20,6 +20,7 @@ AM_CPPFLAGS = \
@SIGC_CFLAGS@ \
@FREETYPE_CFLAGS@ \
@AVFORMAT_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_system.a
diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp
index 6bd43c576..a2762f279 100644
--- a/src/system/ytparser.cpp
+++ b/src/system/ytparser.cpp
@@ -518,6 +518,7 @@ bool cYTFeedParser::ParseFeed(yt_feed_mode_t mode, std::string search, std::stri
default:
//trailer = "&time=today";
curfeed = "&chart=mostPopular";
+ break;
case MOST_POPULAR_ALL_TIME:
curfeed = "&chart=mostPopular";
break;
diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am
index a8e7a9cdb..2e6427d32 100644
--- a/src/zapit/src/Makefile.am
+++ b/src/zapit/src/Makefile.am
@@ -12,6 +12,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/lib/xmltree \
@FREETYPE_CFLAGS@ \
@SIGC_CFLAGS@ \
+ @LUA_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libzapit.a
diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp
index 0cdd92c58..bd18b5314 100644
--- a/src/zapit/src/frontend.cpp
+++ b/src/zapit/src/frontend.cpp
@@ -456,6 +456,7 @@ fe_code_rate_t CFrontend::getCodeRate(const uint8_t fec_inner, delivery_system_t
default:
if (zapit_debug)
printf("no valid fec for DVB-%c set.. assume auto\n", (delsys == DVB_S ? 'S' : (delsys == DVB_C ? 'C' : 'T')));
+ /* fall through */
case fAuto:
fec = FEC_AUTO;
break;
@@ -492,6 +493,7 @@ fe_code_rate_t CFrontend::getCodeRate(const uint8_t fec_inner, delivery_system_t
default:
if (zapit_debug)
printf("no valid fec for DVB-S2 set.. !!\n");
+ /* fall through */
case fAuto:
fec = FEC_AUTO;
break;
@@ -814,6 +816,7 @@ void CFrontend::getXMLDelsysFEC(fe_code_rate_t xmlfec, delivery_system_t & delsy
break;
default:
printf("[frontend] getXMLDelsysFEC: unknown FEC: %d !!!\n", xmlfec);
+ /* fall through */
case FEC_S2_AUTO:
case FEC_AUTO:
fec = FEC_AUTO;
@@ -890,7 +893,7 @@ void CFrontend::getDelSys(delivery_system_t delsys, int f, int m, const char *&f
mod = "QPSK"; // AKA QAM_4
break;
}
- /* fallthrouh for FE_QAM... */
+ /* fall through */
case QAM_AUTO:
default:
mod = "QAM_AUTO";
diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp
index 6c190c330..bba6e472f 100644
--- a/src/zapit/src/scan.cpp
+++ b/src/zapit/src/scan.cpp
@@ -712,6 +712,7 @@ void CServiceScan::ChannelFound(uint8_t service_type, std::string providerName,
case ST_NVOD_REFERENCE_SERVICE:
case ST_NVOD_TIME_SHIFTED_SERVICE:
CZapit::getInstance()->SendEvent(CZapitClient::EVT_SCAN_SERVICENAME, (void *) serviceName.c_str(), serviceName.length() + 1);
+ /* fall through */
case ST_DATA_BROADCAST_SERVICE:
case ST_RCS_MAP:
case ST_RCS_FLS:
diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp
index 49e731568..79e3a1b24 100644
--- a/src/zapit/src/scanbat.cpp
+++ b/src/zapit/src/scanbat.cpp
@@ -82,7 +82,7 @@ bool CBat::Read()
int secdone[255];
int sectotal = -1;
- memset(secdone, 0, 255);
+ memset(secdone, 0, sizeof(secdone));
cDemux * dmx = new cDemux(dmxnum);
dmx->Open(DMX_PSI_CHANNEL);
diff --git a/src/zapit/src/scansdt.cpp b/src/zapit/src/scansdt.cpp
index 5ff2aa358..9114a0eea 100644
--- a/src/zapit/src/scansdt.cpp
+++ b/src/zapit/src/scansdt.cpp
@@ -68,7 +68,7 @@ bool CSdt::Read()
int sectotal = -1;
bool cable_hack_done = false;
- memset(secdone, 0, 255);
+ memset(secdone, 0, sizeof(secdone));
cDemux * dmx = new cDemux(dmxnum);
dmx->Open(DMX_PSI_CHANNEL);