mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 13:39:46 +00:00
Fix warning about negative shifts. (#2171)
This commit is contained in:
parent
cb4bf3c5d3
commit
322fde9205
@ -28,7 +28,7 @@ project(capstone
|
||||
if (MSVC)
|
||||
add_compile_options(/W1 /w14189)
|
||||
else()
|
||||
add_compile_options(-Werror -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
|
||||
add_compile_options(-Werror -Wshift-negative-value -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -808,7 +808,7 @@ DEFINE_printAddrMode5Operand(false) DEFINE_printAddrMode5Operand(true)
|
||||
printRegName(O, MCOperand_getReg(MO1));
|
||||
if (MCOperand_getImm(MO2)) {
|
||||
SStream_concat(O, "%s", ":");
|
||||
printInt64(O, ((int32_t)MCOperand_getImm(MO2)) << 3);
|
||||
printInt64(O, ((uint32_t)MCOperand_getImm(MO2)) << 3);
|
||||
}
|
||||
SStream_concat(O, "%s", "]");
|
||||
SStream_concat0(O, markup(">"));
|
||||
@ -1177,7 +1177,7 @@ void printPCLabel(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
int32_t OffImm = (int32_t)MCOperand_getImm(MO) << scale; \
|
||||
int32_t OffImm = (uint32_t)MCOperand_getImm(MO) << scale; \
|
||||
\
|
||||
SStream_concat0(O, markup("<imm:")); \
|
||||
if (OffImm == INT32_MIN) \
|
||||
|
Loading…
Reference in New Issue
Block a user