Delete same() overloads that don't involve VM types
Don't really need these anymore now that we're not generating C++.
Esse commit está contido em:
@@ -89,10 +89,10 @@ inline bool more(CVarRef v1, CVarRef v2) { return v1.more(v2);}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// bool
|
||||
|
||||
inline bool same(bool v1, bool v2) { return v1 == v2;}
|
||||
inline bool same(bool v1, int v2) { return false;}
|
||||
inline bool same(bool v1, int64_t v2) { return false;}
|
||||
inline bool same(bool v1, double v2) { return false;}
|
||||
inline bool same(bool v1, bool v2) = delete;
|
||||
inline bool same(bool v1, int v2) = delete;
|
||||
inline bool same(bool v1, int64_t v2) = delete;
|
||||
inline bool same(bool v1, double v2) = delete;
|
||||
inline bool same(bool v1, const StringData *v2) { return false;}
|
||||
inline bool same(bool v1, CStrRef v2) { return false;}
|
||||
inline bool same(bool v1, litstr v2) { return false;}
|
||||
@@ -154,10 +154,10 @@ inline bool more(bool v1, CVarRef v2) { return less(v2,v1);}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// int
|
||||
|
||||
inline bool same(int v1, bool v2) { return same(v2, v1);}
|
||||
inline bool same(int v1, int v2) { return v1 == v2;}
|
||||
inline bool same(int v1, int64_t v2) { return v1 == v2;}
|
||||
inline bool same(int v1, double v2) { return (double)v1 == v2;}
|
||||
inline bool same(int v1, bool v2) = delete;
|
||||
inline bool same(int v1, int v2) = delete;
|
||||
inline bool same(int v1, int64_t v2) = delete;
|
||||
inline bool same(int v1, double v2) = delete;
|
||||
inline bool same(int v1, const StringData *v2) { return false;}
|
||||
inline bool same(int v1, CStrRef v2) { return false;}
|
||||
inline bool same(int v1, litstr v2) { return false;}
|
||||
@@ -220,10 +220,10 @@ inline bool more(int v1, CVarRef v2) { return less(v2, v1);}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// int64
|
||||
|
||||
inline bool same(int64_t v1, bool v2) { return same(v2, v1);}
|
||||
inline bool same(int64_t v1, int v2) { return same(v2, v1);}
|
||||
inline bool same(int64_t v1, int64_t v2) { return v1 == v2;}
|
||||
inline bool same(int64_t v1, double v2) { return (double)v1 == v2;}
|
||||
inline bool same(int64_t v1, bool v2) = delete;
|
||||
inline bool same(int64_t v1, int v2) = delete;
|
||||
inline bool same(int64_t v1, int64_t v2) = delete;
|
||||
inline bool same(int64_t v1, double v2) = delete;
|
||||
inline bool same(int64_t v1, const StringData *v2) { return false;}
|
||||
inline bool same(int64_t v1, CStrRef v2) { return false;}
|
||||
inline bool same(int64_t v1, litstr v2) { return false;}
|
||||
@@ -289,10 +289,10 @@ inline bool more(int64_t v1, CVarRef v2) { return less(v2, v1);}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// double
|
||||
|
||||
inline bool same(double v1, bool v2) { return same(v2, v1);}
|
||||
inline bool same(double v1, int v2) { return same(v2, v1);}
|
||||
inline bool same(double v1, int64_t v2) { return same(v2, v1);}
|
||||
inline bool same(double v1, double v2) { return v1 == v2;}
|
||||
inline bool same(double v1, bool v2) = delete;
|
||||
inline bool same(double v1, int v2) = delete;
|
||||
inline bool same(double v1, int64_t v2) = delete;
|
||||
inline bool same(double v1, double v2) = delete;
|
||||
inline bool same(double v1, const StringData *v2) { return false;}
|
||||
inline bool same(double v1, CStrRef v2) { return false;}
|
||||
inline bool same(double v1, litstr v2) { return false;}
|
||||
|
||||
@@ -546,7 +546,7 @@ Object c_ImageSprite::t_clear(CVarRef files /* = null */) {
|
||||
}
|
||||
|
||||
Object c_ImageSprite::t_loaddims(bool block /* = false */) {
|
||||
if (same(m_current, true)) {
|
||||
if (m_current) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ Object c_ImageSprite::t_loaddims(bool block /* = false */) {
|
||||
}
|
||||
|
||||
Object c_ImageSprite::t_loadimages(bool block /* = false */) {
|
||||
if (same(m_current, true)) {
|
||||
if (m_current) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -613,14 +613,14 @@ Object c_ImageSprite::t_loadimages(bool block /* = false */) {
|
||||
std::vector<ImageSprite::Block*>, \
|
||||
ImageSprite::BlockAreaComparator>
|
||||
|
||||
static const StaticString
|
||||
const StaticString
|
||||
s_x("x"),
|
||||
s_y("y"),
|
||||
s_images("images"),
|
||||
s_sprite("sprite");
|
||||
|
||||
void c_ImageSprite::map() {
|
||||
if (same(m_current, true)) {
|
||||
if (m_current) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ bool TestExtNetwork::test_fsockopen() {
|
||||
"Connection: Close\r\n"
|
||||
"\r\n");
|
||||
StringBuffer response;
|
||||
while (!same(f_feof(f), true)) {
|
||||
while (!f_feof(f)) {
|
||||
Variant line = f_fgets(f, 128);
|
||||
response.append(line.toString());
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ bool TestExtSocket::test_socket_close() {
|
||||
bool TestExtSocket::test_socket_strerror() {
|
||||
Variant s = f_socket_create(k_AF_INET, k_SOCK_STREAM, k_SOL_TCP);
|
||||
f_socket_bind(s, "127.0.0.1", 80);
|
||||
if (same(f_socket_last_error(s), 13)) {
|
||||
if (f_socket_last_error(s) == 13) {
|
||||
VS(f_socket_strerror(13), "Permission denied");
|
||||
f_socket_clear_error(s);
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário