diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2023-06-01 09:41:04 -0700 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2023-06-01 09:41:04 -0700 |
commit | d987df5c95340a8b41b23d68ad6a8f9f33485835 (patch) | |
tree | e09f74afc5d4154c659cb269715f0e1366e5d801 /include/sframe-api.h | |
parent | a5ffdcafc76c3f77c1c05fabe1544e004e9ef358 (diff) | |
download | binutils-d987df5c95340a8b41b23d68ad6a8f9f33485835.zip binutils-d987df5c95340a8b41b23d68ad6a8f9f33485835.tar.gz binutils-d987df5c95340a8b41b23d68ad6a8f9f33485835.tar.bz2 |
libsframe: avoid using magic number
Define a new constant for the maximum number of stack offsets handled in
libsframe, and use it. Note that the SFrame format does not define such
a constant (limit). This is an implmentation-defined constant in
libsframe.
include/
* sframe-api.h (MAX_NUM_STACK_OFFSETS): New definition.
libsframe/
* sframe.c (sframe_fre_sanity_check_p): Use it.
Diffstat (limited to 'include/sframe-api.h')
-rw-r--r-- | include/sframe-api.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/sframe-api.h b/include/sframe-api.h index 405e30c..3245bc8 100644 --- a/include/sframe-api.h +++ b/include/sframe-api.h @@ -31,7 +31,10 @@ extern "C" typedef struct sframe_decoder_ctx sframe_decoder_ctx; typedef struct sframe_encoder_ctx sframe_encoder_ctx; -#define MAX_OFFSET_BYTES (SFRAME_FRE_OFFSET_4B * 2 * 3) +#define MAX_NUM_STACK_OFFSETS 3 + +#define MAX_OFFSET_BYTES \ + ((SFRAME_FRE_OFFSET_4B * 2 * MAX_NUM_STACK_OFFSETS)) /* User interfacing SFrame Row Entry. An abstraction provided by libsframe so the consumer is decoupled from |