Fix uninitialized variables
This commit is contained in:
@@ -33,11 +33,11 @@ FileSystemWatcherInterface::FileSystemWatcherInterface(QObject *parent)
|
||||
: QObject(parent) {}
|
||||
|
||||
FileSystemWatcherInterface *FileSystemWatcherInterface::Create(QObject *parent) {
|
||||
FileSystemWatcherInterface *ret;
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
ret = new MacFSListener(parent);
|
||||
FileSystemWatcherInterface *ret = new MacFSListener(parent);
|
||||
#else
|
||||
ret = new QtFSListener(parent);
|
||||
FileSystemWatcherInterface *ret = new QtFSListener(parent);
|
||||
#endif
|
||||
|
||||
ret->Init();
|
||||
|
||||
@@ -282,7 +282,7 @@ QModelIndex MergedProxyModel::mapFromSource(const QModelIndex &source_index) con
|
||||
|
||||
// Add a mapping if we don't have one already
|
||||
const auto &it = p_->mappings_.get<tag_by_source>().find(source_index);
|
||||
Mapping *mapping;
|
||||
Mapping *mapping = nullptr;
|
||||
if (it != p_->mappings_.get<tag_by_source>().end()) {
|
||||
mapping = *it;
|
||||
}
|
||||
|
||||
@@ -566,8 +566,8 @@ void SongLoader::ErrorMessageReceived(GstMessage *msg) {
|
||||
|
||||
if (state_ == Finished) return;
|
||||
|
||||
GError *error;
|
||||
gchar *debugs;
|
||||
GError *error = nullptr;
|
||||
gchar *debugs = nullptr;
|
||||
|
||||
gst_message_parse_error(msg, &error, &debugs);
|
||||
qLog(Error) << __PRETTY_FUNCTION__ << error->message;
|
||||
|
||||
@@ -315,7 +315,7 @@ bool Copy(QIODevice *source, QIODevice *destination) {
|
||||
std::unique_ptr<char[]> data(new char[bytes]);
|
||||
qint64 pos = 0;
|
||||
|
||||
qint64 bytes_read;
|
||||
qint64 bytes_read = 0;
|
||||
do {
|
||||
bytes_read = source->read(data.get() + pos, bytes - pos);
|
||||
if (bytes_read == -1) return false;
|
||||
@@ -324,7 +324,7 @@ bool Copy(QIODevice *source, QIODevice *destination) {
|
||||
} while (bytes_read > 0 && pos != bytes);
|
||||
|
||||
pos = 0;
|
||||
qint64 bytes_written;
|
||||
qint64 bytes_written = 0;
|
||||
do {
|
||||
bytes_written = destination->write(data.get() + pos, bytes - pos);
|
||||
if (bytes_written == -1) return false;
|
||||
|
||||
Reference in New Issue
Block a user