From 0a8ef1c0585a65aafa3c4bcd640ec4a339060339 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 3 Nov 2012 14:03:24 +0100 Subject: [PATCH] SIevents: fix C++11 compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The slightly obscure code caused the following warning: SIevents.cpp:280:148: warning: narrowing conversion of ‘tolower(((int)evt->descr_extended_event_header:: iso_639_2_language_code_lo))’ from ‘int’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing] --- src/eitd/SIevents.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index ec788b0e7..eef45863e 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -250,7 +250,11 @@ void SIevent::parseShortEventDescriptor(const uint8_t *buf, unsigned maxlen) int tsidonid = (transport_stream_id << 16) | original_network_id; - char lang[] = {tolower(evt->language_code_hi), tolower(evt->language_code_mid), tolower(evt->language_code_lo), '\0'}; + char lang[4]; + lang[0] = tolower(evt->language_code_hi); + lang[1] = tolower(evt->language_code_mid); + lang[2] = tolower(evt->language_code_lo); + lang[3] = '\0'; std::string language(lang); int table = getCountryCodeDefaultMapping(language); @@ -273,7 +277,11 @@ void SIevent::parseExtendedEventDescriptor(const uint8_t *buf, unsigned maxlen) int tsidonid = (transport_stream_id << 16) | original_network_id; - char lang[] = {tolower(evt->iso_639_2_language_code_hi), tolower(evt->iso_639_2_language_code_mid), tolower(evt->iso_639_2_language_code_lo), '\0'}; + char lang[4]; + lang[0] = tolower(evt->iso_639_2_language_code_hi); + lang[1] = tolower(evt->iso_639_2_language_code_mid); + lang[2] = tolower(evt->iso_639_2_language_code_lo); + lang[3] = '\0'; std::string language(lang); int table = getCountryCodeDefaultMapping(language);