cvs: php4 /sapi/activescript classfactory.cpp scriptengine.cpp
| From: | Harald Radi | Date: | Mon, 20 May 2002 15:38:19 +0000 |
| Subject: | cvs: php4 /sapi/activescript classfactory.cpp scriptengine.cpp | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12016@lists.php.net to get a copy of this message | ||
phanto Mon May 20 11:38:19 2002 EDT
Modified files:
/php4/sapi/activescript classfactory.cpp scriptengine.cpp
Log:
this way it even compiles
#blame me if i did something wrong, i didn't test it ;)
Index: php4/sapi/activescript/classfactory.cpp
diff -u php4/sapi/activescript/classfactory.cpp:1.1 php4/sapi/activescript/classfactory.cpp:1.2
--- php4/sapi/activescript/classfactory.cpp:1.1 Sun May 19 21:35:29 2002
+++ php4/sapi/activescript/classfactory.cpp Mon May 20 11:38:19 2002
@@ -15,7 +15,7 @@
| Authors: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: classfactory.cpp,v 1.1 2002/05/20 01:35:29 wez Exp $ */
+/* $Id: classfactory.cpp,v 1.2 2002/05/20 15:38:19 phanto Exp $ */
/* IClassFactory Implementation, and DllXXX function implementation */
@@ -41,32 +41,32 @@
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: php4/sapi/activescript/scriptengine.cpp
diff -u php4/sapi/activescript/scriptengine.cpp:1.1 php4/sapi/activescript/scriptengine.cpp:1.2
--- php4/sapi/activescript/scriptengine.cpp:1.1 Sun May 19 21:35:29 2002
+++ php4/sapi/activescript/scriptengine.cpp Mon May 20 11:38:19 2002
@@ -15,7 +15,7 @@
| Authors: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: scriptengine.cpp,v 1.1 2002/05/20 01:35:29 wez Exp $ */
+/* $Id: scriptengine.cpp,v 1.2 2002/05/20 15:38:19 phanto Exp $ */
/* Implementation Notes:
*
@@ -250,11 +250,11 @@
}
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 @@
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 @@
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 @@
}
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;