Skip to content

Commit f00b272

Browse files
committed
multiboot2: fixes: use le_bytes instead of ne_bytes
1 parent 9692c61 commit f00b272

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

multiboot2/src/boot_loader_name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ mod tests {
8484
// size is: 4 bytes for tag + 4 bytes for size + length of null-terminated string
8585
let size = (4 + 4 + MSG.as_bytes().len() + 1) as u32;
8686
[
87-
&((TagType::BootLoaderName.val()).to_ne_bytes()),
88-
&size.to_ne_bytes(),
87+
&((TagType::BootLoaderName.val()).to_le_bytes()),
88+
&size.to_le_bytes(),
8989
MSG.as_bytes(),
9090
// Null Byte
9191
&[0],

multiboot2/src/command_line.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ mod tests {
9393
// size is: 4 bytes for tag + 4 bytes for size + length of null-terminated string
9494
let size = (4 + 4 + MSG.as_bytes().len() + 1) as u32;
9595
[
96-
&((TagType::Cmdline.val()).to_ne_bytes()),
97-
&size.to_ne_bytes(),
96+
&((TagType::Cmdline.val()).to_le_bytes()),
97+
&size.to_le_bytes(),
9898
MSG.as_bytes(),
9999
// Null Byte
100100
&[0],

multiboot2/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,10 +1573,10 @@ mod tests {
15731573
0,
15741574
0,
15751575
0, // end: padding; end of multiboot2 boot information begin
1576-
CUSTOM_TAG_ID.to_ne_bytes()[0],
1577-
CUSTOM_TAG_ID.to_ne_bytes()[1],
1578-
CUSTOM_TAG_ID.to_ne_bytes()[2],
1579-
CUSTOM_TAG_ID.to_ne_bytes()[3], // end: my custom tag id
1576+
CUSTOM_TAG_ID.to_le_bytes()[0],
1577+
CUSTOM_TAG_ID.to_le_bytes()[1],
1578+
CUSTOM_TAG_ID.to_le_bytes()[2],
1579+
CUSTOM_TAG_ID.to_le_bytes()[3], // end: my custom tag id
15801580
12,
15811581
0,
15821582
0,
@@ -1649,10 +1649,10 @@ mod tests {
16491649
0,
16501650
0,
16511651
0, // end: padding; end of multiboot2 boot information begin
1652-
CUSTOM_TAG_ID.to_ne_bytes()[0],
1653-
CUSTOM_TAG_ID.to_ne_bytes()[1],
1654-
CUSTOM_TAG_ID.to_ne_bytes()[2],
1655-
CUSTOM_TAG_ID.to_ne_bytes()[3], // end: my custom tag id
1652+
CUSTOM_TAG_ID.to_le_bytes()[0],
1653+
CUSTOM_TAG_ID.to_le_bytes()[1],
1654+
CUSTOM_TAG_ID.to_le_bytes()[2],
1655+
CUSTOM_TAG_ID.to_le_bytes()[3], // end: my custom tag id
16561656
14,
16571657
0,
16581658
0,
@@ -1699,10 +1699,10 @@ mod tests {
16991699
0,
17001700
0,
17011701
0, // reserved
1702-
TagType::Cmdline.val().to_ne_bytes()[0],
1703-
TagType::Cmdline.val().to_ne_bytes()[1],
1704-
TagType::Cmdline.val().to_ne_bytes()[2],
1705-
TagType::Cmdline.val().to_ne_bytes()[3],
1702+
TagType::Cmdline.val().to_le_bytes()[0],
1703+
TagType::Cmdline.val().to_le_bytes()[1],
1704+
TagType::Cmdline.val().to_le_bytes()[2],
1705+
TagType::Cmdline.val().to_le_bytes()[3],
17061706
13,
17071707
0,
17081708
0,

multiboot2/src/module.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ mod tests {
136136
// 4 bytes mod_start + 4 bytes mod_end
137137
let size = (4 + 4 + 4 + 4 + MSG.as_bytes().len() + 1) as u32;
138138
[
139-
&((TagType::Module.val()).to_ne_bytes()),
140-
&size.to_ne_bytes(),
141-
&0_u32.to_ne_bytes(),
142-
&0_u32.to_ne_bytes(),
139+
&((TagType::Module.val()).to_le_bytes()),
140+
&size.to_le_bytes(),
141+
&0_u32.to_le_bytes(),
142+
&0_u32.to_le_bytes(),
143143
MSG.as_bytes(),
144144
// Null Byte
145145
&[0],

multiboot2/src/smbios.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mod tests {
6767
// + 6 bytes reserved + the actual tables
6868
let size = (4 + 4 + 1 + 1 + 6 + tables.len()) as u32;
6969
let typ: u32 = TagType::Smbios.into();
70-
let mut bytes = [typ.to_ne_bytes(), size.to_ne_bytes()].concat();
70+
let mut bytes = [typ.to_le_bytes(), size.to_le_bytes()].concat();
7171
bytes.push(3);
7272
bytes.push(0);
7373
bytes.extend([0; 6]);

0 commit comments

Comments
 (0)