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
287081ca
Commit
287081ca
authored
May 24, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inline strnlen() and use it
parent
71c7fb19
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
19 deletions
+9
-19
include/vlc_common.h
include/vlc_common.h
+0
-1
include/vlc_fixups.h
include/vlc_fixups.h
+9
-6
src/extras/libc.c
src/extras/libc.c
+0
-11
src/libvlccore.sym
src/libvlccore.sym
+0
-1
No files found.
include/vlc_common.h
View file @
287081ca
...
@@ -723,7 +723,6 @@ VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) );
...
@@ -723,7 +723,6 @@ VLC_EXPORT( int, vlc_vasprintf, (char **, const char *, va_list ) );
VLC_EXPORT
(
int
,
vlc_asprintf
,
(
char
**
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
int
,
vlc_asprintf
,
(
char
**
,
const
char
*
,
...
)
ATTRIBUTE_FORMAT
(
2
,
3
)
);
VLC_EXPORT
(
size_t
,
vlc_strlcpy
,
(
char
*
,
const
char
*
,
size_t
)
);
VLC_EXPORT
(
size_t
,
vlc_strlcpy
,
(
char
*
,
const
char
*
,
size_t
)
);
VLC_EXPORT
(
int64_t
,
vlc_strtoll
,
(
const
char
*
nptr
,
char
**
endptr
,
int
base
)
);
VLC_EXPORT
(
int64_t
,
vlc_strtoll
,
(
const
char
*
nptr
,
char
**
endptr
,
int
base
)
);
VLC_EXPORT
(
size_t
,
vlc_strnlen
,
(
const
char
*
,
size_t
)
);
struct
dirent
;
struct
dirent
;
VLC_EXPORT
(
int
,
vlc_scandir
,
(
const
char
*
name
,
struct
dirent
***
namelist
,
int
(
*
filter
)
(
const
struct
dirent
*
),
int
(
*
compar
)
(
const
struct
dirent
**
,
const
struct
dirent
**
)
)
);
VLC_EXPORT
(
int
,
vlc_scandir
,
(
const
char
*
name
,
struct
dirent
***
namelist
,
int
(
*
filter
)
(
const
struct
dirent
*
),
int
(
*
compar
)
(
const
struct
dirent
**
,
const
struct
dirent
**
)
)
);
...
...
include/vlc_fixups.h
View file @
287081ca
...
@@ -47,11 +47,18 @@ static inline char *strdup (const char *str)
...
@@ -47,11 +47,18 @@ static inline char *strdup (const char *str)
# define asprintf vlc_asprintf
# define asprintf vlc_asprintf
#endif
#endif
#ifndef HAVE_STRNLEN
static
inline
size_t
strnlen
(
const
char
*
str
,
size_t
max
)
{
const
char
*
end
=
memchr
(
str
,
0
,
max
);
return
end
?
(
size_t
)(
end
-
str
)
:
max
;
}
#endif
#ifndef HAVE_STRNDUP
#ifndef HAVE_STRNDUP
static
inline
char
*
strndup
(
const
char
*
str
,
size_t
max
)
static
inline
char
*
strndup
(
const
char
*
str
,
size_t
max
)
{
{
const
char
*
end
=
memchr
(
str
,
'\0'
,
max
);
size_t
len
=
strnlen
(
str
,
max
);
size_t
len
=
end
?
(
size_t
)(
end
-
str
)
:
max
;
char
*
res
=
malloc
(
len
+
1
);
char
*
res
=
malloc
(
len
+
1
);
if
(
res
)
if
(
res
)
{
{
...
@@ -62,10 +69,6 @@ static inline char *strndup (const char *str, size_t max)
...
@@ -62,10 +69,6 @@ static inline char *strndup (const char *str, size_t max)
}
}
#endif
#endif
#ifndef HAVE_STRNLEN
# define strnlen vlc_strnlen
#endif
#ifndef HAVE_STRLCPY
#ifndef HAVE_STRLCPY
# define strlcpy vlc_strlcpy
# define strlcpy vlc_strlcpy
#endif
#endif
...
...
src/extras/libc.c
View file @
287081ca
...
@@ -74,17 +74,6 @@
...
@@ -74,17 +74,6 @@
# define strcoll strcmp
# define strcoll strcmp
#endif
#endif
/*****************************************************************************
* strnlen:
*****************************************************************************/
#if !defined( HAVE_STRNLEN )
size_t
vlc_strnlen
(
const
char
*
psz
,
size_t
n
)
{
const
char
*
psz_end
=
memchr
(
psz
,
0
,
n
);
return
psz_end
?
(
size_t
)(
psz_end
-
psz
)
:
n
;
}
#endif
/*****************************************************************************
/*****************************************************************************
* strcasecmp: compare two strings ignoring case
* strcasecmp: compare two strings ignoring case
*****************************************************************************/
*****************************************************************************/
...
...
src/libvlccore.sym
View file @
287081ca
...
@@ -442,7 +442,6 @@ vlc_strcasecmp
...
@@ -442,7 +442,6 @@ vlc_strcasecmp
vlc_strcasestr
vlc_strcasestr
vlc_strlcpy
vlc_strlcpy
vlc_strncasecmp
vlc_strncasecmp
vlc_strnlen
vlc_strtoll
vlc_strtoll
vlc_submodule_create
vlc_submodule_create
__vlc_thread_create
__vlc_thread_create
...
...
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