Skip to content

Commit ede4e12

Browse files
committed
PSMDB-1890 Suppress the clang-format warnings
1 parent 41c054f commit ede4e12

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

src/third_party/libarchive/dist/libarchive/archive_read_disk_posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ tree_dup(int fd)
20052005
{
20062006
int new_fd;
20072007
#ifdef F_DUPFD_CLOEXEC
2008-
static volatile int can_dupfd_cloexec = 1;
2008+
static volatile int can_dupfd_cloexec = 1; // NOLINT(mongo-volatile-check)
20092009

20102010
if (can_dupfd_cloexec) {
20112011
new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);

src/third_party/libarchive/dist/libarchive/archive_read_open_filename.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ archive_read_open_filenames(struct archive *a, const char **filenames,
132132
mine->block_size = block_size;
133133
mine->fd = -1;
134134
mine->buffer = NULL;
135+
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
135136
mine->st_mode = mine->use_lseek = 0;
136137
if (filename == NULL || filename[0] == '\0') {
137138
mine->filename_type = FNT_STDIN;

src/third_party/libarchive/dist/libarchive/archive_read_support_format_iso9660.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,7 +3276,7 @@ isodate7_valid(const unsigned char *v)
32763276
int hour = v[3];
32773277
int minute = v[4];
32783278
int second = v[5];
3279-
int gmt_off = (signed char)v[6];
3279+
int gmt_off = (signed char)v[6]; // NOLINT(bugprone-signed-char-misuse)
32803280

32813281
/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
32823282
* that the date is unspecified" */
@@ -3332,6 +3332,7 @@ isodate7(const unsigned char *v)
33323332
tm.tm_min = v[4];
33333333
tm.tm_sec = v[5];
33343334
/* v[6] is the signed timezone offset, in 1/4-hour increments. */
3335+
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
33353336
offset = ((const signed char *)v)[6];
33363337
if (offset > -48 && offset < 52) {
33373338
tm.tm_hour -= offset / 4;
@@ -3360,7 +3361,7 @@ isodate17_valid(const unsigned char *v)
33603361
int minute = (v[10] - '0') * 10 + (v[11] - '0');
33613362
int second = (v[12] - '0') * 10 + (v[13] - '0');
33623363
int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
3363-
int gmt_off = (signed char)v[16];
3364+
int gmt_off = (signed char)v[16]; // NOLINT(bugprone-signed-char-misuse)
33643365

33653366
if (year == 0 && month == 0 && day == 0
33663367
&& hour == 0 && minute == 0 && second == 0
@@ -3421,6 +3422,7 @@ isodate17(const unsigned char *v)
34213422
tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
34223423
tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
34233424
/* v[16] is the signed timezone offset, in 1/4-hour increments. */
3425+
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
34243426
offset = ((const signed char *)v)[16];
34253427
if (offset > -48 && offset < 52) {
34263428
tm.tm_hour -= offset / 4;

src/third_party/libarchive/dist/libarchive/archive_read_support_format_lha.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,6 +2634,7 @@ lzh_read_pt_bitlen(struct lzh_stream *strm, int start, int end)
26342634
if ((c = lzh_br_bits(br, 3)) == 7) {
26352635
if (!lzh_br_read_ahead(strm, br, 13))
26362636
return (i);
2637+
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
26372638
c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
26382639
if (c)
26392640
lzh_br_consume(br, c - 3);

src/third_party/libarchive/dist/libarchive/archive_read_support_format_zip.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ process_extra(struct archive_read *a, struct archive_entry *entry,
608608
"Incomplete extended time field");
609609
return ARCHIVE_FAILED;
610610
}
611-
flags = p[offset];
611+
flags = p[offset]; // NOLINT(bugprone-signed-char-misuse)
612612
offset++;
613613
datasize--;
614614
/* Flag bits indicate which dates are present. */
@@ -700,7 +700,7 @@ process_extra(struct archive_read *a, struct archive_entry *entry,
700700
/* We only support first 7 bits of bitmap; skip rest. */
701701
while ((bitmap_last & 0x80) != 0
702702
&& datasize >= 1) {
703-
bitmap_last = p[offset];
703+
bitmap_last = p[offset]; // NOLINT(bugprone-signed-char-misuse)
704704
offset += 1;
705705
datasize -= 1;
706706
}
@@ -891,6 +891,7 @@ process_extra(struct archive_read *a, struct archive_entry *entry,
891891
zip_entry->aes_extra.vendor =
892892
archive_le16dec(p + offset);
893893
/* AES encryption strength. */
894+
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
894895
zip_entry->aes_extra.strength = p[offset + 4];
895896
/* Actual compression method. */
896897
zip_entry->aes_extra.compression =

src/third_party/libarchive/dist/libarchive/archive_string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ _utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
23832383
ch = (unsigned char)*s;
23842384
if (ch == 0)
23852385
return (0); /* Standard: return 0 for end-of-string. */
2386-
cnt = utf8_count[ch];
2386+
cnt = utf8_count[ch]; // NOLINT(bugprone-signed-char-misuse)
23872387

23882388
/* Invalid sequence or there are not plenty bytes. */
23892389
if (n < (size_t)cnt) {
@@ -3866,7 +3866,7 @@ best_effort_strncat_to_utf16(struct archive_string *as16, const void *_p,
38663866

38673867
utf16 = as16->s + as16->length;
38683868
while (remaining--) {
3869-
unsigned c = *s++;
3869+
unsigned c = *s++; // NOLINT(bugprone-signed-char-misuse)
38703870
if (c > 127) {
38713871
/* We cannot handle it. */
38723872
c = UNICODE_R_CHAR;

0 commit comments

Comments
 (0)