Skip to content

Commit 2d434c0

Browse files
committed
remove the bit-field, use "pack" instead
JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
1 parent 8096670 commit 2d434c0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/09.EXT-REFERENCE-ARG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ It will be passed into jerryx_arg_t's extra_info filed.
145145
```c
146146
typedef struct
147147
{
148-
jerryx_arg_round_t round:2; /**< rounding policy */
149-
jerryx_arg_clamp_t clamp:1; /**< clamping policy */
148+
jerryx_arg_round_t round; /**< rounding policy */
149+
jerryx_arg_clamp_t clamp; /**< clamping policy */
150150
} jerryx_arg_int_option_t;
151151
```
152152

jerry-ext/include/jerryscript-ext/arg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ typedef enum
9393
/**
9494
* Indicates the rounding policy which will be choose to transform a integer.
9595
*/
96-
typedef enum
96+
typedef enum __attribute__((packed))
9797
{
9898
JERRYX_ARG_ROUND, /**< round */
9999
JERRYX_ARG_FLOOR, /**< floor */
@@ -103,7 +103,7 @@ typedef enum
103103
/**
104104
* Indicates whether it will throw error when the integer's range is out of the target type.
105105
*/
106-
typedef enum
106+
typedef enum __attribute__((packed))
107107
{
108108
JERRYX_ARG_CLAMP,/**< clamp the number when it is out of range */
109109
JERRYX_ARG_NO_CLAMP /**< throw a range error */
@@ -113,10 +113,10 @@ typedef enum
113113
* The structure indicates the options used to transform integer argument.
114114
* It will be passed into jerryx_arg_t's extra_info filed.
115115
*/
116-
typedef struct
116+
typedef struct __attribute__((packed))
117117
{
118-
jerryx_arg_round_t round:2; /**< rounding policy */
119-
jerryx_arg_clamp_t clamp:1; /**< clamping policy */
118+
jerryx_arg_round_t round; /**< rounding policy */
119+
jerryx_arg_clamp_t clamp; /**< clamping policy */
120120
} jerryx_arg_int_option_t;
121121

122122
#define JERRYX_STATIC_ASSERT(x, msg) \

0 commit comments

Comments
 (0)