Skip to content

Commit

Permalink
Automated fixes to follow Rust development
Browse files Browse the repository at this point in the history
Applied fixes:
	*attribute fix (cf rust-lang/rust#2569)
	*New vec library (cf rust-lang/rust#12771)
  • Loading branch information
Geal committed Apr 2, 2014
1 parent ef83787 commit 1965d9f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/OpenCL/CL.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[allow(non_camel_case_types)];
#![allow(non_camel_case_types)]

extern crate std;

Expand Down
6 changes: 3 additions & 3 deletions src/OpenCL/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use CL::*;
use CL::ll::*;
use mem::*;
use std::mem;
use std::vec;
use std::vec::Vec;
use std::libc::{size_t, c_void};

use hl::KernelArg;
Expand Down Expand Up @@ -85,7 +85,7 @@ impl<T> Get<Array3DCL<T>, Array3D<T>> for Array3D<T>
{
fn get(arr: &Array3DCL<T>, f: |offset: size_t, ptr: *mut c_void, size: size_t|) -> Array3D<T>
{
let mut v: ~[T] = vec::with_capacity(arr.len());
let mut v: ~[T] = Vec::with_capacity(arr.len());
unsafe {
v.set_len(arr.len());
}
Expand Down Expand Up @@ -206,7 +206,7 @@ impl<T> Get<Array2DCL<T>, Array2D<T>> for Array2D<T>
{
fn get(arr: &Array2DCL<T>, f: |offset: size_t, ptr: *mut c_void, size: size_t|) -> Array2D<T>
{
let mut v: ~[T] = vec::with_capacity(arr.len());
let mut v: ~[T] = Vec::with_capacity(arr.len());
unsafe {
v.set_len(arr.len())
}
Expand Down
10 changes: 5 additions & 5 deletions src/OpenCL/hl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use CL::*;
use CL::ll::*;
use error::check;
use std::libc;
use std::vec;
use std::vec::Vec;
use std::str;
use std::mem;
use std::cast;
Expand Down Expand Up @@ -40,7 +40,7 @@ impl Platform {
clGetDeviceIDs(self.id, dtype, 0, ptr::null(),
(&num_devices));

let ids = vec::from_elem(num_devices as uint, 0 as cl_device_id);
let ids = Vec::from_elem(num_devices as uint, 0 as cl_device_id);
clGetDeviceIDs(self.id, dtype, ids.len() as cl_uint,
ids.as_ptr(), (&num_devices));
ids.map(|id| { Device {id: *id }})
Expand Down Expand Up @@ -128,7 +128,7 @@ pub fn get_platforms() -> ~[Platform]
// unlock this before the check in case the check fails
check(status, "could not get platform count.");

let ids = vec::from_elem(num_platforms as uint, 0 as cl_platform_id);
let ids = Vec::from_elem(num_platforms as uint, 0 as cl_platform_id);

let status = clGetPlatformIDs(ids.len() as cl_uint,
ids.as_ptr(),
Expand Down Expand Up @@ -157,7 +157,7 @@ impl Device {
(&mut size));
check(status, "Could not determine name length");

let mut buf = vec::from_elem(size as uint, 0);
let mut buf = Vec::from_elem(size as uint, 0);

let status = clGetDeviceInfo(
self.id,
Expand Down Expand Up @@ -478,7 +478,7 @@ impl Program
(&mut size));
check(status, "Could not get build log");

let mut buf = vec::from_elem(size as uint, 0u8);
let mut buf = Vec::from_elem(size as uint, 0u8);
let status = clGetProgramBuildInfo(
self.prg,
device.id,
Expand Down
14 changes: 7 additions & 7 deletions src/OpenCL/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#[crate_id = "OpenCL#0.2"];
#[crate_type = "lib"];
#[feature(macro_rules)];
#[feature(globs)];
#[feature(managed_boxes)];
#[feature(link_args)];
#[feature(phase)];
#![crate_id = "OpenCL#0.2"]
#![crate_type = "lib"]
#![feature(macro_rules)]
#![feature(globs)]
#![feature(managed_boxes)]
#![feature(link_args)]
#![feature(phase)]

//! OpenCL bindings for Rust.

Expand Down
2 changes: 1 addition & 1 deletion src/OpenCL/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[feature(link_args)];
#![feature(link_args)]
extern crate OpenCL;

use std::io::fs::File;
Expand Down
4 changes: 2 additions & 2 deletions src/OpenCL/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::libc::{size_t, c_void};
use std::mem;
use std::ptr;
use std::vec;
use std::vec::Vec;
use std::num::zero;

use CL::*;
Expand Down Expand Up @@ -127,7 +127,7 @@ impl<T> Get<CLBuffer<T>, T> for ~[T]
{
fn get(mem: &CLBuffer<T>, f: |offset: size_t, ptr: *mut c_void, size: size_t|) -> ~[T]
{
let mut v: ~[T] = vec::with_capacity(mem.len());
let mut v: ~[T] = Vec::with_capacity(mem.len());
unsafe {
v.set_len(mem.len());
}
Expand Down
8 changes: 4 additions & 4 deletions src/OpenCL/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[feature(link_args)];
#[feature(macro_rules)];
#[feature(globs)];
#![feature(link_args)]
#![feature(macro_rules)]
#![feature(globs)]

extern crate std;
extern crate OpenCL = "OpenCL#0.2";
Expand Down Expand Up @@ -43,7 +43,7 @@ pub fn test_all_platforms_devices(test: |Device, Context, CommandQueue|)
}

mod mem {
use std::vec;
use std::vec::Vec;
use OpenCL::mem::{Read, Write};

fn read_write<R: Read, W: Write>(src: &W, dst: &mut R)
Expand Down

0 comments on commit 1965d9f

Please sign in to comment.