Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
517da44e
Commit
517da44e
authored
Mar 22, 2016
by
Sebastian Lackner
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Check element type in CONTAINING_RECORD and similar macros.
parent
16c867ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
list.h
include/wine/list.h
+8
-2
rbtree.h
include/wine/rbtree.h
+8
-2
winnt.h
include/winnt.h
+8
-2
No files found.
include/wine/list.h
View file @
517da44e
...
@@ -228,7 +228,13 @@ static inline void list_move_head( struct list *dst, struct list *src )
...
@@ -228,7 +228,13 @@ static inline void list_move_head( struct list *dst, struct list *src )
/* get pointer to object containing list element */
/* get pointer to object containing list element */
#undef LIST_ENTRY
#undef LIST_ENTRY
#define LIST_ENTRY(elem, type, field) \
#ifdef __GNUC__
((type *)((char *)(elem) - offsetof(type, field)))
# define LIST_ENTRY(elem, type, field) ({ \
const typeof(((type *)0)->field) *__ptr = (elem); \
(type *)((char *)__ptr - offsetof(type, field)); })
#else
# define LIST_ENTRY(elem, type, field) \
((type *)((char *)(elem) - offsetof(type, field)))
#endif
#endif
/* __WINE_SERVER_LIST_H */
#endif
/* __WINE_SERVER_LIST_H */
include/wine/rbtree.h
View file @
517da44e
...
@@ -23,8 +23,14 @@
...
@@ -23,8 +23,14 @@
#ifndef __WINE_WINE_RBTREE_H
#ifndef __WINE_WINE_RBTREE_H
#define __WINE_WINE_RBTREE_H
#define __WINE_WINE_RBTREE_H
#define RB_ENTRY_VALUE(element, type, field) \
#ifdef __GNUC__
((type *)((char *)(element) - offsetof(type, field)))
# define RB_ENTRY_VALUE(element, type, field) ({ \
const typeof(((type *)0)->field) *__ptr = (element); \
(type *)((char *)__ptr - offsetof(type, field)); })
#else
# define RB_ENTRY_VALUE(element, type, field) \
((type *)((char *)(element) - offsetof(type, field)))
#endif
struct
rb_entry
struct
rb_entry
{
{
...
...
include/winnt.h
View file @
517da44e
...
@@ -853,8 +853,14 @@ typedef struct DECLSPEC_ALIGN(8) MEM_EXTENDED_PARAMETER {
...
@@ -853,8 +853,14 @@ typedef struct DECLSPEC_ALIGN(8) MEM_EXTENDED_PARAMETER {
#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
#define RTL_SIZEOF_THROUGH_FIELD(type, field) (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
#define RTL_SIZEOF_THROUGH_FIELD(type, field) (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
#define CONTAINING_RECORD(address, type, field) \
#ifdef __GNUC__
((type *)((PCHAR)(address) - offsetof(type, field)))
# define CONTAINING_RECORD(address, type, field) ({ \
const typeof(((type *)0)->field) *__ptr = (address); \
(type *)((PCHAR)__ptr - offsetof(type, field)); })
#else
# define CONTAINING_RECORD(address, type, field) \
((type *)((PCHAR)(address) - offsetof(type, field)))
#endif
#define ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0]))
#define ARRAYSIZE(x) (sizeof(x) / sizeof((x)[0]))
#ifdef __WINESRC__
#ifdef __WINESRC__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment