Commit d3dea83d authored by Christoph Pfister's avatar Christoph Pfister

fix all warnings from clang

parent eaa22322
......@@ -12,7 +12,13 @@ add_definitions(${KDE4_DEFINITIONS})
if(STRICT_BUILD)
# -DQT_NO_CAST_FROM_ASCII
add_definitions(-ansi -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -pedantic -Wundef
add_definitions(-Werror -Weverything -Wno-padded -Wno-sign-conversion -Wno-unreachable-code -Wno-weak-vtables
-ferror-limit=5
-isystem /home/lxuser/Entwicklung/kaffeine/include
-isystem /usr/include/KDE
-isystem /usr/include/qt4/QtCore
-isystem /usr/include/qt4/QtGui
-isystem /usr/include/qt4/QtNetwork
-DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING
-DQT_STRICT_ITERATORS)
endif(STRICT_BUILD)
......
if(STRICT_BUILD)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
endif(STRICT_BUILD)
set(dtvdaemon_SRCS
connection.cpp
dtvdaemon.cpp
......
......@@ -112,7 +112,7 @@ void Connection::handlePacket()
while (packetLength > 0) {
char buffer[4096];
int size = qMin(packetLength, int(sizeof(buffer)));
int bytesRead = socket->read(buffer, size);
int bytesRead = int(socket->read(buffer, size));
if (bytesRead <= 0) {
Log("Connection::handlePacket: cannot empty buffer");
......
......@@ -59,7 +59,7 @@ bool VlcMediaWidget::init()
}
}
libvlc_media_player_set_xwindow(vlcMediaPlayer, winId());
libvlc_media_player_set_xwindow(vlcMediaPlayer, quint32(winId()));
setAttribute(Qt::WA_NativeWindow);
setAttribute(Qt::WA_PaintOnScreen);
return true;
......@@ -333,8 +333,8 @@ void VlcMediaWidget::updatePlaybackStatus()
void VlcMediaWidget::updateCurrentTotalTime()
{
currentTime = libvlc_media_player_get_time(vlcMediaPlayer);
totalTime = libvlc_media_player_get_length(vlcMediaPlayer);
currentTime = int(libvlc_media_player_get_time(vlcMediaPlayer));
totalTime = int(libvlc_media_player_get_length(vlcMediaPlayer));
if (currentTime < 0) {
currentTime = 0;
......
......@@ -27,7 +27,7 @@
#include "dvb/dvbtab.h"
#include "playlist/playlisttab.h"
QDBusArgument &operator<<(QDBusArgument &argument, const MprisStatusStruct &statusStruct)
static QDBusArgument &operator<<(QDBusArgument &argument, const MprisStatusStruct &statusStruct)
{
argument.beginStructure();
argument << statusStruct.state << statusStruct.random << statusStruct.repeatTrack <<
......@@ -36,7 +36,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const MprisStatusStruct &stat
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, MprisStatusStruct &statusStruct)
static const QDBusArgument &operator>>(const QDBusArgument &argument, MprisStatusStruct &statusStruct)
{
argument.beginStructure();
argument >> statusStruct.state >> statusStruct.random >> statusStruct.repeatTrack >>
......@@ -45,7 +45,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, MprisStatusStruct
return argument;
}
QDBusArgument &operator<<(QDBusArgument &argument, const MprisVersionStruct &versionStruct)
static QDBusArgument &operator<<(QDBusArgument &argument, const MprisVersionStruct &versionStruct)
{
argument.beginStructure();
argument << versionStruct.major << versionStruct.minor;
......@@ -53,7 +53,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const MprisVersionStruct &ver
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, MprisVersionStruct &versionStruct)
static const QDBusArgument &operator>>(const QDBusArgument &argument, MprisVersionStruct &versionStruct)
{
argument.beginStructure();
argument >> versionStruct.major >> versionStruct.minor;
......@@ -61,7 +61,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, MprisVersionStruc
return argument;
}
QDBusArgument &operator<<(QDBusArgument &argument, const TelevisionScheduleEntryStruct &entry)
static QDBusArgument &operator<<(QDBusArgument &argument, const TelevisionScheduleEntryStruct &entry)
{
argument.beginStructure();
argument << entry.key << entry.name << entry.channel << entry.begin << entry.duration <<
......@@ -70,7 +70,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const TelevisionScheduleEntry
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument,
static const QDBusArgument &operator>>(const QDBusArgument &argument,
TelevisionScheduleEntryStruct &entry)
{
argument.beginStructure();
......
......@@ -177,7 +177,7 @@ void DvbLinuxCam::readyRead()
int size = 0;
while (true) {
int bytesRead = read(caFd, buffer.data() + size, buffer.size() - size);
int bytesRead = int(read(caFd, buffer.data() + size, buffer.size() - size));
if ((bytesRead < 0) && (errno == EINTR)) {
continue;
......@@ -371,9 +371,9 @@ void DvbLinuxCam::handleSessionLayer(const unsigned char *data, int size)
messageData[0] = 0x00;
messageData[1] = (resource >> 24);
messageData[2] = (resource >> 16);
messageData[3] = (resource >> 8);
messageData[4] = resource;
messageData[2] = (resource >> 16) & 0xff;
messageData[3] = (resource >> 8) & 0xff;
messageData[4] = resource & 0xff;
messageData[5] = 0x00;
messageData[6] = 0x00;
......@@ -526,7 +526,8 @@ void DvbLinuxCam::customEvent(QEvent *event)
for (QMap<int, DvbLinuxCamService>::iterator it = services.begin();
it != services.end();) {
if (it->pendingAction == DvbLinuxCamService::Remove) {
sendCaPmt(DvbPmtSection(it->pmtSectionData), Update, StopDescrambling);
DvbPmtSection pmtSection(it->pmtSectionData);
sendCaPmt(pmtSection, Update, StopDescrambling);
it = services.erase(it);
} else {
++activeCaPmts;
......@@ -541,15 +542,19 @@ void DvbLinuxCam::customEvent(QEvent *event)
continue;
case DvbLinuxCamService::Add:
if (activeCaPmts == 1) {
sendCaPmt(DvbPmtSection(it->pmtSectionData), Only, Descramble);
DvbPmtSection pmtSection(it->pmtSectionData);
sendCaPmt(pmtSection, Only, Descramble);
} else {
sendCaPmt(DvbPmtSection(it->pmtSectionData), Add, Descramble);
DvbPmtSection pmtSection(it->pmtSectionData);
sendCaPmt(pmtSection, Add, Descramble);
}
break;
case DvbLinuxCamService::Update:
sendCaPmt(DvbPmtSection(it->pmtSectionData), Update, Descramble);
case DvbLinuxCamService::Update: {
DvbPmtSection pmtSection(it->pmtSectionData);
sendCaPmt(pmtSection, Update, Descramble);
break;
}
case DvbLinuxCamService::Remove:
Log("DvbLinuxCam::customEvent: impossible");
break;
......@@ -567,7 +572,7 @@ void DvbLinuxCam::sendCaPmt(const DvbPmtSection &pmtSection, CaPmtListManagement
messageData[0] = listManagement;
messageData[1] = ((pmtSection.programNumber() >> 8) & 0xff);
messageData[2] = (pmtSection.programNumber() & 0xff);
messageData[3] = ((pmtSection.versionNumber() << 1) |
messageData[3] = (((pmtSection.versionNumber() << 1) & 0xff) |
(pmtSection.currentNextIndicator() ? 0x01 : 0x00));
int index = 6;
......@@ -595,7 +600,7 @@ void DvbLinuxCam::sendCaPmt(const DvbPmtSection &pmtSection, CaPmtListManagement
for (DvbPmtSectionEntry entry = pmtSection.entries(); entry.isValid(); entry.advance()) {
resize(index + 5);
messageData[index++] = entry.streamType();
messageData[index++] = (entry.streamType() & 0xff);
messageData[index++] = ((entry.pid() >> 8) & 0xff);
messageData[index++] = (entry.pid() & 0xff);
lengthIndex = index;
......@@ -628,21 +633,21 @@ void DvbLinuxCam::sendCaPmt(const DvbPmtSection &pmtSection, CaPmtListManagement
void DvbLinuxCam::sendTransportLayerMessage(TransportLayerTag tag, char *data, char *end)
{
int length = end - data;
uint length = uint(end - data);
Q_ASSERT(length < 0x10000);
if (length < 0x80) {
*(--data) = length;
*(--data) = (length & 0xff);
} else {
*(--data) = length;
*(--data) = (length >> 8);
*(--data) = (length & 0xff);
*(--data) = ((length >> 8) & 0xff);
*(--data) = quint8(0x82);
}
*(--data) = tag;
*(--data) = ConnectionId;
*(--data) = slot;
length = end - data;
*(--data) = (slot & 0xff);
length = uint(end - data);
if (write(caFd, data, length) != length) {
Log("DvbLinuxCam::sendTransportLayerMessage: cannot send message of length") <<
......@@ -676,19 +681,19 @@ void DvbLinuxCam::sendSessionLayerMessage(SessionLayerTag tag, char *data, char
void DvbLinuxCam::sendApplicationLayerMessage(ApplicationLayerTag tag, char *data, char *end)
{
int length = end - data;
uint length = uint(end - data);
Q_ASSERT(length < 0x10000);
if (length < 0x80) {
*(--data) = length;
*(--data) = (length & 0xff);
} else {
*(--data) = (length & 0xff);
*(--data) = ((length >> 8) & 0xff);
*(--data) = quint8(0x82);
}
*(--data) = tag;
*(--data) = (tag >> 8);
*(--data) = (tag & 0xff);
*(--data) = ((tag >> 8) & 0xff);
*(--data) = (tag >> 16);
switch (tag) {
......
......@@ -38,7 +38,7 @@ bool DvbChannel::validate()
pmtSectionData = QByteArray(5, 0);
}
pmtSectionData[3] = (serviceId >> 8);
pmtSectionData[3] = ((serviceId >> 8) & 0xff);
pmtSectionData[4] = (serviceId & 0xff);
return true;
} else if (pmtSectionData.size() >= 5) {
......@@ -316,7 +316,8 @@ void DvbChannelModel::addChannel(DvbChannel &channel)
}
channel.number = existingChannel->number;
DvbPmtParser pmtParser(DvbPmtSection(channel.pmtSectionData));
DvbPmtSection pmtSection(channel.pmtSectionData);
DvbPmtParser pmtParser(pmtSection);
for (int i = 0; i < pmtParser.audioPids.size(); ++i) {
if (pmtParser.audioPids.at(i).first == existingChannel->audioPid) {
......
......@@ -622,7 +622,8 @@ DvbChannelEditor::DvbChannelEditor(DvbChannelTableModel *model_, const DvbShared
gridLayout->addWidget(new QLabel(i18n("PMT PID:")), 11, 0);
gridLayout->addWidget(new QLabel(QString::number(channel->pmtPid)), 11, 1);
DvbPmtParser pmtParser(DvbPmtSection(channel->pmtSectionData));
DvbPmtSection pmtSection(channel->pmtSectionData);
DvbPmtParser pmtParser(pmtSection);
int row = 12;
if (pmtParser.videoPid >= 0) {
......
......@@ -410,7 +410,7 @@ DvbScanFileDownloadDialog::~DvbScanFileDownloadDialog()
void DvbScanFileDownloadDialog::progressChanged(KJob *, unsigned long percent)
{
progressBar->setValue(percent);
progressBar->setValue(int(percent));
}
void DvbScanFileDownloadDialog::dataArrived(KIO::Job *, const QByteArray &data)
......
......@@ -115,7 +115,7 @@ void DvbSectionFilterInternal::processData(const char data[188])
// be careful that playloadLength is > 0 at this point
if (sectionStart) {
unsigned char pointer = payload[0];
int pointer = quint8(payload[0]);
if (pointer >= payloadLength) {
Log("DvbSectionFilterInternal::processData: invalid pointer");
......@@ -167,7 +167,7 @@ void DvbSectionFilterInternal::processSections(bool force)
}
if (sectionEnd <= end) {
int size = (sectionEnd - it);
int size = int(sectionEnd - it);
int crc = DvbStandardSection::verifyCrc32(it, size);
bool crcOk;
......@@ -206,7 +206,7 @@ void DvbSectionFilterInternal::processSections(bool force)
break;
}
buffer.remove(0, it - buffer.constBegin());
buffer.remove(0, int(it - buffer.constBegin()));
}
class DvbDataDumper : public QFile, public DvbPidFilter
......@@ -322,21 +322,21 @@ void DvbDevice::tune(const DvbTransponder &transponder)
if (config->switchFrequency != 0) {
// dual LO (low / high)
if (frequency < config->switchFrequency) {
frequency = fabs(frequency - config->lowBandFrequency);
frequency = qAbs(frequency - config->lowBandFrequency);
} else {
frequency = fabs(frequency - config->highBandFrequency);
frequency = qAbs(frequency - config->highBandFrequency);
highBand = true;
}
} else if (config->highBandFrequency != 0) {
// single LO (horizontal / vertical)
if (horPolar) {
frequency = fabs(frequency - config->lowBandFrequency);
frequency = qAbs(frequency - config->lowBandFrequency);
} else {
frequency = fabs(frequency - config->highBandFrequency);
frequency = qAbs(frequency - config->highBandFrequency);
}
} else {
// single LO
frequency = fabs(frequency - config->lowBandFrequency);
frequency = qAbs(frequency - config->lowBandFrequency);
}
// tone off
......@@ -353,8 +353,8 @@ void DvbDevice::tune(const DvbTransponder &transponder)
switch (config->configuration) {
case DvbConfigBase::DiseqcSwitch: {
char cmd[] = { quint8(0xe0), 0x10, 0x38, 0x00 };
cmd[3] = 0xf0 | (config->lnbNumber << 2) | (horPolar ? 2 : 0) | (highBand ? 1 : 0);
char cmd[] = { char(0xe0), 0x10, 0x38, 0x00 };
cmd[3] = 0xf0 | char(config->lnbNumber << 2) | (horPolar ? 2 : 0) | (highBand ? 1 : 0);
backend->sendMessage(cmd, sizeof(cmd));
usleep(15000);
......@@ -392,15 +392,15 @@ void DvbDevice::tune(const DvbTransponder &transponder)
if (angle >= 0) {
// east
value = ((16 * angle * 180 / M_PI) + 0.5);
value = int((16 * angle * 180 / M_PI) + 0.5);
value |= 0xe000;
} else {
// west
value = ((16 * (-angle) * 180 / M_PI) + 0.5);
value = int((16 * (-angle) * 180 / M_PI) + 0.5);
value |= 0xd000;
}
char cmd[] = { quint8(0xe0), 0x31, 0x6e, (value / 256), (value % 256) };
char cmd[] = { char(0xe0), 0x31, 0x6e, char(value / 256), char(value % 256) };
backend->sendMessage(cmd, sizeof(cmd));
usleep(15000);
moveRotor = true;
......@@ -408,7 +408,7 @@ void DvbDevice::tune(const DvbTransponder &transponder)
}
case DvbConfigBase::PositionsRotor: {
char cmd[] = { quint8(0xe0), 0x31, 0x6b, config->lnbNumber };
char cmd[] = { char(0xe0), 0x31, 0x6b, char(config->lnbNumber) };
backend->sendMessage(cmd, sizeof(cmd));
usleep(15000);
moveRotor = true;
......
......@@ -252,7 +252,7 @@ bool DvbLinuxDevice::sendMessage(const char *message, int length)
dvb_diseqc_master_cmd cmd;
memset(&cmd, 0, sizeof(cmd));
memcpy(&cmd.msg, message, length);
cmd.msg_len = length;
cmd.msg_len = char(length);
if (ioctl(frontendFd, FE_DISEQC_SEND_MASTER_CMD, &cmd) != 0) {
Log("DvbLinuxDevice::sendMessage: "
......@@ -587,7 +587,7 @@ bool DvbLinuxDevice::addPidFilter(int pid)
dmx_pes_filter_params pes_filter;
memset(&pes_filter, 0, sizeof(pes_filter));
pes_filter.pid = pid;
pes_filter.pid = ushort(pid);
pes_filter.input = DMX_IN_FRONTEND;
pes_filter.output = DMX_OUT_TS_TAP;
pes_filter.pes_type = DMX_PES_OTHER;
......@@ -685,7 +685,7 @@ void DvbLinuxDevice::startDvr()
while (true) {
int bufferSize = dvrBuffer.bufferSize;
int dataSize = read(dvrFd, dvrBuffer.data, bufferSize);
int dataSize = int(read(dvrFd, dvrBuffer.data, bufferSize));
if (dataSize < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
......@@ -696,7 +696,7 @@ void DvbLinuxDevice::startDvr()
continue;
}
dataSize = read(dvrFd, dvrBuffer.data, bufferSize);
dataSize = int(read(dvrFd, dvrBuffer.data, bufferSize));
if (dataSize < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
......@@ -764,7 +764,7 @@ void DvbLinuxDevice::run()
while (true) {
int bufferSize = dvrBuffer.bufferSize;
int dataSize = read(dvrFd, dvrBuffer.data, bufferSize);
int dataSize = int(read(dvrFd, dvrBuffer.data, bufferSize));
if (dataSize < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
......@@ -776,7 +776,7 @@ void DvbLinuxDevice::run()
}
Log("DvbLinuxDevice::run: cannot read from dvr") << dvrPath;
dataSize = read(dvrFd, dvrBuffer.data, bufferSize);
dataSize = int(read(dvrFd, dvrBuffer.data, bufferSize));
if (dataSize < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
......@@ -913,15 +913,15 @@ void DvbLinuxDeviceManager::componentAdded(const QString &udi)
if (QFile::exists(path + "device/vendor")) {
// PCI device
int vendor = readSysAttr(path + "device/vendor");
int device = readSysAttr(path + "device/device");
int pciDevice = readSysAttr(path + "device/device");
int subsystem_vendor = readSysAttr(path + "device/subsystem_vendor");
int subsystem_device = readSysAttr(path + "device/subsystem_device");
if ((vendor >= 0) && (device >= 0) && (subsystem_vendor >= 0) &&
if ((vendor >= 0) && (pciDevice >= 0) && (subsystem_vendor >= 0) &&
(subsystem_device >= 0)) {
deviceId = 'P';
deviceId += QString("%1").arg(vendor, 4, 16, QChar('0'));
deviceId += QString("%1").arg(device, 4, 16, QChar('0'));
deviceId += QString("%1").arg(pciDevice, 4, 16, QChar('0'));
deviceId += QString("%1").arg(subsystem_vendor, 4, 16, QChar('0'));
deviceId += QString("%1").arg(subsystem_device, 4, 16, QChar('0'));
}
......
......@@ -266,7 +266,8 @@ void DvbLiveView::toggleOsd()
void DvbLiveView::pmtSectionChanged(const QByteArray &pmtSectionData)
{
internal->pmtSectionData = pmtSectionData;
DvbPmtParser pmtParser(DvbPmtSection(internal->pmtSectionData));
DvbPmtSection pmtSection(internal->pmtSectionData);
DvbPmtParser pmtParser(pmtSection);
videoPid = pmtParser.videoPid;
for (int i = 0;; ++i) {
......@@ -631,14 +632,14 @@ void DvbLiveViewInternal::resetPipe()
void DvbLiveViewInternal::writeToPipe()
{
while (!buffers.isEmpty()) {
const QByteArray &buffer = buffers.at(0);
int bytesWritten = write(writeFd, buffer.constData(), buffer.size());
const QByteArray &currentBuffer = buffers.at(0);
int bytesWritten = int(write(writeFd, currentBuffer.constData(), currentBuffer.size()));
if ((bytesWritten < 0) && (errno == EINTR)) {
continue;
}
if (bytesWritten == buffer.size()) {
if (bytesWritten == currentBuffer.size()) {
buffers.removeFirst();
continue;
}
......
......@@ -592,7 +592,8 @@ void DvbManager::writeDeviceConfigs()
writer.write("frontendName", deviceConfig.frontendName);
writer.write("configCount", deviceConfig.configs.size());
foreach (const DvbConfig &config, deviceConfig.configs) {
for (int i = 0; i < deviceConfig.configs.size(); ++i) {
const DvbConfig &config = deviceConfig.configs.at(i);
writer.write("[config]");
writer.write("type", config->getTransmissionType());
writer.write("name", config->name);
......@@ -615,7 +616,8 @@ void DvbManager::updateSourceMapping()
sourceMapping.clear();
foreach (const DvbDeviceConfig &deviceConfig, deviceConfigs) {
foreach (const DvbConfig &config, deviceConfig.configs) {
for (int i = 0; i < deviceConfig.configs.size(); ++i) {
const DvbConfig &config = deviceConfig.configs.at(i);
TransmissionType type;
switch (config->getTransmissionType()) {
......@@ -720,7 +722,7 @@ void DvbManager::readScanData()
bool DvbManager::readScanSources(DvbScanData &data, const char *tag, TransmissionType type)
{
int tagLen = strlen(tag);
int tagLen = int(strlen(tag));
bool parseError = false;
while (strncmp(data.getLine(), tag, tagLen) == 0) {
......
......@@ -262,8 +262,8 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
bool offsets = (autoScanSource == "AUTO-Offsets");
for (int frequency = 177500000; frequency <= 226500000; frequency += 7000000) {
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder = transponder.as<DvbTTransponder>();
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder = currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth7MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -272,7 +272,7 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->transmissionMode = DvbTTransponder::TransmissionModeAuto;
dvbTTransponder->guardInterval = DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
for (int frequency = 474000000; frequency <= 858000000; frequency += 8000000) {
......@@ -289,9 +289,9 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
offset = 167000;
}
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency + offset;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth8MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -302,7 +302,7 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->guardInterval =
DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
}
} else if (autoScanSource == "AUTO-Australia") {
......@@ -314,9 +314,9 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
offset = 125000;
}
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency + offset;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth7MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -327,7 +327,7 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->guardInterval =
DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
}
......@@ -339,9 +339,9 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
offset = 125000;
}
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency + offset;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth7MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -352,7 +352,7 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->guardInterval =
DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
}
} else if (autoScanSource == "AUTO-Italy") {
......@@ -361,9 +361,9 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
for (unsigned i = 0; i < (sizeof(italyVhf) / sizeof(italyVhf[0])); ++i) {
for (int j = 0; j < 2; ++j) {
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = italyVhf[i];
dvbTTransponder->bandwidth = ((j == 0) ?
DvbTTransponder::Bandwidth7MHz :
......@@ -376,14 +376,14 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->guardInterval =
DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
}
for (int frequency = 474000000; frequency <= 858000000; frequency += 8000000) {
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth8MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -392,13 +392,13 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->transmissionMode = DvbTTransponder::TransmissionModeAuto;
dvbTTransponder->guardInterval = DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
} else if (autoScanSource == "AUTO-Taiwan") {
for (int frequency = 527000000; frequency <= 599000000; frequency += 6000000) {
DvbTransponder transponder(DvbTransponderBase::DvbT);
DvbTransponder currentTransponder(DvbTransponderBase::DvbT);
DvbTTransponder *dvbTTransponder =
transponder.as<DvbTTransponder>();
currentTransponder.as<DvbTTransponder>();
dvbTTransponder->frequency = frequency;
dvbTTransponder->bandwidth = DvbTTransponder::Bandwidth6MHz;
dvbTTransponder->modulation = DvbTTransponder::ModulationAuto;
......@@ -407,7 +407,7 @@ DvbScan::DvbScan(DvbDevice *device_, const QString &source_, const QString &auto
dvbTTransponder->transmissionMode = DvbTTransponder::TransmissionModeAuto;
dvbTTransponder->guardInterval = DvbTTransponder::GuardIntervalAuto;
dvbTTransponder->hierarchy = DvbTTransponder::HierarchyNone;
transponders.append(transponder);
transponders.append(currentTransponder);
}
}
}
......
......@@ -343,7 +343,7 @@ QString DvbSiText::convertText(const char *data, int size)
}
}
QString result = codecTable[encoding]->toUnicode(dest, destIt - dest);
QString result = codecTable[encoding]->toUnicode(dest, int(destIt - dest));
delete[] dest;
return result;
......@@ -1044,12 +1044,12 @@ void DvbSectionGenerator::initPat(int transportStreamId, int programNumber, int
char *data = startSection(16);
data[0] = 0x00;
data[3] = transportStreamId >> 8;
data[4] = transportStreamId;
data[8] = programNumber >> 8;
data[9] = programNumber;
data[10] = 0xe0 | (pmtPid >> 8);
data[11] = pmtPid;
data[3] = char(transportStreamId >> 8);
data[4] = char(transportStreamId);
data[8] = char(programNumber >> 8);
data[9] = char(programNumber);
data[10] = 0xe0 | char(pmtPid >> 8);
data[11] = char(pmtPid);
endSection(16, 0x00);
}
......@@ -1061,7 +1061,7 @@ void DvbSectionGenerator::initPmt(int pmtPid, const DvbPmtSection &section, cons
DvbPmtSectionEntry entry = section.entries();
memcpy(data, section.getData(), entry.getData() - section.getData());
int size = entry.getData() - section.getData();
int size = int(entry.getData() - section.getData());
while (entry.isValid()) {
if (pids.contains(entry.pid())) {
......@@ -1080,7 +1080,7 @@ QByteArray DvbSectionGenerator::generatePackets()