diff options
author | David 'Digit' Turner <digit@google.com> | 2014-09-25 12:56:12 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2014-09-25 15:44:11 -0700 |
commit | e3823f90ffd60a4b1692f799e31eaccff77bf08d (patch) | |
tree | b887ad2bc6e9d97525ddb186443cdc39be08cd0d /sdklauncher | |
parent | 9319d29db93b728947a32d30a1b109d237130ffd (diff) | |
download | sdk-e3823f90ffd60a4b1692f799e31eaccff77bf08d.zip sdk-e3823f90ffd60a4b1692f799e31eaccff77bf08d.tar.gz sdk-e3823f90ffd60a4b1692f799e31eaccff77bf08d.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 'sdklauncher')
0 files changed, 0 insertions, 0 deletions