Skip to content

Commit 5275ffd

Browse files
authored
od: use snake_case for macro names (#11967)
1 parent 76760a4 commit 5275ffd

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

src/uu/od/src/prn_int.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
use crate::formatter_item_info::{FormatWriter, FormatterItemInfo};
66

77
/// format string to print octal using `int_writer_unsigned`
8-
macro_rules! OCT {
8+
macro_rules! oct {
99
() => {
1010
" {:0width$o}"
1111
};
1212
}
1313
/// format string to print hexadecimal using `int_writer_unsigned`
14-
macro_rules! HEX {
14+
macro_rules! hex {
1515
() => {
1616
" {:0width$x}"
1717
};
1818
}
1919
/// format string to print decimal using `int_writer_unsigned` or `int_writer_signed`
20-
macro_rules! DEC {
20+
macro_rules! dec {
2121
() => {
2222
" {:width$}"
2323
};
@@ -68,25 +68,25 @@ fn sign_extend(item: u64, item_bytes: usize) -> i64 {
6868
(item << shift) as i64 >> shift
6969
}
7070

71-
int_writer_unsigned!(FORMAT_ITEM_OCT8, 1, 4, format_item_oct8, OCT!()); // max: 377
72-
int_writer_unsigned!(FORMAT_ITEM_OCT16, 2, 7, format_item_oct16, OCT!()); // max: 177777
73-
int_writer_unsigned!(FORMAT_ITEM_OCT32, 4, 12, format_item_oct32, OCT!()); // max: 37777777777
74-
int_writer_unsigned!(FORMAT_ITEM_OCT64, 8, 23, format_item_oct64, OCT!()); // max: 1777777777777777777777
75-
76-
int_writer_unsigned!(FORMAT_ITEM_HEX8, 1, 3, format_item_hex8, HEX!()); // max: ff
77-
int_writer_unsigned!(FORMAT_ITEM_HEX16, 2, 5, format_item_hex16, HEX!()); // max: ffff
78-
int_writer_unsigned!(FORMAT_ITEM_HEX32, 4, 9, format_item_hex32, HEX!()); // max: ffffffff
79-
int_writer_unsigned!(FORMAT_ITEM_HEX64, 8, 17, format_item_hex64, HEX!()); // max: ffffffffffffffff
80-
81-
int_writer_unsigned!(FORMAT_ITEM_DEC8U, 1, 4, format_item_dec_u8, DEC!()); // max: 255
82-
int_writer_unsigned!(FORMAT_ITEM_DEC16U, 2, 6, format_item_dec_u16, DEC!()); // max: 65535
83-
int_writer_unsigned!(FORMAT_ITEM_DEC32U, 4, 11, format_item_dec_u32, DEC!()); // max: 4294967295
84-
int_writer_unsigned!(FORMAT_ITEM_DEC64U, 8, 21, format_item_dec_u64, DEC!()); // max: 18446744073709551615
85-
86-
int_writer_signed!(FORMAT_ITEM_DEC8S, 1, 5, format_item_dec_s8, DEC!()); // max: -128
87-
int_writer_signed!(FORMAT_ITEM_DEC16S, 2, 7, format_item_dec_s16, DEC!()); // max: -32768
88-
int_writer_signed!(FORMAT_ITEM_DEC32S, 4, 12, format_item_dec_s32, DEC!()); // max: -2147483648
89-
int_writer_signed!(FORMAT_ITEM_DEC64S, 8, 21, format_item_dec_s64, DEC!()); // max: -9223372036854775808
71+
int_writer_unsigned!(FORMAT_ITEM_OCT8, 1, 4, format_item_oct8, oct!()); // max: 377
72+
int_writer_unsigned!(FORMAT_ITEM_OCT16, 2, 7, format_item_oct16, oct!()); // max: 177777
73+
int_writer_unsigned!(FORMAT_ITEM_OCT32, 4, 12, format_item_oct32, oct!()); // max: 37777777777
74+
int_writer_unsigned!(FORMAT_ITEM_OCT64, 8, 23, format_item_oct64, oct!()); // max: 1777777777777777777777
75+
76+
int_writer_unsigned!(FORMAT_ITEM_HEX8, 1, 3, format_item_hex8, hex!()); // max: ff
77+
int_writer_unsigned!(FORMAT_ITEM_HEX16, 2, 5, format_item_hex16, hex!()); // max: ffff
78+
int_writer_unsigned!(FORMAT_ITEM_HEX32, 4, 9, format_item_hex32, hex!()); // max: ffffffff
79+
int_writer_unsigned!(FORMAT_ITEM_HEX64, 8, 17, format_item_hex64, hex!()); // max: ffffffffffffffff
80+
81+
int_writer_unsigned!(FORMAT_ITEM_DEC8U, 1, 4, format_item_dec_u8, dec!()); // max: 255
82+
int_writer_unsigned!(FORMAT_ITEM_DEC16U, 2, 6, format_item_dec_u16, dec!()); // max: 65535
83+
int_writer_unsigned!(FORMAT_ITEM_DEC32U, 4, 11, format_item_dec_u32, dec!()); // max: 4294967295
84+
int_writer_unsigned!(FORMAT_ITEM_DEC64U, 8, 21, format_item_dec_u64, dec!()); // max: 18446744073709551615
85+
86+
int_writer_signed!(FORMAT_ITEM_DEC8S, 1, 5, format_item_dec_s8, dec!()); // max: -128
87+
int_writer_signed!(FORMAT_ITEM_DEC16S, 2, 7, format_item_dec_s16, dec!()); // max: -32768
88+
int_writer_signed!(FORMAT_ITEM_DEC32S, 4, 12, format_item_dec_s32, dec!()); // max: -2147483648
89+
int_writer_signed!(FORMAT_ITEM_DEC64S, 8, 21, format_item_dec_s64, dec!()); // max: -9223372036854775808
9090

9191
#[test]
9292
#[allow(clippy::cognitive_complexity)]

0 commit comments

Comments
 (0)