Skip to content

Commit

Permalink
Clang-format touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
micahsnyder committed Sep 9, 2024
1 parent 29987c0 commit e7cb0ff
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion clamd/server-th.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ int recvloop(int *socketds, unsigned nsockets, struct cl_engine *engine, unsigne
if ((opt = optget(opts, "MaxRecursion"))->active) {
if ((0 == opt->numarg) || (opt->numarg > CLI_MAX_MAXRECLEVEL)) {
logg(LOGG_ERROR, "MaxRecursion set to %zu, but cannot be larger than %u, and cannot be 0.\n",
(size_t) opt->numarg, CLI_MAX_MAXRECLEVEL);
(size_t)opt->numarg, CLI_MAX_MAXRECLEVEL);
cl_engine_free(engine);
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion clamscan/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ int scanmanager(const struct optstruct *opts)
uint32_t opt_value = opt->numarg;
if ((0 == opt_value) || (opt_value > CLI_MAX_MAXRECLEVEL)) {
logg(LOGG_ERROR, "max-recursion set to %u, but cannot be larger than %u, and cannot be 0.\n",
opt_value, CLI_MAX_MAXRECLEVEL);
opt_value, CLI_MAX_MAXRECLEVEL);
ret = 2;
goto done;
}
Expand Down
12 changes: 6 additions & 6 deletions libclamav/readdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ struct cli_matcher;
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2") || \
cli_strbcasestr(ext, ".imp"))
#define CLI_DBEXT_SIGNATURE(ext) \
( \
cli_strbcasestr(ext, ".cvd") || \
#define CLI_DBEXT_SIGNATURE(ext) \
( \
cli_strbcasestr(ext, ".cvd") || \
cli_strbcasestr(ext, ".cld"))
#else
#define CLI_DBEXT(ext) \
Expand Down Expand Up @@ -124,9 +124,9 @@ struct cli_matcher;
cli_strbcasestr(ext, ".ign") || \
cli_strbcasestr(ext, ".ign2") || \
cli_strbcasestr(ext, ".imp"))
#define CLI_DBEXT_SIGNATURE(ext) \
( \
cli_strbcasestr(ext, ".cvd") || \
#define CLI_DBEXT_SIGNATURE(ext) \
( \
cli_strbcasestr(ext, ".cvd") || \
cli_strbcasestr(ext, ".cld"))
#endif

Expand Down
4 changes: 2 additions & 2 deletions libclamav/scanners.c
Original file line number Diff line number Diff line change
Expand Up @@ -4212,9 +4212,9 @@ static inline bool result_should_goto_done(cli_ctx *ctx, cl_error_t result_in, c

cl_error_t cli_magic_scan(cli_ctx *ctx, cli_file_t type)
{
cl_error_t ret = CL_CLEAN;
cl_error_t ret = CL_CLEAN;
cl_error_t cache_check_result = CL_VIRUS;
bool cache_enabled = true;
bool cache_enabled = true;
cl_error_t verdict_at_this_level;
cli_file_t dettype = 0;
uint8_t typercg = 1;
Expand Down
2 changes: 1 addition & 1 deletion libclamav/special.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int cli_check_mydoom_log(cli_ctx *ctx)
while (blocks) { /* This wasn't probably intended but that's what the current code does anyway */
const uint32_t marker_ff = 0xffffffff;

if (!memcmp(&ptr[--blocks], &marker_ff, sizeof(uint32_t)))
if (!memcmp(&ptr[--blocks], &marker_ff, sizeof(uint32_t)))
return CL_CLEAN;
}

Expand Down
8 changes: 2 additions & 6 deletions libclamav/udf.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typedef struct __attribute__((packed)) {

} lb_addr;


// Long allocation descriptor
typedef struct __attribute__((packed)) {
uint32_t length; // 4/14.14.1.1
Expand Down Expand Up @@ -211,10 +210,7 @@ static uint32_t getFileIdentifierDescriptorPaddingLength(const FileIdentifierDes

static inline size_t getFileIdentifierDescriptorSize(const FileIdentifierDescriptor* fid)
{
return FILE_IDENTIFIER_DESCRIPTOR_SIZE_KNOWN
+ le16_to_host(fid->implementationLength)
+ fid->fileIdentifierLength
+ getFileIdentifierDescriptorPaddingLength(fid);
return FILE_IDENTIFIER_DESCRIPTOR_SIZE_KNOWN + le16_to_host(fid->implementationLength) + fid->fileIdentifierLength + getFileIdentifierDescriptorPaddingLength(fid);
}

typedef struct __attribute__((packed)) {
Expand Down Expand Up @@ -521,7 +517,7 @@ typedef struct __attribute__((packed)) {

} FileSetDescriptor;

typedef struct __attribute__((packed)) {
typedef struct __attribute__((packed)) {
uint8_t structType;
char standardIdentifier[5];
uint8_t structVersion;
Expand Down
7 changes: 1 addition & 6 deletions libclamav_rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ const BINDGEN_FUNCTIONS: &[&str] = &[
];

// Generate bindings for these types (structs, enums):
const BINDGEN_TYPES: &[&str] = &[
"cli_matcher",
"cli_ac_data",
"cli_ac_result",
"onedump_t",
];
const BINDGEN_TYPES: &[&str] = &["cli_matcher", "cli_ac_data", "cli_ac_result", "onedump_t"];

// Find the required functions and types in these headers:
const BINDGEN_HEADERS: &[&str] = &[
Expand Down

0 comments on commit e7cb0ff

Please sign in to comment.