Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
dav1d
Commits
e3d028fb
Commit
e3d028fb
authored
Feb 07, 2019
by
Martin Storsjö
Browse files
Use size_t as return value type for strlen() consistently
parent
95233f9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/checkasm/checkasm.c
View file @
e3d028fb
...
...
@@ -127,7 +127,7 @@ static struct {
CheckasmFuncVersion
*
current_func_ver
;
const
char
*
current_test_name
;
const
char
*
bench_pattern
;
in
t
bench_pattern_len
;
size_
t
bench_pattern_len
;
int
num_checked
;
int
num_failed
;
int
nop_time
;
...
...
@@ -420,7 +420,7 @@ static CheckasmFunc *get_func(CheckasmFunc **root, const char *const name) {
}
}
else
{
/* Allocate and insert a new node into the tree */
const
in
t
name_length
=
strlen
(
name
);
const
size_
t
name_length
=
strlen
(
name
);
f
=
*
root
=
checkasm_malloc
(
sizeof
(
CheckasmFunc
)
+
name_length
);
memcpy
(
f
->
name
,
name
,
name_length
+
1
);
}
...
...
@@ -636,10 +636,11 @@ void checkasm_update_bench(const int iterations, const uint64_t cycles) {
/* Print the outcome of all tests performed since
* the last time this function was called */
void
checkasm_report
(
const
char
*
const
name
,
...)
{
static
int
prev_checked
,
prev_failed
,
max_length
;
static
int
prev_checked
,
prev_failed
;
static
size_t
max_length
;
if
(
state
.
num_checked
>
prev_checked
)
{
int
pad_length
=
max_length
+
4
;
int
pad_length
=
(
int
)
max_length
+
4
;
va_list
arg
;
print_cpu_name
();
...
...
@@ -660,7 +661,7 @@ void checkasm_report(const char *const name, ...) {
}
else
if
(
!
state
.
cpu_flag
)
{
/* Calculate the amount of padding required
* to make the output vertically aligned */
in
t
length
=
strlen
(
state
.
current_test_name
);
size_
t
length
=
strlen
(
state
.
current_test_name
);
va_list
arg
;
va_start
(
arg
,
name
);
...
...
tools/input/input.c
View file @
e3d028fb
...
...
@@ -57,7 +57,7 @@ void init_demuxers(void) {
}
static
const
char
*
find_extension
(
const
char
*
const
f
)
{
const
in
t
l
=
strlen
(
f
);
const
size_
t
l
=
strlen
(
f
);
if
(
l
==
0
)
return
NULL
;
...
...
tools/output/output.c
View file @
e3d028fb
...
...
@@ -59,7 +59,7 @@ void init_muxers(void) {
}
static
const
char
*
find_extension
(
const
char
*
const
f
)
{
const
in
t
l
=
strlen
(
f
);
const
size_
t
l
=
strlen
(
f
);
if
(
l
==
0
)
return
NULL
;
...
...
Write
Preview
Supports
Markdown
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