Skip to content

Commit 0990c77

Browse files
committed
[C++]: for aeron-io#714. Use better constant for type than -1 and preserve behavior.
1 parent f8b59ef commit 0990c77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private static void generateGroupClassHeader(
226226
indent + " m_bufferLength = bufferLength;\n" +
227227
indent + " m_blockLength = dimensions.blockLength();\n" +
228228
indent + " m_count = dimensions.numInGroup();\n" +
229-
indent + " m_index = -1;\n" +
229+
indent + " m_index = std::numeric_limits<std::uint64_t>::max();\n" +
230230
indent + " m_actingVersion = actingVersion;\n" +
231231
indent + " m_positionPtr = pos;\n" +
232232
indent + " *m_positionPtr = *m_positionPtr + %1$d;\n" +
@@ -260,7 +260,7 @@ private static void generateGroupClassHeader(
260260
indent + " %7$s dimensions(buffer, *pos, bufferLength, actingVersion);\n" +
261261
indent + " dimensions.blockLength((%1$s)%2$d);\n" +
262262
indent + " dimensions.numInGroup((%3$s)count);\n" +
263-
indent + " m_index = -1;\n" +
263+
indent + " m_index = std::numeric_limits<std::uint64_t>::max();\n" +
264264
indent + " m_count = count;\n" +
265265
indent + " m_blockLength = %2$d;\n" +
266266
indent + " m_actingVersion = actingVersion;\n" +

0 commit comments

Comments
 (0)