Skip to content

Commit 88c3cbe

Browse files
authored
int: Address some nickpick sonar warnings about TileID initialization (#4722)
Signed-off-by: Larry Gritz <[email protected]>
1 parent 23f17ac commit 88c3cbe

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

src/libtexture/imagecache_pvt.h

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,7 @@ typedef tsl::robin_map<ustring, ImageCacheFileRef> FingerprintMap;
505505
///
506506
struct TileID {
507507
/// Default constructor
508-
///
509-
TileID()
510-
: m_file(nullptr)
511-
{
512-
}
508+
TileID() = default;
513509

514510
/// Initialize a TileID based on full elaboration of image file,
515511
/// subimage, and tile x,y,z indices.
@@ -531,9 +527,8 @@ struct TileID {
531527
}
532528
}
533529

534-
/// Destructor is trivial, because we don't hold any resources
535-
/// of our own. This is by design.
536-
~TileID() {}
530+
/// Trivial destructor.
531+
~TileID() = default;
537532

538533
ImageCacheFile& file(void) const { return *m_file; }
539534
ImageCacheFile* file_ptr(void) const { return m_file; }
@@ -617,13 +612,13 @@ struct TileID {
617612
}
618613

619614
private:
620-
int m_x, m_y, m_z; ///< x,y,z tile index within the subimage
621-
int m_subimage; ///< subimage
622-
int m_miplevel; ///< MIP-map level
623-
short m_chbegin, m_chend; ///< Channel range
624-
int m_colortransformid; ///< Colorspace id (0 == default)
625-
int m_padding = 0; ///< Unused
626-
ImageCacheFile* m_file; ///< Which ImageCacheFile we refer to
615+
int m_x = 0, m_y = 0, m_z = 0; ///< x,y,z tile index within the subimage
616+
int m_subimage = 0; ///< subimage
617+
int m_miplevel = 0; ///< MIP-map level
618+
short m_chbegin = 0, m_chend = 0; ///< Channel range
619+
int m_colortransformid = 0; ///< Colorspace id (0 == default)
620+
int m_padding = 0; ///< Unused
621+
ImageCacheFile* m_file = nullptr; ///< Which ImageCacheFile we refer to
627622
};
628623

629624

0 commit comments

Comments
 (0)