clang6 fix games/abuse

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

clang6 fix games/abuse

Timo Myyrä-6
Hi,

Few static_cast calls to allow this to compile.
Quickly testing the game runs but for some reason the sounds didn't work for me.

timo

Index: patches/patch-src_net_fileman_cpp
===================================================================
RCS file: patches/patch-src_net_fileman_cpp
diff -N patches/patch-src_net_fileman_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_net_fileman_cpp 10 Apr 2018 15:35:17 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/net/fileman.cpp
+--- src/net/fileman.cpp.orig
++++ src/net/fileman.cpp
+@@ -293,7 +293,7 @@ file_manager::remote_file::remote_file(net_socket *soc
+   next=Next;
+   open_local=0;
+
+-  uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
++  uint8_t sizes[3]={ CLIENT_NFS,static_cast<uint8_t>(strlen(filename)+1),static_cast<uint8_t>(strlen(mode)+1)};
+   if (sock->write(sizes,3)!=3) { r_close("could not send open info"); return ; }
+   if (sock->write(filename,sizes[1])!=sizes[1]) { r_close("could not send filename"); return ; }
+   if (sock->write(mode,sizes[2])!=sizes[2]) { r_close("could not send mode"); return ; }
Index: patches/patch-src_sdlport_hmi_cpp
===================================================================
RCS file: patches/patch-src_sdlport_hmi_cpp
diff -N patches/patch-src_sdlport_hmi_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_sdlport_hmi_cpp 10 Apr 2018 15:35:17 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/sdlport/hmi.cpp
+--- src/sdlport/hmi.cpp.orig
++++ src/sdlport/hmi.cpp
+@@ -299,7 +299,7 @@ uint8_t* load_hmi(char const *filename, uint32_t &data
+     uint8_t num_tracks = (next_offset - offset_tracks) / sizeof(uint32_t);
+
+     // Write Midi file header
+-    uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 };
++    uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, static_cast<uint8_t>(num_tracks + 1), 0x00, 0xC0 };
+     memcpy(output_buffer_ptr, midi_header, 14);
+     output_buffer_ptr += 14;
+