diff --git a/src/gl/mod.rs b/src/gl/mod.rs index a782d78..646a322 100644 --- a/src/gl/mod.rs +++ b/src/gl/mod.rs @@ -648,10 +648,9 @@ impl Uniform { } } - pub fn set_float_mutli_raw(&self, data: *const f32, len: usize) { - unsafe { - gl::Uniform4fv(self.0, len as i32, data); - } + #[allow(clippy::missing_safety_doc)] + pub unsafe fn set_float_multi_raw(&self, data: *const f32, len: usize) { + gl::Uniform4fv(self.0, len as i32, data); } pub fn set_matrix4(&self, m: &::cgmath::Matrix4) { diff --git a/src/main.rs b/src/main.rs index 1833dfa..3f4009b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,6 @@ #![recursion_limit = "300"] #![allow(clippy::too_many_arguments)] // match standard gl functions with many arguments #![allow(clippy::many_single_char_names)] // short variable names provide concise clarity -#![warn(clippy::not_unsafe_ptr_arg_deref)] // TODO: fix unsafe warnings #![allow(clippy::float_cmp)] // float comparison used to check if changed use log::{error, info, warn}; diff --git a/src/render/model.rs b/src/render/model.rs index 339af43..70a1bea 100644 --- a/src/render/model.rs +++ b/src/render/model.rs @@ -283,7 +283,9 @@ impl Manager { v.set_matrix4_multi(&model.matrix) } if let Some(v) = collection.shader.color_mul { - v.set_float_mutli_raw(model.colors.as_ptr() as *const _, model.colors.len()) + unsafe { + v.set_float_multi_raw(model.colors.as_ptr() as *const _, model.colors.len()) + } } gl::draw_elements(gl::TRIANGLES, model.count, self.index_type, 0); }