Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
456
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
1252a5eb
Commit
1252a5eb
authored
13 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Add helpers to store floats into vlc_atomic_t
(Lets assume that uintptr_t is big enough, i.e. 32-bits).
parent
aa7fcdb1
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vlc_atomic.h
+17
-0
17 additions, 0 deletions
include/vlc_atomic.h
with
17 additions
and
0 deletions
include/vlc_atomic.h
+
17
−
0
View file @
1252a5eb
...
...
@@ -53,4 +53,21 @@ static inline uintptr_t vlc_atomic_dec (vlc_atomic_t *atom)
VLC_API
uintptr_t
vlc_atomic_swap
(
vlc_atomic_t
*
,
uintptr_t
);
VLC_API
uintptr_t
vlc_atomic_compare_swap
(
vlc_atomic_t
*
,
uintptr_t
,
uintptr_t
);
/** Helper to retrieve a single precision from an atom. */
static
inline
float
vlc_atomic_getf
(
const
vlc_atomic_t
*
atom
)
{
union
{
float
f
;
uintptr_t
i
;
}
u
;
u
.
i
=
vlc_atomic_get
(
atom
);
return
u
.
f
;
}
/** Helper to store a single precision into an atom. */
static
inline
float
vlc_atomic_setf
(
vlc_atomic_t
*
atom
,
float
f
)
{
union
{
float
f
;
uintptr_t
i
;
}
u
;
u
.
f
=
f
;
vlc_atomic_set
(
atom
,
u
.
i
);
return
f
;
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment