Skip to content

Commit 92ab05f

Browse files
committed
C++: Use uppercase literal suffix
Command: ~~~sh run-clang-tidy-14 -header-filter='.*' -checks='-*,readability-uppercase-literal-suffix' -fix ~~~
1 parent c07be52 commit 92ab05f

12 files changed

+20
-20
lines changed

srecord/input/file/ppb.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ srecord::input_file_ppb::input_file_ppb(const std::string &filename) :
3232
input_file(filename),
3333
address(0),
3434
data_seen(false),
35-
packet_address(-1uL),
35+
packet_address(-1UL),
3636
packet_length(0),
3737
packet_used(0)
3838
{

srecord/input/generator.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ srecord::input_generator::create(srecord::arglex_tool *cmdln)
112112
length
113113
);
114114
}
115-
unsigned long over = (1uL << (8u * length)) - 1;
115+
unsigned long over = (1UL << (8U * length)) - 1;
116116
if (length < 4 && datum > over)
117117
{
118118
cmdln->fatal_error
@@ -152,7 +152,7 @@ srecord::input_generator::create(srecord::arglex_tool *cmdln)
152152
length
153153
);
154154
}
155-
unsigned long over = (1uL << (8u * length)) - 1;
155+
unsigned long over = (1UL << (8U * length)) - 1;
156156
if (length < 4 && datum > over)
157157
{
158158
cmdln->fatal_error

srecord/output/file.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ srecord::output_file::seek_to(unsigned long address)
311311
errno = 0;
312312
if (fseek(fp, address, 0) < 0)
313313
{
314-
if (errno == EINVAL && address >= 0x80000000uL)
314+
if (errno == EINVAL && address >= 0x80000000UL)
315315
{
316316
warning
317317
(
@@ -322,7 +322,7 @@ srecord::output_file::seek_to(unsigned long address)
322322
"to create a %3.1fGB file. See the manual for a "
323323
"description of the --offset filter, remembering that "
324324
"you can give negative offsets.",
325-
((double)address / (double)(1uL << 30))
325+
((double)address / (double)(1UL << 30))
326326
);
327327
}
328328
fatal_error_errno("seek 0x%lX", address);
@@ -500,9 +500,9 @@ srecord::output_file::data_address_too_large(const srecord::record &record,
500500
prec,
501501
hi,
502502
prec,
503-
0uL,
503+
0UL,
504504
prec,
505-
(1uL << nbits) - 1
505+
(1UL << nbits) - 1
506506
);
507507
}
508508
fatal_error("data address (0x%lX..0x%lX) too large", lo, hi);

srecord/output/file/cosmac.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ srecord::output_file_cosmac::write(const srecord::record &record)
5757
break;
5858

5959
case srecord::record::type_data:
60-
if (record.get_address() >= (1uL << 24) && address_length < 8)
60+
if (record.get_address() >= (1UL << 24) && address_length < 8)
6161
address_length = 8;
62-
else if (record.get_address() >= (1uL << 16) && address_length < 6)
62+
else if (record.get_address() >= (1UL << 16) && address_length < 6)
6363
address_length = 6;
6464

6565
if (header_required)

srecord/output/file/fairchild.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ srecord::output_file_fairchild::output_file_fairchild(
3030
const std::string &a_file_name
3131
) :
3232
srecord::output_file(a_file_name),
33-
address(~0uL)
33+
address(~0UL)
3434
{
3535
}
3636

srecord/output/file/fastload.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ srecord::output_file_fastload::output_file_fastload(
4343
) :
4444
srecord::output_file(a_filename),
4545
line_length(0),
46-
address(~0uL),
46+
address(~0UL),
4747
column(0),
4848
bytes_since_checksum(0),
4949
max_since_checksum(0),

srecord/output/file/formatted_binary.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ srecord::output_file_formatted_binary::write(const srecord::record &record)
7272
// assert(upper bound != 0);
7373
if (upper_bound == 0)
7474
fatal_error("must call srecord::output::notify_upper_bound first");
75-
if (upper_bound < (1uL << 16))
75+
if (upper_bound < (1UL << 16))
7676
{
7777
put_char(0x08); // *
7878
put_char(0x1C); // ***

srecord/output/file/idt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ srecord::output_file_idt::write(const srecord::record &record)
130130
break;
131131

132132
case srecord::record::type_data:
133-
if (addr < (1uL << 16) && address_length <= 2)
133+
if (addr < (1UL << 16) && address_length <= 2)
134134
{
135135
write_inner
136136
(

srecord/output/file/ppb.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ srecord::output_file_ppb::output_file_ppb(
3636
const std::string &a_file_name
3737
) :
3838
srecord::output_file(a_file_name),
39-
address(-1uL),
39+
address(-1UL),
4040
buffer_length(0),
4141
seen_some_data(false)
4242
{

srecord/output/file/ppx.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ srecord::output_file_ppx::write(const srecord::record &record)
8989
unsigned char data = record.get_data(j);
9090
unsigned long data_address = record.get_address() + j;
9191

92-
if (data_address >= (1uL << 16))
92+
if (data_address >= (1UL << 16))
9393
data_address_too_large(record, 16);
9494

9595
if (data_address != address)

srecord/output/file/tektronix_extended.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ srecord::output_file_tektronix_extended::write_inner(int tag,
9898
static int
9999
addr_width(unsigned long n)
100100
{
101-
if (n < (1uL << 16))
101+
if (n < (1UL << 16))
102102
return 2;
103-
if (n < (1uL << 24))
103+
if (n < (1UL << 24))
104104
return 3;
105105
return 4;
106106
}

srecord/output/file/vmem.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ calc_width_shift(int x)
9494
static unsigned
9595
calc_width_mask(int x)
9696
{
97-
return ((1uL << calc_width_shift(x)) - 1uL);
97+
return ((1UL << calc_width_shift(x)) - 1UL);
9898
}
9999

100100

@@ -127,7 +127,7 @@ srecord::output_file_vmem::command_line(srecord::arglex_tool *cmdln)
127127
cmdln->token_next();
128128

129129
width_shift = calc_width_shift(n);
130-
bytes_per_word = 1u << width_shift;
130+
bytes_per_word = 1U << width_shift;
131131
width_mask = calc_width_mask(n);
132132

133133
//
@@ -185,7 +185,7 @@ srecord::output_file_vmem::write(const srecord::record &record)
185185
||
186186
(record.get_length() & width_mask)
187187
)
188-
fatal_alignment_error(1u << width_shift);
188+
fatal_alignment_error(1U << width_shift);
189189

190190
//
191191
// If we need to advance the address, it has to be at the start

0 commit comments

Comments
 (0)