Fix clippy::ptr_offset_with_cast
This commit is contained in:
parent
73b66ea438
commit
c9c6031a53
@ -16,9 +16,7 @@ impl<'a> Chapter<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_ptr(&self) -> *const AVChapter {
|
pub unsafe fn as_ptr(&self) -> *const AVChapter {
|
||||||
*(*self.context.as_ptr())
|
*(*self.context.as_ptr()).chapters.add(self.index)
|
||||||
.chapters
|
|
||||||
.offset(self.index as isize)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,9 +26,7 @@ impl<'a> ChapterMut<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_mut_ptr(&mut self) -> *mut AVChapter {
|
pub unsafe fn as_mut_ptr(&mut self) -> *mut AVChapter {
|
||||||
*(*self.context.as_mut_ptr())
|
*(*self.context.as_mut_ptr()).chapters.add(self.index)
|
||||||
.chapters
|
|
||||||
.offset(self.index as isize)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ impl<'a> Stream<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_ptr(&self) -> *const AVStream {
|
pub unsafe fn as_ptr(&self) -> *const AVStream {
|
||||||
*(*self.context.as_ptr()).streams.offset(self.index as isize)
|
*(*self.context.as_ptr()).streams.add(self.index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,7 @@ impl<'a> StreamMut<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn as_mut_ptr(&mut self) -> *mut AVStream {
|
pub unsafe fn as_mut_ptr(&mut self) -> *mut AVStream {
|
||||||
*(*self.context.as_mut_ptr())
|
*(*self.context.as_mut_ptr()).streams.add(self.index)
|
||||||
.streams
|
|
||||||
.offset(self.index as isize)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ impl Index<usize> for Buffer {
|
|||||||
panic!("out of bounds");
|
panic!("out of bounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe { slice::from_raw_parts(*self.buffer.offset(index as isize), self.size as usize) }
|
unsafe { slice::from_raw_parts(*self.buffer.add(index), self.size as usize) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user