Fixed pointer conversion bug
This commit is contained in:
parent
ede7db738c
commit
3ca1c3314d
3 changed files with 16 additions and 1 deletions
|
|
@ -248,7 +248,7 @@ namespace ogfx
|
||||||
if (!font) font = m_font;
|
if (!font) font = m_font;
|
||||||
|
|
||||||
auto l_buildCacheKey = [&](void) -> String {
|
auto l_buildCacheKey = [&](void) -> String {
|
||||||
return String("").add(message).add(fontSize).add(reinterpret_cast<uintptr_t>(font));
|
return String("").add(message).add(fontSize).add(font);
|
||||||
};
|
};
|
||||||
|
|
||||||
String cacheKey = l_buildCacheKey();
|
String cacheKey = l_buildCacheKey();
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,13 @@ namespace ostd
|
||||||
return add(s);
|
return add(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String& String::add(const void* p, const String& prefix)
|
||||||
|
{
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << prefix << std::hex << std::uppercase << reinterpret_cast<uintptr_t>(p);
|
||||||
|
return add(stream.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//New String
|
//New String
|
||||||
|
|
@ -431,6 +438,12 @@ namespace ostd
|
||||||
return __str.add(f, precision);
|
return __str.add(f, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String String::new_add(const void* p, const String& prefix)
|
||||||
|
{
|
||||||
|
String __str = m_data;
|
||||||
|
return __str.add(p, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Utility
|
//Utility
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ namespace ostd
|
||||||
String& add(i64 i);
|
String& add(i64 i);
|
||||||
String& add(f32 f, u8 precision = 0);
|
String& add(f32 f, u8 precision = 0);
|
||||||
String& add(f64 f, u8 precision = 0);
|
String& add(f64 f, u8 precision = 0);
|
||||||
|
String& add(const void* p, const String& prefix = "0x");
|
||||||
|
|
||||||
//New String
|
//New String
|
||||||
String new_ltrim(void) const;
|
String new_ltrim(void) const;
|
||||||
|
|
@ -152,6 +153,7 @@ namespace ostd
|
||||||
String new_add(i64 i) const;
|
String new_add(i64 i) const;
|
||||||
String new_add(f32 f, u8 precision = 0) const;
|
String new_add(f32 f, u8 precision = 0) const;
|
||||||
String new_add(f64 f, u8 precision = 0) const;
|
String new_add(f64 f, u8 precision = 0) const;
|
||||||
|
String new_add(const void* p, const String& prefix = "0x");
|
||||||
|
|
||||||
//Utility
|
//Utility
|
||||||
i64 toInt(void) const;
|
i64 toInt(void) const;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue