Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
748c53a3
Commit
748c53a3
authored
Oct 12, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
var_GetAndSet() can fail
Return 0 as usual, rather than undefined result.
parent
863f8518
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
include/vlc_variables.h
include/vlc_variables.h
+10
-5
No files found.
include/vlc_variables.h
View file @
748c53a3
...
...
@@ -428,7 +428,8 @@ static inline int64_t var_IncInteger( vlc_object_t *p_obj, const char *psz_name
{
vlc_value_t
val
;
val
.
i_int
=
1
;
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_INTEGER_ADD
,
&
val
);
if
(
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_INTEGER_ADD
,
&
val
)
)
return
0
;
return
val
.
i_int
;
}
#define var_IncInteger(a,b) var_IncInteger( VLC_OBJECT(a), b )
...
...
@@ -442,7 +443,8 @@ static inline int64_t var_DecInteger( vlc_object_t *p_obj, const char *psz_name
{
vlc_value_t
val
;
val
.
i_int
=
-
1
;
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_INTEGER_ADD
,
&
val
);
if
(
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_INTEGER_ADD
,
&
val
)
)
return
0
;
return
val
.
i_int
;
}
#define var_DecInteger(a,b) var_DecInteger( VLC_OBJECT(a), b )
...
...
@@ -452,7 +454,8 @@ static inline uint64_t var_OrInteger( vlc_object_t *obj, const char *name,
{
vlc_value_t
val
;
val
.
i_int
=
v
;
var_GetAndSet
(
obj
,
name
,
VLC_VAR_INTEGER_OR
,
&
val
);
if
(
var_GetAndSet
(
obj
,
name
,
VLC_VAR_INTEGER_OR
,
&
val
)
)
return
0
;
return
val
.
i_int
;
}
#define var_OrInteger(a,b,c) var_OrInteger(VLC_OBJECT(a),b,c)
...
...
@@ -462,7 +465,8 @@ static inline uint64_t var_NAndInteger( vlc_object_t *obj, const char *name,
{
vlc_value_t
val
;
val
.
i_int
=
v
;
var_GetAndSet
(
obj
,
name
,
VLC_VAR_INTEGER_NAND
,
&
val
);
if
(
var_GetAndSet
(
obj
,
name
,
VLC_VAR_INTEGER_NAND
,
&
val
)
)
return
0
;
return
val
.
i_int
;
}
#define var_NAndInteger(a,b,c) var_NAndInteger(VLC_OBJECT(a),b,c)
...
...
@@ -664,7 +668,8 @@ static inline int var_CountChoices( vlc_object_t *p_obj, const char *psz_name )
static
inline
bool
var_ToggleBool
(
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
vlc_value_t
val
;
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_BOOL_TOGGLE
,
&
val
);
if
(
var_GetAndSet
(
p_obj
,
psz_name
,
VLC_VAR_BOOL_TOGGLE
,
&
val
)
)
return
false
;
return
val
.
b_bool
;
}
#define var_ToggleBool(a,b) var_ToggleBool( VLC_OBJECT(a),b )
...
...
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