Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/games/abuse_sdl/files/patch-src-sdlport-hmi.cpp
16461 views
1
hmi.cpp:302:97: error: non-constant-expression cannot be narrowed from type 'int' to 'uint8_t'
2
(aka 'unsigned char') in initializer list [-Wc++11-narrowing]
3
...0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 };
4
^~~~~~~~~~~~~~~~
5
hmi.cpp:302:97: note: insert an explicit cast to silence this issue
6
...0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 };
7
^~~~~~~~~~~~~~~~
8
static_cast<uint8_t>( )
9
10
--- src/sdlport/hmi.cpp.orig 2011-05-09 07:58:30 UTC
11
+++ src/sdlport/hmi.cpp
12
@@ -299,7 +299,7 @@ uint8_t* load_hmi(char const *filename, uint32_t &data
13
uint8_t num_tracks = (next_offset - offset_tracks) / sizeof(uint32_t);
14
15
// Write Midi file header
16
- uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (num_tracks + 1), 0x00, 0xC0 };
17
+ uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (uint8_t)(num_tracks + 1), 0x00, 0xC0 };
18
memcpy(output_buffer_ptr, midi_header, 14);
19
output_buffer_ptr += 14;
20
21
22