Fix a bunch of warnings

This commit is contained in:
Drakulix 2018-01-07 20:24:40 +01:00
parent b2ee62bebf
commit efaadb8882
8 changed files with 36 additions and 46 deletions

View File

@ -1,10 +1,10 @@
use super::error::*;
use super::DevPath;
use backend::graphics::GraphicsBackend;
use backend::graphics::egl::{EGLGraphicsBackend, EGLContext, EGLSurface, PixelFormat, SwapBuffersError, EglExtensionNotSupportedError};
use backend::graphics::egl::{EGLGraphicsBackend, EGLContext, EGLSurface, PixelFormat, SwapBuffersError};
use backend::graphics::egl::error::Result as EGLResult;
use backend::graphics::egl::native::{Gbm, GbmSurfaceArguments};
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay, BufferAccessError, EGLImages};
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay};
use drm::control::{Device, ResourceInfo};
use drm::control::{connector, crtc, encoder, framebuffer, Mode};
use gbm::{Device as GbmDevice, BufferObject, BufferObjectFlags, Format as GbmFormat, Surface as GbmSurface, SurfaceBufferHandle};
@ -13,7 +13,6 @@ use nix::libc::c_void;
use std::cell::Cell;
use std::rc::{Rc, Weak};
use wayland_server::Display;
use wayland_server::protocol::wl_buffer::WlBuffer;
pub struct DrmBackend<A: Device + 'static> {
backend: Rc<DrmBackendInternal<A>>,

View File

@ -188,11 +188,10 @@
//! ```
#[cfg(feature = "backend_session")]
use backend::graphics::egl::EglExtensionNotSupportedError;
use backend::graphics::egl::context::{EGLContext, GlAttributes, PixelFormatRequirements};
use backend::graphics::egl::context::{EGLContext, GlAttributes};
use backend::graphics::egl::error::Result as EGLResult;
use backend::graphics::egl::native::Gbm;
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay, BufferAccessError, EGLImages};
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay};
#[cfg(feature = "backend_session")]
use backend::session::SessionObserver;
use drm::Device as BasicDevice;
@ -215,7 +214,6 @@ use wayland_server::{EventLoopHandle, StateToken};
use wayland_server::sources::{FdEventSource, FdEventSourceImpl, FdInterest};
#[cfg(feature = "backend_session")]
use wayland_server::{Display, StateProxy};
use wayland_server::protocol::wl_buffer::WlBuffer;
mod backend;
pub mod error;
@ -569,7 +567,7 @@ impl<A: ControlDevice + 'static> SessionObserver for StateToken<DrmDevice<A>> {
}
fn activate<'a>(&mut self, state: &mut StateProxy<'a>) {
state.with_value(self, |state, device| {
let mut device = state.get_mut(self);
device.active = true;
if let Err(err) = device.set_master() {
crit!(
@ -597,6 +595,5 @@ impl<A: ControlDevice + 'static> SessionObserver for StateToken<DrmDevice<A>> {
for crtc in crtcs {
device.backends.remove(&crtc);
}
})
}
}

View File

@ -8,8 +8,6 @@
use super::GraphicsBackend;
use nix::libc::c_void;
use std::fmt;
use wayland_server::Display;
use wayland_server::protocol::wl_buffer::WlBuffer;
pub mod context;
pub use self::context::EGLContext;

View File

@ -16,8 +16,6 @@ use winit::Window as WinitWindow;
#[cfg(feature = "backend_winit")]
use winit::os::unix::WindowExt;
#[cfg(feature = "backend_winit")]
use nix::libc::c_void;
#[cfg(feature = "backend_winit")]
use wayland_client::egl as wegl;
pub trait Backend {

View File

@ -4,7 +4,7 @@ use backend::graphics::egl::ffi::egl::types::EGLImage;
use nix::libc::{c_uint};
use std::rc::{Rc, Weak};
use std::fmt;
use wayland_server::{Display, Resource, StateToken, StateProxy};
use wayland_server::{Display, Resource};
use wayland_server::protocol::wl_buffer::WlBuffer;
use wayland_sys::server::wl_display;

View File

@ -1,7 +1,7 @@
//! Glium compatibility module
use backend::graphics::egl::{EGLGraphicsBackend, SwapBuffersError, EglExtensionNotSupportedError};
use backend::graphics::egl::wayland::{BufferAccessError, EGLImages, EGLWaylandExtensions, EGLDisplay};
use backend::graphics::egl::{EGLGraphicsBackend, SwapBuffersError};
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay};
use backend::graphics::egl::error::Result as EGLResult;
use glium::Frame;
use glium::SwapBuffersError as GliumSwapBuffersError;
@ -11,7 +11,6 @@ use std::borrow::Borrow;
use std::os::raw::c_void;
use std::rc::Rc;
use wayland_server::Display;
use wayland_server::protocol::wl_buffer::WlBuffer;
impl From<SwapBuffersError> for GliumSwapBuffersError {
fn from(error: SwapBuffersError) -> Self {

View File

@ -14,7 +14,7 @@ use drm::control::Device as ControlDevice;
use backend::drm::{drm_device_bind, DrmDevice, DrmHandler};
use backend::session::{Session, SessionObserver};
use nix::fcntl;
use nix::sys::stat::{dev_t, fstat};
use nix::sys::stat::dev_t;
use std::collections::HashMap;
use std::ffi::OsString;
use std::io::{Error as IoError, Result as IoResult};

View File

@ -1,12 +1,12 @@
//! Implementation of backend traits for types provided by `winit`
use backend::graphics::GraphicsBackend;
use backend::graphics::egl::{EGLGraphicsBackend, EGLContext, EGLSurface, PixelFormat, SwapBuffersError, EglExtensionNotSupportedError};
use backend::graphics::egl::{EGLGraphicsBackend, EGLContext, EGLSurface, PixelFormat, SwapBuffersError};
use backend::graphics::egl::error as egl_error;
use backend::graphics::egl::error::Result as EGLResult;
use backend::graphics::egl::native;
use backend::graphics::egl::context::GlAttributes;
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLImages, Format, BufferAccessError, EGLDisplay};
use backend::graphics::egl::wayland::{EGLWaylandExtensions, EGLDisplay};
use backend::input::{Axis, AxisSource, Event as BackendEvent, InputBackend, InputHandler, KeyState,
KeyboardKeyEvent, MouseButton, MouseButtonState, PointerAxisEvent, PointerButtonEvent,
PointerMotionAbsoluteEvent, Seat, SeatCapabilities, TouchCancelEvent, TouchDownEvent,
@ -20,7 +20,6 @@ use winit::{ElementState, Event, EventsLoop, KeyboardInput, MouseButton as Winit
MouseScrollDelta, Touch, TouchPhase, WindowBuilder, WindowEvent, Window as WinitWindow};
use wayland_client::egl as wegl;
use wayland_server::Display;
use wayland_server::protocol::wl_buffer::WlBuffer;
error_chain! {
errors {