From aa4bb4d2184111965ff5776539f49e08ab4e0481 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Sun, 16 Aug 2009 16:43:56 +0700 Subject: [PATCH] CheckAutoVariables: const modifier propagation. No functional change. --- src/checkautovariables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkautovariables.cpp b/src/checkautovariables.cpp index 3e75b3818..efa8b927f 100644 --- a/src/checkautovariables.cpp +++ b/src/checkautovariables.cpp @@ -84,7 +84,7 @@ void print(const Token *tok, int num) bool isTypeName(const Token *tok) { bool ret = false; - std::string _str(tok->str()); + const std::string _str(tok->str()); static const char * const type[] = {"case", "return", "delete", 0}; for (int i = 0; type[i]; i++) { @@ -302,7 +302,7 @@ void CheckAutoVariables::returnPointerToLocalArray() // Return pointer to local array variable.. if (Token::Match(tok, "return %var% ;")) { - unsigned int varid = tok->next()->varId(); + const unsigned int varid = tok->next()->varId(); if (varid > 0 && arrayVar.find(varid) != arrayVar.end()) { errorReturnPointerToLocalArray(tok);