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
6b49f68d
Commit
6b49f68d
authored
Jun 19, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid anonymous compound in add_shortcut (fixes: #3742)
parent
fb718f7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
include/vlc_plugin.h
include/vlc_plugin.h
+7
-4
src/modules/entry.c
src/modules/entry.c
+9
-6
No files found.
include/vlc_plugin.h
View file @
6b49f68d
...
@@ -120,8 +120,8 @@ enum vlc_module_properties
...
@@ -120,8 +120,8 @@ enum vlc_module_properties
/**
/**
* Current plugin ABI version
* Current plugin ABI version
*/
*/
# define MODULE_SYMBOL 1_2_0
b
# define MODULE_SYMBOL 1_2_0
c
# define MODULE_SUFFIX "__1_2_0
b
"
# define MODULE_SUFFIX "__1_2_0
c
"
/*****************************************************************************
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
* Add a few defines. You do not want to read this section. Really.
...
@@ -196,9 +196,12 @@ enum vlc_module_properties
...
@@ -196,9 +196,12 @@ enum vlc_module_properties
goto error;
goto error;
#define add_shortcut( ... ) \
#define add_shortcut( ... ) \
{ \
const char *shortcuts[] = { __VA_ARGS__ }; \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \
sizeof((const char*[]){__VA_ARGS__})/sizeof(const char*), __VA_ARGS__)) \
sizeof(shortcuts)/sizeof(shortcuts[0]), shortcuts)) \
goto error;
goto error; \
}
#define set_shortname( shortname ) \
#define set_shortname( shortname ) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \
...
...
src/modules/entry.c
View file @
6b49f68d
...
@@ -183,14 +183,17 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
...
@@ -183,14 +183,17 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
{
{
unsigned
i_shortcuts
=
va_arg
(
ap
,
unsigned
);
unsigned
i_shortcuts
=
va_arg
(
ap
,
unsigned
);
unsigned
index
=
module
->
i_shortcuts
;
unsigned
index
=
module
->
i_shortcuts
;
module
->
i_shortcuts
+=
i_shortcuts
;
const
char
*
const
*
tab
=
va_arg
(
ap
,
const
char
*
const
*
)
;
const
char
**
pp
=
realloc
(
module
->
pp_shortcuts
,
module
->
pp_shortcuts
=
realloc
(
module
->
pp_shortcuts
,
sizeof
(
char
**
)
*
module
->
i_shortcuts
);
sizeof
(
pp
[
0
])
*
(
index
+
i_shortcuts
)
);
for
(;
index
<
module
->
i_shortcuts
;
index
++
)
if
(
unlikely
(
pp
==
NULL
)
)
{
{
const
char
*
psz_new
=
va_arg
(
ap
,
const
char
*
)
;
ret
=
-
1
;
module
->
pp_shortcuts
[
index
]
=
psz_new
;
break
;
}
}
module
->
pp_shortcuts
=
pp
;
module
->
i_shortcuts
=
index
+
i_shortcuts
;
memcpy
(
pp
+
index
,
tab
,
sizeof
(
pp
[
0
])
*
i_shortcuts
);
break
;
break
;
}
}
...
...
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