mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-25 05:06:59 +00:00
64-bit fixes
`int` values are not the same thing as `size_t` nor `ptrdiff_t`. Convert incorrect uses of `int` to more appropriate types. Fixes warnings for 64-bit compilations.
This commit is contained in:
parent
530e746daa
commit
bebadb9012
12
imgui.cpp
12
imgui.cpp
@ -397,9 +397,9 @@ static inline ImVec2 ImLerp(const ImVec2& a, const ImVec2& b, const ImVec2& t)
|
|||||||
static inline float ImLength(const ImVec2& lhs) { return sqrt(lhs.x*lhs.x + lhs.y*lhs.y); }
|
static inline float ImLength(const ImVec2& lhs) { return sqrt(lhs.x*lhs.x + lhs.y*lhs.y); }
|
||||||
|
|
||||||
static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int in_char); // return output UTF-8 bytes count
|
static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int in_char); // return output UTF-8 bytes count
|
||||||
static int ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
|
static ptrdiff_t ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end); // return output UTF-8 bytes count
|
||||||
static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
|
static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
|
||||||
static int ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
|
static ptrdiff_t ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end); // return input UTF-8 bytes count
|
||||||
|
|
||||||
static int ImStricmp(const char* str1, const char* str2)
|
static int ImStricmp(const char* str1, const char* str2)
|
||||||
{
|
{
|
||||||
@ -5515,7 +5515,7 @@ static int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end)
|
static ptrdiff_t ImTextStrFromUtf8(ImWchar* buf, size_t buf_size, const char* in_text, const char* in_text_end)
|
||||||
{
|
{
|
||||||
ImWchar* buf_out = buf;
|
ImWchar* buf_out = buf;
|
||||||
ImWchar* buf_end = buf + buf_size;
|
ImWchar* buf_end = buf + buf_size;
|
||||||
@ -5535,8 +5535,8 @@ static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int c)
|
|||||||
{
|
{
|
||||||
if (c)
|
if (c)
|
||||||
{
|
{
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
int n = (size_t)buf_size;
|
size_t n = buf_size;
|
||||||
if (c < 0x80)
|
if (c < 0x80)
|
||||||
{
|
{
|
||||||
if (i+1 > n) return 0;
|
if (i+1 > n) return 0;
|
||||||
@ -5575,7 +5575,7 @@ static int ImTextCharToUtf8(char* buf, size_t buf_size, unsigned int c)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
|
static ptrdiff_t ImTextStrToUtf8(char* buf, size_t buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
|
||||||
{
|
{
|
||||||
char* buf_out = buf;
|
char* buf_out = buf;
|
||||||
const char* buf_end = buf + buf_size;
|
const char* buf_end = buf + buf_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user