Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #154 from EPashkin/fix_FromGlibPtrContainer
Browse files Browse the repository at this point in the history
Fix FromGlibPtrContainer implementations
  • Loading branch information
GuillaumeGomez committed Mar 28, 2017
2 parents 6dabedc + 35c6e73 commit d6fe8c6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/translate.rs
Expand Up @@ -896,7 +896,7 @@ for Vec<T> {
return Vec::new()
}
let mut res = Vec::with_capacity(num);
while !(*ptr).is_null() {
for _ in 0..num {
res.push(from_glib_none(*ptr));
ptr = ptr.offset(1);
}
Expand Down Expand Up @@ -925,7 +925,7 @@ for Vec<T> {
}
let orig_ptr = ptr;
let mut res = Vec::with_capacity(num);
while !(*ptr).is_null() {
for _ in 0..num {
res.push(from_glib_full(*ptr));
ptr = ptr.offset(1);
}
Expand Down Expand Up @@ -976,7 +976,7 @@ where T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + Fro
return Vec::new()
}
let mut res = Vec::with_capacity(num);
while !ptr.is_null() {
for _ in 0..num {
let item_ptr: <T as GlibPtrDefault>::GlibType = Ptr::from((*ptr).data);
if !item_ptr.is_null() {
res.push(from_glib_none(item_ptr));
Expand Down Expand Up @@ -1010,7 +1010,7 @@ where T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + Fro
}
let orig_ptr = ptr;
let mut res = Vec::with_capacity(num);
while !ptr.is_null() {
for _ in 0..num {
let item_ptr: <T as GlibPtrDefault>::GlibType = Ptr::from((*ptr).data);
if !item_ptr.is_null() {
res.push(from_glib_full(item_ptr));
Expand All @@ -1034,7 +1034,7 @@ where T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + Fro
return Vec::new()
}
let mut res = Vec::with_capacity(num);
while !ptr.is_null() {
for _ in 0..num {
let item_ptr: <T as GlibPtrDefault>::GlibType = Ptr::from((*ptr).data);
if !item_ptr.is_null() {
res.push(from_glib_none(item_ptr));
Expand Down Expand Up @@ -1068,7 +1068,7 @@ where T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + Fro
}
let orig_ptr = ptr;
let mut res = Vec::with_capacity(num);
while !ptr.is_null() {
for _ in 0..num {
let item_ptr: <T as GlibPtrDefault>::GlibType = Ptr::from((*ptr).data);
if !item_ptr.is_null() {
res.push(from_glib_full(item_ptr));
Expand Down

0 comments on commit d6fe8c6

Please sign in to comment.