Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesBHuff committed Apr 22, 2021
1 parent cac09c4 commit 09182a4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions application/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright © from 2021 by Miles B Huff <MilesBHuff@Users.NoReply.Github.com> per the terms of the GNU LAGPL 3.

////////////////////////////////////////////////////////////////////////////////
use std::assert_eq;
use std::fs;
use std::io::ErrorKind::WouldBlock;
use std::mem::drop;
Expand Down Expand Up @@ -44,7 +43,6 @@ struct ArgStruct {

////////////////////////////////////////////////////////////////////////////////
fn main() {
//TODO: Set niceness to 20.

// Get input
let args = ArgStruct::from_args();
Expand All @@ -60,8 +58,8 @@ fn main() {
let color_channels = 3usize;
let mut color_totals = [0u32, 0u32, 0u32]; // Theoretical maximum of 528,768,000 for 1920x1080; so a large integer (ie, u32) is needed.
let mut color_averages = [0u8, 0u8, 0u8];
assert_eq!(color_totals.len(), color_channels);
assert_eq!(color_averages.len(), color_channels);
debug_assert_eq!(color_totals.len(), color_channels);
debug_assert_eq!(color_averages.len(), color_channels);

// Display
let display = Display::primary().expect("Failed to load primary display.");
Expand All @@ -76,9 +74,7 @@ fn main() {
let pixels = dim.w * dim.h; // Theoretical maximum of 2,073,600 for 1920x1080; so a large integer (ie, u32) is needed.

// Reduce priority
unsafe {
setpriority(PRIO_PROCESS, getpid() as u32, niceness as i32);
}
unsafe {setpriority(PRIO_PROCESS, getpid() as u32, niceness as i32);}

// Core loop
let frequency = Duration::from_millis((1000.0 / fps).round() as u64);
Expand Down

0 comments on commit 09182a4

Please sign in to comment.