Use R_ANAL_OP_DIR* enum value instead of hardcoded values

This commit is contained in:
Jules Maselbas 2023-01-06 12:47:18 +01:00 committed by pancake
parent 48c9edaed6
commit e2b46ce83a

View File

@ -641,9 +641,17 @@ R_API const char *r_anal_op_direction_tostring(RAnalOp *op) {
if (!op) {
return "none";
}
int d = op->direction;
return d == 1 ? "read"
: d == 2 ? "write"
: d == 4 ? "exec"
: d == 8 ? "ref": "none";
switch (op->direction) {
case R_ANAL_OP_DIR_READ:
return "read";
case R_ANAL_OP_DIR_WRITE:
return "write";
case R_ANAL_OP_DIR_EXEC:
return "exec";
case R_ANAL_OP_DIR_REF:
return "ref";
default:
break;
}
return "none";
}