Skip to content

Commit 3add721

Browse files
mikeblomeGitHubber17
authored andcommitted
Mb mfc formatting (#2292)
* fix formatting in mfc reference folder * fixed code formatting for all .cpp files * undid spacing on casts
1 parent dff7024 commit 3add721

File tree

258 files changed

+1057
-1060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+1057
-1060
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
CTypedPtrArray<CObArray, CPerson*> myArray;
1+
CTypedPtrArray<CObArray, CPerson *> myArray;
22

33
myArray.Add(new CPerson());
44
for (int i = 0; i < myArray.GetSize(); i++)
55
{
6-
CPerson* thePerson = myArray.GetAt(i);
6+
CPerson *thePerson = myArray.GetAt(i);
77
thePerson->AssertValid();
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CPerson* thePerson = myArray[i];
1+
CPerson *thePerson = myArray[i];
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
CTypedPtrList<CObList, CPerson*> myList;
1+
CTypedPtrList<CObList, CPerson *> myList;
22

33
myList.AddHead(new CPerson());
44
POSITION pos = myList.GetHeadPosition();
55
while (pos != NULL)
66
{
7-
CPerson* thePerson = myList.GetNext(pos);
7+
CPerson *thePerson = myList.GetNext(pos);
88
thePerson->AssertValid();
99
}

docs/mfc/codesnippet/CPP/accessing-all-members-of-a-collection_4.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
CMap<CString, LPCTSTR, CPerson*, CPerson*> myMap;
1+
CMap<CString, LPCTSTR, CPerson *, CPerson *> myMap;
22
CPerson myPerson;
33

44
myMap.SetAt(_T("Bill"), &myPerson);
55
POSITION pos = myMap.GetStartPosition();
66
while (pos != NULL)
77
{
8-
CPerson* pPerson;
8+
CPerson *pPerson;
99
CString string;
1010
// Get key (string) and value (pPerson)
1111
myMap.GetNextAssoc(pos, string, pPerson);
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
CMapStringToOb myMap; // A nontemplate collection class
1+
CMapStringToOb myMap; // A nontemplate collection class
22
CPerson myPerson;
33
myMap.SetAt(_T("Bill"), &myPerson);
44

55
POSITION pos = myMap.GetStartPosition();
66
while (pos != NULL)
77
{
8-
CPerson* pPerson;
8+
CPerson *pPerson;
99
CString string;
1010
// Gets key (string) and value (pPerson)
11-
myMap.GetNextAssoc(pos, string,
12-
(CObject * &)pPerson);
13-
ASSERT(pPerson->IsKindOf(
14-
RUNTIME_CLASS(CPerson)));
15-
// Use string and pPerson
11+
myMap.GetNextAssoc(pos, string, (CObject *&)pPerson);
12+
ASSERT(pPerson->IsKindOf(RUNTIME_CLASS(CPerson)));
13+
// Use string and pPerson ...
1614
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CRuntimeClass* pClass = RUNTIME_CLASS(CObject);
1+
CRuntimeClass *pClass = RUNTIME_CLASS(CObject);

docs/mfc/codesnippet/CPP/accessing-run-time-class-information_3.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ void MemoryCorruptingSnippet(bool bCorrupt)
66
{
77
if (bCorrupt)
88
{
9-
CAge* pcage = new CAge(21); // CAge is derived from CObject.
10-
Age* page = new Age(22); // Age is NOT derived from CObject.
11-
*(((char*)pcage) - 1) = 99; // Corrupt preceding guard byte
12-
*(((char*)page) - 1) = 99; // Corrupt preceding guard byte
9+
CAge *pcage = new CAge(21); // CAge is derived from CObject.
10+
Age *page = new Age(22); // Age is NOT derived from CObject.
11+
*(((char *)pcage) - 1) = 99; // Corrupt preceding guard byte
12+
*(((char *)page) - 1) = 99; // Corrupt preceding guard byte
1313
AfxCheckMemory();
1414
}
1515
}
1616

1717
void SomeFunction(void)
1818
{
19-
CObject* pMyObject = new CPerson;
19+
CObject *pMyObject = new CPerson;
2020

2121
if (NULL != pMyObject &&
22-
pMyObject->IsKindOf(RUNTIME_CLASS(CPerson)))
22+
pMyObject->IsKindOf(RUNTIME_CLASS(CPerson)))
2323
{
2424
//if IsKindOf is true, then cast is all right
25-
CPerson* pmyPerson = (CPerson*)pMyObject;
25+
CPerson *pmyPerson = (CPerson *)pMyObject;
2626
pmyPerson->AssertValid();
2727
// other code goes here...
2828
}

docs/mfc/codesnippet/CPP/accessing-the-embedded-month-calendar-control_1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ void CMyDialog::OnDtnDropdownDatetimepicker1(NMHDR *pNMHDR, LRESULT *pResult)
33
UNREFERENCED_PARAMETER(pNMHDR);
44

55
//set the background color of the month to gray
6-
COLORREF clr= RGB(100, 100, 100);
6+
COLORREF clr = RGB(100, 100, 100);
77

88
m_DateTimeCtrl.SetMonthCalColor(MCSC_MONTHBK, clr);
99

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
//create and initialize the font to be used
3-
LOGFONT logFont = { 0 };
3+
LOGFONT logFont = {0};
44
logFont.lfHeight = -12;
55
logFont.lfWeight = FW_NORMAL;
66
logFont.lfCharSet = DEFAULT_CHARSET;
77
_tcscpy_s(logFont.lfFaceName, _countof(logFont.lfFaceName),
8-
_T("Verdana"));
8+
_T("Verdana"));
99

1010
m_MonthCalFont.CreateFontIndirect(&logFont);
1111
m_DateTimeCtrl.SetMonthCalFont(m_MonthCalFont);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
BEGIN_EVENTSINK_MAP(CContainerDlg, CDialog)
2-
ON_EVENT(CContainerDlg, IDC_CIRCCTRL1, 1 /* ClickIn */, OnClickInCircctrl1,
3-
VTS_I4 VTS_I4)
2+
ON_EVENT(CContainerDlg, IDC_CIRCCTRL1, 1 /* ClickIn */, OnClickInCircctrl1,
3+
VTS_I4 VTS_I4)
44
END_EVENTSINK_MAP()

0 commit comments

Comments
 (0)