aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorYU Jincheng <shana@zju.edu.cn>2021-09-29 17:37:26 +0800
committerDenys Vlasenko <vda.linux@googlemail.com>2021-10-07 15:22:35 +0200
commit1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e (patch)
treea625455a60081738812f469de6a02010f0c5b252 /libbb
parent17e6fb06b3d36eae11575b226858e8474e2b46d3 (diff)
downloadbusybox-w32-1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e.tar.gz
busybox-w32-1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e.tar.bz2
busybox-w32-1f925038ab9c6bd8f6b3cd40ed7aab0ef10d898e.zip
*: 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')
-rw-r--r--libbb/appletlib.c3
-rw-r--r--libbb/lineedit.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 5c5d7eb95..bf26c99e9 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -247,8 +247,7 @@ void lbb_prepare(const char *applet
247 IF_FEATURE_INDIVIDUAL(, char **argv)) 247 IF_FEATURE_INDIVIDUAL(, char **argv))
248{ 248{
249#ifdef bb_cached_errno_ptr 249#ifdef bb_cached_errno_ptr
250 (*(int **)not_const_pp(&bb_errno)) = get_perrno(); 250 ASSIGN_CONST_PTR(bb_errno, get_perrno());
251 barrier();
252#endif 251#endif
253 applet_name = applet; 252 applet_name = applet;
254 253
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index a7a3ee103..3c87abcf9 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -192,7 +192,7 @@ struct lineedit_statics {
192}; 192};
193 193
194/* See lineedit_ptr_hack.c */ 194/* See lineedit_ptr_hack.c */
195extern struct lineedit_statics *const lineedit_ptr_to_statics; 195extern struct lineedit_statics *BB_GLOBAL_CONST lineedit_ptr_to_statics;
196 196
197#define S (*lineedit_ptr_to_statics) 197#define S (*lineedit_ptr_to_statics)
198#define state (S.state ) 198#define state (S.state )
@@ -214,8 +214,7 @@ extern struct lineedit_statics *const lineedit_ptr_to_statics;
214#define delbuf (S.delbuf ) 214#define delbuf (S.delbuf )
215 215
216#define INIT_S() do { \ 216#define INIT_S() do { \
217 (*(struct lineedit_statics**)not_const_pp(&lineedit_ptr_to_statics)) = xzalloc(sizeof(S)); \ 217 ASSIGN_CONST_PTR(lineedit_ptr_to_statics, xzalloc(sizeof(S))); \
218 barrier(); \
219} while (0) 218} while (0)
220 219
221static void deinit_S(void) 220static void deinit_S(void)