55//
66#include " CorLib.h"
77
8-
9- HRESULT Library_corlib_native_System_Delegate::Equals___BOOLEAN__OBJECT ( CLR_RT_StackFrame& stack )
8+ HRESULT Library_corlib_native_System_Delegate::Equals___BOOLEAN__OBJECT (CLR_RT_StackFrame &stack)
109{
1110 NATIVE_PROFILE_CLR_CORE ();
1211 NANOCLR_HEADER ();
1312
14- stack.SetResult_Boolean ( CLR_RT_HeapBlock::Compare_Unsigned_Values ( stack.Arg0 (), stack.Arg1 () ) == 0 );
13+ stack.SetResult_Boolean (CLR_RT_HeapBlock::Compare_Unsigned_Values (stack.Arg0 (), stack.Arg1 ()) == 0 );
1514
1615 NANOCLR_NOCLEANUP_NOLABEL ();
1716}
1817
1918#if (NANOCLR_REFLECTION == TRUE)
2019
21- HRESULT Library_corlib_native_System_Delegate::GetInvocationList___SZARRAY_SystemDelegate ( CLR_RT_StackFrame& stack )
20+ HRESULT Library_corlib_native_System_Delegate::GetInvocationList___SZARRAY_SystemDelegate (CLR_RT_StackFrame & stack)
2221{
2322 NATIVE_PROFILE_CLR_CORE ();
2423 NANOCLR_HEADER ();
@@ -32,124 +31,146 @@ HRESULT Library_corlib_native_System_Delegate::GetInvocationList___SZARRAY_Syste
3231 // put the return array on the stack
3332 CLR_RT_HeapBlock &top = stack.PushValueAndClear ();
3433
35- if (dlg) {
36- if (dlg->DataType () == DATATYPE_DELEGATELIST_HEAD) {
34+ if (dlg)
35+ {
36+ if (dlg->DataType () == DATATYPE_DELEGATELIST_HEAD)
37+ {
3738 delegatesCount = lst->m_length ;
38- } else {
39+ }
40+ else
41+ {
3942 delegatesCount = 1 ;
4043 }
4144 }
4245
4346 // create the result array
44- NANOCLR_CHECK_HRESULT (CLR_RT_HeapBlock_Array::CreateInstance (top, delegatesCount, g_CLR_RT_WellKnownTypes.m_Delegate ));
47+ NANOCLR_CHECK_HRESULT (
48+ CLR_RT_HeapBlock_Array::CreateInstance (top, delegatesCount, g_CLR_RT_WellKnownTypes.m_Delegate ));
4549
46- if (delegatesCount > 0 ) {
50+ if (delegatesCount > 0 )
51+ {
4752
4853 // get the pointer to the first element
4954 returnArray = (CLR_RT_HeapBlock *)top.DereferenceArray ()->GetFirstElement ();
50-
51- if (delegatesCount > 1 ) {
55+
56+ if (delegatesCount > 1 )
57+ {
5258 CLR_RT_HeapBlock *ptr = lst->GetDelegates ();
5359 // fill the array with the delegates
54- for (int i = 0 ; i < delegatesCount; i++) {
60+ for (int i = 0 ; i < delegatesCount; i++)
61+ {
5562
5663 // create an instance of delegate
57- NANOCLR_CHECK_HRESULT (g_CLR_RT_ExecutionEngine.NewObjectFromIndex (*returnArray, g_CLR_RT_WellKnownTypes.m_Delegate ));
64+ NANOCLR_CHECK_HRESULT (
65+ g_CLR_RT_ExecutionEngine.NewObjectFromIndex (*returnArray, g_CLR_RT_WellKnownTypes.m_Delegate ));
5866
59- // fetch delegate from list
67+ // fetch delegate from list
6068 dlg = ptr[i].DereferenceDelegate ();
61- // set delegate reference to return element
69+ // set delegate reference to return element
6270 returnArray->SetObjectReference (dlg);
6371
6472 returnArray++;
6573 }
66- } else {
74+ }
75+ else
76+ {
6777 // create an instance of delegate
68- NANOCLR_CHECK_HRESULT (g_CLR_RT_ExecutionEngine.NewObjectFromIndex (*returnArray, g_CLR_RT_WellKnownTypes.m_Delegate ));
69- // set delegate reference to return element
78+ NANOCLR_CHECK_HRESULT (
79+ g_CLR_RT_ExecutionEngine.NewObjectFromIndex (*returnArray, g_CLR_RT_WellKnownTypes.m_Delegate ));
80+ // set delegate reference to return element
7081 returnArray->SetObjectReference (dlg);
7182 }
7283 }
7384
7485 NANOCLR_NOCLEANUP ();
7586}
7687
77- HRESULT Library_corlib_native_System_Delegate::get_Method___SystemReflectionMethodInfo ( CLR_RT_StackFrame& stack )
88+ HRESULT Library_corlib_native_System_Delegate::get_Method___SystemReflectionMethodInfo (CLR_RT_StackFrame & stack)
7889{
7990 NATIVE_PROFILE_CLR_CORE ();
8091 NANOCLR_HEADER ();
8192
82- CLR_RT_HeapBlock_Delegate* dlg = stack.Arg0 ().DereferenceDelegate ();
93+ CLR_RT_HeapBlock_Delegate * dlg = stack.Arg0 ().DereferenceDelegate ();
8394
84- dlg = GetLastDelegate ( dlg ); if (!dlg) NANOCLR_SET_AND_LEAVE (CLR_E_WRONG_TYPE);
95+ dlg = GetLastDelegate (dlg);
96+ if (!dlg)
97+ NANOCLR_SET_AND_LEAVE (CLR_E_WRONG_TYPE);
8598
8699 {
87- CLR_RT_HeapBlock& top = stack.PushValue ();
88- CLR_RT_HeapBlock* hbObj;
89-
100+ CLR_RT_HeapBlock & top = stack.PushValue ();
101+ CLR_RT_HeapBlock * hbObj;
102+
90103 NANOCLR_CHECK_HRESULT (g_CLR_RT_ExecutionEngine.NewObjectFromIndex (top, g_CLR_RT_WellKnownTypes.m_MethodInfo ));
91104 hbObj = top.Dereference ();
92-
93- hbObj->SetReflection ( dlg->DelegateFtn () );
105+
106+ hbObj->SetReflection (dlg->DelegateFtn ());
94107 }
95108
96109 NANOCLR_NOCLEANUP ();
97110}
98111
99- HRESULT Library_corlib_native_System_Delegate::get_Target___OBJECT ( CLR_RT_StackFrame& stack )
112+ HRESULT Library_corlib_native_System_Delegate::get_Target___OBJECT (CLR_RT_StackFrame & stack)
100113{
101114 NATIVE_PROFILE_CLR_CORE ();
102115 NANOCLR_HEADER ();
103116
104- CLR_RT_HeapBlock_Delegate* dlg = stack.Arg0 ().DereferenceDelegate ();
117+ CLR_RT_HeapBlock_Delegate * dlg = stack.Arg0 ().DereferenceDelegate ();
105118
106- dlg = GetLastDelegate ( dlg ); if (!dlg) NANOCLR_SET_AND_LEAVE (CLR_E_WRONG_TYPE);
119+ dlg = GetLastDelegate (dlg);
120+ if (!dlg)
121+ NANOCLR_SET_AND_LEAVE (CLR_E_WRONG_TYPE);
107122
108123 {
109- stack.PushValueAndAssign ( dlg->m_object );
124+ stack.PushValueAndAssign (dlg->m_object );
110125 }
111126
112127 NANOCLR_NOCLEANUP ();
113128}
114129
115130#endif // NANOCLR_REFLECTION
116131
117- HRESULT Library_corlib_native_System_Delegate::Combine___STATIC__SystemDelegate__SystemDelegate__SystemDelegate ( CLR_RT_StackFrame& stack )
132+ HRESULT Library_corlib_native_System_Delegate::Combine___STATIC__SystemDelegate__SystemDelegate__SystemDelegate (
133+ CLR_RT_StackFrame &stack)
118134{
119135 NATIVE_PROFILE_CLR_CORE ();
120136 NANOCLR_HEADER ();
121137
122- NANOCLR_SET_AND_LEAVE (CLR_RT_HeapBlock_Delegate_List::Combine ( stack.PushValue (), stack.Arg0 (), stack.Arg1 (), false ));
138+ NANOCLR_SET_AND_LEAVE (
139+ CLR_RT_HeapBlock_Delegate_List::Combine (stack.PushValue (), stack.Arg0 (), stack.Arg1 (), false ));
123140
124141 NANOCLR_NOCLEANUP ();
125142}
126143
127- HRESULT Library_corlib_native_System_Delegate::Remove___STATIC__SystemDelegate__SystemDelegate__SystemDelegate ( CLR_RT_StackFrame& stack )
144+ HRESULT Library_corlib_native_System_Delegate::Remove___STATIC__SystemDelegate__SystemDelegate__SystemDelegate (
145+ CLR_RT_StackFrame &stack)
128146{
129147 NATIVE_PROFILE_CLR_CORE ();
130148 NANOCLR_HEADER ();
131149
132- NANOCLR_SET_AND_LEAVE (CLR_RT_HeapBlock_Delegate_List::Remove ( stack.PushValue (), stack.Arg0 (), stack.Arg1 () ));
150+ NANOCLR_SET_AND_LEAVE (CLR_RT_HeapBlock_Delegate_List::Remove (stack.PushValue (), stack.Arg0 (), stack.Arg1 ()));
133151
134152 NANOCLR_NOCLEANUP ();
135153}
136154
137- HRESULT Library_corlib_native_System_Delegate::op_Equality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate ( CLR_RT_StackFrame& stack )
155+ HRESULT Library_corlib_native_System_Delegate::op_Equality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate (
156+ CLR_RT_StackFrame &stack)
138157{
139158 NATIVE_PROFILE_CLR_CORE ();
140159 NANOCLR_HEADER ();
141160
142- NANOCLR_SET_AND_LEAVE (Library_corlib_native_System_Delegate::Equals___BOOLEAN__OBJECT ( stack ));
161+ NANOCLR_SET_AND_LEAVE (Library_corlib_native_System_Delegate::Equals___BOOLEAN__OBJECT (stack));
143162
144163 NANOCLR_NOCLEANUP ();
145164}
146165
147- HRESULT Library_corlib_native_System_Delegate::op_Inequality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate ( CLR_RT_StackFrame& stack )
166+ HRESULT Library_corlib_native_System_Delegate::op_Inequality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate (
167+ CLR_RT_StackFrame &stack)
148168{
149169 NATIVE_PROFILE_CLR_CORE ();
150170 NANOCLR_HEADER ();
151171
152- NANOCLR_CHECK_HRESULT (Library_corlib_native_System_Delegate::op_Equality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate ( stack ));
172+ NANOCLR_CHECK_HRESULT (
173+ Library_corlib_native_System_Delegate::op_Equality___STATIC__BOOLEAN__SystemDelegate__SystemDelegate (stack));
153174
154175 stack.NegateResult ();
155176
@@ -158,24 +179,24 @@ HRESULT Library_corlib_native_System_Delegate::op_Inequality___STATIC__BOOLEAN__
158179
159180// --//
160181
161- CLR_RT_HeapBlock_Delegate* Library_corlib_native_System_Delegate::GetLastDelegate ( CLR_RT_HeapBlock_Delegate* dlg )
182+ CLR_RT_HeapBlock_Delegate * Library_corlib_native_System_Delegate::GetLastDelegate (CLR_RT_HeapBlock_Delegate * dlg)
162183{
163184 NATIVE_PROFILE_CLR_CORE ();
164- if (dlg)
185+ if (dlg)
165186 {
166- if (dlg->DataType () == DATATYPE_DELEGATELIST_HEAD)
187+ if (dlg->DataType () == DATATYPE_DELEGATELIST_HEAD)
167188 {
168- CLR_RT_HeapBlock_Delegate_List* lst = (CLR_RT_HeapBlock_Delegate_List*)dlg;
189+ CLR_RT_HeapBlock_Delegate_List * lst = (CLR_RT_HeapBlock_Delegate_List *)dlg;
169190
170- if (lst->m_length == 0 )
191+ if (lst->m_length == 0 )
171192 {
172193 dlg = NULL ;
173194 }
174195 else
175196 {
176- CLR_RT_HeapBlock* ptr = lst->GetDelegates ();
197+ CLR_RT_HeapBlock * ptr = lst->GetDelegates ();
177198
178- dlg = ptr[ lst->m_length - 1 ].DereferenceDelegate ();
199+ dlg = ptr[lst->m_length - 1 ].DereferenceDelegate ();
179200 }
180201 }
181202 }
0 commit comments