1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 13:36:53 +02:00

Cleaned up compilation warnings.

This commit is contained in:
Rolf Ahrenberg 2009-03-24 12:51:51 +02:00
parent 2e2aacd573
commit 0a162a9a8c
8 changed files with 27 additions and 10 deletions

View File

@ -355,3 +355,7 @@ VDR Plugin 'femon' Revision History
- Fixed closing of frontend file handles (Thanks to Brendon Higgins for - Fixed closing of frontend file handles (Thanks to Brendon Higgins for
reporting this one). reporting this one).
2009-xx-xx: Version 1.7.2
- Cleaned up compilation warnings.

View File

@ -23,7 +23,7 @@ VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ p
### The C++ compiler and options: ### The C++ compiler and options:
CXX ?= g++ CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Wswitch-default -Wfloat-equal -Wundef -Wpointer-arith -Wconversion -Wcast-align -Wredundant-decls -Wno-unused-parameter -Woverloaded-virtual -Wno-parentheses
### The directory environment: ### The directory environment:

View File

@ -18,7 +18,7 @@
#error "VDR-1.7.0 API version or greater is required!" #error "VDR-1.7.0 API version or greater is required!"
#endif #endif
static const char VERSION[] = "1.7.1"; static const char VERSION[] = "1.7.2";
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)"); static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
static const char MAINMENUENTRY[] = trNOOP("Signal Information"); static const char MAINMENUENTRY[] = trNOOP("Signal Information");

View File

@ -34,7 +34,7 @@ bool getAC3AudioInfo(uint8_t *buf, int len, ac3_info_t *info)
return false; return false;
uint8_t *data = buf + 2; uint8_t *data = buf + 2;
uint8_t frame = (data[2] & 0x3f); uint8_t frame = (uint8_t)(data[2] & 0x3f);
info->bitrate = 1000 * ac3_bitrates[frame >> 1]; info->bitrate = 1000 * ac3_bitrates[frame >> 1];
uint8_t fr = (data[2] & 0xc0 ) >> 6; uint8_t fr = (data[2] & 0xc0 ) >> 6;
//uint8_t sz = ac3_frames[fr][frame >> 1]; //uint8_t sz = ac3_frames[fr][frame >> 1];

View File

@ -358,7 +358,7 @@ static int h264_get_picture_type(const uint8_t *buf, int len)
{ {
for (int i = 0; i < (len - 5); ++i) { for (int i = 0; i < (len - 5); ++i) {
if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 1 && buf[i + 3] == NAL_AUD) { if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 1 && buf[i + 3] == NAL_AUD) {
uint8_t type = (buf[i + 4] >> 5); uint8_t type = (uint8_t)(buf[i + 4] >> 5);
switch (type) { switch (type) {
case 0: case 3: case 5: return I_FRAME; case 0: case 3: case 5: return I_FRAME;
case 1: case 4: case 6: return P_FRAME; case 1: case 4: case 6: return P_FRAME;
@ -392,7 +392,7 @@ bool getH264VideoInfo(uint8_t *buf, int len, video_info_t *info)
int nal_len; int nal_len;
//Dprintf("H.264: Found NAL SPS at offset %d/%d", i, len); //Dprintf("H.264: Found NAL SPS at offset %d/%d", i, len);
if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) { if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) {
h264_sps_data_t sps = { 0 }; h264_sps_data_t sps = { 0, 0, VIDEO_ASPECT_RATIO_INVALID, VIDEO_FORMAT_INVALID };
if (h264_parse_sps(nal_data, nal_len, &sps)) { if (h264_parse_sps(nal_data, nal_len, &sps)) {
info->format = sps.format; info->format = sps.format;
info->width = sps.width; info->width = sps.width;
@ -408,7 +408,7 @@ bool getH264VideoInfo(uint8_t *buf, int len, video_info_t *info)
int nal_len; int nal_len;
//Dprintf("H.264: Found NAL SEI at offset %d/%d", i, len); //Dprintf("H.264: Found NAL SEI at offset %d/%d", i, len);
if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) { if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) {
h264_sei_data_t sei = { 0 }; h264_sei_data_t sei = { 0, 0, VIDEO_SCAN_INVALID };
if (h264_parse_sei(nal_data, nal_len, &sei)) { if (h264_parse_sei(nal_data, nal_len, &sei)) {
info->frameRate = sei.frame_rate; info->frameRate = sei.frame_rate;
info->bitrate = sei.bitrate; info->bitrate = sei.bitrate;

View File

@ -472,9 +472,9 @@ void cFemonOsd::Action(void)
else if (!strncasecmp(s, "STAT:", 5)) else if (!strncasecmp(s, "STAT:", 5))
m_FrontendStatus = (fe_status_t) strtol(s + 5, NULL, 16); m_FrontendStatus = (fe_status_t) strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "SGNL:", 5)) else if (!strncasecmp(s, "SGNL:", 5))
m_Signal = strtol(s + 5, NULL, 16); m_Signal = (uint16_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "SNRA:", 5)) else if (!strncasecmp(s, "SNRA:", 5))
m_SNR = strtol(s + 5, NULL, 16); m_SNR = (uint16_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "BERA:", 5)) else if (!strncasecmp(s, "BERA:", 5))
m_BER = strtol(s + 5, NULL, 16); m_BER = strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "UNCB:", 5)) else if (!strncasecmp(s, "UNCB:", 5))
@ -653,7 +653,7 @@ bool cFemonOsd::SvdrpConnect(void)
m_SvdrpPlugin = cPluginManager::GetPlugin(SVDRPPLUGIN); m_SvdrpPlugin = cPluginManager::GetPlugin(SVDRPPLUGIN);
if (m_SvdrpPlugin) { if (m_SvdrpPlugin) {
m_SvdrpConnection.serverIp = femonConfig.svdrpip; m_SvdrpConnection.serverIp = femonConfig.svdrpip;
m_SvdrpConnection.serverPort = femonConfig.svdrpport; m_SvdrpConnection.serverPort = (unsigned short)femonConfig.svdrpport;
m_SvdrpConnection.shared = true; m_SvdrpConnection.shared = true;
m_SvdrpPlugin->Service("SvdrpConnection-v1.0", &m_SvdrpConnection); m_SvdrpPlugin->Service("SvdrpConnection-v1.0", &m_SvdrpConnection);
if (m_SvdrpConnection.handle >= 0) { if (m_SvdrpConnection.handle >= 0) {

View File

@ -199,7 +199,7 @@ void cFemonReceiver::Receive(uchar *Data, int Length)
} }
uint8_t off = 0; uint8_t off = 0;
if (Data[3] & ADAPT_FIELD) { if (Data[3] & ADAPT_FIELD) {
off = Data[4] + 1; off = (uint8_t)(Data[4] + 1);
} }
if (Data[1] & PAY_START) { if (Data[1] & PAY_START) {
uint8_t *sb = Data + 4 + off; uint8_t *sb = Data + 4 + off;

View File

@ -55,6 +55,7 @@ static cString getCA(int value)
case 0x4AE0: return cString::sprintf("%s (%X)", "RossCrypt", value); // Digi Raum Electronics Co. Ltd. case 0x4AE0: return cString::sprintf("%s (%X)", "RossCrypt", value); // Digi Raum Electronics Co. Ltd.
case 0x5500: return cString::sprintf("%s (%X)", "Z-Crypt", value); // Digi Raum Electronics Co. Ltd. case 0x5500: return cString::sprintf("%s (%X)", "Z-Crypt", value); // Digi Raum Electronics Co. Ltd.
case 0x5501: return cString::sprintf("%s (%X)", "Griffin", value); // Griffin case 0x5501: return cString::sprintf("%s (%X)", "Griffin", value); // Griffin
default: break;
} }
return cString::sprintf("%X", value); return cString::sprintf("%X", value);
} }
@ -264,6 +265,7 @@ cString getVideoCodec(int value)
switch (value) { switch (value) {
case VIDEO_CODEC_MPEG2: return cString::sprintf("%s", tr("MPEG-2")); case VIDEO_CODEC_MPEG2: return cString::sprintf("%s", tr("MPEG-2"));
case VIDEO_CODEC_H264: return cString::sprintf("%s", tr("H.264")); case VIDEO_CODEC_H264: return cString::sprintf("%s", tr("H.264"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -278,6 +280,7 @@ cString getAudioCodec(int value)
case AUDIO_CODEC_MPEG2_II: return cString::sprintf("%s", tr("MPEG-2 Layer II")); case AUDIO_CODEC_MPEG2_II: return cString::sprintf("%s", tr("MPEG-2 Layer II"));
case AUDIO_CODEC_MPEG2_III: return cString::sprintf("%s", tr("MPEG-2 Layer III")); case AUDIO_CODEC_MPEG2_III: return cString::sprintf("%s", tr("MPEG-2 Layer III"));
case AUDIO_CODEC_HEAAC: return cString::sprintf("%s", tr("HE-AAC")); case AUDIO_CODEC_HEAAC: return cString::sprintf("%s", tr("HE-AAC"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -289,6 +292,7 @@ cString getAudioChannelMode(int value)
case AUDIO_CHANNEL_MODE_JOINT_STEREO: return cString::sprintf("%s", tr("joint Stereo")); case AUDIO_CHANNEL_MODE_JOINT_STEREO: return cString::sprintf("%s", tr("joint Stereo"));
case AUDIO_CHANNEL_MODE_DUAL: return cString::sprintf("%s", tr("dual")); case AUDIO_CHANNEL_MODE_DUAL: return cString::sprintf("%s", tr("dual"));
case AUDIO_CHANNEL_MODE_SINGLE: return cString::sprintf("%s", tr("mono")); case AUDIO_CHANNEL_MODE_SINGLE: return cString::sprintf("%s", tr("mono"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -373,6 +377,7 @@ cString getAspectRatio(int value)
case VIDEO_ASPECT_RATIO_160_99: return cString::sprintf("160:99"); case VIDEO_ASPECT_RATIO_160_99: return cString::sprintf("160:99");
case VIDEO_ASPECT_RATIO_3_2: return cString::sprintf("3:2"); case VIDEO_ASPECT_RATIO_3_2: return cString::sprintf("3:2");
case VIDEO_ASPECT_RATIO_2_1: return cString::sprintf("2:1"); case VIDEO_ASPECT_RATIO_2_1: return cString::sprintf("2:1");
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -387,6 +392,7 @@ cString getVideoFormat(int value)
case VIDEO_FORMAT_NTSC: return cString::sprintf("%s", tr("NTSC")); case VIDEO_FORMAT_NTSC: return cString::sprintf("%s", tr("NTSC"));
case VIDEO_FORMAT_SECAM: return cString::sprintf("%s", tr("SECAM")); case VIDEO_FORMAT_SECAM: return cString::sprintf("%s", tr("SECAM"));
case VIDEO_FORMAT_MAC: return cString::sprintf("%s", tr("MAC")); case VIDEO_FORMAT_MAC: return cString::sprintf("%s", tr("MAC"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -409,6 +415,7 @@ cString getAC3BitStreamMode(int value, int coding)
case AUDIO_BITSTREAM_MODE_C: return cString::sprintf("%s", tr("Commentary (C)")); case AUDIO_BITSTREAM_MODE_C: return cString::sprintf("%s", tr("Commentary (C)"));
case AUDIO_BITSTREAM_MODE_E: return cString::sprintf("%s", tr("Emergency (E)")); case AUDIO_BITSTREAM_MODE_E: return cString::sprintf("%s", tr("Emergency (E)"));
case AUDIO_BITSTREAM_MODE_VO_KAR: return cString::sprintf("%s", (coding == 1) ? tr("Voice Over (VO)") : tr("Karaoke")); case AUDIO_BITSTREAM_MODE_VO_KAR: return cString::sprintf("%s", (coding == 1) ? tr("Voice Over (VO)") : tr("Karaoke"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -425,6 +432,7 @@ cString getAC3AudioCodingMode(int value, int stream)
case AUDIO_CODING_MODE_3_1: return cString::sprintf("3/1 - %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("S")); case AUDIO_CODING_MODE_3_1: return cString::sprintf("3/1 - %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("S"));
case AUDIO_CODING_MODE_2_2: return cString::sprintf("2/2 - %s, %s, %s, %s", tr("L"), tr("R"), tr("SL"), tr("SR")); case AUDIO_CODING_MODE_2_2: return cString::sprintf("2/2 - %s, %s, %s, %s", tr("L"), tr("R"), tr("SL"), tr("SR"));
case AUDIO_CODING_MODE_3_2: return cString::sprintf("3/2 - %s, %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("SL"), tr("SR")); case AUDIO_CODING_MODE_3_2: return cString::sprintf("3/2 - %s, %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("SL"), tr("SR"));
default: break;
} }
} }
return cString::sprintf("---"); return cString::sprintf("---");
@ -437,6 +445,7 @@ cString getAC3CenterMixLevel(int value)
case AUDIO_CENTER_MIX_LEVEL_MINUS_4_5dB: return cString::sprintf("-4.5 %s", tr("dB")); case AUDIO_CENTER_MIX_LEVEL_MINUS_4_5dB: return cString::sprintf("-4.5 %s", tr("dB"));
case AUDIO_CENTER_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6.0 %s", tr("dB")); case AUDIO_CENTER_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6.0 %s", tr("dB"));
case AUDIO_CENTER_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved")); case AUDIO_CENTER_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -448,6 +457,7 @@ cString getAC3SurroundMixLevel(int value)
case AUDIO_SURROUND_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6 %s", tr("dB")); case AUDIO_SURROUND_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6 %s", tr("dB"));
case AUDIO_SURROUND_MIX_LEVEL_0_dB: return cString::sprintf("0 %s", tr("dB")); case AUDIO_SURROUND_MIX_LEVEL_0_dB: return cString::sprintf("0 %s", tr("dB"));
case AUDIO_SURROUND_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved")); case AUDIO_SURROUND_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -459,6 +469,7 @@ cString getAC3DolbySurroundMode(int value)
case AUDIO_DOLBY_SURROUND_MODE_NOT_DOLBYSURROUND: return cString::sprintf("%s", trVDR("no")); case AUDIO_DOLBY_SURROUND_MODE_NOT_DOLBYSURROUND: return cString::sprintf("%s", trVDR("no"));
case AUDIO_DOLBY_SURROUND_MODE_DOLBYSURROUND: return cString::sprintf("%s", trVDR("yes")); case AUDIO_DOLBY_SURROUND_MODE_DOLBYSURROUND: return cString::sprintf("%s", trVDR("yes"));
case AUDIO_DOLBY_SURROUND_MODE_RESERVED: return cString::sprintf("%s", tr("reserved")); case AUDIO_DOLBY_SURROUND_MODE_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
} }
return cString::sprintf("---"); return cString::sprintf("---");
} }
@ -481,6 +492,7 @@ cString getAudioSamplingFreq(int value)
switch (value) { switch (value) {
case AUDIO_SAMPLING_FREQUENCY_INVALID: return cString::sprintf("---"); case AUDIO_SAMPLING_FREQUENCY_INVALID: return cString::sprintf("---");
case AUDIO_SAMPLING_FREQUENCY_RESERVED: return cString::sprintf("%s", tr("reserved")); case AUDIO_SAMPLING_FREQUENCY_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
} }
return cString::sprintf("%d %s", value, tr("Hz")); return cString::sprintf("%d %s", value, tr("Hz"));
} }
@ -491,6 +503,7 @@ cString getAudioBitrate(double value, double stream)
case AUDIO_BITRATE_INVALID: return cString::sprintf("---"); case AUDIO_BITRATE_INVALID: return cString::sprintf("---");
case AUDIO_BITRATE_RESERVED: return cString::sprintf("%s (%s)", tr("reserved"), *getBitrateKbits(value)); case AUDIO_BITRATE_RESERVED: return cString::sprintf("%s (%s)", tr("reserved"), *getBitrateKbits(value));
case AUDIO_BITRATE_FREE: return cString::sprintf("%s (%s)", tr("free"), *getBitrateKbits(value)); case AUDIO_BITRATE_FREE: return cString::sprintf("%s (%s)", tr("free"), *getBitrateKbits(value));
default: break;
} }
return cString::sprintf("%s (%s)", *getBitrateKbits(stream), *getBitrateKbits(value)); return cString::sprintf("%s (%s)", *getBitrateKbits(stream), *getBitrateKbits(value));
} }