make RWops compatible to i686 platform; also add more patterns to .gitignore.

This commit is contained in:
Kang Seonghoon
2014-04-08 23:53:33 +09:00
parent c73bb3436a
commit 0b1cbd7550
2 changed files with 14 additions and 3 deletions
+11
View File
@@ -1,3 +1,14 @@
*~
*#
*.o
*.a
*.so
*.rlib
*.dylib
*.dSYM
*.dll
*.dummy
*.exe
.rust/
build/
bin/
+3 -3
View File
@@ -1,7 +1,7 @@
use std::io;
use std::io::IoResult;
use get_error;
use libc::{c_void, c_int};
use libc::{c_void, c_int, size_t};
#[allow(non_camel_case_types)]
pub mod ll {
@@ -80,7 +80,7 @@ impl Drop for RWops {
impl Reader for RWops {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
let out_len = buf.len() as u64;
let out_len = buf.len() as size_t;
// FIXME: it's better to use as_mut_ptr().
// number of objects read, or 0 at error or end of file.
let ret = unsafe {
@@ -96,7 +96,7 @@ impl Reader for RWops {
impl Writer for RWops {
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
let in_len = buf.len() as u64;
let in_len = buf.len() as size_t;
let ret = unsafe {
((*self.raw).write)(self.raw, buf.as_ptr() as *c_void, 1, in_len)
};