mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #308 from ebfe/fix-build-master
Fix build with rust master
This commit is contained in:
commit
58d0d930eb
5 changed files with 9 additions and 9 deletions
|
@ -177,7 +177,7 @@ fn write_bytes(files: Vec<String>, number: NumberingMode, squeeze_blank: bool,
|
|||
};
|
||||
|
||||
// Flush all 1024 iterations.
|
||||
let mut flush_counter = range(0, 1024);
|
||||
let mut flush_counter = range(0u, 1024);
|
||||
|
||||
let mut in_buf = [0, .. 1024 * 32];
|
||||
let mut out_buf = [0, .. 1024 * 64];
|
||||
|
@ -191,7 +191,7 @@ fn write_bytes(files: Vec<String>, number: NumberingMode, squeeze_blank: bool,
|
|||
for &byte in in_buf.slice_to(n).iter() {
|
||||
if flush_counter.next().is_none() {
|
||||
writer.possibly_flush();
|
||||
flush_counter = range(0, 1024);
|
||||
flush_counter = range(0u, 1024);
|
||||
}
|
||||
if byte == '\n' as u8 {
|
||||
if !at_line_start || !squeeze_blank {
|
||||
|
|
|
@ -25,7 +25,7 @@ static VERSION : &'static str = "1.0.0";
|
|||
fn crc_update(mut crc: u32, input: u8) -> u32 {
|
||||
crc ^= input as u32 << 24;
|
||||
|
||||
for _ in range(0, 8) {
|
||||
for _ in range(0u, 8) {
|
||||
if crc & 0x80000000 != 0 {
|
||||
crc <<= 1;
|
||||
crc ^= 0x04c11db7;
|
||||
|
|
|
@ -60,7 +60,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, uint) {
|
|||
};
|
||||
|
||||
let mut bytes = vec!();
|
||||
for offset in range(0, max_digits) {
|
||||
for offset in range(0u, max_digits) {
|
||||
if string.len() <= index + offset as uint {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -162,8 +162,8 @@ fn usage(program: &str, binary_name: &str, opts: &[getopts::OptGroup]) {
|
|||
}
|
||||
|
||||
fn hashsum(algoname: &str, mut digest: Box<Digest>, files: Vec<String>, binary: bool, check: bool, tag: bool, status: bool, quiet: bool, strict: bool, warn: bool) -> Result<(), int> {
|
||||
let mut bad_format = 0;
|
||||
let mut failed = 0;
|
||||
let mut bad_format = 0u;
|
||||
let mut failed = 0u;
|
||||
let binary_marker = if binary {
|
||||
"*"
|
||||
} else {
|
||||
|
|
6
nl/nl.rs
6
nl/nl.rs
|
@ -170,7 +170,7 @@ fn nl<T: Reader> (reader: &mut BufferedReader<T>, settings: &Settings) {
|
|||
let line_no_width_initial = line_no_width;
|
||||
// Stores the smallest integer with one more digit than line_no, so that
|
||||
// when line_no >= line_no_threshold, we need to use one more digit.
|
||||
let mut line_no_threshold = std::num::pow(10, line_no_width) as u64;
|
||||
let mut line_no_threshold = std::num::pow(10u64, line_no_width);
|
||||
let mut empty_line_count: u64 = 0;
|
||||
let fill_char = match settings.number_format {
|
||||
RightZero => '0',
|
||||
|
@ -204,7 +204,7 @@ fn nl<T: Reader> (reader: &mut BufferedReader<T>, settings: &Settings) {
|
|||
// a header) or the current char does not form part of
|
||||
// a new group, then this line is not a segment indicator.
|
||||
if matched_groups >= 3
|
||||
|| settings.section_delimiter[std::bool::to_bit::<uint>(odd)] != c {
|
||||
|| settings.section_delimiter[if odd { 1 } else { 0 }] != c {
|
||||
matched_groups = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ fn nl<T: Reader> (reader: &mut BufferedReader<T>, settings: &Settings) {
|
|||
if settings.renumber {
|
||||
line_no = settings.starting_line_number;
|
||||
line_no_width = line_no_width_initial;
|
||||
line_no_threshold = std::num::pow(10, line_no_width) as u64;
|
||||
line_no_threshold = std::num::pow(10u64, line_no_width);
|
||||
}
|
||||
&settings.header_numbering
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue