diff --git a/jdk/src/windows/native/sun/windows/Devices.h b/jdk/src/windows/native/sun/windows/Devices.h index e8324ce4c6c..748ded20a3f 100644 --- a/jdk/src/windows/native/sun/windows/Devices.h +++ b/jdk/src/windows/native/sun/windows/Devices.h @@ -54,7 +54,7 @@ static BOOL UpdateInstance(JNIEnv *env); InstanceAccess& operator=(const InstanceAccess&); InstanceAccess* operator&(); }; -friend InstanceAccess; +friend class InstanceAccess; private: Devices(int numElements); diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index 8fdef922369..b78a80272f2 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -173,7 +173,7 @@ extern JavaVM *jvm; // Platform encoding is Unicode (UTF-16), re-define JNU_ functions // to proper JNI functions. -#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast(x), static_cast(_tcslen(x))) +#define JNU_NewStringPlatform(env, x) env->NewString(reinterpret_cast(x), static_cast(_tcslen(x))) #define JNU_GetStringPlatformChars(env, x, y) reinterpret_cast(env->GetStringChars(x, y)) #define JNU_ReleaseStringPlatformChars(env, x, y) env->ReleaseStringChars(x, reinterpret_cast(y)) diff --git a/jdk/src/windows/native/sun/windows/awt_Debug.cpp b/jdk/src/windows/native/sun/windows/awt_Debug.cpp index 3d6c424dbf2..42e099bb599 100644 --- a/jdk/src/windows/native/sun/windows/awt_Debug.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Debug.cpp @@ -47,12 +47,21 @@ void * operator new(size_t size, const char * filename, int linenumber) { return ptr; } +void * operator new[](size_t size, const char * filename, int linenumber) { + void * ptr = DMem_AllocateBlock(size, filename, linenumber); + if (ptr == NULL) { + throw std::bad_alloc(); + } + + return ptr; +} + #if _MSC_VER >= 1200 void operator delete(void *ptr, const char*, int) { DASSERTMSG(FALSE, "This version of 'delete' should never get called!!!"); } #endif -void operator delete(void *ptr) { +void operator delete(void *ptr) throw() { DMem_FreeBlock(ptr); } diff --git a/jdk/src/windows/native/sun/windows/awt_Debug.h b/jdk/src/windows/native/sun/windows/awt_Debug.h index 9fc4ab6b7d3..729e652621a 100644 --- a/jdk/src/windows/native/sun/windows/awt_Debug.h +++ b/jdk/src/windows/native/sun/windows/awt_Debug.h @@ -48,11 +48,14 @@ }; extern void * operator new(size_t size, const char * filename, int linenumber); + extern void * operator new[](size_t size, const char * filename, int linenumber); + #if _MSC_VER >= 1200 /* VC 6.0 is more strict about enforcing matching placement new & delete */ extern void operator delete(void *ptr, const char*, int); #endif - extern void operator delete(void *ptr); + + extern void operator delete(void *ptr) throw(); extern void DumpClipRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); extern void DumpUpdateRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); diff --git a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp index 0e6148d058a..8eeeae5bc9e 100644 --- a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp @@ -650,7 +650,7 @@ UINT AwtDesktopProperties::GetIntegerParameter(UINT spi) { } void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setStringPropertyID, key, JNU_NewStringPlatform(GetEnv(), value)); @@ -658,7 +658,7 @@ void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { } void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setIntegerPropertyID, key, (jint)value); @@ -666,7 +666,7 @@ void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { } void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setBooleanPropertyID, key, value ? JNI_TRUE : JNI_FALSE); @@ -674,7 +674,7 @@ void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { } void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setColorPropertyID, key, GetRValue(value), GetGValue(value), @@ -726,7 +726,7 @@ void AwtDesktopProperties::SetFontProperty(HDC dc, int fontID, style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -744,7 +744,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon jint pointSize; jint style; - fontName = JNU_NewStringPlatform(GetEnv(), const_cast(font.lfFaceName)); + fontName = JNU_NewStringPlatform(GetEnv(), font.lfFaceName); #if 0 HDC hdc; @@ -767,7 +767,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -776,8 +776,8 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon } void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventName) { - jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); - jstring event = JNU_NewStringPlatform(GetEnv(), const_cast(winEventName)); + jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring event = JNU_NewStringPlatform(GetEnv(), winEventName); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setSoundPropertyID, key, event); diff --git a/jdk/src/windows/native/sun/windows/awt_TextArea.h b/jdk/src/windows/native/sun/windows/awt_TextArea.h index 27b7b004b97..19a44e7681b 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextArea.h +++ b/jdk/src/windows/native/sun/windows/awt_TextArea.h @@ -41,9 +41,6 @@ class AwtTextArea : public AwtTextComponent { - // inner classes - class OleCallback; - public: /* java.awt.TextArea fields ids */ @@ -89,6 +86,37 @@ public: static void _ReplaceText(void *param); protected: + + /***************************************************************** + * Inner class OleCallback declaration. + */ + class OleCallback : public IRichEditOleCallback { + public: + OleCallback(); + + STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj); + STDMETHODIMP_(ULONG) AddRef(); + STDMETHODIMP_(ULONG) Release(); + STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg); + STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe, + LPOLEINPLACEUIWINDOW FAR* ppipuiDoc, + LPOLEINPLACEFRAMEINFO pipfinfo); + STDMETHODIMP ShowContainerUI(BOOL fShow); + STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp); + STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj); + STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat, + DWORD reco, BOOL fReally, HGLOBAL hMetaPict); + STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode); + STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco, + LPDATAOBJECT *ppdataobj); + STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState, + LPDWORD pdwEffect); + STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj, + CHARRANGE FAR * pchrg, HMENU FAR * phmenu); + private: + ULONG m_refs; // Reference count + };//OleCallback class + INLINE static OleCallback& GetOleCallback() { return sm_oleCallback; } void EditSetSel(CHARRANGE &cr); void EditGetSel(CHARRANGE &cr); @@ -114,37 +142,6 @@ protected: static OleCallback sm_oleCallback; - /***************************************************************** - * Inner class OleCallback declaration. - */ - - class AwtTextArea::OleCallback : public IRichEditOleCallback { - public: - OleCallback(); - - STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj); - STDMETHODIMP_(ULONG) AddRef(); - STDMETHODIMP_(ULONG) Release(); - STDMETHODIMP GetNewStorage(LPSTORAGE FAR * ppstg); - STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME FAR * ppipframe, - LPOLEINPLACEUIWINDOW FAR* ppipuiDoc, - LPOLEINPLACEFRAMEINFO pipfinfo); - STDMETHODIMP ShowContainerUI(BOOL fShow); - STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pstg, LONG cp); - STDMETHODIMP DeleteObject(LPOLEOBJECT poleobj); - STDMETHODIMP QueryAcceptData(LPDATAOBJECT pdataobj, CLIPFORMAT *pcfFormat, - DWORD reco, BOOL fReally, HGLOBAL hMetaPict); - STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode); - STDMETHODIMP GetClipboardData(CHARRANGE *pchrg, DWORD reco, - LPDATAOBJECT *ppdataobj); - STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState, - LPDWORD pdwEffect); - STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT poleobj, - CHARRANGE FAR * pchrg, HMENU FAR * phmenu); - private: - ULONG m_refs; // Reference count - }; - }; #endif /* AWT_TEXTAREA_H */ diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.h b/jdk/src/windows/native/sun/windows/awt_Toolkit.h index 01219d610e2..74bdc3ee965 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.h +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.h @@ -110,7 +110,7 @@ class CriticalSection { private: const CriticalSection& critSec; }; - friend Lock; + friend class Lock; private: CRITICAL_SECTION rep;