mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
use CStr literals over calling CStr::from_bytes_with_nul
This commit is contained in:
committed by
Ivan Molodetskikh
parent
b9fd0a405e
commit
9b78b15ba5
@@ -1,5 +1,5 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ffi::{CStr, CString};
|
use std::ffi::CString;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use glam::{Mat3, Vec2};
|
use glam::{Mat3, Vec2};
|
||||||
@@ -76,14 +76,14 @@ unsafe fn compile_program(
|
|||||||
let debug_program =
|
let debug_program =
|
||||||
unsafe { link_program(gl, include_str!("shaders/texture.vert"), &debug_shader)? };
|
unsafe { link_program(gl, include_str!("shaders/texture.vert"), &debug_shader)? };
|
||||||
|
|
||||||
let vert = CStr::from_bytes_with_nul(b"vert\0").expect("NULL terminated");
|
let vert = c"vert";
|
||||||
let vert_position = CStr::from_bytes_with_nul(b"vert_position\0").expect("NULL terminated");
|
let vert_position = c"vert_position";
|
||||||
let matrix = CStr::from_bytes_with_nul(b"matrix\0").expect("NULL terminated");
|
let matrix = c"matrix";
|
||||||
let tex_matrix = CStr::from_bytes_with_nul(b"tex_matrix\0").expect("NULL terminated");
|
let tex_matrix = c"tex_matrix";
|
||||||
let size = CStr::from_bytes_with_nul(b"niri_size\0").expect("NULL terminated");
|
let size = c"niri_size";
|
||||||
let scale = CStr::from_bytes_with_nul(b"niri_scale\0").expect("NULL terminated");
|
let scale = c"niri_scale";
|
||||||
let alpha = CStr::from_bytes_with_nul(b"niri_alpha\0").expect("NULL terminated");
|
let alpha = c"niri_alpha";
|
||||||
let tint = CStr::from_bytes_with_nul(b"niri_tint\0").expect("NULL terminated");
|
let tint = c"niri_tint";
|
||||||
|
|
||||||
Ok(ShaderProgram(Rc::new(ShaderProgramInner {
|
Ok(ShaderProgram(Rc::new(ShaderProgramInner {
|
||||||
normal: ShaderProgramInternal {
|
normal: ShaderProgramInternal {
|
||||||
|
|||||||
Reference in New Issue
Block a user