Skip to content

Commit 62de672

Browse files
committed
[C++] Add const to buffer accessor within a message or fixed flyweight. Issue aeron-io#601.
1 parent c7f1ac7 commit 62de672

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ private CharSequence generateFixedFlyweightCode(final String className, final in
14271427
" {\n" +
14281428
" return m_offset;\n" +
14291429
" }\n\n" +
1430-
" char *buffer() SBE_NOEXCEPT\n" +
1430+
" const char * buffer() const SBE_NOEXCEPT\n" +
14311431
" {\n" +
14321432
" return m_buffer;\n" +
14331433
" }\n\n" +
@@ -1580,7 +1580,7 @@ private CharSequence generateMessageFlyweightCode(final String className, final
15801580
" {\n" +
15811581
" return sbePosition() - m_offset;\n" +
15821582
" }\n\n" +
1583-
" char *buffer() SBE_NOEXCEPT\n" +
1583+
" const char * buffer() SBE_NOEXCEPT\n" +
15841584
" {\n" +
15851585
" return m_buffer;\n" +
15861586
" }\n\n" +
@@ -1697,7 +1697,7 @@ private static void generateFieldMetaAttributeMethod(
16971697
final String semanticType = encoding.semanticType() == null ? "" : encoding.semanticType();
16981698

16991699
sb.append(String.format("\n" +
1700-
indent + " static const char *%sMetaAttribute(const ::sbe::MetaAttribute::Attribute metaAttribute)" +
1700+
indent + " static const char * %sMetaAttribute(const ::sbe::MetaAttribute::Attribute metaAttribute)" +
17011701
" SBE_NOEXCEPT\n" +
17021702
indent + " {\n" +
17031703
indent + " switch (metaAttribute)\n" +

0 commit comments

Comments
 (0)