Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d79be0ff
Commit
d79be0ff
authored
Nov 16, 2009
by
JP Dinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skins2: No need to new char[] temporaries; use stack instead.
parent
c8dbc4eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
modules/gui/skins2/vars/time.cpp
modules/gui/skins2/vars/time.cpp
+4
-11
No files found.
modules/gui/skins2/vars/time.cpp
View file @
d79be0ff
...
@@ -45,12 +45,9 @@ const string StreamTime::getAsStringPercent() const
...
@@ -45,12 +45,9 @@ const string StreamTime::getAsStringPercent() const
{
{
int
value
=
(
int
)(
100.
*
get
());
int
value
=
(
int
)(
100.
*
get
());
// 0 <= value <= 100, so we need 4 chars
// 0 <= value <= 100, so we need 4 chars
char
*
str
=
new
cha
r
[
4
];
char
st
r
[
4
];
snprintf
(
str
,
4
,
"%d"
,
value
);
snprintf
(
str
,
4
,
"%d"
,
value
);
string
ret
=
str
;
return
string
(
str
);
delete
[]
str
;
return
ret
;
}
}
...
@@ -121,7 +118,7 @@ const string StreamTime::getAsStringDuration( bool bShortFormat ) const
...
@@ -121,7 +118,7 @@ const string StreamTime::getAsStringDuration( bool bShortFormat ) const
const
string
StreamTime
::
formatTime
(
int
seconds
,
bool
bShortFormat
)
const
const
string
StreamTime
::
formatTime
(
int
seconds
,
bool
bShortFormat
)
const
{
{
char
*
psz_time
=
new
char
[
MSTRTIME_MAX_SIZE
];
char
psz_time
[
MSTRTIME_MAX_SIZE
];
if
(
bShortFormat
&&
(
seconds
<
60
*
60
)
)
if
(
bShortFormat
&&
(
seconds
<
60
*
60
)
)
{
{
snprintf
(
psz_time
,
MSTRTIME_MAX_SIZE
,
"%02d:%02d"
,
snprintf
(
psz_time
,
MSTRTIME_MAX_SIZE
,
"%02d:%02d"
,
...
@@ -135,9 +132,5 @@ const string StreamTime::formatTime( int seconds, bool bShortFormat ) const
...
@@ -135,9 +132,5 @@ const string StreamTime::formatTime( int seconds, bool bShortFormat ) const
(
int
)
(
seconds
/
60
%
60
),
(
int
)
(
seconds
/
60
%
60
),
(
int
)
(
seconds
%
60
)
);
(
int
)
(
seconds
%
60
)
);
}
}
return
string
(
psz_time
);
string
ret
=
psz_time
;
delete
[]
psz_time
;
return
ret
;
}
}
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