Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b72ccbc5
Commit
b72ccbc5
authored
Oct 07, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConfigKeyToString: binary search
parent
90ee09e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
src/config/keys.c
src/config/keys.c
+12
-11
No files found.
src/config/keys.c
View file @
b72ccbc5
...
...
@@ -175,8 +175,7 @@ char *KeyToString (uint_fast32_t sym)
{
key_descriptor_t
*
d
;
d
=
(
key_descriptor_t
*
)
bsearch
((
void
*
)(
uintptr_t
)
sym
,
vlc_keys
,
vlc_num_keys
,
d
=
bsearch
((
void
*
)(
uintptr_t
)
sym
,
vlc_keys
,
vlc_num_keys
,
sizeof
(
vlc_keys
[
0
]),
cmpkey
);
return
d
?
strdup
(
d
->
psz_key_string
)
:
NULL
;
}
...
...
@@ -238,14 +237,16 @@ char *ConfigKeyToString (uint_fast32_t i_key)
vlc_modifiers
[
i
].
psz_key_string
);
}
}
for
(
size_t
i
=
0
;
i
<
vlc_num_keys
;
i
++
)
{
if
((
i_key
&
~
KEY_MODIFIER
)
==
vlc_keys
[
i
].
i_key_code
)
{
p
+=
snprintf
(
p
,
psz_end
-
p
,
"%s"
,
vlc_keys
[
i
].
psz_key_string
);
break
;
}
}
key_descriptor_t
*
d
;
i_key
&=
~
KEY_MODIFIER
;
d
=
bsearch
((
void
*
)(
uintptr_t
)
i_key
,
vlc_keys
,
vlc_num_keys
,
sizeof
(
vlc_keys
[
0
]),
cmpkey
);
if
(
d
)
p
+=
snprintf
(
p
,
psz_end
-
p
,
"%s"
,
d
->
psz_key_string
);
else
return
NULL
;
return
psz_key
;
}
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