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-net-fileman.cpp
16461 views
1
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]
2
uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
3
^~~~~~~~~~~~~~~~~~
4
fileman.cpp:296:33: note: insert an explicit cast to silence this issue
5
uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
6
^~~~~~~~~~~~~~~~~~
7
static_cast<uint8_t>( )
8
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]
9
uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
10
^~~~~~~~~~~~~~
11
fileman.cpp:296:52: note: insert an explicit cast to silence this issue
12
uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
13
^~~~~~~~~~~~~~
14
static_cast<uint8_t>( )
15
16
--- src/net/fileman.cpp.orig 2011-05-02 11:55:06 UTC
17
+++ src/net/fileman.cpp
18
@@ -293,7 +293,7 @@ file_manager::remote_file::remote_file(net_socket *soc
19
next=Next;
20
open_local=0;
21
22
- uint8_t sizes[3]={ CLIENT_NFS,strlen(filename)+1,strlen(mode)+1};
23
+ uint8_t sizes[3]={ CLIENT_NFS,(uint8_t)(strlen(filename)+1),(uint8_t)(strlen(mode)+1)};
24
if (sock->write(sizes,3)!=3) { r_close("could not send open info"); return ; }
25
if (sock->write(filename,sizes[1])!=sizes[1]) { r_close("could not send filename"); return ; }
26
if (sock->write(mode,sizes[2])!=sizes[2]) { r_close("could not send mode"); return ; }
27
28