milkytracker-1.02.00-clang-6.0.0-fix.patch (1324B)
1 From 857d3d68cb3bc2cf3da50bc9daff9325d05179a4 Mon Sep 17 00:00:00 2001
2 From: Christopher O'Neill <code@chrisoneill.co.uk>
3 Date: Tue, 27 Feb 2018 10:21:34 +0000
4 Subject: [PATCH] Fix #151: clang6.0.0 (freeBSD) build failure
5
6 Add explicit cast for narrowing conversion to hopefully fix the build failure.
7 ---
8 src/tracker/sdl/SDL_Main.cpp | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-)
10
11 diff --git a/src/tracker/sdl/SDL_Main.cpp b/src/tracker/sdl/SDL_Main.cpp
12 index 420b4d92..526302bc 100644
13 --- a/src/tracker/sdl/SDL_Main.cpp
14 +++ b/src/tracker/sdl/SDL_Main.cpp
15 @@ -609,7 +609,7 @@ void translateKeyDownEvent(const SDL_Event& event)
16 printf ("DEBUG: Key pressed: VK: %d, SC: %d, Scancode: %d\n", toVK(keysym), toSC(keysym), keysym.sym);
17 #endif
18
19 - pp_uint16 chr[3] = {toVK(keysym), toSC(keysym), keysym.sym};
20 + pp_uint16 chr[3] = {toVK(keysym), toSC(keysym), static_cast<pp_uint16> (keysym.sym)};
21
22 PPEvent myEvent(eKeyDown, &chr, sizeof(chr));
23 RaiseEventSerialized(&myEvent);
24 @@ -621,7 +621,7 @@ void translateKeyUpEvent(const SDL_Event& event)
25
26 preTranslateKey(keysym);
27
28 - pp_uint16 chr[3] = {toVK(keysym), toSC(keysym), keysym.sym};
29 + pp_uint16 chr[3] = {toVK(keysym), toSC(keysym), static_cast<pp_uint16> (keysym.sym)};
30
31 PPEvent myEvent(eKeyUp, &chr, sizeof(chr));
32 RaiseEventSerialized(&myEvent);