From 87c0b8624831854d63f143d9407970bfe7fb872f Mon Sep 17 00:00:00 2001 From: mio Date: Sat, 21 Sep 2024 17:59:23 +0800 Subject: [PATCH] Format code --- include/unicorn/unicorn.h | 2 +- tests/unit/test_x86.c | 38 +++++++++++++++++++++++++++++--------- uc.c | 3 ++- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/include/unicorn/unicorn.h b/include/unicorn/unicorn.h index 26f7549e..d0f5b9ea 100644 --- a/include/unicorn/unicorn.h +++ b/include/unicorn/unicorn.h @@ -65,7 +65,7 @@ typedef size_t uc_hook; #define UNICORN_DEPRECATED __declspec(deprecated) #else #pragma message( \ - "WARNING: You need to implement UNICORN_DEPRECATED for this compiler") + "WARNING: You need to implement UNICORN_DEPRECATED for this compiler") #define UNICORN_DEPRECATED #endif diff --git a/tests/unit/test_x86.c b/tests/unit/test_x86.c index 0b377c73..a95259e6 100644 --- a/tests/unit/test_x86.c +++ b/tests/unit/test_x86.c @@ -1682,7 +1682,9 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap ax - 0x66, 0x0F, 0xC8, + 0x66, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_32, code); TEST_IN_REG(EAX, 0x44332211); @@ -1692,7 +1694,9 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap ax - 0x66, 0x0F, 0xC8, + 0x66, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1702,7 +1706,10 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap rax (66h ignored) - 0x66, 0x48, 0x0F, 0xC8, + 0x66, + 0x48, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1712,7 +1719,10 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap ax (rex ignored) - 0x48, 0x66, 0x0F, 0xC8, + 0x48, + 0x66, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1722,7 +1732,8 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap eax - 0x0F, 0xC8, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_32, code); TEST_IN_REG(EAX, 0x44332211); @@ -1732,7 +1743,8 @@ static void test_bswap_ax(void) { uint8_t code[] = { // bswap eax - 0x0F, 0xC8, + 0x0F, + 0xC8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1746,7 +1758,10 @@ static void test_rex_x64(void) { uint8_t code[] = { // mov ax, bx (rex.w ignored) - 0x48, 0x66, 0x89, 0xD8, + 0x48, + 0x66, + 0x89, + 0xD8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1757,7 +1772,10 @@ static void test_rex_x64(void) { uint8_t code[] = { // mov rax, rbx (66h ignored) - 0x66, 0x48, 0x89, 0xD8, + 0x66, + 0x48, + 0x89, + 0xD8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); @@ -1768,7 +1786,9 @@ static void test_rex_x64(void) { uint8_t code[] = { // mov ax, bx (expected encoding) - 0x66, 0x89, 0xD8, + 0x66, + 0x89, + 0xD8, }; TEST_CODE(UC_MODE_64, code); TEST_IN_REG(RAX, 0x8877665544332211); diff --git a/uc.c b/uc.c index 73386774..bc8019ea 100644 --- a/uc.c +++ b/uc.c @@ -2837,7 +2837,8 @@ static uc_err uc_restore_latest_snapshot(struct uc_struct *uc) subregions_link, subregion_next) { uc->memory_filter_subregions(subregion, uc->snapshot_level); - if (subregion->priority >= uc->snapshot_level || (!subregion->terminates && QTAILQ_EMPTY(&subregion->subregions))) { + if (subregion->priority >= uc->snapshot_level || + (!subregion->terminates && QTAILQ_EMPTY(&subregion->subregions))) { uc->memory_unmap(uc, subregion); } }