Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
8bc37015
Commit
8bc37015
authored
2 months ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
TODO: remove stdout print on fuzzing
parent
78e6bbff
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
programs/cmp_guess.c
+7
-0
7 additions, 0 deletions
programs/cmp_guess.c
programs/cmp_io.c
+8
-0
8 additions, 0 deletions
programs/cmp_io.c
programs/cmp_tool.c
+3
-2
3 additions, 2 deletions
programs/cmp_tool.c
with
18 additions
and
2 deletions
programs/cmp_guess.c
+
7
−
0
View file @
8bc37015
...
...
@@ -35,6 +35,13 @@
#define CMP_GUESS_MAX_CAL_STEPS 20274
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
/* Redefine (f)printf to do nothing */
__extension__
#define printf(...) do {} while (0)
#define fprintf(...) do {} while (0)
#endif
/* how often the model is updated before it is rested */
static
int
num_model_updates
=
CMP_GUESS_N_MODEL_UPDATE_DEF
;
...
...
This diff is collapsed.
Click to expand it.
programs/cmp_io.c
+
8
−
0
View file @
8bc37015
...
...
@@ -292,9 +292,11 @@ int write_data_to_file(const void *buf, uint32_t buf_size, const char *output_pr
}
if
(
flags
&
CMP_IO_VERBOSE_EXTRA
&&
!
(
flags
&
CMP_IO_BINARY
))
{
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
printf
(
"
\n
"
);
fwrite
(
output_file_data
,
1
,
output_file_size
,
stdout
);
printf
(
"
\n
"
);
#endif
}
free
(
tmp_buf
);
...
...
@@ -499,6 +501,12 @@ int case_insensitive_compare(const char *s1, const char *s2)
{
size_t
i
;
if
(
s1
==
NULL
)
abort
();
if
(
s2
==
NULL
)
abort
();
for
(
i
=
0
;
;
++
i
)
{
unsigned
int
x1
=
(
unsigned
char
)
s1
[
i
];
unsigned
int
x2
=
(
unsigned
char
)
s2
[
i
];
...
...
This diff is collapsed.
Click to expand it.
programs/cmp_tool.c
+
3
−
2
View file @
8bc37015
...
...
@@ -153,6 +153,7 @@ static uint32_t model_counter;
__extension__
#define printf(...) do {} while (0)
#define fprintf(...) do {} while (0)
#define fflush(...) do {} while (0)
int
CMP_MAIN
(
int
argc
,
char
**
argv
);
...
...
@@ -649,7 +650,7 @@ static int guess_cmp_pars(struct rdcu_cfg *rcfg, struct cmp_par *chunk_par,
printf
(
"Search for a good set of compression parameters (level: %d) ... "
,
guess_level
);
fflush
(
stdout
);
if
(
!
case_insensitive_compare
(
guess_option
,
"rdcu"
))
{
if
(
guess_option
&&
!
case_insensitive_compare
(
guess_option
,
"rdcu"
))
{
if
(
add_rdcu_pars
)
data_type
=
DATA_TYPE_IMAGETTE_ADAPTIVE
;
else
...
...
@@ -658,7 +659,7 @@ static int guess_cmp_pars(struct rdcu_cfg *rcfg, struct cmp_par *chunk_par,
rcfg
->
cmp_mode
=
CMP_GUESS_DEF_MODE_MODEL
;
else
rcfg
->
cmp_mode
=
CMP_GUESS_DEF_MODE_DIFF
;
}
else
if
(
!
case_insensitive_compare
(
guess_option
,
"chunk"
))
{
}
else
if
(
guess_option
&&
!
case_insensitive_compare
(
guess_option
,
"chunk"
))
{
data_type
=
DATA_TYPE_CHUNK
;
}
else
{
data_type
=
DATA_TYPE_IMAGETTE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment