1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Add type suffixes where necessary

This commit is contained in:
Michael Gehring 2014-06-25 13:12:43 +02:00
parent e023d97821
commit b3c9fd891e
5 changed files with 8 additions and 8 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -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;
}

View file

@ -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 {

View file

@ -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',
@ -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
},