[commit] r2708 - in trunk/GME: Common ConstraintManager Core GMEActiveBrowser Gme Mga MgaUtil ObjectInspector Parser Search

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Mon Oct 30 15:58:21 CDT 2017


Author: ksmyth
Date: Mon Oct 30 15:58:21 2017
New Revision: 2708

Log:
Fix some narrowing conversion warnings

Modified:
   trunk/GME/Common/CommonCollection.h
   trunk/GME/Common/CommonSmart.cpp
   trunk/GME/Common/CommonSmart.h
   trunk/GME/Common/CommonStl.h
   trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp
   trunk/GME/Core/CoreBinFile.cpp
   trunk/GME/GMEActiveBrowser/AggregateContextMenu.cpp
   trunk/GME/GMEActiveBrowser/AggregateTreeCtrl.cpp
   trunk/GME/GMEActiveBrowser/MetaTreeCtrl.cpp
   trunk/GME/Gme/AspectSyncDlg.cpp
   trunk/GME/Gme/GMEApp.cpp
   trunk/GME/Gme/GMEOLEColl.cpp
   trunk/GME/Gme/GMEOLEData.cpp
   trunk/GME/Gme/GmePrintDialog.h
   trunk/GME/Gme/GuiMeta.cpp
   trunk/GME/Mga/MgaFCO.cpp
   trunk/GME/Mga/MgaFolder.cpp
   trunk/GME/Mga/MgaLibRefr.cpp
   trunk/GME/MgaUtil/AnnotationBrowserDlg.cpp
   trunk/GME/MgaUtil/CompDlg.cpp
   trunk/GME/MgaUtil/MetaPurgeDialog.cpp
   trunk/GME/MgaUtil/MgaResolver.cpp
   trunk/GME/MgaUtil/RegistryBrowserDlg.cpp
   trunk/GME/MgaUtil/RegistryTree.cpp
   trunk/GME/ObjectInspector/Attribute.cpp
   trunk/GME/ObjectInspector/InPlaceManager.cpp
   trunk/GME/Parser/GenParser.cpp
   trunk/GME/Parser/MgaDumper.cpp
   trunk/GME/Search/ComHelp.cpp

Modified: trunk/GME/Common/CommonCollection.h
==============================================================================
--- trunk/GME/Common/CommonCollection.h	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Common/CommonCollection.h	Mon Oct 30 15:58:21 2017	(r2708)
@@ -289,7 +289,7 @@
 //start and index are 1-based, index is 0 if not found
 	STDMETHOD(Find)(ITFTYPE* pvar, long start, long *index) {
 
-		if(start == 0) start = m_coll.size();
+		if(start == 0) start = (long) m_coll.size();
 		else start--;
 		if((unsigned long)start > m_coll.size()) return E_FAIL;
 		if (pvar == NULL)
@@ -298,7 +298,7 @@
 		COLLTYPE::iterator iter = m_coll.begin()+start;
 		while (iter != m_coll.end()) {
 			if(pvar == *iter) {
-				*index = m_coll.begin() - iter + 1;
+				*index = (long)(m_coll.begin() - iter + 1);
 				return S_OK;
 			}
 			++iter;
@@ -311,7 +311,7 @@
 	STDMETHOD(Insert)(ITFTYPE* pvar, long pos) {
 		// this fuction must be supplied by the user for CollectionEx to compile
 		// extern HRESULT check_location_compatibility(ITFTYPE *newobj, ITFTYPE *oldobj);
-		if(pos == 0) pos = m_coll.size();
+		if(pos == 0) pos = (long)m_coll.size();
 		else pos--;
 		if((unsigned long)pos > m_coll.size()) return E_FAIL;
 		if (pvar == NULL)
@@ -331,7 +331,7 @@
 	}
 
 	STDMETHOD(Remove)(long pos) {
-		if(pos == 0) pos = m_coll.size();
+		if(pos == 0) pos = (long)m_coll.size();
 		else pos--;
 		if((unsigned long)pos > m_coll.size()) return E_FAIL;
 		GETALL_COPYTYPE::destroy(&(m_coll[0])+pos);

Modified: trunk/GME/Common/CommonSmart.cpp
==============================================================================
--- trunk/GME/Common/CommonSmart.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Common/CommonSmart.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -116,7 +116,7 @@
 	ASSERT( p != NULL && *p == NULL );
 	ASSERT( start <= end );
 
-	*p = SafeArrayCreateVector(VT_BSTR, 1, end - start);
+	*p = SafeArrayCreateVector(VT_BSTR, 1, (ULONG)(end - start));
 	if( *p == NULL )
 		HR_THROW(E_OUTOFMEMORY);
 
@@ -151,7 +151,7 @@
 	ASSERT( p != NULL && *p == NULL );
 	ASSERT( start <= end );
 
-	*p = SafeArrayCreateVector(VT_BSTR, 1, end - start);
+	*p = SafeArrayCreateVector(VT_BSTR, 1, (ULONG)(end - start));
 	if( *p == NULL )
 		HR_THROW(E_OUTOFMEMORY);
 
@@ -186,7 +186,7 @@
 	ASSERT( p != NULL && *p == NULL );
 	ASSERT( start <= end );
 
-	*p = SafeArrayCreateVector(VT_UI1, 1, end - start);
+	*p = SafeArrayCreateVector(VT_UI1, 1, (ULONG)(end - start));
 	if( *p == NULL )
 		HR_THROW(E_OUTOFMEMORY);
 
@@ -222,7 +222,7 @@
 	ASSERT( p != NULL && *p == NULL );
 	ASSERT( start <= end );
 
-	*p = SafeArrayCreateVector(VT_I4, 1, end - start);
+	*p = SafeArrayCreateVector(VT_I4, 1, (ULONG)(end - start));
 	if( *p == NULL )
 		HR_THROW(E_OUTOFMEMORY);
 
@@ -258,7 +258,7 @@
 	ASSERT( start <= end );
 
 	SAFEARRAYBOUND bounds[2];
-	bounds[0].cElements = end - start;
+	bounds[0].cElements = (ULONG)(end - start);
 	bounds[0].lLbound = 1;
 	bounds[1].cElements = sizeof(GUID);
 	bounds[1].lLbound = 0;

Modified: trunk/GME/Common/CommonSmart.h
==============================================================================
--- trunk/GME/Common/CommonSmart.h	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Common/CommonSmart.h	Mon Oct 30 15:58:21 2017	(r2708)
@@ -427,7 +427,7 @@
 	template<> PutInBstr(const BSTR& a) : b(a) { }
 
 	template<> PutInBstr(const std::wstring& t) {
-		b.p = SysAllocStringLen(t.c_str(), t.length());
+		b.p = SysAllocStringLen(t.c_str(), (UINT)t.length());
 	}
 
 	operator BSTR () { return b; }

Modified: trunk/GME/Common/CommonStl.h
==============================================================================
--- trunk/GME/Common/CommonStl.h	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Common/CommonStl.h	Mon Oct 30 15:58:21 2017	(r2708)
@@ -24,10 +24,10 @@
 inline void CopyTo(BSTR b, std::string::iterator i, int l) {}
 inline void CopyTo(VARIANT &v, std::string::iterator i, int l) {}
 */
-inline void CopyTo(const std::string &s, BSTR *b) { CopyTo( s.c_str(), s.length(), b); }
-inline void CopyTo(const std::string &s, VARIANT *v) { CopyTo(s.c_str(), s.length(), v); }
-inline void CopyTo(const std::string &s, CComBstrObj &a) { CopyTo(s.c_str(), s.length(), a); }
-inline void CopyTo(const std::string &s, CComVariant &a) { CopyTo(s.c_str(), s.length(), a); }
+inline void CopyTo(const std::string &s, BSTR *b) { CopyTo( s.c_str(), (int)s.length(), b); }
+inline void CopyTo(const std::string &s, VARIANT *v) { CopyTo(s.c_str(), (int)s.length(), v); }
+inline void CopyTo(const std::string &s, CComBstrObj &a) { CopyTo(s.c_str(), (int)s.length(), a); }
+inline void CopyTo(const std::string &s, CComVariant &a) { CopyTo(s.c_str(), (int)s.length(), a); }
 
 inline void CopyTo(BSTR b, std::string &s)
 {

Modified: trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp
==============================================================================
--- trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/ConstraintManager/GMEConstraintBrowserDialog.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -543,7 +543,7 @@
 			else
 				iImNum = eType + 10;
 			HTREEITEM hItem = m_treeObjects.InsertItem( uiMask, OclCommonEx::Convert( strKind ), iImNum, iImNum, iImNumS << 12 , TVIS_STATEIMAGEMASK, NULL, TVI_ROOT, TVI_LAST );
-			m_treeObjects.SetItemData( hItem, ( DWORD ) hItem );
+			m_treeObjects.SetItemData( hItem, (DWORD_PTR) hItem );
 			m_mapH2ID.insert( MapH2ID::value_type( hItem, strKind ) );
 			m_mapID2H.insert( MapID2H::value_type( strKind, hItem ) );
 		}
@@ -592,7 +592,7 @@
 		UINT uiMask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT;
 		int iImNum = spConstraint->GetType();
 		HTREEITEM hItem = m_treeConstraints.InsertItem( uiMask, OclCommonEx::Convert( spConstraint->GetFullName() ), iImNum, iImNum, iImNumS << 12 , TVIS_STATEIMAGEMASK, NULL, TVI_ROOT, TVI_LAST );
-		m_treeConstraints.SetItemData( hItem, ( DWORD ) hItem );
+		m_treeConstraints.SetItemData( hItem, (DWORD_PTR) hItem );
 		if ( iImNumS == CSIMG_OK ) {
 			ConstraintVectorMap::iterator it = m_mapConstraints.find( spConstraint->GetContextType() );
 			if ( it == m_mapConstraints.end() )
@@ -625,7 +625,7 @@
 			int iImNum = vecConstraints[ i ]->GetType();
 			int iImNumS = ( vecConstraints[ i ]->GetLocation() != OclGme::ConstraintBase::CL_PROJECT && vecConstraints[ i ]->GetPriority() == 1 ) ? NS_CHECKED_DISABLED : NS_CHECKED;
 			HTREEITEM hCItem = m_treeObjects.InsertItem( uiMask, OclCommonEx::Convert( vecConstraints[ i ]->GetFullName() ), iImNum, iImNum, iImNumS << 12 , TVIS_STATEIMAGEMASK, NULL, hItem, TVI_LAST );
-			m_treeObjects.SetItemData( hCItem, ( DWORD ) hCItem );
+			m_treeObjects.SetItemData( hCItem, (DWORD_PTR)hCItem );
 		}
 		m_treeObjects.SETSTATE( hItem, (int) ( ( vecConstraints.size() == 0 ) ? NS_UNCHECKED_DISABLED : NS_CHECKED ) );
 
@@ -678,7 +678,7 @@
 		int iImNumS = NS_UNKNOWN;
 		UINT uiMask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT;
 		HTREEITEM hItem = m_treeObjects.InsertItem( uiMask, OclCommonEx::Convert( strName ), iImNum, iImNum, iImNumS << 12 , TVIS_STATEIMAGEMASK, NULL, hParent, TVI_LAST );
-		m_treeObjects.SetItemData( hItem, ( DWORD ) hItem );
+		m_treeObjects.SetItemData( hItem, (DWORD_PTR)hItem );
 		m_mapH2ID.insert( MapH2ID::value_type( hItem, OclCommonEx::Convert( strID ) ) );
 		m_mapID2H.insert( MapID2H::value_type( OclCommonEx::Convert( strID ), hItem ) );
 
@@ -689,7 +689,7 @@
 			int iImCNum = vecConstraints[ i ]->GetType();
 			int iImCNumS = NS_UNKNOWN;
 			HTREEITEM hCItem = m_treeObjects.InsertItem( uiMask, OclCommonEx::Convert( vecConstraints[ i ]->GetFullName() ), iImCNum, iImCNum, iImCNumS << 12 , TVIS_STATEIMAGEMASK, NULL, hItem, TVI_LAST );
-			m_treeObjects.SetItemData( hCItem, ( DWORD ) hCItem );
+			m_treeObjects.SetItemData( hCItem, (DWORD_PTR)hCItem );
 
 			// Determine state
 
@@ -915,7 +915,7 @@
 		else
 			iImNum = eType + 10;
 		HTREEITEM hItem = m_treeObjects.InsertItem( uiMask, OclCommonEx::Convert( strKind ), iImNum, iImNum, iImNumS << 12 , TVIS_STATEIMAGEMASK, NULL, TVI_ROOT, TVI_LAST );
-		m_treeObjects.SetItemData( hItem, ( DWORD ) hItem );
+		m_treeObjects.SetItemData( hItem, (DWORD_PTR)hItem );
 		m_mapH2ID.insert( MapH2ID::value_type( hItem, strKind ) );
 		m_mapID2H.insert( MapID2H::value_type( strKind, hItem ) );
 

Modified: trunk/GME/Core/CoreBinFile.cpp
==============================================================================
--- trunk/GME/Core/CoreBinFile.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Core/CoreBinFile.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -734,7 +734,7 @@
 {
 	ASSERT( ofs.is_open() );
 
-	int len = b.size();
+	int len = (int)b.size();
 	ASSERT( len >= 0 );
 	
 	write(len);

Modified: trunk/GME/GMEActiveBrowser/AggregateContextMenu.cpp
==============================================================================
--- trunk/GME/GMEActiveBrowser/AggregateContextMenu.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/GMEActiveBrowser/AggregateContextMenu.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -793,7 +793,7 @@
 	// will automatically destroy it
 	if(mnuInsertFolder.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertFolder.GetSafeHmenu(),_T("Insert &Folder"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertFolder.GetSafeHmenu(),_T("Insert &Folder"));
 		mnuInsertFolder.Detach();
 	}
 
@@ -868,28 +868,28 @@
 	// Append Atom
 	if(mnuInsertAtom.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertAtom.GetSafeHmenu(),_T("Insert &Atom"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertAtom.GetSafeHmenu(),_T("Insert &Atom"));
 		mnuInsertAtom.Detach();
 	}
 	
 	// Append Model
 	if(mnuInsertModel.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertModel.GetSafeHmenu(),_T("Insert &Model"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertModel.GetSafeHmenu(),_T("Insert &Model"));
 		mnuInsertModel.Detach();
 	}
 
 	// Append Reference
 	if(mnuInsertReference.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertReference.GetSafeHmenu(),_T("Insert &Reference"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertReference.GetSafeHmenu(),_T("Insert &Reference"));
 		mnuInsertReference.Detach();
 	}
 
 	// Append Set
 	if(mnuInsertSet.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertSet.GetSafeHmenu(),_T("Insert &Set"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertSet.GetSafeHmenu(),_T("Insert &Set"));
 		mnuInsertSet.Detach();
 	}
 
@@ -1014,28 +1014,28 @@
 	// Append Atom
 	if(mnuInsertAtom.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertAtom.GetSafeHmenu(),_T("Insert &Atom"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertAtom.GetSafeHmenu(),_T("Insert &Atom"));
 		mnuInsertAtom.Detach();
 	}
 	
 	// Append Model
 	if(mnuInsertModel.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertModel.GetSafeHmenu(),_T("Insert &Model"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertModel.GetSafeHmenu(),_T("Insert &Model"));
 		mnuInsertModel.Detach();
 	}
 
 	// Append Reference
 	if(mnuInsertReference.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertReference.GetSafeHmenu(),_T("Insert &Reference"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertReference.GetSafeHmenu(),_T("Insert &Reference"));
 		mnuInsertReference.Detach();
 	}
 
 	// Append Set
 	if(mnuInsertSet.GetMenuItemCount()!=NULL) 
 	{
-		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT)mnuInsertSet.GetSafeHmenu(),_T("Insert &Set"));
+		InsertMenu(ID_POPUP_INSERTIONS,MF_POPUP|MF_STRING,(UINT_PTR)mnuInsertSet.GetSafeHmenu(),_T("Insert &Set"));
 		mnuInsertSet.Detach();
 	}
 }

Modified: trunk/GME/GMEActiveBrowser/AggregateTreeCtrl.cpp
==============================================================================
--- trunk/GME/GMEActiveBrowser/AggregateTreeCtrl.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/GMEActiveBrowser/AggregateTreeCtrl.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -136,7 +136,7 @@
 	strObjectName.ReleaseBuffer();
 
 	// tvInsert.item.iImage = 0;
-	SetItemData(hItem,(DWORD)hItem);
+	SetItemData(hItem,(DWORD_PTR)hItem);
 	
 	CAggregateMgaObjectProxy ObjectProxy(pUnknown, otObjectType);
 	CAggregateMgaObjectProxy& insertedProxy = m_MgaMap.AddEntry(hItem, ObjectProxy);

Modified: trunk/GME/GMEActiveBrowser/MetaTreeCtrl.cpp
==============================================================================
--- trunk/GME/GMEActiveBrowser/MetaTreeCtrl.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/GMEActiveBrowser/MetaTreeCtrl.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -45,7 +45,7 @@
 		HTREEITEM hItem=CTreeCtrlEx::InsertItem(strObjectName,(int)otObjectType,(int)otObjectType,hParent,TVI_SORT);	
 		HTREEITEM hRefItem;
 		m_MgaMap.LookupTreeItem(pUnknown,hRefItem); // Search for the handle of the inserted element
-		SetItemData(hItem,(DWORD)hRefItem); // Set item data to reference that
+		SetItemData(hItem,(DWORD_PTR)hRefItem); // Set item data to reference that
 		return NULL;
 	}
 	else
@@ -53,7 +53,7 @@
 		HTREEITEM hItem=CTreeCtrlEx::InsertItem(strObjectName,(int)otObjectType,(int)otObjectType,hParent,TVI_SORT);	
 		CMgaObjectProxy ObjectProxy(pUnknown,otObjectType);
 		m_MgaMap.AddEntry(hItem,ObjectProxy);
-		SetItemData(hItem,(DWORD)0); // Set to zero if this is the first and hence no referenced element
+		SetItemData(hItem,(DWORD_PTR)0); // Set to zero if this is the first and hence no referenced element
 		return hItem;
 	}
 }

Modified: trunk/GME/Gme/AspectSyncDlg.cpp
==============================================================================
--- trunk/GME/Gme/AspectSyncDlg.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/AspectSyncDlg.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -75,14 +75,14 @@
 		CGuiMetaAspect *metaAspect = m_allAspects.GetNext(apos);
 		
 		int nItem = m_srcAspectCombo.AddString(metaAspect->name);
-		m_srcAspectCombo.SetItemData(nItem, (DWORD)metaAspect);
+		m_srcAspectCombo.SetItemData(nItem, (DWORD_PTR)metaAspect);
 
 		if (m_srcAspect == metaAspect) {
 			m_srcAspectCombo.SetCurSel(nItem);
 		}
 
 		nItem = m_dstAspectList.InsertItem(aspectCount++, metaAspect->name);
-		m_dstAspectList.SetItemData(nItem, (DWORD)metaAspect);
+		m_dstAspectList.SetItemData(nItem, (DWORD_PTR)metaAspect);
 		if (m_srcAspect != metaAspect) {
 			m_dstAspectList.SetItemState(nItem, LVIS_SELECTED, LVIS_SELECTED);
 		} else {

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/GMEApp.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -954,8 +954,8 @@
 
 
 		// Traversing  the plugins and interpreters
-		int plugins_size = min(plugins.GetSize(), ID_FILE_RUNPLUGIN_LAST - ID_FILE_RUNPLUGIN1);
-		int interpreters_size = min(interpreters.GetSize(), ID_FILE_INTERPRET_LAST - ID_FILE_INTERPRET1);
+		int plugins_size = min((int)plugins.GetSize(), ID_FILE_RUNPLUGIN_LAST - ID_FILE_RUNPLUGIN1);
+		int interpreters_size = min((int)interpreters.GetSize(), ID_FILE_INTERPRET_LAST - ID_FILE_INTERPRET1);
 		for(int i = 0; i < plugins_size + interpreters_size; ++i)
 		{
 			// Querying component name
@@ -1044,7 +1044,7 @@
 			ASSERT(succ == TRUE);
 
 			// Adding button
-			INT_PTR commandID = (i < plugins_size) ? ID_FILE_RUNPLUGIN1 + i : ID_FILE_INTERPRET1 + i - plugins_size;
+			UINT commandID = (i < plugins_size) ? ID_FILE_RUNPLUGIN1 + i : ID_FILE_INTERPRET1 + i - plugins_size;
 			CMFCToolBarButton toolBarButton(commandID, nIndex, componentName + '\n' + toolTip, TRUE);
 
 			VERIFY(componentBar.InsertButton(toolBarButton) != -1);

Modified: trunk/GME/Gme/GMEOLEColl.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEColl.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/GMEOLEColl.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -93,7 +93,7 @@
 LPUNKNOWN CGMEOLEColl::GetNewEnum()
 {
 	std::unique_ptr<CEnumVariant> pEnum(new CEnumVariant);
-	int nCount = m_ptrArray.GetSize();
+	int nCount = (int)m_ptrArray.GetSize();
 	std::unique_ptr<VARIANT[]> pContents(new VARIANT[nCount]);
 	int i;
 
@@ -124,7 +124,7 @@
 
 long CGMEOLEColl::GetCount()
 {
-	return m_ptrArray.GetSize();
+	return (long)m_ptrArray.GetSize();
 }
 
 LPDISPATCH CGMEOLEColl::GetItem(long nIndex)
@@ -150,7 +150,7 @@
 
 long CGMEOLEColl::Find(LPDISPATCH findValue)
 {
-	int nCount = m_ptrArray.GetSize();
+	int nCount = (int)m_ptrArray.GetSize();
 	for (int i = 0; i < nCount; ++i)
 	{
 		if (m_ptrArray.ElementAt(i) == findValue)

Modified: trunk/GME/Gme/GMEOLEData.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEData.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/GMEOLEData.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -116,7 +116,7 @@
 int CGMEDataDescriptor::GetCount()
 {
 	/* return (rects.GetCount() + annRects.GetCount()); */
-	return rects.GetCount(); 
+	return (int)rects.GetCount(); 
 }
 
 void CGMEDataDescriptor::Clean()

Modified: trunk/GME/Gme/GmePrintDialog.h
==============================================================================
--- trunk/GME/Gme/GmePrintDialog.h	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/GmePrintDialog.h	Mon Oct 30 15:58:21 2017	(r2708)
@@ -57,7 +57,7 @@
 		if (m_selasp == CUR_ASP)
 			return 1;
 		else
-			return m_selAspects.size();
+			return (int)m_selAspects.size();
 	}
 	bool HasHeader() {return m_noheader == FALSE;}
 	bool IsAutorotate() {return m_autorotate != FALSE;}

Modified: trunk/GME/Gme/GuiMeta.cpp
==============================================================================
--- trunk/GME/Gme/GuiMeta.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Gme/GuiMeta.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -677,7 +677,7 @@
 		CMenu& dmm = dm->GetMenu();
 		menu->InsertMenu(pos, MF_BYPOSITION | MF_POPUP |
 			(dm->GetCount() > 0 ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)),
-			(UINT)dmm.m_hMenu, label);
+			(UINT_PTR)dmm.m_hMenu, label);
 	}
 
 }

Modified: trunk/GME/Mga/MgaFCO.cpp
==============================================================================
--- trunk/GME/Mga/MgaFCO.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Mga/MgaFCO.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -910,7 +910,7 @@
 		SAFEARRAY *pVariantsArray = NULL;
 		SAFEARRAYBOUND rgsabound[1];
 		rgsabound[0].lLbound = 0;
-		rgsabound[0].cElements = modifications.size();
+		rgsabound[0].cElements = (ULONG)modifications.size();
 		pVariantsArray = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
 		for (LONG i=0; i<LONG(modifications.size()); i++) {
 			COMTHROW(SafeArrayPutElement(pVariantsArray, &i, &modifications[i]));

Modified: trunk/GME/Mga/MgaFolder.cpp
==============================================================================
--- trunk/GME/Mga/MgaFolder.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Mga/MgaFolder.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -531,8 +531,12 @@
 	// return false if both are not libraries
 	if ( s1.find("MGA=") == std::string::npos || s2.find("MGA=") == std::string::npos) return false;
 
-	int i1 = s1.length() - 1; while ( i1 >= 0 && s1[i1] != '\\' && s1[i1] != ':' && s1[i1] != '=') --i1; //int i1 = s1.rfind( '\\' || '=');
-	int i2 = s2.length() - 1; while ( i2 >= 0 && s2[i2] != '\\' && s2[i2] != ':' && s2[i2] != '=') --i2; //int i2 = s2.rfind( '\\' || '=');
+	int i1 = s1.length() - 1;
+	while ( i1 >= 0 && s1[i1] != '\\' && s1[i1] != ':' && s1[i1] != '=')
+		--i1; //int i1 = s1.rfind( '\\' || '=');
+	int i2 = s2.length() - 1;
+	while ( i2 >= 0 && s2[i2] != '\\' && s2[i2] != ':' && s2[i2] != '=')
+		--i2; //int i2 = s2.rfind( '\\' || '=');
 	
 	if ( i1 >= 0) s1 = s1.substr( i1 + 1, s1.length() - i1 - 1); 
 	if ( i2 >= 0) s2 = s2.substr( i2 + 1, s2.length() - i2 - 1);

Modified: trunk/GME/Mga/MgaLibRefr.cpp
==============================================================================
--- trunk/GME/Mga/MgaLibRefr.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Mga/MgaLibRefr.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -1951,7 +1951,7 @@
 									 , SET_CREALIST& p_sets, REF_CREALIST& p_refs)
 {
 	int targetlevel = 0;
-	unsigned int cnt = p_newComers.size();
+	unsigned int cnt = (unsigned int)p_newComers.size();
 	CoreObj rootp;
 	GetRootOfDeriv( p_adaptiveObj, rootp, &targetlevel);
 

Modified: trunk/GME/MgaUtil/AnnotationBrowserDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/AnnotationBrowserDlg.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/AnnotationBrowserDlg.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -125,7 +125,7 @@
 	ctrlSize = clientRect.Width();
 	m_wndAnnotationAspectList.InsertColumn(0, _T("Aspect"), LVCFMT_LEFT,  ctrlSize, -1);
 
-	DWORD dwStyle = ::SendMessage(m_wndAnnotationAspectList.GetSafeHwnd(),LVM_GETEXTENDEDLISTVIEWSTYLE,0,0);
+	LPARAM dwStyle = ::SendMessage(m_wndAnnotationAspectList.GetSafeHwnd(),LVM_GETEXTENDEDLISTVIEWSTYLE,0,0);
 	dwStyle |= LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES ;
 	::SendMessage(m_wndAnnotationAspectList.GetSafeHwnd(),LVM_SETEXTENDEDLISTVIEWSTYLE,0,dwStyle);
 

Modified: trunk/GME/MgaUtil/CompDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/CompDlg.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/CompDlg.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -89,7 +89,7 @@
 {
 	NMLISTVIEW *pLV = (NMLISTVIEW *) pNMHDR;
 	SortParam s = { this, pLV->iItem };
-	m_list.SortItemsEx(SortFunc, (DWORD)(void*)&s);
+	m_list.SortItemsEx(SortFunc, (DWORD_PTR)(void*)&s);
 	
 	*pResult = 0;
 }

Modified: trunk/GME/MgaUtil/MetaPurgeDialog.cpp
==============================================================================
--- trunk/GME/MgaUtil/MetaPurgeDialog.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/MetaPurgeDialog.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -171,6 +171,7 @@
 {
 	NMLISTVIEW *pLV = (NMLISTVIEW *) pNMHDR;
 	SortParam s = { this->m_list, pLV->iSubItem };
+	// FIXME x64: pointer may be truncated (but it is on the stack so we are probably ok)
 	m_list.SortItemsEx(SortFunc, (DWORD)(void*)&s);
 	
 	*pResult = 0;

Modified: trunk/GME/MgaUtil/MgaResolver.cpp
==============================================================================
--- trunk/GME/MgaUtil/MgaResolver.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/MgaResolver.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -1173,7 +1173,7 @@
 				} // eo for()
 				MGACOLL_ITERATE_END;
 
-                int dlgres = cdl.DoModal();
+                INT_PTR dlgres = cdl.DoModal();
                 if( dlgres == IDIGNORE )
                 {
                     *p = NULL;

Modified: trunk/GME/MgaUtil/RegistryBrowserDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/RegistryBrowserDlg.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/RegistryBrowserDlg.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -274,7 +274,7 @@
 		}
 
 		brNode->handle = (void*)hnd;
-		m_wndRegistryTree.SetItemData(hnd,(DWORD)brNode);
+		m_wndRegistryTree.SetItemData(hnd,(DWORD_PTR)brNode);
 		
 		int imageNum;
 		switch (brNode->status) {

Modified: trunk/GME/MgaUtil/RegistryTree.cpp
==============================================================================
--- trunk/GME/MgaUtil/RegistryTree.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/MgaUtil/RegistryTree.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -164,7 +164,7 @@
 	int imageNum;
 	dlg->m_imageMap.Lookup(IDI_ICON_REGHERE, imageNum);
 	newNode->handle = InsertItem(newNode->name, imageNum, imageNum, hItem, TVI_LAST);
-	SetItemData((HTREEITEM)newNode->handle, (DWORD) newNode);
+	SetItemData((HTREEITEM)newNode->handle, (DWORD_PTR) newNode);
 
 	dlg->m_nodes.AddTail(newNode);
     if (hItem)

Modified: trunk/GME/ObjectInspector/Attribute.cpp
==============================================================================
--- trunk/GME/ObjectInspector/Attribute.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/ObjectInspector/Attribute.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -330,14 +330,14 @@
 					CString strValue=CComBSTR(ccvtValue.bstrVal);
 					CStringArray strValueArray;
 					str_split(strValue, strValueArray);
-					int nLineNum = max(nLineNumMin, strValueArray.GetCount());
+					int nLineNum = max(nLineNumMin, (int)strValueArray.GetCount());
 					ListItem.Value.SetStringValue(strValueArray, nLineNum);
 
 					// Setting default value
 					CString strDefValue=CComBSTR(ccvtDefValue.bstrVal);
 					CStringArray strDefValueArray;
 					strDefValueArray.Add(strDefValue);
-					nLineNum = max(nLineNum, max(nLineNumMin, strDefValueArray.GetCount()));
+					nLineNum = max(nLineNum, max(nLineNumMin, (int)strDefValueArray.GetCount()));
 					ListItem.DefValue.SetStringValue(strDefValueArray, nLineNum);
 
 				}

Modified: trunk/GME/ObjectInspector/InPlaceManager.cpp
==============================================================================
--- trunk/GME/ObjectInspector/InPlaceManager.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/ObjectInspector/InPlaceManager.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -560,7 +560,7 @@
 		}break;
 	case ITEMDATA_FIXED_LIST:
 		{
-			rectWnd.bottom += min(ListItem.Value.stringVal.GetSize(), 8) 
+			rectWnd.bottom += min((long)ListItem.Value.stringVal.GetSize(), 8) 
 				* m_pInspectorList->m_ComboboxLineHeight + 2;
 			DisplayCombo(rectWnd);
 		}break;

Modified: trunk/GME/Parser/GenParser.cpp
==============================================================================
--- trunk/GME/Parser/GenParser.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Parser/GenParser.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -154,7 +154,7 @@
 	{
 		attributes_type attributes;
 
-		unsigned int len = attrlist.getLength();
+		unsigned int len = (unsigned int)attrlist.getLength();
 		for(unsigned int index = 0; index < len; index++)
 		{
 			attributes.push_back( std::pair<std::tstring,std::tstring>(

Modified: trunk/GME/Parser/MgaDumper.cpp
==============================================================================
--- trunk/GME/Parser/MgaDumper.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Parser/MgaDumper.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -319,7 +319,7 @@
 	elems.back().inbody = false;
 	elems.back().indata = false;
 
-	Indent(elems.size()-1);
+	Indent((int)elems.size()-1);
 	ofs << L'<' << name;
 }
 
@@ -381,7 +381,7 @@
 	if( elems.back().inbody )
 	{
 		if( !elems.back().indata )
-			Indent(elems.size()-1);
+			Indent((int)elems.size()-1);
 
 		ofs << L"</" << elems.back().name << L">\n";
 	}

Modified: trunk/GME/Search/ComHelp.cpp
==============================================================================
--- trunk/GME/Search/ComHelp.cpp	Mon Oct 30 15:58:13 2017	(r2707)
+++ trunk/GME/Search/ComHelp.cpp	Mon Oct 30 15:58:21 2017	(r2708)
@@ -58,7 +58,7 @@
 {
 	SAFEARRAY *psa;
 
-	psa = SafeArrayCreateVector(VT_UNKNOWN, 0, GetCount());
+	psa = SafeArrayCreateVector(VT_UNKNOWN, 0, (ULONG)GetCount());
 	ASSERT(psa);
 
 	IUnknown* *p;
@@ -132,7 +132,7 @@
 {
 	SAFEARRAY *psa;
 
-	psa = SafeArrayCreateVector(VT_BSTR, 0, source.GetCount());
+	psa = SafeArrayCreateVector(VT_BSTR, 0, (ULONG)source.GetCount());
 	ASSERT(psa);
 
 	BSTR *p;


More information about the gme-commit mailing list