-
Notifications
You must be signed in to change notification settings - Fork 6
CNLOADS upgrade #310
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
base: main
Are you sure you want to change the base?
CNLOADS upgrade #310
Conversation
src/CNLOADS.CPP
Outdated
@@ -3381,7 +3382,7 @@ RC RSYS::rs_EndSubhr() | |||
// verify RSYSRES_IVL_SUB layout at compile time | |||
// fixed sequence allows array access by rs_mode (see code below) | |||
// rsmHEAT/rsmCOOL/rsmOAV definitions must be consistent with member sequences. | |||
#define QZONECHK( m, oDif) static_assert( &((RSYSRES_IVL_SUB *)0)->m-&((RSYSRES_IVL_SUB *)0)->qhZoneSen == oDif, "Bad seq " #m) | |||
#define QZONECHK( m, oDif) assert( &((RSYSRES_IVL_SUB *)0)->m-&((RSYSRES_IVL_SUB *)0)->qhZoneSen == oDif && "Bad seq " #m) |
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.
assert() is runtime. static_assert() is compile time. This was deliberately coded to be a compile time check so the runtime cost is not incurred every subhour. Can a method be found that does the compile time check and is OK on all compilers?
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 can look for a replacement. I was worried if that would be a problem. The error that I got was that it was non-constant condition. non-constant condition for static assertion
.
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.
You could try &((const RSYSRES_IVL_SUB *)0)->m - &((const RSYSRES_IVL_SUB *)0)->qhZoneSen
That is, add consts.
src/CNLOADS.CPP
Outdated
@@ -6580,7 +6581,9 @@ RC XSURF::xs_ASHWAT() // subhour calcs for ASHWAT fenestration | |||
{ // shades closed | |||
xs_pFENAW[ 1]->fa_Subhr( min( fSC, 1.f), bDoFrm); | |||
} | |||
#ifdef _WIN32 |
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.
Why do this? Why not conditionally #define FPCHECK as needed for different platforms. E.g., #define it as nothing if suitable functionality cannot be found. Then you touch cnglob.h only, not every place FPCHECK is used.
Description
Updates CNLOADS to build at all platforms.
Changes:
*0
Replace the content in this section with:
Author Progress Checklist:
Reviewer Checklist: