From bc574e96884150b38e82363fae262cfc1f3aadfe Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 16 Jun 2012 09:44:42 +0200 Subject: [PATCH] use empty() instead of size() --- src/daemonc/remotecontrol.cpp | 12 ++++---- src/driver/lcdd.cpp | 2 +- src/driver/rcinput.cpp | 2 +- src/driver/record.cpp | 14 ++++----- src/driver/vcrcontrol.cpp | 4 +-- src/driver/vfd.cpp | 2 +- src/eitd/sectionsd.cpp | 4 +-- src/gui/audioplayer.cpp | 6 ++-- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/bouquetlist.cpp | 8 ++--- src/gui/channellist.cpp | 4 +-- src/gui/epgview.cpp | 2 +- src/gui/eventlist.cpp | 4 +-- src/gui/filebrowser.cpp | 4 +-- src/gui/infoviewer_bb.cpp | 4 +-- src/gui/moviebrowser.cpp | 30 +++++++++---------- src/gui/movieinfo.cpp | 8 ++--- src/gui/nfs.cpp | 2 +- src/gui/streaminfo2.cpp | 2 +- src/neutrino.cpp | 10 +++---- .../tuxboxapi/coolstream/controlapi.cpp | 2 +- src/nhttpd/tuxboxapi/dbox/controlapi.cpp | 4 +-- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 2 +- src/zapit/src/bouquets.cpp | 4 +-- src/zapit/src/femanager.cpp | 2 +- src/zapit/src/getservices.cpp | 12 ++++---- src/zapit/src/scan.cpp | 2 +- src/zapit/src/zapit.cpp | 2 +- 29 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 06ba0b50d..00d913d7a 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -367,7 +367,7 @@ printf("CRemoteControl::handleMsg: EVT_TUNE_COMPLETE (%016llx)\n", chid); void CRemoteControl::getSubChannels() { //printf("[neutrino] getSubChannels, current_EPGid %llx\n", current_EPGid); - if ( subChannels.size() == 0 ) + if ( subChannels.empty() ) { CSectionsdClient::LinkageDescriptorList linkedServices; //if ( g_Sectionsd->getLinkageDescriptorsUniqueKey( current_EPGid, linkedServices ) ) @@ -401,7 +401,7 @@ void CRemoteControl::getSubChannels() void CRemoteControl::getNVODs() { //printf("[neutrino] getNVODs, current_EPGid %llx\n", current_EPGid); - if ( subChannels.size() == 0 ) + if ( subChannels.empty() ) { CSectionsdClient::NVODTimesList NVODs; //if ( g_Sectionsd->getNVODTimesServiceKey( current_channel_id & 0xFFFFFFFFFFFFULL, NVODs ) ) @@ -633,13 +633,13 @@ const std::string & CRemoteControl::subChannelUp(void) { //return setSubChannel((subChannels.size() == 0) ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); // if there are any NVOD/subchannels switch these else switch audio channel (if any) - if (subChannels.size() > 0 || !g_settings.audiochannel_up_down_enable) + if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) { return setSubChannel((subChannels.size() == 0) ? -1 : (int)((selected_subchannel + 1) % subChannels.size())); } else { - if (current_PIDs.APIDs.size() > 0) + if ( !current_PIDs.APIDs.empty() ) { setAPID((current_PIDs.PIDs.selected_apid + 1) % current_PIDs.APIDs.size()); } @@ -651,13 +651,13 @@ const std::string & CRemoteControl::subChannelDown(void) { //return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1)); // if there are any NVOD/subchannels switch these else switch audio channel (if any) - if (subChannels.size() > 0 || !g_settings.audiochannel_up_down_enable) + if ( !subChannels.empty() || !g_settings.audiochannel_up_down_enable) { return setSubChannel((selected_subchannel <= 0) ? (subChannels.size() - 1) : (selected_subchannel - 1)); } else { - if (current_PIDs.APIDs.size() > 0) + if ( !current_PIDs.APIDs.empty() ) { if (current_PIDs.PIDs.selected_apid <= 0) setAPID(current_PIDs.APIDs.size() - 1); diff --git a/src/driver/lcdd.cpp b/src/driver/lcdd.cpp index 2104bf8c8..8b6083df6 100644 --- a/src/driver/lcdd.cpp +++ b/src/driver/lcdd.cpp @@ -1241,7 +1241,7 @@ void CLCD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if (mode == MODE_FILEBROWSER && m_fileList != NULL && - m_fileList->size() > 0) + !m_fileList->empty() ) { printf("[lcdd] FileList:OK\n"); diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index c064c5fd0..8c9ed6c56 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -539,7 +539,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 #endif while(1) { timer_id = 0; - if ( timers.size()> 0 ) + if ( !timers.empty() ) { #ifdef USE_GETTIMEOFDAY gettimeofday( &tv, NULL ); diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5a5bbe4dc..0580b687e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -522,7 +522,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis info2 = epgdata.info2; recMovieInfo->parentalLockAge = epgdata.fsk; - if(epgdata.contentClassification.size() > 0 ) + if( !epgdata.contentClassification.empty() ) recMovieInfo->genreMajor = epgdata.contentClassification[0]; recMovieInfo->length = epgdata.epg_times.dauer / 60; @@ -555,7 +555,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis } } /* FIXME sometimes no apid in xml ?? */ - if(recMovieInfo->audioPids.empty() && allpids.APIDs.size()) { + if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; audio_pids.epgAudioPid = allpids.APIDs[i].pid; audio_pids.epgAudioPidName = g_RemoteControl->current_PIDs.APIDs[i].desc; @@ -791,7 +791,7 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons #if 1 // FIXME test StopSectionsd = false; - if(recmap.size()) + if( !recmap.empty() ) StopSectionsd = true; #endif RunStartScript(); @@ -922,7 +922,7 @@ void CRecordManager::StartNextRecording() for(nextmap_iterator_t it = nextmap.begin(); it != nextmap.end(); it++) { bool tested = true; eventinfo = *it; - if(recmap.size() > 0) { + if( !recmap.empty() ) { CRecordInstance * inst = FindInstance(eventinfo->channel_id); /* same channel recording and not auto - skip */ if(inst && !inst->Timeshift()) @@ -958,7 +958,7 @@ bool CRecordManager::RecordingStatus(const t_channel_id channel_id) CRecordInstance * inst = FindInstance(channel_id); ret = (inst != NULL); } else - ret = recmap.size() != 0; + ret = !recmap.empty(); mutex.unlock(); return ret; @@ -1464,7 +1464,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo last_mode = CNeutrinoApp::getInstance()->getMode(); - if(last_mode == NeutrinoMessages::mode_standby && !recmap.size()) + if(last_mode == NeutrinoMessages::mode_standby && recmap.empty()) g_Zapit->setStandby(false); // this zap to live_channel_id t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -1546,7 +1546,7 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo void CRecordManager::RestoreNeutrino(void) { - if(recmap.size()) + if(!recmap.empty()) return; /* after this zapit send EVT_RECORDMODE_DEACTIVATED, so neutrino getting NeutrinoMessages::EVT_RECORDMODE */ diff --git a/src/driver/vcrcontrol.cpp b/src/driver/vcrcontrol.cpp index d0570cd82..df201b4fd 100644 --- a/src/driver/vcrcontrol.cpp +++ b/src/driver/vcrcontrol.cpp @@ -893,7 +893,7 @@ std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRComm info2 = epgdata.info2; recMovieInfo->parentalLockAge = epgdata.fsk; - if(epgdata.contentClassification.size() > 0 ) + if( !epgdata.contentClassification.empty() ) recMovieInfo->genreMajor = epgdata.contentClassification[0]; recMovieInfo->length = epgdata.epg_times.dauer / 60; @@ -947,7 +947,7 @@ std::string CVCRControl::CFileAndServerDevice::getMovieInfoString(const CVCRComm } } /* FIXME sometimes no apid in xml ?? */ - if(recMovieInfo->audioPids.empty() && allpids.APIDs.size()) { + if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; audio_pids.epgAudioPid = allpids.APIDs[i].pid; audio_pids.epgAudioPidName = ZapitTools::UTF8_to_UTF8XML(g_RemoteControl->current_PIDs.APIDs[i].desc); diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index b1348aa8a..e94d90fed 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -802,7 +802,7 @@ void CVFD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi if (mode == MODE_FILEBROWSER && m_fileList != NULL && - m_fileList->size() > 0) + !m_fileList->empty() ) { printf("[lcdd] FileList:OK\n"); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index dc4686d32..2759b8e82 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1825,7 +1825,7 @@ static bool addService(const SIservice &s, const int is_actual) mySIservicesOrderUniqueKey.insert(std::make_pair(sptr->uniqueKey(), sptr)); unlockServices(); - if (sptr->nvods.size()) + if (!sptr->nvods.empty()) { writeLockServices(); mySIservicesNVODorderUniqueKey.insert(std::make_pair(sptr->uniqueKey(), sptr)); @@ -2700,7 +2700,7 @@ bool sectionsd_getNVODTimesServiceKey(const t_channel_id uniqueServiceKey, CSect { dprintf("NVODServices: %u\n", si->second->nvods.size()); - if (si->second->nvods.size()) { + if (!si->second->nvods.empty()) { for (SInvodReferences::iterator ni = si->second->nvods.begin(); ni != si->second->nvods.end(); ++ni) { SItime zeitEvt1(0, 0); findActualSIeventForServiceUniqueKey(ni->uniqueKey(), zeitEvt1, 15*60); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index d69841228..fc998a5cf 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -582,7 +582,7 @@ int CAudioPlayerGui::show() //stop(); // Stop if song is deleted, next song will be startet automat. } if (m_selected >= m_playlist.size()) - m_selected = m_playlist.size() == 0 ? m_playlist.size() : m_playlist.size() - 1; + m_selected = m_playlist.empty() ? m_playlist.size() : m_playlist.size() - 1; update = true; } } @@ -2469,7 +2469,7 @@ void CAudioPlayerGui::removeFromPlaylist(long pos) item->second.erase(pos); // delete empty entries - if (item->second.size() == 0) + if (item->second.empty()) { m_title2Pos.erase(item); } @@ -2529,7 +2529,7 @@ void CAudioPlayerGui::selectTitle(unsigned char selectionChar) } else { - if (it->second.size() > 0) + if ( !it->second.empty() ) { i = *(it->second.begin()); //printf("using begin i: %ld\n",i); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 0659dc7f4..0d9d99526 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -83,7 +83,7 @@ void CBEBouquetWidget::paintItem(int pos) } else { bool has_channels = true; if(current < Bouquets->size()) - has_channels = ((*Bouquets)[current]->tvChannels.size() > 0) || ((*Bouquets)[current]->radioChannels.size() > 0); + has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty()); color = has_channels ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 0b363dd76..056799fbd 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -244,7 +244,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) listmaxshow=bookmarks.size(); height = theight+0+listmaxshow*fheight*2; // recalc height } - if (selected==bookmarks.size() && !(bookmarks.empty())) + if (!(bookmarks.empty() && selected==bookmarks.size())) { selected=bookmarks.size()-1; liststart = (selected/listmaxshow)*listmaxshow; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 5e84ab9f5..0a0f3134d 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -224,7 +224,7 @@ int CBouquetList::doMenu() CZapitBouquet * tmp, * zapitBouquet; ZapitChannelList* channels; - if(!Bouquets.size() || g_settings.minimode) + if(Bouquets.empty() || g_settings.minimode) return 0; zapitBouquet = Bouquets[selected]->zapitBouquet; @@ -383,7 +383,7 @@ int CBouquetList::show(bool bShowChannelList) return -3; } } - else if(Bouquets.size() == 0) + else if(Bouquets.empty()) continue; //FIXME msgs not forwarded to neutrino !! else if ( msg == CRCInput::RC_setup) { int ret = doMenu(); @@ -593,7 +593,7 @@ void CBouquetList::paint() { liststart = (selected/listmaxshow)*listmaxshow; int lastnum = liststart + listmaxshow; - int bsize = Bouquets.size() > 0 ? Bouquets.size() : 1; + int bsize = Bouquets.empty() ? 1 : Bouquets.size(); if(lastnum<10) numwidth = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("0"); @@ -610,7 +610,7 @@ void CBouquetList::paint() ::paintButtons(x, y + (height - footerHeight), width, sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]), CBouquetListButtons, footerHeight); - if(Bouquets.size()) + if(!Bouquets.empty()) { for(unsigned int count=0;countBouquets.size() > 0) { + if (!bouquetList->Bouquets.empty()) { bool found = true; int nNext = (bouquetList->getActiveBouquetNumber()+bouquetList->Bouquets.size()-1) % bouquetList->Bouquets.size(); if(bouquetList->Bouquets[nNext]->channelList->getSize() <= 0) { @@ -1421,7 +1421,7 @@ void CChannelList::virtual_zap_mode(bool up) void CChannelList::quickZap(int key, bool /* cycle */) { - if(chanlist.size() == 0) + if(chanlist.empty()) return; unsigned int sl = selected; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index d4ad4202d..c9d295368 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -568,7 +568,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // 21.07.2005 - rainerk // Show extended information - if (0 != epgData.itemDescriptions.size() && 0 != epgData.items.size()) { + if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { char line[256]; std::vector::iterator description; std::vector::iterator item; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 42e1b5a80..db0901179 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -230,7 +230,7 @@ void CNeutrinoEventList::readEvents(const t_channel_id channel_id) current_event++; } - if ( evtlist.size() == 0 ) + if ( evtlist.empty() ) { CChannelEvent evt; @@ -1066,7 +1066,7 @@ bool CNeutrinoEventList::findEvents(void) } if(evtlist.empty()) { - if ( evtlist.size() == 0 ) + if ( evtlist.empty() ) { CChannelEvent evt; //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 2f5487ccf..c60c22fd7 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -986,7 +986,7 @@ bool CFileBrowser::exec(const char * const dirname) } else #endif - if (selections.size() > 0) + if (!selections.empty()) { ChangeDir("..",selections.back()); selections.pop_back(); @@ -1046,7 +1046,7 @@ bool CFileBrowser::exec(const char * const dirname) else #endif { - if (selections.size() > 0) + if ( !selections.empty() ) { ChangeDir("..",selections.back()); selections.pop_back(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index df1976489..3ff3e5531 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -223,7 +223,7 @@ void CInfoViewerBB::getBBButtonInfo() text = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN]; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; - if (g_RemoteControl->current_PIDs.APIDs.size() > 0) { + if (!g_RemoteControl->current_PIDs.APIDs.empty()) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; if (text.empty()) text = g_RemoteControl->current_PIDs.APIDs[selected].desc; @@ -698,7 +698,7 @@ void CInfoViewerBB::showIcon_CA_Status(int notfirst) return; if (g_settings.casystem_display == 2) { - fta = (channel->camap.size() == 0); + fta = channel->camap.empty(); showOne_CAIcon(); return; } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 6daa81ca8..c8d8fdef5 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1206,7 +1206,7 @@ void CMovieBrowser::refreshMovieInfo(void) { //TRACE("[mb]->refreshMovieInfo m_vMovieInfo.size %d\n", m_vMovieInfo.size()); std::string emptytext = " "; - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcInfo != NULL) m_pcInfo->setText(&emptytext); return; @@ -1286,7 +1286,7 @@ void CMovieBrowser::info_hdd_level(bool paint_hdd) } void CMovieBrowser::refreshLCD(void) { - if(m_vMovieInfo.size() <= 0) return; + if(m_vMovieInfo.empty()) return; //CVFD * lcd = CVFD::getInstance(); if(m_movieSelectionHandler == NULL) @@ -1313,7 +1313,7 @@ void CMovieBrowser::refreshFilterList(void) m_FilterLines.rowWidth[0] = 100; m_FilterLines.lineHeader[0]= ""; - if(m_vMovieInfo.size() <= 0) + if(m_vMovieInfo.empty()) return; // exit here if nothing else is to do if(m_settings.filter.item == MB_INFO_MAX_NUMBER) @@ -1389,7 +1389,7 @@ void CMovieBrowser::refreshLastPlayList(void) //P2 } m_vHandlePlayList.clear(); - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcLastPlay != NULL) m_pcLastPlay->setLines(&m_playListLines); return; // exit here if nothing else is to do @@ -1447,7 +1447,7 @@ void CMovieBrowser::refreshLastRecordList(void) //P2 } m_vHandleRecordList.clear(); - if(m_vMovieInfo.size() <= 0) { + if(m_vMovieInfo.empty()) { if(m_pcLastRecord != NULL) m_pcLastRecord->setLines(&m_recordListLines); return; // exit here if nothing else is to do @@ -1506,7 +1506,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1 } m_vHandleBrowserList.clear(); - if(m_vMovieInfo.size() <= 0) + if(m_vMovieInfo.empty()) { m_currentBrowserSelection = 0; m_movieSelectionHandler = NULL; @@ -1727,7 +1727,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if ((m_vMovieInfo.size() > 0) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) + if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) onDeleteFile(*m_movieSelectionHandler); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) @@ -2318,7 +2318,7 @@ void CMovieBrowser::onSetFocusNext(void) bool CMovieBrowser::onSortMovieInfoHandleList(std::vector& handle_list, MB_INFO_ITEM sort_item, MB_DIRECTION direction) { //TRACE("sort: %d\r\n",direction); - if(handle_list.size() <= 0) + if(handle_list.empty()) return (false); // nothing to sort, return immedately if(sortBy[sort_item] == NULL) return (false); @@ -2585,13 +2585,13 @@ bool CMovieBrowser::delFile_std(CFile& file) void CMovieBrowser::updateMovieSelection(void) { //TRACE("[mb]->updateMovieSelection %d\r\n",m_windowFocus); - if (m_vMovieInfo.size() == 0) return; + if (m_vMovieInfo.empty()) return; bool new_selection = false; unsigned int old_movie_selection; if(m_windowFocus == MB_FOCUS_BROWSER) { - if(m_vHandleBrowserList.size() == 0) + if(m_vHandleBrowserList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentBrowserSelection = 0; @@ -2612,7 +2612,7 @@ void CMovieBrowser::updateMovieSelection(void) } else if(m_windowFocus == MB_FOCUS_LAST_PLAY) { - if(m_vHandlePlayList.size() == 0) + if(m_vHandlePlayList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentPlaySelection = 0; @@ -2633,7 +2633,7 @@ void CMovieBrowser::updateMovieSelection(void) } else if(m_windowFocus == MB_FOCUS_LAST_RECORD) { - if(m_vHandleRecordList.size() == 0) + if(m_vHandleRecordList.empty()) { // There are no elements in the Filebrowser, clear all handles m_currentRecordSelection = 0; @@ -2666,7 +2666,7 @@ void CMovieBrowser::updateMovieSelection(void) void CMovieBrowser::updateFilterSelection(void) { //TRACE("[mb]->updateFilterSelection \r\n"); - if(m_FilterLines.lineArray[0].size() == 0) return; + if(m_FilterLines.lineArray[0].empty()) return; bool result = true; int selected_line = m_pcFilter->getSelectedLine(); @@ -3214,7 +3214,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = movie_info.file.getFileName(); break; case MB_INFO_FILEPATH: // = 1, - if(m_dirNames.size() > 0) + if(!m_dirNames.empty()) *item_string = m_dirNames[movie_info.dirItNr]; break; case MB_INFO_TITLE: // = 2, @@ -3557,7 +3557,7 @@ CDirMenu::CDirMenu(std::vector* dir_list) { std::string tmp = g_settings.network_nfs_local_dir[nfs]; int result = -1; - if(tmp.size()) + if(!tmp.empty()) result = (*dirList)[i].name.compare( 0,tmp.size(),tmp) ; printf("[CDirMenu] (nfs%d) %s == (mb%d) %s (%d)\n",nfs,g_settings.network_nfs_local_dir[nfs],i,(*dirList)[i].name.c_str(),result); diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 32d3ae023..7e0a785a5 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -182,7 +182,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); //%d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u - if (movie_info->audioPids.size() > 0) { + if ( !movie_info->audioPids.empty() ) { //*extMessage += "\t\t<"MI_XML_TAG_AUDIOPIDS" selected=\""; //sprintf(tmp, "%u", movie_info->audioPids[0].epgAudioPid); //pids.APIDs[i].pid); //*extMessage += tmp; @@ -426,7 +426,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) print_buffer += "\n"; print_buffer += movie_info.epgInfo2; - if (movie_info.productionCountry.size() != 0 || movie_info.productionDate != 0) { + if ( !movie_info.productionCountry.empty() || movie_info.productionDate != 0) { print_buffer += "\n"; print_buffer += movie_info.productionCountry; print_buffer += " "; @@ -468,7 +468,7 @@ void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) snprintf(date_char, 12, "%3d", movie_info.length); print_buffer += date_char; } - if (movie_info.audioPids.size() != 0) { + if ( !movie_info.audioPids.empty() ) { print_buffer += "\n"; print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); print_buffer += ": "; @@ -828,7 +828,7 @@ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bo movie_info->bookmarks.user[i].pos = new_bookmark.pos; movie_info->bookmarks.user[i].length = new_bookmark.length; //if(movie_info->bookmarks.user[i].name.empty()) - if (movie_info->bookmarks.user[i].name.size() == 0) { + if (movie_info->bookmarks.user[i].name.empty() ) { if (new_bookmark.length == 0) movie_info->bookmarks.user[i].name = g_Locale->getText(LOCALE_MOVIEBROWSER_BOOK_NEW); if (new_bookmark.length < 0) diff --git a/src/gui/nfs.cpp b/src/gui/nfs.cpp index bef2fe9d4..79122a775 100644 --- a/src/gui/nfs.cpp +++ b/src/gui/nfs.cpp @@ -318,7 +318,7 @@ int CNFSUmountGui::menu() umountMenu.addItem(forwarder); } } - if(infos.size() > 0) + if( !infos.empty() ) return umountMenu.exec(this,""); else return menu_return::RETURN_REPAINT; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 64eb145a4..30a407b36 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -801,7 +801,7 @@ int CStreamInfo2::ts_setup () unsigned short vpid, apid = 0; vpid = g_RemoteControl->current_PIDs.PIDs.vpid; - if(g_RemoteControl->current_PIDs.APIDs.size() > 0) + if( !g_RemoteControl->current_PIDs.APIDs.empty() ) apid = g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid; if(vpid == 0 && apid == 0) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 774aa7a45..87118b4a4 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1240,7 +1240,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) satellite_map_t satlist = CServiceManager::getInstance()->SatelliteList(); for(sit = satlist.begin(); sit != satlist.end(); sit++) { CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, sit->first); - if(!zapitList.size()) + if( zapitList.empty() ) continue; tvi = 0, ri = 0; @@ -2045,7 +2045,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) switchTvRadioMode(); //used with defined rc key TODO: do we really need this, because we already have a specified key on the remote control } else if( msg == (neutrino_msg_t) g_settings.key_subchannel_up ) { - if(g_RemoteControl->subChannels.size() > 0) { + if( !g_RemoteControl->subChannels.empty() ) { StopSubtitles(); g_RemoteControl->subChannelUp(); g_InfoViewer->showSubchan(); @@ -2059,7 +2059,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) quickZap( msg ); } else if( msg == (neutrino_msg_t) g_settings.key_subchannel_down ) { - if(g_RemoteControl->subChannels.size()> 0) { + if( !g_RemoteControl->subChannels.empty() ) { StopSubtitles(); g_RemoteControl->subChannelDown(); g_InfoViewer->showSubchan(); @@ -2291,7 +2291,7 @@ _show: //_show: if(msg == CRCInput::RC_ok) { - if(bouquetList->Bouquets.size() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) + if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! else nNewChannel = bouquetList->exec(true); @@ -2627,7 +2627,7 @@ _repeat: tmpTimerList.clear(); tmpTimerdClient.getTimerList( tmpTimerList ); - if(tmpTimerList.size() > 0) { + if( !tmpTimerList.empty() ) { sort( tmpTimerList.begin(), tmpTimerList.end() ); CTimerd::responseGetTimer &timer = tmpTimerList[0]; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 0da793884..57851a73f 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -136,7 +136,7 @@ THandleStatus CControlAPI::Hook_SendResponse(CyhookHandler *hh) void CControlAPI::compatibility_Timer(CyhookHandler *hh) { log_level_printf(4,"CControlAPI Compatibility Timer Start url:%s\n",hh->UrlData["url"].c_str()); - if(NeutrinoAPI->Timerd->isTimerdAvailable() && hh->ParamList.size() > 0) + if(NeutrinoAPI->Timerd->isTimerdAvailable() && !hh->ParamList.empty() ) { if(hh->ParamList["action"] == "remove") { diff --git a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp index 1fe9f694a..9b39fbce9 100644 --- a/src/nhttpd/tuxboxapi/dbox/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/dbox/controlapi.cpp @@ -110,7 +110,7 @@ THandleStatus CControlAPI::Hook_SendResponse(CyhookHandler *hh) void CControlAPI::compatibility_Timer(CyhookHandler *hh) { log_level_printf(4,"CControlAPI Compatibility Timer Start url:%s\n",hh->UrlData["url"].c_str()); - if(NeutrinoAPI->Timerd->isTimerdAvailable() && hh->ParamList.size() > 0) + if(NeutrinoAPI->Timerd->isTimerdAvailable() && !hh->ParamList.empty() ) { if(hh->ParamList["action"] == "remove") { @@ -353,7 +353,7 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - if (hh->ParamList.size() > 0) + if ( !hh->ParamList.empty() ) { script = hh->ParamList["1"]; unsigned int len = hh->ParamList.size(); diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 0df6079b8..fc8a5c48b 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -159,7 +159,7 @@ void CyParser::cgi(CyhookHandler *hh) { bool ydebug = false; std::string htmlfilename, yresult, ycmd; - if (hh->ParamList.size() > 0) { + if ( !hh->ParamList.empty() ) { if (hh->ParamList["tmpl"] != "") // for GET and POST htmlfilename = hh->ParamList["tmpl"]; else diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index b7b4d7727..af0996a7e 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -274,7 +274,7 @@ void CBouquetManager::saveBouquets(const CZapitClient::bouquetMode bouquetMode, delete (*it); Bouquets.erase(it); } - if(Bouquets.size() > 0) + if( !Bouquets.empty() ) Bouquets[0]->Name = providerName; } @@ -443,7 +443,7 @@ void CBouquetManager::makeRemainingChannelsBouquet(void) sort(unusedChannels.begin(), unusedChannels.end(), CmpChannelByChName()); // TODO: use locales - remainChannels = addBouquet((Bouquets.size() == 0) ? "All Channels" : "Other", false); // UTF-8 encoded + remainChannels = addBouquet( Bouquets.empty() ? "All Channels" : "Other", false); // UTF-8 encoded remainChannels->bOther = true; for (ZapitChannelList::const_iterator it = unusedChannels.begin(); it != unusedChannels.end(); ++it) { diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 8cd9260c3..85253a9a0 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -70,7 +70,7 @@ bool CFEManager::Init() } } INFO("found %d frontends\n", femap.size()); - if(femap.size() == 0) + if( femap.empty() ) return false; #if 0 if(femap.size() == 1) diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index d1175ad9d..708a5b485 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -225,7 +225,7 @@ bool CServiceManager::GetAllRadioChannels(ZapitChannelList &list, int flags) ((flags == 0) || (it->second.flags & flags))) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllTvChannels(ZapitChannelList &list, int flags) @@ -236,7 +236,7 @@ bool CServiceManager::GetAllTvChannels(ZapitChannelList &list, int flags) ((flags == 0) || (it->second.flags & flags))) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllHDChannels(ZapitChannelList &list) @@ -246,7 +246,7 @@ bool CServiceManager::GetAllHDChannels(ZapitChannelList &list) if (it->second.isHD()) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list) @@ -256,7 +256,7 @@ bool CServiceManager::GetAllUnusedChannels(ZapitChannelList &list) if (it->second.has_bouquet == false) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position) @@ -266,7 +266,7 @@ bool CServiceManager::GetAllSatelliteChannels(ZapitChannelList &list, t_satellit if(it->second.getSatellitePosition() == position) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid) @@ -276,7 +276,7 @@ bool CServiceManager::GetAllTransponderChannels(ZapitChannelList &list, transpon if(it->second.getTransponderId() == tpid) list.push_back(&(it->second)); } - return (list.size() != 0); + return (!list.empty()); } std::string CServiceManager::GetServiceName(t_channel_id channel_id) diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index bc4084eb8..b91871e8c 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -539,7 +539,7 @@ bool CServiceScan::ScanProviders() break; } - if(scanBouquetManager->Bouquets.size() > 0) { + if( !scanBouquetManager->Bouquets.empty() ) { scanBouquetManager->saveBouquets(bouquetMode, spI->second.c_str()); } scanBouquetManager->clearAll(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index cf8c6510c..03f118c37 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1040,7 +1040,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) CBasicServer::receive_data(connfd, &TP, sizeof(TP)); sig_delay = 0; TP.feparams.inversion = INVERSION_AUTO; - const char *name = scanProviders.size() > 0 ? scanProviders.begin()->second.c_str() : "unknown"; + const char *name = scanProviders.empty() ? "unknown" : scanProviders.begin()->second.c_str(); switch (live_fe->getInfo()->type) { case FE_QPSK: