diff options
author | Björn Gustavsson <[email protected]> | 2017-09-19 07:15:03 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-01 07:08:19 +0200 |
commit | 4e94a3dfc5cade0f8334efa1c785f44eaa55fdac (patch) | |
tree | feabf3cbe7d629cf73bc5a63818e29b4f8881661 /erts/emulator/hipe/hipe_bif64.h | |
parent | e64a26414428c2f9c10cd91991bbc9dd81f0d8ae (diff) | |
download | otp-4e94a3dfc5cade0f8334efa1c785f44eaa55fdac.tar.gz otp-4e94a3dfc5cade0f8334efa1c785f44eaa55fdac.tar.bz2 otp-4e94a3dfc5cade0f8334efa1c785f44eaa55fdac.zip |
Eliminate unnecessary and inconsistent casts
Consider the types in the code below:
BeamInstr* I;
.
.
.
BeamInstr* next;
next = (BeamInstr *) *I;
Goto(next);
This is illogical. If 'I' points to a BeamInstr, then 'next' should
be a BeamInstr, not a pointer to a BeamInstr. The Goto() macros does
not require a pointer, because it will cast its argument to a void*
anyway.
Therefore, this code example can be simplified to:
BeamInstr* I;
.
.
.
BeamInstr next;
next = *I;
Goto(next);
Similarly, we can remove the casts in the macros when NO_JUMP_TABLE
is defined.
Diffstat (limited to 'erts/emulator/hipe/hipe_bif64.h')
0 files changed, 0 insertions, 0 deletions