Skip to content

Commit 80605d7

Browse files
committed
Code style fixes
***NO_CI***
1 parent e2b1f6c commit 80605d7

File tree

2 files changed

+46
-40
lines changed

2 files changed

+46
-40
lines changed

src/CLR/CorLib/corlib_native_System_Reflection_ConstructorInfo.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//
66
#include "CorLib.h"
77

8-
9-
HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::GetCustomAttributes___SZARRAY_OBJECT__BOOLEAN( CLR_RT_StackFrame& stack )
8+
HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::GetCustomAttributes___SZARRAY_OBJECT__BOOLEAN(
9+
CLR_RT_StackFrame &stack)
1010
{
1111
NANOCLR_HEADER();
1212

@@ -15,31 +15,33 @@ HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::GetCustomAttrib
1515
NANOCLR_NOCLEANUP();
1616
}
1717

18-
HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::Invoke___OBJECT__SZARRAY_OBJECT( CLR_RT_StackFrame& stack )
18+
HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::Invoke___OBJECT__SZARRAY_OBJECT(
19+
CLR_RT_StackFrame &stack)
1920
{
2021
NATIVE_PROFILE_CLR_CORE();
2122
NANOCLR_HEADER();
2223

23-
CLR_RT_HeapBlock* thisRef = stack.ThisRef().Dereference();
24-
CLR_RT_MethodDef_Instance md;
25-
CLR_RT_HeapBlock_Array* pArray = stack.Arg1().DereferenceArray();
26-
CLR_RT_HeapBlock* args = NULL;
27-
int numArgs = 0;
24+
CLR_RT_HeapBlock *thisRef = stack.ThisRef().Dereference();
25+
CLR_RT_MethodDef_Instance md;
26+
CLR_RT_HeapBlock_Array *pArray = stack.Arg1().DereferenceArray();
27+
CLR_RT_HeapBlock *args = NULL;
28+
int numArgs = 0;
2829

29-
if(md.InitializeFromIndex( thisRef->ReflectionDataConst().m_data.m_method ) == false) NANOCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);
30+
if (md.InitializeFromIndex(thisRef->ReflectionDataConst().m_data.m_method) == false)
31+
NANOCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);
3032

31-
if(stack.m_customState == 0)
33+
if (stack.m_customState == 0)
3234
{
3335
stack.m_customState = 1;
3436

35-
if(pArray)
37+
if (pArray)
3638
{
37-
args = (CLR_RT_HeapBlock*)pArray->GetFirstElement();
39+
args = (CLR_RT_HeapBlock *)pArray->GetFirstElement();
3840
numArgs = pArray->m_numOfElements;
3941
}
4042

41-
NANOCLR_CHECK_HRESULT(stack.MakeCall( md, NULL, args, numArgs ));
42-
}
43+
NANOCLR_CHECK_HRESULT(stack.MakeCall(md, NULL, args, numArgs));
44+
}
4345

4446
NANOCLR_NOCLEANUP();
4547
}

src/CLR/CorLib/corlib_native_System_Reflection_RuntimeMethodInfo.cpp

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,59 @@
55
//
66
#include "CorLib.h"
77

8-
9-
HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::get_ReturnType___SystemType( CLR_RT_StackFrame& stack )
8+
HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::get_ReturnType___SystemType(CLR_RT_StackFrame &stack)
109
{
1110
NATIVE_PROFILE_CLR_CORE();
1211
NANOCLR_HEADER();
1312

1413
CLR_RT_MethodDef_Instance md;
15-
CLR_RT_SignatureParser parser;
16-
CLR_RT_TypeDescriptor desc;
17-
CLR_RT_HeapBlock* hbMeth = stack.Arg0().Dereference();
14+
CLR_RT_SignatureParser parser;
15+
CLR_RT_TypeDescriptor desc;
16+
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
1817

19-
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor( stack, *hbMeth, md ));
18+
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor(stack, *hbMeth, md));
2019

21-
parser.Initialize_MethodSignature( md.m_assm, md.m_target );
20+
parser.Initialize_MethodSignature(md.m_assm, md.m_target);
2221

23-
NANOCLR_CHECK_HRESULT(desc.InitializeFromSignatureParser( parser ));
22+
NANOCLR_CHECK_HRESULT(desc.InitializeFromSignatureParser(parser));
2423

2524
{
26-
CLR_RT_HeapBlock& top = stack.PushValue();
27-
CLR_RT_HeapBlock* hbObj;
28-
25+
CLR_RT_HeapBlock &top = stack.PushValue();
26+
CLR_RT_HeapBlock *hbObj;
27+
2928
NANOCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(top, g_CLR_RT_WellKnownTypes.m_TypeStatic));
3029
hbObj = top.Dereference();
31-
hbObj->SetReflection( desc.m_reflex );
30+
hbObj->SetReflection(desc.m_reflex);
3231
}
3332

3433
NANOCLR_NOCLEANUP();
3534
}
3635

37-
HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttributesNative___SZARRAY_OBJECT__BOOLEAN( CLR_RT_StackFrame& stack )
36+
HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttributesNative___SZARRAY_OBJECT__BOOLEAN(
37+
CLR_RT_StackFrame &stack)
3838
{
3939
NATIVE_PROFILE_CLR_CORE();
4040
NANOCLR_HEADER();
4141

42-
CLR_RT_HeapBlock* returnArray = NULL;
43-
CLR_RT_MethodDef_Instance methodDefinition;
44-
CLR_RT_HeapBlock* callerMethod;
42+
CLR_RT_HeapBlock *returnArray = NULL;
43+
CLR_RT_MethodDef_Instance methodDefinition;
44+
CLR_RT_HeapBlock *callerMethod;
4545
int count = 0;
4646

4747
// put the return array on the stack
48-
CLR_RT_HeapBlock& top = stack.PushValueAndClear();
48+
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
4949

5050
// get the caller method
5151
callerMethod = stack.Arg0().Dereference();
5252

53-
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor( stack, *callerMethod, methodDefinition ));
53+
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor(
54+
stack,
55+
*callerMethod,
56+
methodDefinition));
5457

5558
// setup attribute enumerator
5659
CLR_RT_AttributeEnumerator attributeEnumerator;
57-
attributeEnumerator.Initialize( methodDefinition );
60+
attributeEnumerator.Initialize(methodDefinition);
5861

5962
// the return array has two positions for each attribute:
6063
// 1st: the attribute type
@@ -64,7 +67,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttr
6467
do
6568
{
6669
// move to the next attribute in the collection, if any
67-
if(attributeEnumerator.Advance())
70+
if (attributeEnumerator.Advance())
6871
{
6972
count++;
7073
}
@@ -74,7 +77,8 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttr
7477

7578
// create the result array
7679
// (2 positions for each attribute)
77-
NANOCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance( top, ( count * 2 ), g_CLR_RT_WellKnownTypes.m_Object ));
80+
NANOCLR_CHECK_HRESULT(
81+
CLR_RT_HeapBlock_Array::CreateInstance(top, (count * 2), g_CLR_RT_WellKnownTypes.m_Object));
7882

7983
// use this to skip to the 2nd pass if no attribute was found
8084
if (count == 0)
@@ -83,18 +87,18 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttr
8387
}
8488

8589
// get the pointer to the first element
86-
returnArray = (CLR_RT_HeapBlock*)top.DereferenceArray()->GetFirstElement();
90+
returnArray = (CLR_RT_HeapBlock *)top.DereferenceArray()->GetFirstElement();
8791

8892
// reset attribute enumerator
89-
attributeEnumerator.Initialize( methodDefinition );
93+
attributeEnumerator.Initialize(methodDefinition);
9094

9195
break;
9296
}
93-
}
94-
while(true);
97+
} while (true);
9598

9699
// 2nd pass: fill the array with the attributes types, if any
97-
NANOCLR_CHECK_HRESULT( Library_corlib_native_System_RuntimeType::GetCustomAttributes( attributeEnumerator, returnArray, count ) );
100+
NANOCLR_CHECK_HRESULT(
101+
Library_corlib_native_System_RuntimeType::GetCustomAttributes(attributeEnumerator, returnArray, count));
98102

99103
NANOCLR_NOCLEANUP();
100104
}

0 commit comments

Comments
 (0)