[commit] r2811 - in trunk/GME: ConstraintManager XmlBackEnd

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Oct 5 08:23:56 CDT 2021


Author: ksmyth
Date: Tue Oct  5 08:23:56 2021
New Revision: 2811

Log:
Fix more sprintf formats (or args)

Modified:
   trunk/GME/ConstraintManager/OCLCommonEx.cpp
   trunk/GME/ConstraintManager/OCLContext.h
   trunk/GME/ConstraintManager/OCLGMEECFacade.cpp
   trunk/GME/ConstraintManager/OCLTree.cpp
   trunk/GME/XmlBackEnd/CoreXmlFile.cpp

Modified: trunk/GME/ConstraintManager/OCLCommonEx.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLCommonEx.cpp	Fri Oct  1 11:44:58 2021	(r2810)
+++ trunk/GME/ConstraintManager/OCLCommonEx.cpp	Tue Oct  5 08:23:56 2021	(r2811)
@@ -81,7 +81,7 @@
 			}
 			else if ( arrBounds.GetSize() == 1 ) {
 				int iMultiplicity = 0;
-				if ( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%ld"), &iMultiplicity ) != 1 ) {
+				if ( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%d"), &iMultiplicity ) != 1 ) {
 					bError = true;
 					break;
 				}
@@ -98,7 +98,7 @@
 				int iMultiplicityMin = 0;
 				int iMultiplicityMax = 0;
 
-				if( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%ld"), &iMultiplicityMin ) != 1 ) {
+				if( _stscanf_s( (LPCTSTR) arrBounds[ 0 ], _T("%d"), &iMultiplicityMin ) != 1 ) {
 					bError = true;
 					break;
 				}
@@ -111,7 +111,7 @@
 						bMultiple = true;
 				}
 
-				if( _stscanf_s( (LPCTSTR) arrBounds[ 1 ], _T("%ld"), &iMultiplicityMax ) != 1 ) {
+				if( _stscanf_s( (LPCTSTR) arrBounds[ 1 ], _T("%d"), &iMultiplicityMax ) != 1 ) {
 					if ( arrBounds[ 1 ] != _T("*") ) {
 						bError = true;
 						break;

Modified: trunk/GME/ConstraintManager/OCLContext.h
==============================================================================
--- trunk/GME/ConstraintManager/OCLContext.h	Fri Oct  1 11:44:58 2021	(r2810)
+++ trunk/GME/ConstraintManager/OCLContext.h	Tue Oct  5 08:23:56 2021	(r2811)
@@ -317,7 +317,7 @@
 					StateItemVector vecItems = m_vecContexts[ i ].GetState();
 					if ( i != 0 && vecItems[ 0 ].name == "self" ) {
 						char chBuffer[ 100 ];
-						sprintf_s( chBuffer, sizeof(chBuffer), "%lu", i + 1 );
+						sprintf_s( chBuffer, sizeof(chBuffer), "%u", i + 1 );
 						vecItems[ 0 ].name = "self - " + std::string( chBuffer );
 					}
 					for ( unsigned int j = 0 ; j < vecItems.size() ; j++ )

Modified: trunk/GME/ConstraintManager/OCLGMEECFacade.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLGMEECFacade.cpp	Fri Oct  1 11:44:58 2021	(r2810)
+++ trunk/GME/ConstraintManager/OCLGMEECFacade.cpp	Tue Oct  5 08:23:56 2021	(r2811)
@@ -198,7 +198,7 @@
 			std::string strType = OclCommonEx::GetObjectName( vecFCOs[ i ].p );
 			if ( strType.empty() ) {
 				char chNum[ 100 ];
-				sprintf_s( chNum, "%lu", i );
+				sprintf_s( chNum, "%u", i );
 				strType = "UntitledClass_" + std::string( chNum );
 			}
 			OclGme::SpConstraint pConstraint( new OclGme::Constraint( strType, spConstraint, bFieldsMandatory ) );

Modified: trunk/GME/ConstraintManager/OCLTree.cpp
==============================================================================
--- trunk/GME/ConstraintManager/OCLTree.cpp	Fri Oct  1 11:44:58 2021	(r2810)
+++ trunk/GME/ConstraintManager/OCLTree.cpp	Tue Oct  5 08:23:56 2021	(r2811)
@@ -1220,7 +1220,7 @@
 
 		if ( m_vecDeclarators.empty() ) {
 			char chBuffer[ 20 ];
-			sprintf_s( chBuffer, sizeof(chBuffer), "!iter%ld", context.m_vecImplicits.size() );
+			sprintf_s( chBuffer, sizeof(chBuffer), "!iter%zd", context.m_vecImplicits.size() );
 			m_vecDeclarators.push_back( std::string( chBuffer ) );
 			context.m_vecImplicits.push_back( std::string( chBuffer ) );
 		}
@@ -1431,7 +1431,7 @@
 		if ( ! m_vecArguments.empty() ) {
 			for ( unsigned int i = 0 ; i < m_vecArguments.size() ; i++ ) {
 				char chNum[ 100 ];
-				sprintf_s( chNum, sizeof(chNum), "%lu", i );
+				sprintf_s( chNum, sizeof(chNum), "%u", i );
 				strOut += strTabs + TABSTR + "<Argument_" + std::string( chNum ) + ">\r\n";
 				strOut += m_vecArguments[ i ]->Print( strTabs + TABSTR + TABSTR );
 				strOut += strTabs + TABSTR + "</Argument_" + std::string( chNum ) + ">\r\n";
@@ -1531,7 +1531,7 @@
 				TypeSeq vecType = m_pThisNode->m_vecType;
 				vecType.erase( vecType.begin() );
 				char chBuffer[ 20 ];
-				sprintf_s( chBuffer, sizeof(chBuffer), "!iter%lu", contextIterator.m_vecImplicits.size() );
+				sprintf_s( chBuffer, sizeof(chBuffer), "!iter%zu", contextIterator.m_vecImplicits.size() );
 				contextIterator.m_ctxTypes.AddVariable( std::string( chBuffer ), vecType, true );
 				contextIterator.m_vecImplicits.push_back( std::string( chBuffer ) );
 
@@ -1767,7 +1767,7 @@
 		if ( ! m_vecArguments.empty() ) {
 			for ( unsigned int i = 0 ; i < m_vecArguments.size() ; i++ ) {
 				char chNum[ 100 ];
-				sprintf_s( chNum, sizeof(chNum), "%lu", i );
+				sprintf_s( chNum, sizeof(chNum), "%u", i );
 				strOut += strTabs + TABSTR + "<Argument_" + std::string( chNum ) + ">\r\n";
 				strOut += m_vecArguments[ i ]->Print( strTabs + TABSTR + TABSTR );
 				strOut += strTabs + TABSTR + "</Argument_" + std::string( chNum ) + ">\r\n";
@@ -2219,9 +2219,9 @@
 							context.m_setDependencies.insert( OclMeta::Dependency( sigAttributeInner.Print(), m_mapPositions[ LID_FEATURE_NAME ] ) );
 						int iPiece = 0; char chBuffer[ 500 ];
 						std::string strDeclarator = "-" + m_strName;
-						sprintf_s( chBuffer, sizeof(chBuffer), "%ld", iPiece );
+						sprintf_s( chBuffer, sizeof(chBuffer), "%d", iPiece );
 						while ( context.m_ctxTypes.ExistsVariable( strDeclarator + std::string( chBuffer ) ) )
-							sprintf_s( chBuffer, sizeof(chBuffer), "%ld", ++iPiece );
+							sprintf_s( chBuffer, sizeof(chBuffer), "%d", ++iPiece );
 
 						VariableNode* pVariableNode = GetTreeManager()->CreateVariable();
 						pVariableNode->m_strName = strDeclarator + std::string( chBuffer );
@@ -2680,7 +2680,7 @@
 
 		for ( unsigned int i = 0 ; i < pNode->m_vecNodes.size() ; i++ ) {
 			char chNum[ 100 ];
-			sprintf_s( chNum, sizeof(chNum), "%lu", i );
+			sprintf_s( chNum, sizeof(chNum), "%u", i );
 			strOut += strTabs + TABSTR + "<Element_" + std::string( chNum ) + ">\r\n";
 			strOut += pNode->m_vecNodes[ i ]->Print( strTabs + TABSTR + TABSTR );
 			strOut += strTabs + TABSTR + "</Element_" + std::string( chNum ) + ">\r\n";

Modified: trunk/GME/XmlBackEnd/CoreXmlFile.cpp
==============================================================================
--- trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Fri Oct  1 11:44:58 2021	(r2810)
+++ trunk/GME/XmlBackEnd/CoreXmlFile.cpp	Tue Oct  5 08:23:56 2021	(r2811)
@@ -5257,7 +5257,7 @@
 	}
 	catch( hresult_exception& e)
 	{
-		char buff[200]; sprintf( buff, "Could not get \"%s\" file from source control. Exception code: 0x%x", fulllocalfname.c_str(), e.hr);
+		char buff[200]; sprintf( buff, "Could not get \"%s\" file from source control. Exception code: 0x%x", fulllocalfname.c_str(), (unsigned int)e.hr);
 		sendMsg( buff, MSG_ERROR);
 		return false;
 	}


More information about the gme-commit mailing list