[libcamera-devel] [PATCH] android: jpeg: Utilise compiler specific nodiscard
Kieran Bingham
kieran.bingham at ideasonboard.com
Thu Feb 4 15:37:36 CET 2021
Utilise the new compiler specific __nodiscard to maintain coding style.
Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
Only applicable along with Laurent's [[nodiscard]] series.
src/android/jpeg/exif.cpp | 2 +-
src/android/jpeg/exif.h | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp
index fdd46070ba7c..ed995ca13167 100644
--- a/src/android/jpeg/exif.cpp
+++ b/src/android/jpeg/exif.cpp
@@ -515,7 +515,7 @@ std::u16string Exif::utf8ToUtf16(const std::string &str)
return ret;
}
-[[nodiscard]] int Exif::generate()
+__nodiscard int Exif::generate()
{
if (exifData_) {
free(exifData_);
diff --git a/src/android/jpeg/exif.h b/src/android/jpeg/exif.h
index b0d614027ede..67dbd20524d8 100644
--- a/src/android/jpeg/exif.h
+++ b/src/android/jpeg/exif.h
@@ -13,6 +13,7 @@
#include <libexif/exif-data.h>
+#include <libcamera/compiler.h>
#include <libcamera/geometry.h>
#include <libcamera/span.h>
@@ -75,7 +76,7 @@ public:
void setWhiteBalance(WhiteBalance wb);
libcamera::Span<const uint8_t> data() const { return { exifData_, size_ }; }
- [[nodiscard]] int generate();
+ __nodiscard int generate();
private:
ExifEntry *createEntry(ExifIfd ifd, ExifTag tag);
--
2.25.1
More information about the libcamera-devel
mailing list