]> granicus.if.org Git - php/commitdiff
this way it even compiles
authorHarald Radi <phanto@php.net>
Mon, 20 May 2002 15:38:19 +0000 (15:38 +0000)
committerHarald Radi <phanto@php.net>
Mon, 20 May 2002 15:38:19 +0000 (15:38 +0000)
#blame me if i did something wrong, i didn't test it ;)

sapi/activescript/classfactory.cpp
sapi/activescript/scriptengine.cpp

index 3d4f256db65b1b006a165ed9e3b65f05a2154694..7dd37424c766c06b1b59c4c6dc1f9018e8a7d7a2 100644 (file)
@@ -41,32 +41,32 @@ volatile LONG TPHPClassFactory::object_count = 0;
 TPHPClassFactory::TPHPClassFactory()
 {
        m_refcount = 1;
-       InterlockedIncrement(&factory_count);
+       InterlockedIncrement(const_cast<long*> (&factory_count));
 }
 
 TPHPClassFactory::~TPHPClassFactory()
 {
-       InterlockedDecrement(&factory_count);
+       InterlockedDecrement(const_cast<long*> (&factory_count));
 }
 
 void TPHPClassFactory::AddToObjectCount(void)
 {
-       InterlockedIncrement(&object_count);
+       InterlockedIncrement(const_cast<long*> (&object_count));
 }
 
 void TPHPClassFactory::RemoveFromObjectCount(void)
 {
-       InterlockedDecrement(&object_count);
+       InterlockedDecrement(const_cast<long*> (&object_count));
 }
 
 STDMETHODIMP_(DWORD) TPHPClassFactory::AddRef(void)
 {
-       return InterlockedIncrement(&m_refcount);
+       return InterlockedIncrement(const_cast<long*> (&m_refcount));
 }
 
 STDMETHODIMP_(DWORD) TPHPClassFactory::Release(void)
 {
-       DWORD ret = InterlockedDecrement(&m_refcount);
+       DWORD ret = InterlockedDecrement(const_cast<long*> (&m_refcount));
        if (ret == 0)
                delete this;
        return ret;
index b0dc40dcb52db17ce265d63d370648dc212154d1..8e1f92baaf4a5362e38bb4fc5ed0a1f0b7bf2893 100644 (file)
@@ -250,11 +250,11 @@ public:
        }
        
        STDMETHODIMP_(DWORD) AddRef(void) {
-               return InterlockedIncrement(&m_refcount);
+               return InterlockedIncrement(const_cast<long*> (&m_refcount));
        }
        
        STDMETHODIMP_(DWORD) Release(void) {
-               DWORD ret = InterlockedDecrement(&m_refcount);
+               DWORD ret = InterlockedDecrement(const_cast<long*> (&m_refcount));
                trace("%08x: IDispatchImpl: release ref count is now %d\n", this, ret);
                if (ret == 0)
                        delete this;
@@ -1286,12 +1286,12 @@ trace("Add %s to global namespace\n", name);
 
 STDMETHODIMP_(DWORD) TPHPScriptingEngine::AddRef(void)
 {
-       return InterlockedIncrement(&m_refcount);
+       return InterlockedIncrement(const_cast<long*> (&m_refcount));
 }
 
 STDMETHODIMP_(DWORD) TPHPScriptingEngine::Release(void)
 {
-       DWORD ret = InterlockedDecrement(&m_refcount);
+       DWORD ret = InterlockedDecrement(const_cast<long*> (&m_refcount));
        if (ret == 0) {
                trace("%08x: Release: zero refcount, destroy the engine!\n", this);
                delete this;
@@ -1305,9 +1305,9 @@ STDMETHODIMP TPHPScriptingEngine::QueryInterface(REFIID iid, void **ppvObject)
        
        if (IsEqualGUID(IID_IActiveScript, iid)) {
                *ppvObject = (IActiveScript*)this;
-       } else if (IsEqualGUID(IID_IActiveScriptParse32, iid)) {
-               *ppvObject = (IActiveScriptParse32*)this;
-       } else if (IsEqualGUID(IID_IActiveScriptParseProcedure32, iid)) {
+       } else if (IsEqualGUID(IID_IActiveScriptParse, iid)) {
+               *ppvObject = (IActiveScriptParse*)this;
+       } else if (IsEqualGUID(IID_IActiveScriptParseProcedure, iid)) {
                *ppvObject = (IActiveScriptParseProcedure*)this;
        } else if (IsEqualGUID(IID_IUnknown, iid)) {
                *ppvObject = this;      
@@ -1717,11 +1717,11 @@ public:
        }
        
        STDMETHODIMP_(DWORD) AddRef(void) {
-               return InterlockedIncrement(&m_refcount);
+               return InterlockedIncrement(const_cast<long*> (&m_refcount));
        }
        
        STDMETHODIMP_(DWORD) Release(void) {
-               DWORD ret = InterlockedDecrement(&m_refcount);
+               DWORD ret = InterlockedDecrement(const_cast<long*> (&m_refcount));
                trace("Release: errobj refcount=%d\n", ret);
                if (ret == 0)
                        delete this;