mirror of
https://github.com/0intro/libtask
synced 2024-11-23 14:19:46 +03:00
fix clang warnings
amd64-ucontext.h:3:25: warning: redefinition of typedef 'mcontext_t' is a C11 feature amd64-ucontext.h:4:25: warning: redefinition of typedef 'ucontext_t' is a C11 feature context.c:86:3: warning: indirection of non-volatile null pointer will be deleted, not trap
This commit is contained in:
parent
3ae1151187
commit
53021339da
@ -83,7 +83,7 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
||||
|
||||
memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext);
|
||||
if(argc != 2)
|
||||
*(int*)0 = 0;
|
||||
*(volatile int*)0 = 0;
|
||||
va_start(va, argc);
|
||||
ucp->uc_mcontext.mc_rdi = va_arg(va, int);
|
||||
ucp->uc_mcontext.mc_rsi = va_arg(va, int);
|
||||
|
12
taskimpl.h
12
taskimpl.h
@ -105,19 +105,17 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) && defined(__amd64__)
|
||||
typedef struct mcontext mcontext_t;
|
||||
typedef struct ucontext ucontext_t;
|
||||
# if defined(__i386__)
|
||||
# include "386-ucontext.h"
|
||||
# elif defined(__x86_64__)
|
||||
# include "amd64-ucontext.h"
|
||||
# endif
|
||||
extern int getmcontext(mcontext_t*);
|
||||
extern void setmcontext(const mcontext_t*);
|
||||
#define setcontext(u) setmcontext(&(u)->uc_mcontext)
|
||||
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
|
||||
extern int swapcontext(ucontext_t*, const ucontext_t*);
|
||||
extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
||||
# if defined(__i386__)
|
||||
# include "386-ucontext.h"
|
||||
# elif defined(__x86_64__)
|
||||
# include "amd64-ucontext.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
Loading…
Reference in New Issue
Block a user