Ref: add operator==(), operator!=()

This commit is contained in:
josh committed 2014-06-23 15:07:19 -04:00
1 parent 8aff635d5f
commit 1d049b5f27
5 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ namespace jes
FT_Set_Pixel_Sizes(m_face, 0, size);
GlyphRef x_glyph = load_glyph('x');
if (x_glyph.is_null())
if (x_glyph == NULL)
{
std::cerr << "Could not load 'x' glyph from font" << fname << std::endl;
return false;
+2 -2
View File
@@ -15,7 +15,7 @@ namespace jes
/* Load failsafe font */
m_mono_font = load_font("FreeMono", 20);
if (m_mono_font.is_null())
if (m_mono_font == NULL)
{
std::cerr << "Error loading FreeMono font" << std::endl;
return false;
@@ -27,7 +27,7 @@ namespace jes
FontRef FontManager::load_font(const char * fname, size_t size)
{
PathRef font_path = Runtime::locate(Runtime::FONT, fname);
if (font_path.is_null())
if (font_path == NULL)
return NULL;
FontRef font = new Font();
+1 -1
View File
@@ -24,7 +24,7 @@ namespace jes
bool load(const char * fname);
unsigned int num_lines()
{
if (m_lines.is_null())
if (m_lines == NULL)
{
return 0u;
}
+2
View File
@@ -18,6 +18,8 @@ namespace jes
T & operator*() const { return *m_ptr; }
T * operator->() const { return m_ptr; }
bool is_null() const { return m_ptr == NULL; }
bool operator==(const T * ptr) { return m_ptr == ptr; }
bool operator!=(const T * ptr) { return m_ptr != ptr; }
private:
void clone_from(const Ref<T> & orig);
+1 -1
View File
@@ -38,7 +38,7 @@ namespace jes
break;
}
if ((!rv.is_null()) && (rv->exists()))
if ((rv != NULL) && (rv->exists()))
return rv;
return NULL;