-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements in convert and format handling #1938
Conversation
Removed call to GetIntegerPart since it couldn't support UInt64 conversions and edit for invalid values. Wrote new string parse loop based on code that is being used for SUPPORT_ANY_BASE_CONVERSION. Moved some code so it could be used by both SUPPORT_ANY... and the radix 10/16 logic. Possible problem change in Double parsing - used pow() method to better generate the IEEE 574 compliant double in storage. pow() is considered to be slow, but without a more precise float multiplication the resulting double will not match what is used by the Roslyn compiler when creating and comparing doubles. Fixes #715
Cleaned up brackets in system convert to be consistent with rest of file. Added "signed" to char for cast operation - win32 treats char as signed, but gcc does not. Adding signed makes this un-ambiguous. Fix #715
Automated fixes for code style.
…c0f-9575-4847-8842-0c97899413f7 Code style fixes for nanoframework/nf-interpreter PR#1928
Unit tests of boxing/unboxing are expecting invalid cast exception. Code was returning generic System.Exception with HR of CLR_E_WRONG_TYPE. Changed code since invalid cast exception is more descriptive of the problem.
This reverts commit c29ea88.
Add a FormatException and edits for formatting of int and doubles. Fix #708
Win32 builds worked, but not ESP32 and STM32. Fixed (1) missing API in target cmake-variants.json; (2) moved location of <cerrno> declaration to allow it to be defined before redefines happen for "errno". Fix #708
Some code was simplified by combing the handling of both positive and negative results into one routine that checked for adjusting the sign at the end just before returning a value. Remove the code that was commented out now that all unit testing is complete. Fix #708
Removed call to GetIntegerPart since it couldn't support UInt64 conversions and edit for invalid values. Wrote new string parse loop based on code that is being used for SUPPORT_ANY_BASE_CONVERSION. Moved some code so it could be used by both SUPPORT_ANY... and the radix 10/16 logic. Possible problem change in Double parsing - used pow() method to better generate the IEEE 574 compliant double in storage. pow() is considered to be slow, but without a more precise float multiplication the resulting double will not match what is used by the Roslyn compiler when creating and comparing doubles. Fixes #715
Unit tests of boxing/unboxing are expecting invalid cast exception. Code was returning generic System.Exception with HR of CLR_E_WRONG_TYPE. Changed code since invalid cast exception is more descriptive of the problem.
Automated fixes for code style.
This reverts commit c29ea88.
Add a FormatException and edits for formatting of int and doubles. Fix #708
Win32 builds worked, but not ESP32 and STM32. Fixed (1) missing API in target cmake-variants.json; (2) moved location of <cerrno> declaration to allow it to be defined before redefines happen for "errno". Fix #708
Some code was simplified by combing the handling of both positive and negative results into one routine that checked for adjusting the sign at the end just before returning a value. Remove the code that was commented out now that all unit testing is complete. Fix #708
When compiled with devices that use LWIP for networking certain stdlib routines are required to be reentrant. Cleaned up a little left over formatting in nf_errors_exceptions.h Fix #708
Automated fixes for code style.
@edleno2 there are issues with the code style on the source files. Make sure to follow the project code style. Check the details here on how it works and the tools required to help you with that. |
…02b-9a25-4604-bbc0-010311b101e3 Code style fixes for nanoframework/nf-interpreter PR#1938
@@ -893,7 +893,7 @@ HRESULT CLR_RT_HeapBlock::PerformUnboxing(const CLR_RT_TypeDef_Instance &cls) | |||
|
|||
if (this->DataType() != DATATYPE_OBJECT) | |||
{ | |||
NANOCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these to be safe changes - the CLR_E_WRONG_TYPE returns a generic Exception type, so any try/catch in C# code will work the same. I could not find any instances of CPP code specifically looking for CLR_E_WRONG_TYPE - everything I could find was just setting the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Let's take those. If any changes are required in generics, I'll deal with those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!!
Automated fixes for code style.
@edleno2 there are issues with the code style on the source files. Make sure to follow the project code style. Check the details here on how it works and the tools required to help you with that. |
…11c-95bf-4d84-9de8-8fa8f2275231 Code style fixes for nanoframework/nf-interpreter PR#1938
Description
Motivation and Context
How Has This Been Tested?
Ran unit tests on Win32 with both SUPPORT_ANY_BASE_CONVERSION and without that, then ESP32-WROOM and STM32F429I-Discovery.
Screenshots
Types of changes
Checklist: