mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-23 07:21:31 +11:00
Convert the rest of functions to unsafe
This commit is contained in:
parent
8ccdddda2e
commit
bb40160a6a
File diff suppressed because it is too large
Load diff
|
@ -8,7 +8,7 @@ use std::mem;
|
||||||
const ICD_VERSION: u32 = 5;
|
const ICD_VERSION: u32 = 5;
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn vk_icdGetInstanceProcAddr(
|
pub unsafe extern "C" fn vk_icdGetInstanceProcAddr(
|
||||||
instance: VkInstance,
|
instance: VkInstance,
|
||||||
pName: *const ::std::os::raw::c_char,
|
pName: *const ::std::os::raw::c_char,
|
||||||
) -> PFN_vkVoidFunction {
|
) -> PFN_vkVoidFunction {
|
||||||
|
@ -16,10 +16,10 @@ pub extern "C" fn vk_icdGetInstanceProcAddr(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn vk_icdNegotiateLoaderICDInterfaceVersion(
|
pub unsafe extern "C" fn vk_icdNegotiateLoaderICDInterfaceVersion(
|
||||||
pSupportedVersion: *mut ::std::os::raw::c_uint,
|
pSupportedVersion: *mut ::std::os::raw::c_uint,
|
||||||
) -> VkResult {
|
) -> VkResult {
|
||||||
let supported_version = unsafe { &mut *pSupportedVersion };
|
let supported_version = &mut *pSupportedVersion;
|
||||||
if *supported_version > ICD_VERSION {
|
if *supported_version > ICD_VERSION {
|
||||||
*supported_version = ICD_VERSION;
|
*supported_version = ICD_VERSION;
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,11 @@ pub extern "C" fn vk_icdNegotiateLoaderICDInterfaceVersion(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn vk_icdGetPhysicalDeviceProcAddr(
|
pub unsafe extern "C" fn vk_icdGetPhysicalDeviceProcAddr(
|
||||||
_instance: VkInstance,
|
_instance: VkInstance,
|
||||||
pName: *const ::std::os::raw::c_char,
|
pName: *const ::std::os::raw::c_char,
|
||||||
) -> PFN_vkVoidFunction {
|
) -> PFN_vkVoidFunction {
|
||||||
let name = unsafe { CStr::from_ptr(pName) };
|
let name = CStr::from_ptr(pName);
|
||||||
let name = match name.to_str() {
|
let name = match name.to_str() {
|
||||||
Ok(name) => name,
|
Ok(name) => name,
|
||||||
Err(_) => return None,
|
Err(_) => return None,
|
||||||
|
|
Loading…
Reference in a new issue