Make functions const correct.

- get_expanded_pathname
- print_log_n_stderr
- resoved_maxscale_conf_fname
This commit is contained in:
Johan Wikman
2016-02-11 10:43:39 +02:00
parent eac672421d
commit 000579814e

View File

@ -165,24 +165,24 @@ static bool file_write_header(FILE* outfile);
static bool file_write_footer(FILE* outfile); static bool file_write_footer(FILE* outfile);
static void write_footer(void); static void write_footer(void);
static int ntfw_cb(const char*, const struct stat*, int, struct FTW*); static int ntfw_cb(const char*, const struct stat*, int, struct FTW*);
static bool file_is_readable(char* absolute_pathname); static bool file_is_readable(const char* absolute_pathname);
static bool file_is_writable(char* absolute_pathname); static bool file_is_writable(const char* absolute_pathname);
bool handle_path_arg(char** dest, char* path, char* arg, bool rd, bool wr); bool handle_path_arg(char** dest, char* path, char* arg, bool rd, bool wr);
static void set_log_augmentation(const char* value); static void set_log_augmentation(const char* value);
static void usage(void); static void usage(void);
static char* get_expanded_pathname( static char* get_expanded_pathname(
char** abs_path, char** abs_path,
char* input_path, const char* input_path,
const char* fname); const char* fname);
static void print_log_n_stderr( static void print_log_n_stderr(
bool do_log, bool do_log,
bool do_stderr, bool do_stderr,
char* logstr, const char* logstr,
char* fprstr, const char* fprstr,
int eno); int eno);
static bool resolve_maxscale_conf_fname( static bool resolve_maxscale_conf_fname(
char** cnf_full_path, char** cnf_full_path,
char* home_dir, const char* home_dir,
char* cnf_file_arg); char* cnf_file_arg);
static char* check_dir_access(char* dirname, bool, bool); static char* check_dir_access(char* dirname, bool, bool);
@ -553,7 +553,7 @@ static bool file_write_header(FILE* outfile)
} }
static bool resolve_maxscale_conf_fname(char** cnf_full_path, static bool resolve_maxscale_conf_fname(char** cnf_full_path,
char* home_dir, const char* home_dir,
char* cnf_file_arg) char* cnf_file_arg)
{ {
bool succp = false; bool succp = false;
@ -720,8 +720,8 @@ retblock:
static void print_log_n_stderr( static void print_log_n_stderr(
bool do_log, /*< is printing to log enabled */ bool do_log, /*< is printing to log enabled */
bool do_stderr,/*< is printing to stderr enabled */ bool do_stderr,/*< is printing to stderr enabled */
char* logstr, /*< string to be printed to log */ const char* logstr, /*< string to be printed to log */
char* fprstr, /*< string to be printed to stderr */ const char* fprstr, /*< string to be printed to stderr */
int eno) /*< errno, if it is set, zero, otherwise */ int eno) /*< errno, if it is set, zero, otherwise */
{ {
char* log_err = "Error :"; char* log_err = "Error :";
@ -755,7 +755,7 @@ static void print_log_n_stderr(
* @param absolute_pathname Path of the file or directory to check * @param absolute_pathname Path of the file or directory to check
* @return True if file is readable * @return True if file is readable
*/ */
static bool file_is_readable(char* absolute_pathname) static bool file_is_readable(const char* absolute_pathname)
{ {
bool succp = true; bool succp = true;
@ -783,7 +783,7 @@ static bool file_is_readable(char* absolute_pathname)
* @param absolute_pathname Path of the file or directory to check * @param absolute_pathname Path of the file or directory to check
* @return True if file is writable * @return True if file is writable
*/ */
static bool file_is_writable(char* absolute_pathname) static bool file_is_writable(const char* absolute_pathname)
{ {
bool succp = true; bool succp = true;
@ -826,7 +826,7 @@ static bool file_is_writable(char* absolute_pathname)
* *
*/ */
static char* get_expanded_pathname(char** output_path, static char* get_expanded_pathname(char** output_path,
char* relative_path, const char* relative_path,
const char* fname) const char* fname)
{ {
char* cnf_file_buf = NULL; char* cnf_file_buf = NULL;