Update for int/uint -> isize/usize

This commit is contained in:
John Gallagher
2015-01-10 20:39:59 -06:00
parent 60c9a04161
commit cc8a68ca83
3 changed files with 15 additions and 9 deletions

View File

@@ -210,7 +210,7 @@ impl SqliteConnection {
/// }
/// }
/// ```
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> SqliteResult<uint> {
pub fn execute(&self, sql: &str, params: &[&ToSql]) -> SqliteResult<c_int> {
self.prepare(sql).and_then(|mut stmt| stmt.execute(params))
}
@@ -280,7 +280,7 @@ impl SqliteConnection {
self.db.borrow_mut().decode_result(code)
}
fn changes(&self) -> uint {
fn changes(&self) -> c_int {
self.db.borrow_mut().changes()
}
}
@@ -390,8 +390,8 @@ impl InnerSqliteConnection {
})
}
fn changes(&mut self) -> uint {
unsafe{ ffi::sqlite3_changes(self.db) as uint }
fn changes(&mut self) -> c_int {
unsafe{ ffi::sqlite3_changes(self.db) }
}
}
@@ -432,7 +432,7 @@ impl<'conn> SqliteStatement<'conn> {
/// Ok(())
/// }
/// ```
pub fn execute(&mut self, params: &[&ToSql]) -> SqliteResult<uint> {
pub fn execute(&mut self, params: &[&ToSql]) -> SqliteResult<c_int> {
self.reset_if_needed();
unsafe {
@@ -796,7 +796,7 @@ mod test {
assert_eq!(db.last_insert_rowid(), 1);
let mut stmt = db.prepare("INSERT INTO foo DEFAULT VALUES").unwrap();
for _ in range(0i, 9) {
for _ in range(0i32, 9) {
stmt.execute(&[]).unwrap();
}
assert_eq!(db.last_insert_rowid(), 10);