diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-11 12:36:43 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-11 12:40:08 +0000 |
commit | 0b116a1d023ad7cc148d91f268dbf71452dbd9dd (patch) | |
tree | 5953a9f5445bec1b9d2f88b32a0a509b96f6b658 /src/sna/sna.h | |
parent | 47657e5355103b2e61da6f059c560e63fe13b0ed (diff) |
sna: Fix inaccurate use of __attribute__((const))
'const' is only allowed to use the function parameters and not allowed
to access global memory - that includes not allowed to deference its
arguments...
Thanks to Jiri Slaby for spotting my mistake.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r-- | src/sna/sna.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index a51e6a11..f6e89ecd 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -164,7 +164,7 @@ static inline PixmapPtr get_drawable_pixmap(DrawablePtr drawable) extern DevPrivateKeyRec sna_pixmap_key; -constant static inline struct sna_pixmap *sna_pixmap(PixmapPtr pixmap) +pure static inline struct sna_pixmap *sna_pixmap(PixmapPtr pixmap) { return ((void **)__get_private(pixmap, sna_pixmap_key))[1]; } @@ -307,25 +307,25 @@ extern int sna_page_flip(struct sna *sna, void *data, int ref_crtc_hw_id); -constant static inline struct sna * +pure static inline struct sna * to_sna(ScrnInfoPtr scrn) { return (struct sna *)(scrn->driverPrivate); } -constant static inline struct sna * +pure static inline struct sna * to_sna_from_screen(ScreenPtr screen) { return to_sna(xf86ScreenToScrn(screen)); } -constant static inline struct sna * +pure static inline struct sna * to_sna_from_pixmap(PixmapPtr pixmap) { return ((void **)__get_private(pixmap, sna_pixmap_key))[0]; } -constant static inline struct sna * +pure static inline struct sna * to_sna_from_drawable(DrawablePtr drawable) { return to_sna_from_screen(drawable->pScreen); |