Skip to content

Commit

Permalink
clam-format touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
micahsnyder committed Apr 13, 2024
1 parent 06ef85a commit 4695e20
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion libclamav/filetypes_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,6 @@ static const char *ftypes_int[] = {
"1:2:2d6c68(30|31|32|33|34|35|36|37|64|78)2d:LHA or LZH archive:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:2:2d6c7a(73|34|35)2d:LHA archive using .LZS extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:2:2d706d302d:LHA archive using PMarc (.PMA) extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"0:0:414c5a01:ALZ:CL_TYPE_ANY:CL_TYPE_ALZ:210",
"0:0:414c5a01:ALZ:CL_TYPE_ANY:CL_TYPE_ALZ:210",
NULL};
#endif
1 change: 0 additions & 1 deletion libclamav/hwp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,6 @@ static cl_error_t hwp3_cb(void *cbdata, int fd, const char *filepath, cli_ctx *c
if (SCAN_COLLECT_METADATA)
cli_jsonint(ctx->wrkproperty, "ParagraphCount", p);


last = 0;
/* 'additional information block #1's - attachments and media */
while (!last && ((ret = parsehwp3_infoblk_1(ctx, map, &offset, &last)) == CL_SUCCESS)) continue;
Expand Down
4 changes: 2 additions & 2 deletions libclamav/mbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -3217,7 +3217,7 @@ parseMimeHeader(message *m, const char *cmd, const table_t *rfc821Table, const c
#ifdef CL_THREAD_SAFE
s = strtok_r(NULL, ";", &strptr);
#else
s = strtok(NULL, ";");
s = strtok(NULL, ";");
#endif
if (s == NULL)
break;
Expand Down Expand Up @@ -4387,7 +4387,7 @@ do_multipart(message *mainMessage, message **messages, int i, mbox_status *rc, m
* This can save a lot of memory
*/
messageDestroy(messages[i]);
messages[i] = NULL;
messages[i] = NULL;
mctx->wrkobj = thisobj;

if (body) {
Expand Down
24 changes: 12 additions & 12 deletions libclamav/others.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,16 +587,16 @@ extern LIBCLAMAV_EXPORT int have_rar;

/* based on macros from A. Melnikoff */
#define cbswap16(v) (((v & 0xff) << 8) | (((v) >> 8) & 0xff))
#define cbswap32(v) ((((v) & 0x000000ff) << 24) | (((v) & 0x0000ff00) << 8) | \
(((v) & 0x00ff0000) >> 8) | (((v) & 0xff000000) >> 24))
#define cbswap64(v) ((((v) & 0x00000000000000ffULL) << 56) | \
(((v) & 0x000000000000ff00ULL) << 40) | \
(((v) & 0x0000000000ff0000ULL) << 24) | \
(((v) & 0x00000000ff000000ULL) << 8) | \
(((v) & 0x000000ff00000000ULL) >> 8) | \
(((v) & 0x0000ff0000000000ULL) >> 24) | \
(((v) & 0x00ff000000000000ULL) >> 40) | \
(((v) & 0xff00000000000000ULL) >> 56))
#define cbswap32(v) ((((v)&0x000000ff) << 24) | (((v)&0x0000ff00) << 8) | \
(((v)&0x00ff0000) >> 8) | (((v)&0xff000000) >> 24))
#define cbswap64(v) ((((v)&0x00000000000000ffULL) << 56) | \
(((v)&0x000000000000ff00ULL) << 40) | \
(((v)&0x0000000000ff0000ULL) << 24) | \
(((v)&0x00000000ff000000ULL) << 8) | \
(((v)&0x000000ff00000000ULL) >> 8) | \
(((v)&0x0000ff0000000000ULL) >> 24) | \
(((v)&0x00ff000000000000ULL) >> 40) | \
(((v)&0xff00000000000000ULL) >> 56))

#ifndef HAVE_ATTRIB_PACKED
#define __attribute__(x)
Expand Down Expand Up @@ -822,8 +822,8 @@ size_t cli_recursion_stack_get_size(cli_ctx *ctx, int index);
/* used by: spin, yc (C) aCaB */
#define __SHIFTBITS(a) (sizeof(a) << 3)
#define __SHIFTMASK(a) (__SHIFTBITS(a) - 1)
#define CLI_ROL(a, b) a = (a << ((b) & __SHIFTMASK(a))) | (a >> ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROR(a, b) a = (a >> ((b) & __SHIFTMASK(a))) | (a << ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROL(a, b) a = (a << ((b)&__SHIFTMASK(a))) | (a >> ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))
#define CLI_ROR(a, b) a = (a >> ((b)&__SHIFTMASK(a))) | (a << ((__SHIFTBITS(a) - (b)) & __SHIFTMASK(a)))

/* Implementation independent sign-extended signed right shift */
#ifdef HAVE_SAR
Expand Down
1 change: 1 addition & 0 deletions libclamav/scanners.c
Original file line number Diff line number Diff line change
Expand Up @@ -4550,6 +4550,7 @@ cl_error_t cli_magic_scan(cli_ctx *ctx, cli_file_t type)
if (SCAN_PARSE_ONENOTE && (DCONF_ARCH & DOC_CONF_ONENOTE))
ret = scan_onenote(ctx);
break;

case CL_TYPE_ALZ:
if (SCAN_PARSE_ARCHIVE && (DCONF_ARCH & ARCH_CONF_ALZ)) {
ret = cli_scanalz(ctx);
Expand Down
2 changes: 1 addition & 1 deletion libclamav/sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ enum { T_INVALID,

const char *sisfields[] = {"Invalid", "String", "Array", "Compressed", "Version", "VersionRange", "Date", "Time", "DateTime", "Uid", "Unused", "Language", "Contents", "Controller", "Info", "SupportedLanguages", "SupportedOptions", "Prerequisites", "Dependency", "Properties", "Property", "Signatures", "CertificateChain", "Logo", "FileDescription", "Hash", "If", "ElseIf", "InstallBlock", "Expression", "Data", "DataUnit", "FileData", "SupportedOption", "ControllerChecksum", "DataChecksum", "Signature", "Blob", "SignatureAlgorithm", "SignatureCertificateChain", "DataIndex", "Capabilities"};

#define ALIGN4(x) (((x) & ~3) + ((((x) & 1) | (((x) >> 1) & 1)) << 2))
#define ALIGN4(x) (((x) & ~3) + ((((x)&1) | (((x) >> 1) & 1)) << 2))

#define HERE printf("here\n"), abort();

Expand Down
6 changes: 4 additions & 2 deletions libclamav_rust/src/alz.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* ALZ archive extraction.
* ALZ archive extraction.
*
* Copyright (C) 2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*
Expand Down Expand Up @@ -308,7 +308,9 @@ impl AlzLocalFileHeader {
}

if self.is_data_descriptor() {
return Err(Error::UnsupportedFeature("Data Descriptors are Unsupported"));
return Err(Error::UnsupportedFeature(
"Data Descriptors are Unsupported",
));
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion libclamav_rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/// cbindgen:ignore
pub mod sys;

pub mod alz;
pub mod cdiff;
pub mod css_image_extract;
pub mod ctx;
Expand All @@ -34,4 +35,3 @@ pub mod logging;
pub mod onenote;
pub mod scanners;
pub mod util;
pub mod alz;

0 comments on commit 4695e20

Please sign in to comment.