mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
dive.h: add a variant of FOR_EACH_PICTURE
This prevents a warning caused by -Waddress, that the address of 'displayed_dive' will always be defined. Exact macro variant suggested by Dirk. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
70a2e91f1c
commit
874754e22b
2 changed files with 3 additions and 1 deletions
2
dive.h
2
dive.h
|
@ -349,6 +349,8 @@ struct picture {
|
||||||
if (_dive) \
|
if (_dive) \
|
||||||
for (struct picture *picture = (_dive)->picture_list; picture; picture = picture->next)
|
for (struct picture *picture = (_dive)->picture_list; picture; picture = picture->next)
|
||||||
|
|
||||||
|
#define FOR_EACH_PICTURE_NON_PTR(_divestruct) \
|
||||||
|
for (struct picture *picture = (_divestruct).picture_list; picture; picture = picture->next)
|
||||||
|
|
||||||
extern struct picture *alloc_picture();
|
extern struct picture *alloc_picture();
|
||||||
extern void dive_create_picture(struct dive *d, char *filename, int shift_time);
|
extern void dive_create_picture(struct dive *d, char *filename, int shift_time);
|
||||||
|
|
|
@ -51,7 +51,7 @@ void DivePictureModel::updateDivePictures()
|
||||||
|
|
||||||
stringPixmapCache.clear();
|
stringPixmapCache.clear();
|
||||||
QStringList pictures;
|
QStringList pictures;
|
||||||
FOR_EACH_PICTURE (&displayed_dive) {
|
FOR_EACH_PICTURE_NON_PTR(displayed_dive) {
|
||||||
stringPixmapCache[QString(picture->filename)].offsetSeconds = picture->offset.seconds;
|
stringPixmapCache[QString(picture->filename)].offsetSeconds = picture->offset.seconds;
|
||||||
pictures.push_back(QString(picture->filename));
|
pictures.push_back(QString(picture->filename));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue