SIevents: fix C++11 compiler warning

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]
This commit is contained in:
Stefan Seyfried
2012-11-03 14:03:24 +01:00
parent e0acbd3ddb
commit 0a8ef1c058

View File

@@ -250,7 +250,11 @@ void SIevent::parseShortEventDescriptor(const uint8_t *buf, unsigned maxlen)
int tsidonid = (transport_stream_id << 16) | original_network_id; 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); std::string language(lang);
int table = getCountryCodeDefaultMapping(language); 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; 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); std::string language(lang);
int table = getCountryCodeDefaultMapping(language); int table = getCountryCodeDefaultMapping(language);