write() don't need return value
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 27 Dec 2017 11:34:09 +0100
changeset 362b3a26d3b1ad
parent 35 84356a15828b
child 37 b63d62c675fe
write() don't need return value
c++/rgb-assembler/Memory.h
     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