From 255c1a28b94ec3dc2851b916f4565ba4d9ff004d Mon Sep 17 00:00:00 2001 From: Syping Date: Wed, 8 Feb 2023 19:59:56 +0100 Subject: [PATCH] C API: ragephoto_setphotodata(c) returns now bool --- src/RagePhoto.cpp | 8 ++++---- src/RagePhotoA.h | 4 ++-- src/RagePhotoC.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index 30d0ec8..32304de 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -1249,16 +1249,16 @@ void ragephoto_setbufferoffsets(ragephoto_t instance) ragePhoto->setBufferOffsets(); } -void ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData) +ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData) { RagePhoto *ragePhoto = static_cast(*instance); - ragePhoto->setData(ragePhotoData, true); + return ragePhoto->setData(ragePhotoData, true); } -void ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData) +ragephoto_bool_t ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData) { RagePhoto *ragePhoto = static_cast(instance); - ragePhoto->setData(ragePhotoData, false); + return ragePhoto->setData(ragePhotoData, false); } void ragephoto_setphotodesc(ragephoto_t instance, const char *description, uint32_t bufferSize) diff --git a/src/RagePhotoA.h b/src/RagePhotoA.h index 5034e09..b435a4c 100644 --- a/src/RagePhotoA.h +++ b/src/RagePhotoA.h @@ -229,9 +229,9 @@ public: /** Sets the internal RagePhotoData object. */ bool setData(RagePhotoData *ragePhotoData, bool takeOwnership = true) { if (takeOwnership) - ragephoto_setphotodata(&instance, ragePhotoData); + return ragephoto_setphotodata(&instance, ragePhotoData); else - ragephoto_setphotodatac(instance, ragePhotoData); + return ragephoto_setphotodatac(instance, ragePhotoData); } /** Sets the Photo description. */ void setDescription(const char *description, uint32_t bufferSize = 0) { diff --git a/src/RagePhotoC.h b/src/RagePhotoC.h index 9dc941e..2c4153d 100644 --- a/src/RagePhotoC.h +++ b/src/RagePhotoC.h @@ -167,13 +167,13 @@ LIBRAGEPHOTO_C_BINDING void ragephoto_setbufferoffsets(ragephoto_t instance); * \param instance \p ragephoto_t instance * \param ragePhotoData RagePhotoData object being set */ -LIBRAGEPHOTO_C_BINDING void ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData); +LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodata(ragephoto_t *instance, RagePhotoData *ragePhotoData); /** Copies RagePhotoData object to internal RagePhotoData object. * \param instance \p ragephoto_t instance * \param ragePhotoData RagePhotoData object being copied */ -LIBRAGEPHOTO_C_BINDING void ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData); +LIBRAGEPHOTO_C_BINDING ragephoto_bool_t ragephoto_setphotodatac(ragephoto_t instance, RagePhotoData *ragePhotoData); /** Sets the Photo description. * \param instance \p ragephoto_t instance