Skip to content

Commit a1b1a5b

Browse files
committed
review remarks
1 parent a167837 commit a1b1a5b

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

include/libParamTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
PARAM_TYPE_32(unk) // Unknown, intended to be used for "not a function" types and for "function" documentation when reverse-engineering efforts could not narrow it down to either the stack or one of the registers.
44
PARAM_TYPE__0(void) // 0 bits
5-
PARAM_TYPE_64(stk2) // 64 bits
6-
PARAM_TYPE_32(stk) // 32 bits
5+
PARAM_TYPE_64(stk2) // 64 bits (two pushes)
6+
PARAM_TYPE_32(stk) // 32 bits (one push)
77
PARAM_TYPE_32(eax) // 32 bits
88
PARAM_TYPE_16_(ax) // 16 bits
99
PARAM_TYPE__8_(ah) // 8 bits

include/libXbSymbolDatabase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void XbSymbolDatabase_SetOutputMessage(xb_output_message_t message_func);
230230

231231
/// <summary>
232232
/// To register any detected symbol name with address and build version back to third-party program.
233-
/// NOTE: Be aware of library name will be variety since some libraries are detecting in other sections as well.
233+
/// NOTE: Be aware that the library name will vary since some libraries are detected in other sections as well.
234234
/// </summary>
235235
/// <param name="library_str">Name of the library in string.</param>
236236
/// <param name="library_flag">Name of the library in flag.</param>

include/xref/list_xref.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ typedef enum _XRefDatabase {
422422
// Also, if XREF_COUNT > sizeof(uint16), enlarge struct OOVPA.XRefSaveIndex (and Value somehow)
423423
} XRefDatabase;
424424

425-
// NOTE: XREF_PUBLIC_INDEX is only for library's internal API usage.
426-
#define XREF_PUBLIC_INDEX(xref_index) xref_index - XREF_KT_COUNT - 1
425+
#define XREF_API_TO_PUBLIC_INDEX(xref_api_index) xref_api_index - XREF_KT_COUNT - 1
426+
#define XREF_PUBLIC_TO_API_INDEX(xref_public_index) xref_public_index + XREF_KT_COUNT + 1
427427

428428
#define XREF_ADDR_UNDETERMINED -1
429429
#define XREF_ADDR_NOT_FOUND ((void*)0)

src/OOVPADatabase/OOVPA.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// MSVC_EXPAND works around a Visual C++ problem, expanding __VA_ARGS__ incorrectly:
3232
#define MSVC_EXPAND(x) x
3333

34-
// Wrap C++ style macro function for clang-format to follow our code style.
34+
// Wrap C++ style macro function so that clang-format follows our code style.
3535
// NOTE: Not relative to MSVC_EXPAND macro's bugfix.
3636
#define MACRO_FUNC(x) x
3737

@@ -46,10 +46,10 @@
4646
#define UNPARENTHESES_INVOKE(args) VA_ARGS_EXPAND(args)
4747
#define UNPARENTHESES(args) UNPARENTHESES_INVOKE(VA_ARGS_EXPAND args)
4848

49-
// count array type size
49+
// get the number of elements of an array
5050
#define COUNT_ARRAYSIZE(type_, array_) (sizeof((type_[])UNPARENTHESES(array_)) / sizeof(type_))
5151

52-
// Increment counter for PARAMS macro to use with.
52+
// Increment counter used by the PARAMS macro.
5353
#define INC_1 2
5454
#define INC_2 3
5555
#define INC_3 4
@@ -211,7 +211,7 @@ typedef struct _LOOVPA {
211211

212212
#define OOVPA_END }
213213

214-
#pragma pack() // require restore pack for AppleClang to build
214+
#pragma pack() // restore packing so that AppleClang can build
215215
typedef struct _OOVPARevision {
216216
OOVPA* Oovpa;
217217
unsigned short Version; // : 13; // 2^13 = 8192, enough to store lowest and highest possible Library Version number in
@@ -229,7 +229,7 @@ typedef enum _eDBScanType {
229229
// ******************************************************************
230230
// * OOVPATable
231231
// ******************************************************************
232-
#pragma pack() // require restore pack for AppleClang to build
232+
#pragma pack() // restore packing so that AppleClang can build
233233
typedef struct _OOVPATable {
234234
const uint16_t xref;
235235
const unsigned scan_type;
@@ -299,13 +299,13 @@ typedef struct _OOVPATable {
299299
#define CALL_fas call_fastcall
300300
#define CALL(Name) CALL_##Name
301301

302-
// For generate symbol's suffix name, mainly for registers, and extend API usage.
302+
// For generate symbol's suffix name, mainly for registers, and extended API usage.
303303
#define PARAM(Param, Name) Param, Name
304304
#define PARAM1(Param) Param, ""
305305
#define PARAM_TOKEN_unk(Index, Name) _unk##Index
306306
#define PARAM_TOKEN_void(Index, Name) // No argument, do not append to symbol reference.
307-
#define PARAM_TOKEN_stk2(Index, Name) // Argument is stored in call stack, do not append to symbol reference.
308-
#define PARAM_TOKEN_stk(Index, Name) // Argument is stored in call stack, do not append to symbol reference.
307+
#define PARAM_TOKEN_stk2(Index, Name) // (Custom) argument is stored in call stack with two pushes, do not append to symbol reference.
308+
#define PARAM_TOKEN_stk(Index, Name) // Argument is stored in call stack with one push, do not append to symbol reference.
309309
#define PARAM_TOKEN_eax(Index, Name) _eax##Index
310310
#define PARAM_TOKEN__ax(Index, Name) _ax##Index
311311
#define PARAM_TOKEN__ah(Index, Name) _ah##Index

src/lib/libXbSymbolDatabase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ const char* XbSymbolDatabase_SymbolReferenceToString(uint32_t xref_index)
444444
if (xref_index <= XREF_KT_COUNT || XREF_COUNT <= xref_index) {
445445
return NULL;
446446
}
447-
return xref_str[XREF_PUBLIC_INDEX(xref_index)];
447+
return xref_str[XREF_API_TO_PUBLIC_INDEX(xref_index)];
448448
}
449449

450450
// NOTE: Library string must return only one specific flag, cannot make a mix combo flags.

0 commit comments

Comments
 (0)