replace range with an external iterator

This commit is contained in:
Daniel Micay
2013-08-01 18:35:46 -04:00
parent 5890fcf872
commit 234acad404
117 changed files with 336 additions and 442 deletions

View File

@@ -32,7 +32,7 @@ use cast;
use clone::Clone;
use container::Container;
use io;
use iterator::IteratorUtil;
use iterator::{IteratorUtil, range};
use libc;
use libc::{c_char, c_void, c_int, size_t};
use libc::FILE;
@@ -43,7 +43,6 @@ use prelude::*;
use ptr;
use str;
use to_str;
use uint;
use unstable::finally::Finally;
use vec;
@@ -1114,7 +1113,7 @@ pub fn set_exit_status(code: int) {
unsafe fn load_argc_and_argv(argc: c_int, argv: **c_char) -> ~[~str] {
let mut args = ~[];
for uint::range(0, argc as uint) |i| {
foreach i in range(0u, argc as uint) {
args.push(str::raw::from_c_str(*argv.offset(i as int)));
}
args
@@ -1163,7 +1162,7 @@ pub fn real_args() -> ~[~str] {
let szArgList = unsafe { CommandLineToArgvW(lpCmdLine, lpArgCount) };
let mut args = ~[];
for uint::range(0, nArgs as uint) |i| {
foreach i in range(0u, nArgs as uint) {
unsafe {
// Determine the length of this argument.
let ptr = *szArgList.offset(i as int);