esubtitle.h: fix compiler warnings
[enigma2.git] / lib / base / smartptr.h
index 6c3dbc2f0f9c6502a8df06e3f13c8caa311fb601..a2c6691f09097f2116b02cc4ef6e0b1957d7073d 100644 (file)
@@ -54,12 +54,13 @@ public:
                        ptr->Release();
        }
        
+#ifndef SWIG
        T* grabRef() { if (!ptr) return 0; ptr->AddRef(); return ptr; }
-       T* &ptrref() { assert(!ptr); return ptr; }
+       T* &ptrref() { ASSERT(!ptr); return ptr; }
+       operator bool() const { return !!this->ptr; }
+#endif
        T* operator->() const { ptrAssert(ptr); return ptr; }
        operator T*() const { return this->ptr; }
-       
-       operator bool() const { return !!this->ptr; }
 };
 
 
@@ -131,8 +132,10 @@ public:
                }
        }
        
+#ifndef SWIG
        T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; }
-       T* &ptrref() { assert(!ptr); return ptr; }
+       T* &ptrref() { ASSERT(!ptr); return ptr; }
+#endif
        T* operator->() const { ptrAssert(ptr); return ptr; }
        operator T*() const { return this->ptr; }
 };