Changeset: 0f6e613ee580 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0f6e613ee580
Modified Files:
clients/Tests/exports.stable.out
common/options/monet_options.c
common/options/monet_options.h
tools/mserver/mserver5.c
Branch: Dec2023
Log Message:
mo_find_option returns string that should not be changed, so make it const.
diffs (75 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -570,7 +570,7 @@ void *mdlopen(const char *library, int m
const char *mercurial_revision(void) __attribute__((__const__));
int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name,
const char *value);
int mo_builtin_settings(opt **Set);
-char *mo_find_option(opt *set, int setlen, const char *name);
+const char *mo_find_option(opt *set, int setlen, const char *name);
void mo_free_options(opt *set, int setlen);
void mo_print_options(opt *set, int setlen);
int mo_system_config(opt **Set, int setlen);
@@ -720,7 +720,7 @@ const char *mcrypt_getHashAlgorithms(voi
char *mcrypt_hashPassword(const char *algo, const char *password, const char
*challenge);
int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name,
const char *value);
int mo_builtin_settings(opt **Set);
-char *mo_find_option(opt *set, int setlen, const char *name);
+const char *mo_find_option(opt *set, int setlen, const char *name);
void mo_free_options(opt *set, int setlen);
void mo_print_options(opt *set, int setlen);
int mo_system_config(opt **Set, int setlen);
diff --git a/common/options/monet_options.c b/common/options/monet_options.c
--- a/common/options/monet_options.c
+++ b/common/options/monet_options.c
@@ -87,7 +87,7 @@ mo_print_options(opt *set, int setlen)
}
-char *
+const char *
mo_find_option(opt *set, int setlen, const char *name)
{
opt *o = NULL;
@@ -105,7 +105,7 @@ mo_find_option(opt *set, int setlen, con
}
static int
-mo_config_file(opt **Set, int setlen, char *file)
+mo_config_file(opt **Set, int setlen, const char *file)
{
char buf[BUFSIZ];
FILE *fd = NULL;
@@ -197,7 +197,7 @@ mo_config_file(opt **Set, int setlen, ch
int
mo_system_config(opt **Set, int setlen)
{
- char *cfg;
+ const char *cfg;
if (Set == NULL) {
if (default_set == NULL) {
diff --git a/common/options/monet_options.h b/common/options/monet_options.h
--- a/common/options/monet_options.h
+++ b/common/options/monet_options.h
@@ -36,7 +36,7 @@ moptions_export void mo_print_options(op
/* mo_find_option, finds the option with the given name in the option set
(set,setlen). */
-moptions_export char *mo_find_option(opt *set, int setlen, const char *name);
+moptions_export const char *mo_find_option(opt *set, int setlen, const char
*name);
/* mo_system_config will add the options from the system config file
(returns the new setlen) */
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -194,7 +194,7 @@ monet_hello(void)
}
static str
-absolute_path(str s)
+absolute_path(const char *s)
{
if (!MT_path_absolute(s)) {
str ret = (str) GDKmalloc(strlen(s) + strlen(monet_cwd) + 2);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]