-
-
Notifications
You must be signed in to change notification settings - Fork 178
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 #1936
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
Trying to find another way to use errno - the lwip library has overridden the functionality of errno processing and I'm not sure how to replace it AND have it work. I can fix the build, but then the unit tests fail when run on hardware. |
src/CLR/Core/CLR_RT_HeapBlock.cpp
Outdated
@@ -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); | |||
NANOCLR_SET_AND_LEAVE(CLR_E_INVALID_CAST); |
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.
Are we sure that it's safe to replace this exception? I'm asking because I recall this being used in the generics processing and not sure about the impact at this time... So, just asking.
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.
The current hResult of CLR_E_WRONG_TYPE generates a generic Exception, so any managed code doing a Catch (Exception ex) will continue to work. I could not find any references to the CLR_E_WRONG_TYPE in nanoCLR that was looking at that specific HR and acted different - i.e. all of the references were to setting that hResult. The invalid cast exception IS what is being returned in .net core in the same situation, so that led me to the change after checking if there were references to the old hr.
@edleno2 just rebased and fix some style issues. As I couldn't push to your fork, I've made this in branch "pr1936". |
@edleno2 just fixed the build issue with |
@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. |
@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. |
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
@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. |
Closing this PR - made a mess of it while trying to rebase. Will open a new one. |
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: