From 6bc682893c7d50bce71edc7b8d292d3e9becfb17 Mon Sep 17 00:00:00 2001 From: maik klein Date: Thu, 5 Jan 2017 09:52:32 +0100 Subject: [PATCH] Cleanup additional warnings --- src/device.rs | 52 ++++++++++++++++------------------ src/extensions/debug_report.rs | 11 ++++--- src/extensions/swapchain.rs | 1 + 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/device.rs b/src/device.rs index deded2b..415978c 100644 --- a/src/device.rs +++ b/src/device.rs @@ -422,20 +422,18 @@ pub trait DeviceV1_0 { } unsafe fn create_pipeline_layout(&self, - create_info: &vk::PipelineLayoutCreateInfo, - allocation_callbacks: Option<&vk::AllocationCallbacks>) - -> VkResult { - unsafe { - let mut pipeline_layout = mem::uninitialized(); - let err_code = self.fp_v1_0() - .create_pipeline_layout(self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut pipeline_layout); - match err_code { - vk::Result::Success => Ok(pipeline_layout), - _ => Err(err_code), - } + create_info: &vk::PipelineLayoutCreateInfo, + allocation_callbacks: Option<&vk::AllocationCallbacks>) + -> VkResult { + let mut pipeline_layout = mem::uninitialized(); + let err_code = self.fp_v1_0() + .create_pipeline_layout(self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut pipeline_layout); + match err_code { + vk::Result::Success => Ok(pipeline_layout), + _ => Err(err_code), } } @@ -463,20 +461,18 @@ pub trait DeviceV1_0 { } unsafe fn create_framebuffer(&self, - create_info: &vk::FramebufferCreateInfo, - allocation_callbacks: Option<&vk::AllocationCallbacks>) - -> VkResult { - unsafe { - let mut framebuffer = mem::uninitialized(); - let err_code = self.fp_v1_0() - .create_framebuffer(self.handle(), - create_info, - allocation_callbacks.as_raw_ptr(), - &mut framebuffer); - match err_code { - vk::Result::Success => Ok(framebuffer), - _ => Err(err_code), - } + create_info: &vk::FramebufferCreateInfo, + allocation_callbacks: Option<&vk::AllocationCallbacks>) + -> VkResult { + let mut framebuffer = mem::uninitialized(); + let err_code = self.fp_v1_0() + .create_framebuffer(self.handle(), + create_info, + allocation_callbacks.as_raw_ptr(), + &mut framebuffer); + match err_code { + vk::Result::Success => Ok(framebuffer), + _ => Err(err_code), } } diff --git a/src/extensions/debug_report.rs b/src/extensions/debug_report.rs index 024c5ae..cfe9ba8 100644 --- a/src/extensions/debug_report.rs +++ b/src/extensions/debug_report.rs @@ -1,11 +1,10 @@ +#![allow(dead_code)] use prelude::*; use std::mem; -use instance::Instance; -use entry::Entry; use vk; use std::ffi::CStr; use ::RawPtr; -use version::{V1_0, EntryV1_0}; +use version::{EntryV1_0, InstanceV1_0}; #[derive(Clone)] pub struct DebugReport { @@ -14,9 +13,9 @@ pub struct DebugReport { } impl DebugReport { - pub fn new(entry: &Entry, - instance: &Instance) - -> Result> { + pub fn new(entry: &E, + instance: &I) + -> Result> { let debug_report_fn = vk::DebugReportFn::load(|name| { unsafe { mem::transmute(entry.get_instance_proc_addr(instance.handle(), name.as_ptr())) diff --git a/src/extensions/swapchain.rs b/src/extensions/swapchain.rs index e9e69f4..f1712a3 100644 --- a/src/extensions/swapchain.rs +++ b/src/extensions/swapchain.rs @@ -1,3 +1,4 @@ +#![allow(dead_code)] use prelude::*; use std::ptr; use std::mem;