From 2ac42558f2b6269ad4d8e0809519f96aae1fd342 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 15 Jan 2023 14:23:54 +0100 Subject: Add const qualifiers --- src/HalfMove.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/HalfMove.cpp') diff --git a/src/HalfMove.cpp b/src/HalfMove.cpp index 1375b25..8038acb 100644 --- a/src/HalfMove.cpp +++ b/src/HalfMove.cpp @@ -11,7 +11,7 @@ HalfMove::~HalfMove() { } } -std::string HalfMove::NestedDump(HalfMove *m, int indent) { +std::string HalfMove::NestedDump(const HalfMove *m, int indent) const{ std::stringstream ss; for (int i = 0; i < indent; i++) { @@ -33,11 +33,11 @@ std::string HalfMove::NestedDump(HalfMove *m, int indent) { return (ss.str()); } -std::string HalfMove::Dump() { return (NestedDump(this, 0)); } +std::string HalfMove::Dump() const { return (NestedDump(this, 0)); } -int HalfMove::GetLength() { +int HalfMove::GetLength() const { int length = 0; - HalfMove *m = this; + const HalfMove *m = this; while (m != NULL) { length++; m = m->MainLine; -- cgit v1.2.3