From c6c9c82f960a68aec32bef2e5773d2342c6bdce2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 3 Feb 2021 21:13:54 -0500 Subject: [PATCH] ID strings are immutable, so make them const char * arguments --- src/USER-VTK/dump_vtk.cpp | 9 +++++---- src/USER-VTK/dump_vtk.h | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 92981c98ff..8b970820d2 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -24,6 +24,7 @@ #include "dump_vtk.h" +#include "arg_info.h" #include "atom.h" #include "compute.h" #include "domain.h" @@ -1908,7 +1909,7 @@ void DumpVTK::identify_vectors() if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_compute(char *id) +int DumpVTK::add_compute(const char *id) { int icompute; for (icompute = 0; icompute < ncompute; icompute++) @@ -1933,7 +1934,7 @@ int DumpVTK::add_compute(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_fix(char *id) +int DumpVTK::add_fix(const char *id) { int ifix; for (ifix = 0; ifix < nfix; ifix++) @@ -1958,7 +1959,7 @@ int DumpVTK::add_fix(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_variable(char *id) +int DumpVTK::add_variable(const char *id) { int ivariable; for (ivariable = 0; ivariable < nvariable; ivariable++) @@ -1987,7 +1988,7 @@ int DumpVTK::add_variable(char *id) if already in list, do not add, just return index, else add to list ------------------------------------------------------------------------- */ -int DumpVTK::add_custom(char *id, int flag) +int DumpVTK::add_custom(const char *id, int flag) { int icustom; for (icustom = 0; icustom < ncustom; icustom++) diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index 28fcca78d6..9d46571d23 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -81,10 +81,10 @@ class DumpVTK : public DumpCustom { int parse_fields(int, char **); void identify_vectors(); - int add_compute(char *); - int add_fix(char *); - int add_variable(char *); - int add_custom(char *, int); + int add_compute(const char *); + int add_fix(const char *); + int add_variable(const char *); + int add_custom(const char *, int); virtual int modify_param(int, char **); typedef void (DumpVTK::*FnPtrHeader)(bigint);