From cdab9d60bfa2661f41cd557da97cd87e42ad7a26 Mon Sep 17 00:00:00 2001 From: focus Date: Sat, 27 Mar 2010 14:11:27 +0000 Subject: [PATCH] Fixes for Werror build git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@529 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/zapit/src/fastscan.cpp | 2 +- src/zapit/src/frontend.cpp | 38 ++++++------------------ 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index f3bb7d116..98a557f4a 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -246,7 +246,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* else if (msg==CRCInput::RC_down || msg==(neutrino_msg_t)g_settings.key_channelList_pagedown) { unsigned int step = 0; - int prev_selected = selected; + unsigned int prev_selected = selected; step = (msg==(neutrino_msg_t)g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 selected += step; diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 433e73ab8..f58fb6b26 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -502,7 +502,7 @@ int parse_fnt(unsigned short pid, unsigned short operator_id) FrontendParameters feparams; uint8_t polarization; t_satellite_position satellitePosition = 0; - freq_id_t freq; + freq_id_t freq = 0; for (pos2 = pos + 6; pos2 < pos + transport_descriptors_length + 6; pos2 += buffer[pos2 + 1] + 2) { diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index cdf49ff5b..3c3cadf24 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -131,7 +131,7 @@ int startPlayBack(CZapitChannel * thisChannel); int zapit(const t_channel_id channel_id, bool in_nvod, bool forupdate = 0, bool nowait = 0); #define TIMER_INIT() \ - static unsigned int tmin = 2000, tmax; \ + static unsigned int tmin = 2000, tmax = 0; \ struct timeval tv, tv2; \ unsigned int timer_msec = 0; @@ -402,9 +402,6 @@ struct dvb_frontend_event CFrontend::getEvent(void) TIMER_INIT(); - int msec = TIME_STEP; - int tmsec = msec; - pfd.fd = fd; pfd.events = POLLIN | POLLPRI; pfd.revents = 0; @@ -415,16 +412,15 @@ struct dvb_frontend_event CFrontend::getEvent(void) TIMER_START(); //while (msec <= TIMEOUT_MAX_MS ) { - while ((int) timer_msec <= TIMEOUT_MAX_MS) { + while ((int) timer_msec < TIMEOUT_MAX_MS) { //int ret = poll(&pfd, 1, TIME_STEP); - int ret = poll(&pfd, 1, TIMEOUT_MAX_MS); + int ret = poll(&pfd, 1, TIMEOUT_MAX_MS - timer_msec); if (ret < 0) { perror("CFrontend::getEvent poll"); continue; } if (ret == 0) { TIMER_STOP("[fe0] ############################## poll timeout, time"); - msec += TIME_STEP; continue; } @@ -446,7 +442,7 @@ struct dvb_frontend_event CFrontend::getEvent(void) break; } else if (event.status & FE_TIMEDOUT) { printf("[fe%d] ############################## FE_TIMEDOUT\n", fenumber); - break; + /*break;*/ } else { if (event.status & FE_HAS_SIGNAL) printf("[fe%d] FE_HAS_SIGNAL\n", fenumber); @@ -464,10 +460,6 @@ struct dvb_frontend_event CFrontend::getEvent(void) TIMER_STOP("[fe0] poll hup after"); reset(); } - msec += TIME_STEP; - tmsec += TIME_STEP; - if (tmsec > 15000) - break; } //printf("[fe%d] event after: %d\n", fenumber, tmsec); return event; @@ -703,27 +695,14 @@ int CFrontend::setFrontend(const struct dvb_frontend_parameters *feparams, bool struct dvb_frontend_event ev; { - TIMER_INIT(); - TIMER_START(); - struct pollfd pfd; - pfd.fd = fd; - pfd.events = POLLIN | POLLPRI; - pfd.revents = 0; - -#if 1 + //TIMER_INIT(); + //TIMER_START(); while (1) { if (ioctl(fd, FE_GET_EVENT, &ev) < 0) break; printf("[fe0] DEMOD: event status %d\n", ev.status); } -#else - int ret = poll(&pfd, 1, 100); - if (ret > 0) { - if (ioctl(fd, FE_GET_EVENT, &ev) >= 0) - printf("[fe0] CLEAR DEMOD: event status %d\n", ev.status); - } -#endif - TIMER_STOP("[fe0] clear events took"); + //TIMER_STOP("[fe0] clear events took"); } printf("[fe0] DEMOD: FEC %s system %s modulation %s pilot %s\n", f, s, m, pilot == PILOT_ON ? "on" : "off"); @@ -740,7 +719,8 @@ int CFrontend::setFrontend(const struct dvb_frontend_parameters *feparams, bool TIMER_INIT(); TIMER_START(); - getEvent(); + struct dvb_frontend_event event; + event = getEvent(); TIMER_STOP("[fe0] tuning took"); }