summaryrefslogtreecommitdiff
path: root/unoidl
diff options
context:
space:
mode:
authorjsala <javier.salamanca.munoz@gmail.com>2022-06-25 13:35:01 +0200
committerHossein <hossein@libreoffice.org>2022-11-06 01:22:27 +0100
commit04a58d7eae2b26559efd48ff7cdd23cec1c2187c (patch)
treea43067d9b24d5c86a8fa2f299f8f7c807ff96ebb /unoidl
parent804f21e42bdc9328ab0f17b983411657e1f6215d (diff)
tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Also change some range based for. Change-Id: I32c5cbe0033c40cde3f1fc86ec8af90e558f2652 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141666 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'unoidl')
-rw-r--r--unoidl/source/unoidl-write.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx
index 84cad5bdda69..042b72c0471e 100644
--- a/unoidl/source/unoidl-write.cxx
+++ b/unoidl/source/unoidl-write.cxx
@@ -130,7 +130,7 @@ void write8(osl::File & file, sal_uInt64 value) {
}
unsigned char buf[1];
buf[0] = value & 0xFF;
- write(file, buf, SAL_N_ELEMENTS(buf));
+ write(file, buf, std::size(buf));
}
void write16(osl::File & file, sal_uInt64 value) {
@@ -142,7 +142,7 @@ void write16(osl::File & file, sal_uInt64 value) {
unsigned char buf[2];
buf[0] = value & 0xFF;
buf[1] = (value >> 8) & 0xFF;
- write(file, buf, SAL_N_ELEMENTS(buf));
+ write(file, buf, std::size(buf));
}
void write32(osl::File & file, sal_uInt64 value) {
@@ -156,7 +156,7 @@ void write32(osl::File & file, sal_uInt64 value) {
buf[1] = (value >> 8) & 0xFF;
buf[2] = (value >> 16) & 0xFF;
buf[3] = (value >> 24) & 0xFF;
- write(file, buf, SAL_N_ELEMENTS(buf));
+ write(file, buf, std::size(buf));
}
void write64(osl::File & file, sal_uInt64 value) {
@@ -169,7 +169,7 @@ void write64(osl::File & file, sal_uInt64 value) {
buf[5] = (value >> 40) & 0xFF;
buf[6] = (value >> 48) & 0xFF;
buf[7] = (value >> 56) & 0xFF;
- write(file, buf, SAL_N_ELEMENTS(buf));
+ write(file, buf, std::size(buf));
}
void writeIso60599Binary32(osl::File & file, float value) {
@@ -182,7 +182,7 @@ void writeIso60599Binary32(osl::File & file, float value) {
std::swap(sa.buf[0], sa.buf[3]);
std::swap(sa.buf[1], sa.buf[2]);
#endif
- write(file, sa.buf, SAL_N_ELEMENTS(sa.buf));
+ write(file, sa.buf, std::size(sa.buf));
}
void writeIso60599Binary64(osl::File & file, double value) {
@@ -197,7 +197,7 @@ void writeIso60599Binary64(osl::File & file, double value) {
std::swap(sa.buf[2], sa.buf[5]);
std::swap(sa.buf[3], sa.buf[4]);
#endif
- write(file, sa.buf, SAL_N_ELEMENTS(sa.buf));
+ write(file, sa.buf, std::size(sa.buf));
}
OString toAscii(OUString const & name) {