代码拉取完成,页面将自动刷新
From 2f41eb92cb97ba980ac4d9d7b6b39d001687c111 Mon Sep 17 00:00:00 2001
From: liqiang <liqiang64@huawei.com>
Date: Thu, 29 Aug 2024 03:56:58 +0800
Subject: [PATCH] fix some clean code problem
Signed-off-by: liqiang <liqiang64@huawei.com>
---
upatch-diff/insn/asm/inat.h | 8 ++++----
upatch-diff/insn/inat.c | 6 +++---
upatch-diff/insn/insn.c | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/upatch-diff/insn/asm/inat.h b/upatch-diff/insn/asm/inat.h
index f446ad8..4ab84d6 100644
--- a/upatch-diff/insn/asm/inat.h
+++ b/upatch-diff/insn/asm/inat.h
@@ -156,7 +156,7 @@ static inline int inat_is_escape(insn_attr_t attr)
return attr & INAT_ESC_MASK;
}
-static inline int inat_escape_id(insn_attr_t attr)
+static inline unsigned int inat_escape_id(insn_attr_t attr)
{
return (attr & INAT_ESC_MASK) >> INAT_ESC_OFFS;
}
@@ -166,7 +166,7 @@ static inline int inat_is_group(insn_attr_t attr)
return attr & INAT_GRP_MASK;
}
-static inline int inat_group_id(insn_attr_t attr)
+static inline unsigned int inat_group_id(insn_attr_t attr)
{
return (attr & INAT_GRP_MASK) >> INAT_GRP_OFFS;
}
@@ -181,7 +181,7 @@ static inline int inat_has_immediate(insn_attr_t attr)
return attr & INAT_IMM_MASK;
}
-static inline int inat_immediate_size(insn_attr_t attr)
+static inline unsigned int inat_immediate_size(insn_attr_t attr)
{
return (attr & INAT_IMM_MASK) >> INAT_IMM_OFFS;
}
@@ -220,4 +220,4 @@ static inline int inat_must_vex(insn_attr_t attr)
{
return attr & INAT_VEXONLY;
}
-#endif
\ No newline at end of file
+#endif
diff --git a/upatch-diff/insn/inat.c b/upatch-diff/insn/inat.c
index 193583f..cb5aec6 100644
--- a/upatch-diff/insn/inat.c
+++ b/upatch-diff/insn/inat.c
@@ -43,7 +43,7 @@ insn_attr_t inat_get_escape_attribute(insn_byte_t opcode, int lpfx_id,
insn_attr_t esc_attr)
{
const insn_attr_t *table;
- int n;
+ unsigned int n;
n = inat_escape_id(esc_attr);
@@ -62,7 +62,7 @@ insn_attr_t inat_get_group_attribute(insn_byte_t modrm, int lpfx_id,
insn_attr_t grp_attr)
{
const insn_attr_t *table;
- int n;
+ unsigned int n;
n = inat_group_id(grp_attr);
@@ -95,4 +95,4 @@ insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
return 0;
}
return table[opcode];
-}
\ No newline at end of file
+}
diff --git a/upatch-diff/insn/insn.c b/upatch-diff/insn/insn.c
index d9a356b..7880eed 100644
--- a/upatch-diff/insn/insn.c
+++ b/upatch-diff/insn/insn.c
@@ -574,6 +574,6 @@ void insn_get_length(struct insn *insn)
return;
if (!insn->immediate.got)
insn_get_immediate(insn);
- insn->length = (unsigned char)((unsigned long)insn->next_byte
- - (unsigned long)insn->kaddr);
-}
\ No newline at end of file
+ insn->length = (unsigned char)((unsigned long)insn->next_byte -
+ (unsigned long)insn->kaddr);
+}
--
2.34.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。