Skip to content

Commit 54c7b8c

Browse files
committed
Remove request for consts
1 parent 2652ba2 commit 54c7b8c

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/libnml/nml/nml.cc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void NML::operator delete(void *nml_space)
170170
* later if the constructor returned before creating the objects
171171
* the pointers are intended to point at.
172172
******************************************************************/
173-
NML::NML(NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc, const char * const file,
173+
NML::NML(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc, const char *file,
174174
const int set_to_server, const int set_to_master)
175175
{
176176
registered_with_server = 0;
@@ -182,9 +182,11 @@ NML::NML(NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc,
182182
rtapi_strlcpy(bufname, buf, 40);
183183
rtapi_strlcpy(procname, proc, 40);
184184
if (NULL == file) {
185-
file = default_nml_config_file;
185+
rtapi_strlcpy(cfgfilename, default_nml_config_file, 160);
186+
}
187+
else {
188+
rtapi_strlcpy(cfgfilename, file, 160);
186189
}
187-
rtapi_strlcpy(cfgfilename, file, 160);
188190

189191
if (rcs_errors_printed >= max_rcs_errors_to_print
190192
&& max_rcs_errors_to_print > 0 && nml_reset_errors_printed) {
@@ -196,7 +198,7 @@ NML::NML(NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc,
196198
already_deleted = 0;
197199
channel_type = NML_GENERIC_CHANNEL_TYPE;
198200

199-
reconstruct(f_ptr, buf, proc, file, set_to_server, set_to_master);
201+
reconstruct(f_ptr, buf, proc, cfgfilename, set_to_server, set_to_master);
200202

201203
if (NULL != cms) {
202204
char *forced_type_eq = strstr(cms->buflineupper, "FORCE_TYPE=");
@@ -220,7 +222,7 @@ int NML::login(const char *name, const char *passwd)
220222
}
221223

222224
void NML::reconstruct(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
223-
const char *file, int set_to_server, int set_to_master)
225+
const char *file, const int set_to_server, const int set_to_master)
224226
{
225227

226228
cms = (CMS *) NULL;
@@ -252,8 +254,7 @@ void NML::reconstruct(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
252254
print_info(buf, proc, file);
253255
}
254256
if (NULL != cms) {
255-
rcs_print_debug(PRINT_NML_DESTRUCTORS, " delete (CMS *) %p;\n",
256-
cms);
257+
rcs_print_debug(PRINT_NML_DESTRUCTORS, " delete (CMS *) %p;\n", cms);
257258
delete cms;
258259
cms = (CMS *) NULL;
259260
}
@@ -337,8 +338,8 @@ void NML::reconstruct(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
337338
* the format_chain is constructed. (This may be done by
338339
* derived classes. )
339340
******************************************************************/
340-
NML::NML(const char *buf, const char *proc, const char *file, int set_to_server,
341-
int set_to_master)
341+
NML::NML(const char *buf, const char *proc, const char *file, const int set_to_server,
342+
const int set_to_master)
342343
{
343344
if (NULL == file) {
344345
file = default_nml_config_file;
@@ -456,7 +457,7 @@ NML::NML(const char *buf, const char *proc, const char *file, int set_to_server,
456457
* the format_chain is constructed. (This may be done by
457458
* derived classes. )
458459
******************************************************************/
459-
NML::NML(const char * const buffer_line, const char * const proc_line)
460+
NML::NML(const char * buffer_line, const char * proc_line)
460461
{
461462
registered_with_server = 0;
462463
cms_for_msg_string_conversions = 0;
@@ -602,7 +603,7 @@ void NML::register_with_server()
602603
* later if the constructor returned before creating the objects
603604
* the pointers are intended to point at.
604605
*************************************************************/
605-
NML::NML(NML * nml_ptr, int set_to_server, int set_to_master)
606+
NML::NML(NML * nml_ptr, const int set_to_server, const int set_to_master)
606607
{
607608
registered_with_server = 0;
608609
cms_for_msg_string_conversions = 0;

src/libnml/nml/nml.hh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ class NML:public virtual CMS_USER {
171171

172172
/* Constructors and destructors. */
173173
NML(NML_FORMAT_PTR f_ptr,
174-
const char * const, const char * const, const char * const, const int set_to_server = 0, const int set_to_master = 0);
174+
const char *, const char *, const char *, const int set_to_server = 0, const int set_to_master = 0);
175175
NML(NML *, const int set_to_server = 0, const int set_to_master = 0);
176-
NML(const char * const buffer_line, const char * const proc_line);
176+
NML(const char *buffer_line, const char *proc_line);
177177
virtual ~ NML();
178178
int reset();
179179

@@ -186,10 +186,10 @@ class NML:public virtual CMS_USER {
186186
int fast_mode;
187187
int *cms_status;
188188
long *cms_inbuffer_header_size;
189-
NML(const char *, const char *, const char *, int set_to_server = 0, int set_to_master =
189+
NML(const char *, const char *, const char *, const int set_to_server = 0, const int set_to_master =
190190
0);
191191
void reconstruct(NML_FORMAT_PTR, const char *, const char *, const char *,
192-
int set_to_server = 0, int set_to_master = 0);
192+
const int set_to_server = 0, const int set_to_master = 0);
193193

194194
int info_printed;
195195

0 commit comments

Comments
 (0)