1.1 --- a/c++/rgb-assembler/Memory.h Mon Dec 25 16:15:55 2017 +0100
1.2 +++ b/c++/rgb-assembler/Memory.h Wed Dec 27 11:34:09 2017 +0100
1.3 @@ -77,13 +77,13 @@
1.4 * Writes data to current position in memory and increments the index (position).
1.5 * @param value value to be written at current position
1.6 */
1.7 - template<typename T> T write(const T value) {
1.8 + template<typename T> void write(const T value) {
1.9 if (index + sizeof (T) <= memorySize) {
1.10 T * m = reinterpret_cast<T*> (memory + index);
1.11 *m = value;
1.12 index += sizeof (value);
1.13 } else {
1.14 - return logMemoryError<T>(index);
1.15 + logMemoryError<T>(index);
1.16 }
1.17 }
1.18
1.19 @@ -91,12 +91,12 @@
1.20 * Writes data to given position in memory (without affecting the current position).
1.21 * @param value value to be written at given position
1.22 */
1.23 - template<typename T> T write(const address_t &address, const T value) {
1.24 + template<typename T> void write(const address_t &address, const T value) {
1.25 if (address + sizeof (T) <= memorySize) {
1.26 T * m = reinterpret_cast<T*> (memory + address);
1.27 *m = value;
1.28 } else {
1.29 - return logMemoryError<T>(address);
1.30 + logMemoryError<T>(address);
1.31 }
1.32 }
1.33