aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2003-12-10 23:52:29 +0000
committerJamieson Christian2003-12-10 23:52:29 +0000
commitc95e9d12a2dab1e49eaf8febaf063a76c0fc1d64 (patch)
tree5fecca98cfcd360db330d9f4e201afd12bb94106
parent425126fa61f238802bd7a55572770b9430ca92c5 (diff)
downloadscummvm-rg350-c95e9d12a2dab1e49eaf8febaf063a76c0fc1d64.tar.gz
scummvm-rg350-c95e9d12a2dab1e49eaf8febaf063a76c0fc1d64.tar.bz2
scummvm-rg350-c95e9d12a2dab1e49eaf8febaf063a76c0fc1d64.zip
Endian-safe read-and-advance helper functions are
now based on the READ_LE_* and READ_BE_* macros. Very slight performance gain, woo hoo. svn-id: r11558
-rw-r--r--sound/midiparser.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/midiparser.h b/sound/midiparser.h
index 30d3243667..502fd9c14f 100644
--- a/sound/midiparser.h
+++ b/sound/midiparser.h
@@ -190,9 +190,8 @@ protected:
* the pointer.
*/
uint32 read4high (byte * &data) {
- uint32 val = 0;
- int i;
- for (i = 0; i < 4; ++i) val = (val << 8) | *data++;
+ uint32 val = READ_BE_UINT32 (data);
+ data += 4;
return val;
}
@@ -202,9 +201,8 @@ protected:
* the pointer.
*/
uint16 read2low (byte * &data) {
- uint16 val = 0;
- int i;
- for (i = 0; i < 2; ++i) val |= (*data++) << (i * 8);
+ uint16 val = READ_LE_UINT16 (data);
+ data += 2;
return val;
}