summaryrefslogtreecommitdiff
path: root/src/KM_platform.h
diff options
context:
space:
mode:
authorArnaud Bienner <abien@dolby.com>2022-08-10 11:47:06 +0200
committerArnaud Bienner <abien@dolby.com>2022-08-10 11:47:06 +0200
commit548416631b645890e46586dbe7bf10a8f0e9c3f8 (patch)
treef8eb675a28322cc247df1259b96d15b10026744a /src/KM_platform.h
parent585b5cb808eeaf16671772d016722852ed95329e (diff)
Fix misaligned reads when readin/writing audio
Diffstat (limited to 'src/KM_platform.h')
-rw-r--r--src/KM_platform.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/KM_platform.h b/src/KM_platform.h
index 747f6fc..7994228 100644
--- a/src/KM_platform.h
+++ b/src/KM_platform.h
@@ -147,9 +147,11 @@ namespace Kumu
}
// write an integer to byte-structured storage
+ // returns the number of bytes written
template<class T>
- inline void i2p(T i, byte_t* p) {
+ inline size_t i2p(T i, byte_t* p) {
memcpy(p, &i, sizeof(T));
+ return sizeof(T);
}