Gdcm update 2022 01 05#3042
Conversation
Code extracted from:
https://github.com/malaterre/GDCM.git
at commit 17ec5d668eca38e13a33555b6396de61a7125343 (release).
# By GDCM Upstream * upstream-GDCM: GDCM 2022-01-05 (17ec5d66)
|
This will fix some of the few remaining |
|
I guess we need to increase allowed file sizes here and here. While at it, we should probably clean up main |
|
Which exactly to update though? For example, one error message says |
|
Changes to the files I mentioned should be done before triggering the update. 300000 might be the default limit. |
|
Something is still confusing though:
Where is this maximum size 1048576 bytes from? The three files you mentioned have: and Both those number are already > 2336006 bytes. |
|
There's always the approach with reinterpret_cast return *reinterpret_cast<float *>(&Swap(*reinterpret_cast<uint32_t *>(&val))); |
Strictly speaking, that's UB too, which is why the memcpy dance is best. |
|
@Leengit see for example https://adriann.github.io/undefined_behavior.html |
@Leengit Definitely UB, but I guess it won't compile anyway, as it tries to take the address of a temporary 😸 I mean: the r-value returned by FYI https://godbolt.org/z/1j71M8e49 (gcc 11.2) says:
Update: just look here for a minute 😱😱: https://twitter.com/hankadusikova/status/1479391214659067906/photo/1 😸😸 |
|
As @issakomi mentions, we need a second template <>
inline float
SwapperNoOp::Swap<float>(float val)
{
uint32_t temp;
memcpy(&temp, &val, sizeof(uint32_t));
temp = Swap(temp);
memcpy(&val, &temp, sizeof(float));
return val;
} |
|
|
Just for completeness, looked what other libraries do, e.g. boost 1.77.0
And here in boost FAQ
SDL does exactly the same thing as in my example with union Looks like there is probably no general good solution at all (IEEE 754 floating-point standard does not specify endianness), there are also very special implementations. If the conversion is required a programmer has to find the best solution that works in particular case. |
|
A workable solution at the bottom that unfortunately would surely need changes to the code that calls it would be to not convert |
|
So this leaves figuring out the max sizes that @dzenanz and I were discussing... |
|
I guess I could just arbitrarily increase a few of them until CI is happy... |
|
Anyone know where |
|
Judging by this comment, |
|
And that would be this project https://gitlab.kitware.com/utils/ghostflow-director/-/tree/master/doc ? The word "hook" does not appear in any of the files in the docs folder: https://gitlab.kitware.com/utils/ghostflow-director/-/blob/master/doc/usage.md |
|
Thanks! And this |
|
FYI
Fortunately this could be fixed by removing a lot of white-space from itkMacro.h 😃 By clang-format |
|
|
|
OK thanks. So maybe this is what we need: malaterre/GDCM@ba4d34a |
|
OK that's now upstreamed, so maybe this will work: #3215 |
No description provided.