Bug 1355187 - Rename some struct fields so that the Rust/C++ names are the same. r=rhunt

The binding generator just takes the Rust field names and uses that in the
generated C++ structs. So installing the autogenerated bindings is easier if
we make sure the names are the same ahead of time.

MozReview-Commit-ID: 6cuzmtI5Qqw
This commit is contained in:
Kartikaya Gupta 2017-04-10 17:38:02 -04:00
Родитель 2e1233a137
Коммит 1358415529
3 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -480,7 +480,7 @@ inline WrByteSlice RangeToByteSlice(mozilla::Range<uint8_t> aRange) {
}
inline mozilla::Range<uint8_t> ByteSliceToRange(WrByteSlice aWrSlice) {
return mozilla::Range<uint8_t>(aWrSlice.mBuffer, aWrSlice.mLength);
return mozilla::Range<uint8_t>(aWrSlice.buffer, aWrSlice.len);
}
struct BuiltDisplayList {

Просмотреть файл

@ -550,18 +550,18 @@ impl WrImageDescriptor {
#[repr(C)]
pub struct WrVecU8 {
ptr: *mut u8,
data: *mut u8,
length: usize,
capacity: usize,
}
impl WrVecU8 {
fn to_vec(self) -> Vec<u8> {
unsafe { Vec::from_raw_parts(self.ptr, self.length, self.capacity) }
unsafe { Vec::from_raw_parts(self.data, self.length, self.capacity) }
}
fn from_vec(mut v: Vec<u8>) -> WrVecU8 {
let w = WrVecU8 {
ptr: v.as_mut_ptr(),
data: v.as_mut_ptr(),
length: v.len(),
capacity: v.capacity(),
};

Просмотреть файл

@ -66,8 +66,8 @@ WR_DECL_FFI_2(WrFontKey, uint32_t, uint32_t)
// view of a buffer of bytes.
// The canonical gecko equivalent is mozilla::Range<uint8_t>.
struct WrByteSlice {
uint8_t* mBuffer;
size_t mLength;
uint8_t* buffer;
size_t len;
};
// ----