@@ -1238,7 +1238,7 @@ GHC_INLINE unsigned consumeUtf8Fragment(const unsigned state, const uint8_t frag
1238
1238
0x88888880u , 0x22818108u , 0x88888881u , 0x88888882u , 0x88888884u , 0x88888887u , 0x88888886u , 0x82218108u , 0x82281108u , 0x88888888u , 0x88888883u , 0x88888885u , 0u , 0u , 0u , 0u ,
1239
1239
};
1240
1240
uint8_t category = fragment < 128 ? 0 : (utf8_state_info[(fragment >> 3 ) & 0xf ] >> ((fragment & 7 ) << 2 )) & 0xf ;
1241
- codepoint = (state ? (codepoint << 6 ) | (fragment & 0x3f ) : (0xff >> category) & fragment);
1241
+ codepoint = (state ? (codepoint << 6 ) | (fragment & 0x3fu ) : (0xffu >> category) & fragment);
1242
1242
return state == S_RJCT ? static_cast <unsigned >(S_RJCT) : static_cast <unsigned >((utf8_state_info[category + 16 ] >> (state << 2 )) & 0xf );
1243
1243
}
1244
1244
@@ -1320,7 +1320,7 @@ inline StringType fromUtf8(const std::string& utf8String, const typename StringT
1320
1320
std::uint32_t codepoint = 0 ;
1321
1321
while (iter < utf8String.end ()) {
1322
1322
if ((utf8_state = consumeUtf8Fragment (utf8_state, (uint8_t )*iter++, codepoint)) == S_STRT) {
1323
- result += codepoint;
1323
+ result += static_cast < typename StringType::value_type>( codepoint) ;
1324
1324
codepoint = 0 ;
1325
1325
}
1326
1326
else if (utf8_state == S_RJCT) {
@@ -1383,7 +1383,7 @@ inline std::string toUtf8(const std::basic_string<charT, traits, Alloc>& unicode
1383
1383
{
1384
1384
std::string result;
1385
1385
for (auto c : unicodeString) {
1386
- appendUTF8 (result, c );
1386
+ appendUTF8 (result, static_cast < uint32_t >(c) );
1387
1387
}
1388
1388
return result;
1389
1389
}
@@ -1732,7 +1732,7 @@ GHC_INLINE path resolveSymlink(const path& p, std::error_code& ec)
1732
1732
return path ();
1733
1733
}
1734
1734
else if (rc < static_cast <int >(bufferSize)) {
1735
- return path (std::string (buffer.data (), rc ));
1735
+ return path (std::string (buffer.data (), static_cast <std::string::size_type>(rc) ));
1736
1736
}
1737
1737
bufferSize *= 2 ;
1738
1738
}
@@ -1903,7 +1903,7 @@ GHC_INLINE file_status status_ex(const path& p, std::error_code& ec, file_status
1903
1903
}
1904
1904
}
1905
1905
if (sz) {
1906
- *sz = st.st_size ;
1906
+ *sz = static_cast < uintmax_t >( st.st_size ) ;
1907
1907
}
1908
1908
if (nhl) {
1909
1909
*nhl = st.st_nlink ;
@@ -3289,9 +3289,9 @@ GHC_INLINE bool copy_file(const path& from, const path& to, copy_options options
3289
3289
std::shared_ptr<void > guard_out (nullptr , [out](void *) { ::close (out); });
3290
3290
ssize_t br, bw;
3291
3291
while ((br = ::read (in, buffer.data (), buffer.size ())) > 0 ) {
3292
- int offset = 0 ;
3292
+ ssize_t offset = 0 ;
3293
3293
do {
3294
- if ((bw = ::write (out, buffer.data () + offset, br )) > 0 ) {
3294
+ if ((bw = ::write (out, buffer.data () + offset, static_cast < size_t >(br) )) > 0 ) {
3295
3295
br -= bw;
3296
3296
offset += bw;
3297
3297
}
@@ -4170,7 +4170,7 @@ GHC_INLINE void resize_file(const path& p, uintmax_t size, std::error_code& ec)
4170
4170
ec = std::error_code (::GetLastError (), std::system_category ());
4171
4171
}
4172
4172
#else
4173
- if (::truncate (p.c_str (), size) != 0 ) {
4173
+ if (::truncate (p.c_str (), static_cast < off_t >( size) ) != 0 ) {
4174
4174
ec = std::error_code (errno, std::system_category ());
4175
4175
}
4176
4176
#endif
0 commit comments