2
0
Daniele Bartolini 10 жил өмнө
parent
commit
26d433375c

+ 3 - 3
src/core/network/socket.h

@@ -191,7 +191,7 @@ struct TCPSocket
 
 		return ar;
 #elif CROWN_PLATFORM_WINDOWS
-		int err = ::accept(m_socket, NULL, NULL);
+		SOCKET err = ::accept(m_socket, NULL, NULL);
 
 		if (err != INVALID_SOCKET)
 		{
@@ -279,7 +279,7 @@ struct TCPSocket
 
 		while (to_read > 0)
 		{
-			int read_bytes = ::recv(m_socket, buf, to_read, 0);
+			int read_bytes = ::recv(m_socket, buf, (int)to_read, 0);
 
 			if (read_bytes == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK)
 				return rr;
@@ -359,7 +359,7 @@ struct TCPSocket
 
 		while (to_send > 0)
 		{
-			int bytes_wrote = ::send(m_socket, (const char*) buf, to_send, 0);
+			int bytes_wrote = ::send(m_socket, (const char*) buf, (int)to_send, 0);
 
 			if (bytes_wrote == SOCKET_ERROR && WSAGetLastError() == WSAEWOULDBLOCK)
 			{

+ 1 - 1
src/core/os.h

@@ -203,7 +203,7 @@ namespace os
 #endif
 	}
 
-	inline const char* getcwd(char* buf, size_t size)
+	inline const char* getcwd(char* buf, uint32_t size)
 	{
 #if CROWN_PLATFORM_POSIX
 		return ::getcwd(buf, size);

+ 6 - 6
src/core/strings/dynamic_string.h

@@ -77,7 +77,7 @@ inline DynamicString::DynamicString(const char* s, Allocator& a)
 	: _data(a)
 {
 	CE_ASSERT_NOT_NULL(s);
-	array::push(_data, s, strlen(s));
+	array::push(_data, s, (uint32_t)strlen(s));
 }
 
 inline DynamicString& DynamicString::operator+=(const DynamicString& s)
@@ -88,7 +88,7 @@ inline DynamicString& DynamicString::operator+=(const DynamicString& s)
 inline DynamicString& DynamicString::operator+=(const char* s)
 {
 	CE_ASSERT_NOT_NULL(s);
-	array::push(_data, s, strlen(s));
+	array::push(_data, s, (uint32_t)strlen(s));
 	return *this;
 }
 
@@ -108,7 +108,7 @@ inline DynamicString& DynamicString::operator=(const char* s)
 {
 	CE_ASSERT_NOT_NULL(s);
 	array::clear(_data);
-	array::push(_data, s, strlen(s));
+	array::push(_data, s, (uint32_t)strlen(s));
 	return *this;
 }
 
@@ -137,7 +137,7 @@ inline bool DynamicString::operator==(const char* s) const
 
 inline uint32_t DynamicString::length() const
 {
-	return strlen(this->c_str());
+	return (uint32_t)strlen(this->c_str());
 }
 
 inline void DynamicString::strip_leading(const char* s)
@@ -149,7 +149,7 @@ inline void DynamicString::strip_leading(const char* s)
 	const size_t s_len = strlen(s);
 
 	memmove(array::begin(_data), array::begin(_data) + s_len, (my_len - s_len));
-	array::resize(_data, my_len - s_len);
+	array::resize(_data, uint32_t(my_len - s_len));
 }
 
 inline void DynamicString::strip_trailing(const char* s)
@@ -159,7 +159,7 @@ inline void DynamicString::strip_trailing(const char* s)
 
 	const size_t my_len = strlen(c_str());
 	const size_t s_len = strlen(s);
-	array::resize(_data, my_len - s_len);
+	array::resize(_data, uint32_t(my_len - s_len));
 }
 
 inline bool DynamicString::starts_with(const char* s) const

+ 1 - 1
src/core/strings/string_stream.h

@@ -89,7 +89,7 @@ namespace string_stream
 
 	inline StringStream& operator<<(StringStream& s, const char* string)
 	{
-		array::push(s, string, strlen(string));
+		array::push(s, string, (uint32_t)strlen(string));
 		return s;
 	}
 

+ 1 - 1
src/lua/lua_stack.h

@@ -176,7 +176,7 @@ struct LuaStack
 
 	int get_int(int i)
 	{
-		return CHECKINTEGER(L, i);
+		return (int)CHECKINTEGER(L, i);
 	}
 
 	StringId32 get_string_id(int i)