Merge pull request #119764 from danielfullmer/looking-glass-B3

looking-glass-client: B2 -> B3
This commit is contained in:
Sandro 2021-04-19 06:31:15 +02:00 committed by GitHub
commit 5b2aabc6ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 5 deletions

@ -0,0 +1,45 @@
From 95a7293b30ff7b89d615daea00269ed32f4b70a2 Mon Sep 17 00:00:00 2001
From: Geoffrey McRae <geoff@hostfission.com>
Date: Tue, 23 Feb 2021 20:25:30 +1100
Subject: [PATCH] [client] all: fix more `maybe-uninitialized` when `-O3` is in
use
Closes #475
---
client/renderers/EGL/egl.c | 3 ++-
client/src/main.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c
index b7a5644..72ce50d 100644
--- a/client/renderers/EGL/egl.c
+++ b/client/renderers/EGL/egl.c
@@ -271,7 +271,8 @@ static void egl_calc_mouse_size(struct Inst * this)
if (!this->formatValid)
return;
- int w, h;
+ int w = 0, h = 0;
+
switch(this->format.rotate)
{
case LG_ROTATE_0:
diff --git a/client/src/main.c b/client/src/main.c
index f05e929..f5d6fad 100644
--- a/client/src/main.c
+++ b/client/src/main.c
@@ -186,8 +186,9 @@ static void updatePositionInfo(void)
if (!g_state.haveSrcSize)
goto done;
- float srcW;
- float srcH;
+ float srcW = 0.0f;
+ float srcH = 0.0f;
+
switch(params.winRotate)
{
case LG_ROTATE_0:
--
2.30.1

@ -1,17 +1,18 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, SDL2, SDL2_ttf, spice-protocol { lib, stdenv, fetchFromGitHub, cmake, pkg-config, SDL2, SDL2_ttf, spice-protocol
, fontconfig, libX11, freefont_ttf, nettle, libpthreadstubs, libXau, libXdmcp , fontconfig, libX11, freefont_ttf, nettle, libpthreadstubs, libXau, libXdmcp
, libXi, libXext, wayland, libffi, libGLU, expat, libbfd , libXi, libXext, wayland, wayland-protocols, libffi, libGLU, libXScrnSaver
, expat, libbfd
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "looking-glass-client"; pname = "looking-glass-client";
version = "B2"; version = "B3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "gnif"; owner = "gnif";
repo = "LookingGlass"; repo = "LookingGlass";
rev = version; rev = version;
sha256 = "100b5kzh8gr81kzw5fdqz2jsms25hv3815d31vy3qd6lrlm5gs3d"; sha256 = "1vmabjzn85p0brdian9lbpjq39agzn8k0limn8zjm713lh3n3c0f";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -19,10 +20,18 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
SDL2 SDL2_ttf spice-protocol fontconfig libX11 freefont_ttf nettle SDL2 SDL2_ttf spice-protocol fontconfig libX11 freefont_ttf nettle
libpthreadstubs libXau libXdmcp libXi libXext wayland libffi libGLU expat libpthreadstubs libXau libXdmcp libXi libXext wayland wayland-protocols
libbfd libffi libGLU libXScrnSaver expat libbfd
]; ];
patches = [
# error: h may be used uninitialized in this function [-Werror=maybe-uninitialized]
# Fixed upstream in master in 8771103abbfd04da9787dea760405364af0d82de, but not in B3.
# Including our own patch here since upstream commit patch doesnt apply cleanly on B3
./0001-client-all-fix-more-maybe-uninitialized-when-O3-is-i.patch
];
patchFlags = "-p2";
sourceRoot = "source/client"; sourceRoot = "source/client";
NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem. NIX_CFLAGS_COMPILE = "-mavx"; # Fix some sort of AVX compiler problem.