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
608be371
Commit
608be371
authored
Apr 12, 2012
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zip: Add unlikely()
parent
a23a2ea7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
modules/access/zip/zipaccess.c
modules/access/zip/zipaccess.c
+7
-7
No files found.
modules/access/zip/zipaccess.c
View file @
608be371
...
@@ -60,7 +60,7 @@ static char *unescapeXml( const char *psz_text );
...
@@ -60,7 +60,7 @@ static char *unescapeXml( const char *psz_text );
static
char
*
unescapeXml
(
const
char
*
psz_text
)
static
char
*
unescapeXml
(
const
char
*
psz_text
)
{
{
char
*
psz_ret
=
malloc
(
strlen
(
psz_text
)
+
1
);
char
*
psz_ret
=
malloc
(
strlen
(
psz_text
)
+
1
);
if
(
!
psz_ret
)
return
NULL
;
if
(
unlikely
(
!
psz_ret
)
)
return
NULL
;
char
*
psz_tmp
=
psz_ret
;
char
*
psz_tmp
=
psz_ret
;
for
(
char
*
psz_iter
=
(
char
*
)
psz_text
;
*
psz_iter
;
++
psz_iter
,
++
psz_tmp
)
for
(
char
*
psz_iter
=
(
char
*
)
psz_text
;
*
psz_iter
;
++
psz_iter
,
++
psz_tmp
)
...
@@ -113,7 +113,7 @@ int AccessOpen( vlc_object_t *p_this )
...
@@ -113,7 +113,7 @@ int AccessOpen( vlc_object_t *p_this )
p_access
->
p_sys
=
p_sys
=
(
access_sys_t
*
)
p_access
->
p_sys
=
p_sys
=
(
access_sys_t
*
)
calloc
(
1
,
sizeof
(
access_sys_t
)
);
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
if
(
unlikely
(
!
p_sys
)
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
/* Split the MRL */
/* Split the MRL */
...
@@ -128,17 +128,17 @@ int AccessOpen( vlc_object_t *p_this )
...
@@ -128,17 +128,17 @@ int AccessOpen( vlc_object_t *p_this )
msg_Dbg
(
p_access
,
"not an encoded URL Trying file '%s'"
,
msg_Dbg
(
p_access
,
"not an encoded URL Trying file '%s'"
,
psz_path
);
psz_path
);
psz_pathToZip
=
strdup
(
psz_path
);
psz_pathToZip
=
strdup
(
psz_path
);
if
(
!
psz_pathToZip
)
if
(
unlikely
(
!
psz_pathToZip
)
)
{
{
i_ret
=
VLC_ENOMEM
;
i_ret
=
VLC_ENOMEM
;
goto
exit
;
goto
exit
;
}
}
}
}
p_sys
->
psz_fileInzip
=
unescapeXml
(
psz_sep
+
ZIP_SEP_LEN
);
p_sys
->
psz_fileInzip
=
unescapeXml
(
psz_sep
+
ZIP_SEP_LEN
);
if
(
!
p_sys
->
psz_fileInzip
)
if
(
unlikely
(
!
p_sys
->
psz_fileInzip
)
)
{
{
p_sys
->
psz_fileInzip
=
strdup
(
psz_sep
+
ZIP_SEP_LEN
);
p_sys
->
psz_fileInzip
=
strdup
(
psz_sep
+
ZIP_SEP_LEN
);
if
(
!
p_sys
->
psz_fileInzip
)
if
(
unlikely
(
!
p_sys
->
psz_fileInzip
)
)
{
{
i_ret
=
VLC_ENOMEM
;
i_ret
=
VLC_ENOMEM
;
goto
exit
;
goto
exit
;
...
@@ -148,7 +148,7 @@ int AccessOpen( vlc_object_t *p_this )
...
@@ -148,7 +148,7 @@ int AccessOpen( vlc_object_t *p_this )
/* Define IO functions */
/* Define IO functions */
zlib_filefunc_def
*
p_func
=
(
zlib_filefunc_def
*
)
zlib_filefunc_def
*
p_func
=
(
zlib_filefunc_def
*
)
calloc
(
1
,
sizeof
(
zlib_filefunc_def
)
);
calloc
(
1
,
sizeof
(
zlib_filefunc_def
)
);
if
(
!
p_func
)
if
(
unlikely
(
!
p_func
)
)
{
{
i_ret
=
VLC_ENOMEM
;
i_ret
=
VLC_ENOMEM
;
goto
exit
;
goto
exit
;
...
@@ -390,7 +390,7 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
...
@@ -390,7 +390,7 @@ static void* ZCALLBACK ZipIO_Open( void* opaque, const char* file, int mode )
access_t
*
p_access
=
(
access_t
*
)
opaque
;
access_t
*
p_access
=
(
access_t
*
)
opaque
;
char
*
fileUri
=
malloc
(
strlen
(
file
)
+
8
);
char
*
fileUri
=
malloc
(
strlen
(
file
)
+
8
);
if
(
!
fileUri
)
if
(
unlikely
(
!
fileUri
)
)
return
NULL
;
return
NULL
;
if
(
!
strstr
(
file
,
"://"
)
)
if
(
!
strstr
(
file
,
"://"
)
)
{
{
...
...
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