Skip to content

Commit c163521

Browse files
committed
BUG: VTKPolyDataMeshIO should use signed char for the CHAR cases
`VTKPolyDataMeshIO` originally casted the `buffer` to plain `char *` for component type `CHAR`. However, `CHAR` indicates that the component type is _signed_ char, whereas the default `char` might be unsigned. Follow-up to pull request #5470 commit 70fbb2b "BUG: MINCImageIO should use `signed char` for `CHAR` and `MI_TYPE_BYTE`"
1 parent 0f1f022 commit c163521

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/IO/MeshVTK/src/itkVTKPolyDataMeshIO.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ VTKPolyDataMeshIO::ReadMeshInformation()
828828
} \
829829
case IOComponentEnum::CHAR: \
830830
{ \
831-
function(param, static_cast<char *>(buffer)); \
831+
function(param, static_cast<signed char *>(buffer)); \
832832
break; \
833833
} \
834834
case IOComponentEnum::USHORT: \
@@ -1696,7 +1696,7 @@ VTKPolyDataMeshIO::WriteMeshInformation()
16961696
} \
16971697
case IOComponentEnum::CHAR: \
16981698
{ \
1699-
function(outputFile, static_cast<char *>(buffer), " char"); \
1699+
function(outputFile, static_cast<signed char *>(buffer), " char"); \
17001700
break; \
17011701
} \
17021702
case IOComponentEnum::USHORT: \
@@ -1819,8 +1819,8 @@ VTKPolyDataMeshIO::WritePoints(void * buffer)
18191819
} \
18201820
case IOComponentEnum::CHAR: \
18211821
{ \
1822-
UpdateCellInformation(static_cast<char *>(buffer)); \
1823-
function(outputFile, static_cast<char *>(buffer)); \
1822+
UpdateCellInformation(static_cast<signed char *>(buffer)); \
1823+
function(outputFile, static_cast<signed char *>(buffer)); \
18241824
break; \
18251825
} \
18261826
case IOComponentEnum::USHORT: \

0 commit comments

Comments
 (0)