Message ID | 20210813012511.65397-3-duke@naive.systems (mailing list archive) |
---|---|
State | Deferred, archived |
Headers | show |
Series | fixes for using sparse as a C++ library | expand |
diff --git a/ptrlist.h b/ptrlist.h index 67c7a208..9fd20f84 100644 --- a/ptrlist.h +++ b/ptrlist.h @@ -303,7 +303,7 @@ extern void split_ptr_list_head(struct ptr_list *); static inline void update_tag(void *p, unsigned long tag) { - unsigned long *ptr = p; + unsigned long *ptr = (unsigned long *)p; *ptr = tag | (~3UL & *ptr); } diff --git a/token.h b/token.h index 804cc6f8..7a97a478 100644 --- a/token.h +++ b/token.h @@ -204,7 +204,7 @@ struct token { static inline struct token *containing_token(struct token **p) { void *addr = (char *)p - ((char *)&((struct token *)0)->next - (char *)0); - return addr; + return (struct token *)addr; } #define token_type(x) ((x)->pos.type)