Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 18, 2024
1 parent 9de3330 commit 93654ec
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/H5Tconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2898,12 +2898,11 @@ H5T__conv_enum_init(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, cons
* if the entry is unused.
*
* (This optimized algorithm doesn't work when the byte orders are different.
* The code such as "n = *((int *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * src_sh->size))));"
* can change the value significantly. i.g. if the source value is big-endian 0x0000000f,
* executing the casting on little-endian machine will get a big number 0x0f000000.
* Then it can't meet the condition
* "if (src_nmembs < 2 || ((double)length / (double)src_nmembs < (double)(1.2F)))"
* Because this is the optimized code, we won't fix it. It should still work in some
* The code such as "n = *((int *)((void *)((uint8_t *)src_sh->u.enumer.value + (i *
* src_sh->size))));" can change the value significantly. i.g. if the source value is big-endian
* 0x0000000f, executing the casting on little-endian machine will get a big number 0x0f000000. Then
* it can't meet the condition "if (src_nmembs < 2 || ((double)length / (double)src_nmembs <
* (double)(1.2F)))" Because this is the optimized code, we won't fix it. It should still work in some
* situations. SLU - 2011/5/24)
*/
if (1 == src_sh->size || sizeof(short) == src_sh->size || sizeof(int) == src_sh->size) {
Expand Down Expand Up @@ -3096,8 +3095,8 @@ H5T__conv_enum(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T
/* (The casting won't work when the byte orders are different. i.g. if the source value
* is big-endian 0x0000000f, the direct casting "n = *((int *)((void *)s));" will make
* it a big number 0x0f000000 on little-endian machine. But we won't fix it because it's
* an optimization code. Please also see the comment in the H5T__conv_enum_init() function.
* SLU - 2011/5/24)
* an optimization code. Please also see the comment in the H5T__conv_enum_init()
* function. SLU - 2011/5/24)
*/
if (1 == src_sh->size)
n = *((signed char *)s);
Expand Down

0 comments on commit 93654ec

Please sign in to comment.