Skip to content

Commit

Permalink
Rename CS_OPT_NONE to CS_OPT_INVALID
Browse files Browse the repository at this point in the history
  • Loading branch information
tandasat committed Apr 8, 2016
1 parent 6dad566 commit 375d743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/capstone.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions tests/test_skipdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 375d743

Please sign in to comment.