servo: range function requires for loop now

Source-Repo: https://github.com/servo/servo
Source-Revision: 8b013462d506100653f60578202d73303f8fb7c1
This commit is contained in:
Brian Anderson 2012-05-26 15:10:37 -07:00
Родитель bd9483b17f
Коммит 06968c4fbd
4 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -70,7 +70,7 @@ crust fn debug(cx: *JSContext, argc: uintN, vp: *jsval) {
unsafe {
let argv = JS_ARGV(cx, vp);
uint::range(0u, argc as uint) { |i|
for uint::range(0u, argc as uint) { |i|
let jsstr = JS_ValueToString(cx, argv[i]);
let bytes = JS_EncodeString(cx, jsstr);
let str = str::unsafe::from_c_str(bytes);

Просмотреть файл

@ -278,10 +278,10 @@ mod test {
let read_chan = comm::chan(read_port);
// fire up a reader task
uint::range(0u, iter1) { |i|
for uint::range(0u, iter1) { |i|
s.reader_forked();
let wait_chan = task::spawn_listener {|wait_port|
uint::range(0u, iter2) { |_i|
for uint::range(0u, iter2) { |_i|
comm::send(read_chan, henrietta.rd(read_characteristic));
comm::send(read_chan, ferdinand.rd(read_characteristic));
comm::recv(wait_port);
@ -294,7 +294,7 @@ mod test {
let frc = ferdinand.rd(read_characteristic);
assert frc == i * iter2;
uint::range(0u, iter2) { |_i|
for uint::range(0u, iter2) { |_i|
assert hrc == comm::recv(read_port);
s.wr(henrietta, mutate);
assert frc == comm::recv(read_port);

Просмотреть файл

@ -91,9 +91,9 @@ fn draw_image(draw_target: AzDrawTargetRef, item: dl::display_item,
}
let stride = image.width * image.depth;
uint::range(0u, image.height) {
for uint::range(0u, image.height) {
|y|
uint::range(0u, image.width) {
for uint::range(0u, image.width) {
|x|
let color = {
r: image.data[y * stride + x * image.depth].to_float()

Просмотреть файл

@ -76,7 +76,7 @@ impl layout_methods_priv for @box {
#[doc="Dumps the box tree, for debugging, with indentation."]
fn dump_indent(indent: uint) {
let mut s = "";
uint::range(0u, indent) {
for uint::range(0u, indent) {
|_i|
s += " ";
}
@ -118,7 +118,7 @@ impl node_methods_priv for node {
#[doc="Dumps the node tree, for debugging, with indentation."]
fn dump_indent(indent: uint) {
let mut s = "";
uint::range(0u, indent) {
for uint::range(0u, indent) {
|_i|
s += " ";
}