unbreak with clang 6, from Timo Myyrä

This commit is contained in:
sthen 2018-04-10 15:41:55 +00:00
parent d8e4568ca1
commit 4900290518
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_net_fileman_cpp,v 1.1 2018/04/10 15:41:55 sthen Exp $
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 ; }

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_sdlport_hmi_cpp,v 1.1 2018/04/10 15:41:55 sthen Exp $
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;