From 31bbb7e526e5d93128d814206358b829b6a071d9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Nov 2010 16:31:02 +0100 Subject: Fix warnings with clang inotify_event is a type with dynamic size, it should not be stored in a QMap. (even if it is fine here because we do not use the name, but it still generates warnings). We can however store the pointer from the buffer. Reviewed-by: Gabriel --- src/corelib/io/qfilesystemwatcher_inotify.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index 4740a89..dc18ae7 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -353,24 +353,24 @@ void QInotifyFileSystemWatcherEngine::readFromInotify() ioctl(inotifyFd, FIONREAD, (char *) &buffSize); QVarLengthArray buffer(buffSize); buffSize = read(inotifyFd, buffer.data(), buffSize); - const char *at = buffer.data(); - const char * const end = at + buffSize; + char *at = buffer.data(); + char * const end = at + buffSize; - QMap eventForId; + QMap eventForId; while (at < end) { - const inotify_event *event = reinterpret_cast(at); + inotify_event *event = reinterpret_cast(at); if (eventForId.contains(event->wd)) - eventForId[event->wd].mask |= event->mask; + eventForId[event->wd]->mask |= event->mask; else - eventForId.insert(event->wd, *event); + eventForId.insert(event->wd, event); at += sizeof(inotify_event) + event->len; } - QMap::const_iterator it = eventForId.constBegin(); + QMap::const_iterator it = eventForId.constBegin(); while (it != eventForId.constEnd()) { - inotify_event event = *it; + const inotify_event &event = **it; ++it; // qDebug() << "inotify event, wd" << event.wd << "mask" << hex << event.mask; -- cgit v0.12