Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to current rust #30

Merged
merged 3 commits into from Apr 10, 2014
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

4 ffi.rs
@@ -7,9 +7,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[allow(non_camel_case_types)];
#![allow(non_camel_case_types)]

use std::libc::{c_int, size_t, c_void, c_char};
use libc::{c_int, size_t, c_void, c_char};

pub static TRANSFORM_IDENTITY: c_int = 0;

16 lib.rs
@@ -7,18 +7,20 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[crate_id = "github.com/mozilla-servo/rust-png#png:0.1"];
#[crate_type = "lib"];
#[crate_type = "dylib"];
#[crate_type = "rlib"];
#![crate_id = "github.com/mozilla-servo/rust-png#png:0.1"]
#![crate_type = "lib"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]

extern crate libc;
extern crate std;

use libc::{c_int, size_t};
use std::cast;
use std::io;
use std::io::File;
use std::ptr;
use std::slice;
use std::libc::{c_int, size_t};

pub mod ffi;

@@ -74,7 +76,7 @@ pub fn load_png(path: &Path) -> Result<Image,~str> {
Ok(b) => b,
Err(e) => return Err(format!("could not read file: {}", e.desc))
};
load_png_from_memory(buf)
load_png_from_memory(buf.as_slice())
}

pub fn load_png_from_memory(image: &[u8]) -> Result<Image,~str> {
@@ -305,7 +307,7 @@ mod test {
Err(e) => fail!(e)
};
let bs = bench::benchmark(|b| b.iter(|| {
match load_png_from_memory(buf) {
match load_png_from_memory(buf.as_slice()) {
Err(m) => fail!(m),
Ok(image) => {
assert_eq!(image.color_type, c);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.