add tons of const.
2008-09-04 Michael Natterer <mitch@gimp.org> * tools/gimptool.c: add tons of const. svn path=/trunk/; revision=26857
This commit is contained in:

committed by
Michael Natterer

parent
8fd8f8ffc0
commit
6570d5d19b
@ -1,3 +1,7 @@
|
|||||||
|
2008-09-04 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* tools/gimptool.c: add tons of const.
|
||||||
|
|
||||||
2008-09-04 Michael Natterer <mitch@gimp.org>
|
2008-09-04 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* libgimpbase/gimpreloc.c (set_gerror): made the error_message
|
* libgimpbase/gimpreloc.c (set_gerror): made the error_message
|
||||||
|
@ -36,16 +36,16 @@
|
|||||||
#include "libgimpbase/gimpversion.h"
|
#include "libgimpbase/gimpversion.h"
|
||||||
|
|
||||||
|
|
||||||
static gboolean silent = FALSE;
|
static gboolean silent = FALSE;
|
||||||
static gboolean dry_run = FALSE;
|
static gboolean dry_run = FALSE;
|
||||||
static gchar *prefix;
|
static gchar *prefix;
|
||||||
static gchar *exec_prefix;
|
static const gchar *exec_prefix;
|
||||||
|
|
||||||
static gchar *env_cc;
|
static gboolean msvc_syntax = FALSE;
|
||||||
static gboolean msvc_syntax = FALSE;
|
static const gchar *env_cc;
|
||||||
static gchar *env_cflags;
|
static const gchar *env_cflags;
|
||||||
static gchar *env_ldflags;
|
static const gchar *env_ldflags;
|
||||||
static gchar *env_libs;
|
static const gchar *env_libs;
|
||||||
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@ -64,7 +64,7 @@ static gchar *env_libs;
|
|||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
const gchar *option;
|
const gchar *option;
|
||||||
gchar *value;
|
const gchar *value;
|
||||||
} dirs[] = {
|
} dirs[] = {
|
||||||
{ "prefix", PREFIX },
|
{ "prefix", PREFIX },
|
||||||
{ "exec-prefix", EXEC_PREFIX },
|
{ "exec-prefix", EXEC_PREFIX },
|
||||||
@ -105,16 +105,16 @@ win32_command (gchar *command)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
starts_with_dir (gchar *string,
|
starts_with_dir (const gchar *string,
|
||||||
gchar *test)
|
const gchar *test)
|
||||||
{
|
{
|
||||||
return g_str_has_prefix (string, g_strconcat (test, "/", NULL)) ||
|
return g_str_has_prefix (string, g_strconcat (test, "/", NULL)) ||
|
||||||
strcmp (string, test) == 0;
|
strcmp (string, test) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
one_line_output (gchar *program,
|
one_line_output (const gchar *program,
|
||||||
gchar *args)
|
const gchar *args)
|
||||||
{
|
{
|
||||||
gchar *command = g_strconcat (program, " ", args, NULL);
|
gchar *command = g_strconcat (program, " ", args, NULL);
|
||||||
FILE *pipe = popen (command, "r");
|
FILE *pipe = popen (command, "r");
|
||||||
@ -146,7 +146,7 @@ one_line_output (gchar *program,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
pkg_config (gchar *args)
|
pkg_config (const gchar *args)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
if (msvc_syntax)
|
if (msvc_syntax)
|
||||||
@ -156,7 +156,7 @@ pkg_config (gchar *args)
|
|||||||
return one_line_output ("pkg-config", args);
|
return one_line_output ("pkg-config", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static const gchar *
|
||||||
get_runtime_prefix (gchar slash)
|
get_runtime_prefix (gchar slash)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@ -204,7 +204,7 @@ get_runtime_prefix (gchar slash)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static const gchar *
|
||||||
get_exec_prefix (gchar slash)
|
get_exec_prefix (gchar slash)
|
||||||
{
|
{
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@ -222,7 +222,7 @@ get_exec_prefix (gchar slash)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
expand_and_munge (gchar *value)
|
expand_and_munge (const gchar *value)
|
||||||
{
|
{
|
||||||
if (starts_with_dir (value, "${prefix}"))
|
if (starts_with_dir (value, "${prefix}"))
|
||||||
value = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
|
value = g_strconcat (PREFIX, value + strlen ("${prefix}"), NULL);
|
||||||
@ -417,18 +417,18 @@ maybe_run (gchar *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
do_build_2 (gchar *cflags,
|
do_build_2 (const gchar *cflags,
|
||||||
gchar *libs,
|
const gchar *libs,
|
||||||
gchar *install_dir,
|
const gchar *install_dir,
|
||||||
gchar *what)
|
const gchar *what)
|
||||||
{
|
{
|
||||||
gchar *cmd;
|
gchar *cmd;
|
||||||
gchar *dest_dir;
|
gchar *dest_dir;
|
||||||
gchar *output_flag;
|
const gchar *output_flag;
|
||||||
gchar *dest_exe;
|
gchar *dest_exe;
|
||||||
gchar *here_comes_linker_flags = "";
|
const gchar *here_comes_linker_flags = "";
|
||||||
gchar *windows_subsystem_flag = "";
|
const gchar *windows_subsystem_flag = "";
|
||||||
gchar *p, *q;
|
gchar *p, *q;
|
||||||
|
|
||||||
if (install_dir != NULL)
|
if (install_dir != NULL)
|
||||||
dest_dir = g_strconcat (install_dir, "/", NULL);
|
dest_dir = g_strconcat (install_dir, "/", NULL);
|
||||||
|
Reference in New Issue
Block a user