diff options
author | David 'Digit' Turner <digit@google.com> | 2014-09-25 12:56:12 -0700 |
---|---|---|
committer | bohu <bohu@google.com> | 2014-11-25 12:30:47 -0800 |
commit | d0dc1ddf4a9678714c88aca05883592f04f6c37f (patch) | |
tree | 7b9c64cf17d7f6f41b7ab897fff6df48c7723bed /emulator/opengl/host/libs/libOpenglRender/NativeLinuxSubWindow.cpp | |
parent | 7f0f4aab2a307626c13b860179f46017480f7985 (diff) | |
download | sdk-d0dc1ddf4a9678714c88aca05883592f04f6c37f.zip sdk-d0dc1ddf4a9678714c88aca05883592f04f6c37f.tar.gz sdk-d0dc1ddf4a9678714c88aca05883592f04f6c37f.tar.bz2 |
emulator/opengl/emugen: Move pointer increment out of case statements.
Minor patch that ensures that the pointer/position increment all
happen at one place, instead of being replicated in each case
statement. In other words, the generated code used to look like:
switch (opcode) {
case OP_someOperation1: {
...
ptr += *(uint32_t)(ptr + 4);
pos += *(uint32_t)(ptr + 4);
break;
}
case OP_someOperation2: {
...
ptr += *(uint32_t)(ptr + 4);
pos += *(uint32_t)(ptr + 4);
break;
}
...
default: {
unknownOpcode = true;
}
Now it looks like:
switch (opcode) {
case OP_someOperation1: {
...
break;
}
case OP_someOperation2: {
...
break;
}
...
default: {
unknownOpcode = true;
}
if (!unknownOpcode) {
ptr += packetLen;
pos += packetLen;
}
Which is cleaner. Also change the type of |opcode| and |packetLen|
to uint32_t and size_t respectively. + Minor formatting changes to
indentation.
Change-Id: If0002fe18a24b9ce6691e3e3cd3e102d1e00d4c9
Diffstat (limited to 'emulator/opengl/host/libs/libOpenglRender/NativeLinuxSubWindow.cpp')
0 files changed, 0 insertions, 0 deletions