diff options
author | YU Jincheng | 2021-09-29 17:37:26 +0800 |
---|---|---|
committer | Denys Vlasenko | 2021-10-07 15:22:35 +0200 |
commit | 1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e (patch) | |
tree | a625455a60081738812f469de6a02010f0c5b252 /libbb/lineedit.c | |
parent | 17e6fb06b3d36eae11575b226858e8474e2b46d3 (diff) | |
download | busybox-1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e.zip busybox-1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e.tar.gz |
*: generalize "const trick"
While at it, change all "__asm__" to "asm"
Co-authored-by: canyie <31466456+canyie@users.noreply.github.com>
Signed-off-by: YU Jincheng <shana@zju.edu.cn>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index a7a3ee1..3c87abc 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -192,7 +192,7 @@ struct lineedit_statics { }; /* See lineedit_ptr_hack.c */ -extern struct lineedit_statics *const lineedit_ptr_to_statics; +extern struct lineedit_statics *BB_GLOBAL_CONST lineedit_ptr_to_statics; #define S (*lineedit_ptr_to_statics) #define state (S.state ) @@ -214,8 +214,7 @@ extern struct lineedit_statics *const lineedit_ptr_to_statics; #define delbuf (S.delbuf ) #define INIT_S() do { \ - (*(struct lineedit_statics**)not_const_pp(&lineedit_ptr_to_statics)) = xzalloc(sizeof(S)); \ - barrier(); \ + ASSIGN_CONST_PTR(lineedit_ptr_to_statics, xzalloc(sizeof(S))); \ } while (0) static void deinit_S(void) |