From 570834e3636a5911a16a29d890d220d6c421f8c9 Mon Sep 17 00:00:00 2001 From: tandasat Date: Fri, 8 Apr 2016 08:05:06 -0700 Subject: [PATCH] Rename CS_OPT_NONE to CS_OPT_INVALID --- include/capstone.h | 4 ++-- tests/test_skipdata.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/capstone.h b/include/capstone.h index b0a887b3..a5c7579a 100644 --- a/include/capstone.h +++ b/include/capstone.h @@ -120,7 +120,7 @@ typedef struct cs_opt_mem { // Runtime option for the disassembled engine typedef enum cs_opt_type { - CS_OPT_NONE = 0, // No opetion specified + CS_OPT_INVALID = 0, // No opetion specified CS_OPT_SYNTAX, // Assembly output syntax CS_OPT_DETAIL, // Break down instruction structure into details CS_OPT_MODE, // Change engine's mode at run-time @@ -172,7 +172,7 @@ typedef enum cs_group_type { @return: return number of bytes to skip, or 0 to immediately stop disassembling. */ -typedef size_t (CAPSTONE_API*cs_skipdata_cb_t)(const uint8_t *code, size_t code_size, size_t offset, void *user_data); +typedef size_t (*cs_skipdata_cb_t)(const uint8_t *code, size_t code_size, size_t offset, void *user_data); // User-customized setup for SKIPDATA option typedef struct cs_opt_skipdata { diff --git a/tests/test_skipdata.c b/tests/test_skipdata.c index 3db81e00..371903c4 100644 --- a/tests/test_skipdata.c +++ b/tests/test_skipdata.c @@ -30,7 +30,7 @@ static void print_string_hex(unsigned char *str, size_t len) printf("\n"); } -static size_t CAPSTONE_API mycallback(const uint8_t *buffer, size_t buffer_size, size_t offset, void *p) +static size_t mycallback(const uint8_t *buffer, size_t buffer_size, size_t offset, void *p) { // always skip 2 bytes when encountering data return 2; @@ -72,7 +72,7 @@ static void test() (unsigned char*)X86_CODE32, sizeof(X86_CODE32) - 1, "X86 32 (Intel syntax) - Skip data with custom mnemonic", - CS_OPT_NONE, + CS_OPT_INVALID, CS_OPT_OFF, CS_OPT_SKIPDATA_SETUP, (size_t) &skipdata, @@ -83,7 +83,7 @@ static void test() (unsigned char*)RANDOM_CODE, sizeof(RANDOM_CODE) - 1, "Arm - Skip data with callback", - CS_OPT_NONE, + CS_OPT_INVALID, CS_OPT_OFF, CS_OPT_SKIPDATA_SETUP, (size_t) &skipdata_callback,