diff options
author | jbeich <jbeich@FreeBSD.org> | 2018-01-21 01:45:52 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2018-01-21 01:45:52 +0800 |
commit | 0596b70ef456e90f81d6a7cdf3438796ec25ed01 (patch) | |
tree | 2ced07bcfb1074c350c863765b7dd1e1925fe07b /games/abuse_sdl | |
parent | 9dc5b2f11259db0d13ed060f85a3d56d89e90243 (diff) | |
download | freebsd-ports-gnome-0596b70ef456e90f81d6a7cdf3438796ec25ed01.tar.gz freebsd-ports-gnome-0596b70ef456e90f81d6a7cdf3438796ec25ed01.tar.zst freebsd-ports-gnome-0596b70ef456e90f81d6a7cdf3438796ec25ed01.zip |
games/abuse_sdl: unbreak build with Clang 6 (C++14 by default)
fileman.cpp:296:33: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'uint8_t' (aka 'unsigned char') in initializer list [-Wc++11-narrowing]
uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
^~~~~~~~~~~~~~~~~~
hmi.cpp:302:97: error: non-constant-expression cannot be narrowed from type 'int' to 'uint8_t'
(aka 'unsigned char') in initializer list [-Wc++11-narrowing]
...0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 };
^~~~~~~~~~~~~~~~
Reported by: pkg-fallout
Diffstat (limited to 'games/abuse_sdl')
-rw-r--r-- | games/abuse_sdl/files/patch-src-net-fileman.cpp | 26 | ||||
-rw-r--r-- | games/abuse_sdl/files/patch-src-sdlport-hmi.cpp | 20 |
2 files changed, 46 insertions, 0 deletions
diff --git a/games/abuse_sdl/files/patch-src-net-fileman.cpp b/games/abuse_sdl/files/patch-src-net-fileman.cpp new file mode 100644 index 000000000000..8727d8341008 --- /dev/null +++ b/games/abuse_sdl/files/patch-src-net-fileman.cpp @@ -0,0 +1,26 @@ +fileman.cpp:296:33: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'uint8_t' (aka 'unsigned char') in initializer list [-Wc++11-narrowing] + uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1}; + ^~~~~~~~~~~~~~~~~~ +fileman.cpp:296:33: note: insert an explicit cast to silence this issue + uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1}; + ^~~~~~~~~~~~~~~~~~ + static_cast<uint8_t>( ) +fileman.cpp:296:52: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'uint8_t' (aka 'unsigned char') in initializer list [-Wc++11-narrowing] + uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1}; + ^~~~~~~~~~~~~~ +fileman.cpp:296:52: note: insert an explicit cast to silence this issue + uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1}; + ^~~~~~~~~~~~~~ + static_cast<uint8_t>( ) + +--- src/net/fileman.cpp.orig 2011-05-02 11:55:06 UTC ++++ 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,(uint8_t)(strlen(filename)+1),(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 ; } diff --git a/games/abuse_sdl/files/patch-src-sdlport-hmi.cpp b/games/abuse_sdl/files/patch-src-sdlport-hmi.cpp new file mode 100644 index 000000000000..4513ad1390bc --- /dev/null +++ b/games/abuse_sdl/files/patch-src-sdlport-hmi.cpp @@ -0,0 +1,20 @@ +hmi.cpp:302:97: error: non-constant-expression cannot be narrowed from type 'int' to 'uint8_t' + (aka 'unsigned char') in initializer list [-Wc++11-narrowing] + ...0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 }; + ^~~~~~~~~~~~~~~~ +hmi.cpp:302:97: note: insert an explicit cast to silence this issue + ...0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 }; + ^~~~~~~~~~~~~~~~ + static_cast<uint8_t>( ) + +--- src/sdlport/hmi.cpp.orig 2011-05-09 07:58:30 UTC ++++ 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, (uint8_t)(num_tracks + 1), 0x00, 0xC0 }; + memcpy(output_buffer_ptr, midi_header, 14); + output_buffer_ptr += 14; + |