[gimp] libgimpbase: add lots of const to GimpEnumDesc and GimpFlagsDesc APIs
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpbase: add lots of const to GimpEnumDesc and GimpFlagsDesc APIs
- Date: Fri, 9 Aug 2019 11:30:23 +0000 (UTC)
commit 31b8ea4a901f7713324cb2c0727154cfc5511d73
Author: Michael Natterer <mitch gimp org>
Date: Fri Aug 9 13:29:34 2019 +0200
libgimpbase: add lots of const to GimpEnumDesc and GimpFlagsDesc APIs
app/pdb/gimppdb-query.c | 24 +++++-----
libgimpbase/gimputils.c | 70 ++++++++++++++--------------
libgimpbase/gimputils.h | 98 ++++++++++++++++++++--------------------
libgimpwidgets/gimpcolorscales.c | 6 +--
libgimpwidgets/gimpcolorselect.c | 2 +-
5 files changed, 100 insertions(+), 100 deletions(-)
---
diff --git a/app/pdb/gimppdb-query.c b/app/pdb/gimppdb-query.c
index f22ba9f854..b35cc584af 100644
--- a/app/pdb/gimppdb-query.c
+++ b/app/pdb/gimppdb-query.c
@@ -342,13 +342,13 @@ gimp_pdb_query_entry (gpointer key,
gpointer value,
gpointer user_data)
{
- PDBQuery *pdb_query = user_data;
- GList *list;
- GimpProcedure *procedure;
- const gchar *proc_name;
- PDBStrings strings;
- GEnumClass *enum_class;
- GimpEnumDesc *type_desc;
+ PDBQuery *pdb_query = user_data;
+ GList *list;
+ GimpProcedure *procedure;
+ const gchar *proc_name;
+ PDBStrings strings;
+ GEnumClass *enum_class;
+ const GimpEnumDesc *type_desc;
proc_name = key;
@@ -450,11 +450,11 @@ gimp_pdb_print_entry (gpointer key,
for (; list; list = list->next)
{
- GimpProcedure *procedure = list->data;
- PDBStrings strings;
- GEnumValue *arg_value;
- GimpEnumDesc *type_desc;
- gint i;
+ GimpProcedure *procedure = list->data;
+ PDBStrings strings;
+ GEnumValue *arg_value;
+ const GimpEnumDesc *type_desc;
+ gint i;
num++;
diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c
index 4a3c8f3a87..a6f141e2f3 100644
--- a/libgimpbase/gimputils.c
+++ b/libgimpbase/gimputils.c
@@ -722,7 +722,7 @@ gimp_canonicalize_identifier (const gchar *identifier)
*
* Since: 2.2
**/
-GimpEnumDesc *
+const GimpEnumDesc *
gimp_enum_get_desc (GEnumClass *enum_class,
gint value)
{
@@ -738,7 +738,7 @@ gimp_enum_get_desc (GEnumClass *enum_class,
while (value_desc->value_desc)
{
if (value_desc->value == value)
- return (GimpEnumDesc *) value_desc;
+ return value_desc;
value_desc++;
}
@@ -774,9 +774,9 @@ gimp_enum_get_value (GType enum_type,
const gchar **value_desc,
const gchar **value_help)
{
- GEnumClass *enum_class;
- GEnumValue *enum_value;
- gboolean success = FALSE;
+ GEnumClass *enum_class;
+ const GEnumValue *enum_value;
+ gboolean success = FALSE;
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), FALSE);
@@ -793,7 +793,7 @@ gimp_enum_get_value (GType enum_type,
if (value_desc || value_help)
{
- GimpEnumDesc *enum_desc;
+ const GimpEnumDesc *enum_desc;
enum_desc = gimp_enum_get_desc (enum_class, value);
@@ -849,11 +849,11 @@ gimp_enum_get_value (GType enum_type,
* Since: 2.2
**/
const gchar *
-gimp_enum_value_get_desc (GEnumClass *enum_class,
- GEnumValue *enum_value)
+gimp_enum_value_get_desc (GEnumClass *enum_class,
+ const GEnumValue *enum_value)
{
- GType type = G_TYPE_FROM_CLASS (enum_class);
- GimpEnumDesc *enum_desc;
+ GType type = G_TYPE_FROM_CLASS (enum_class);
+ const GimpEnumDesc *enum_desc;
enum_desc = gimp_enum_get_desc (enum_class, enum_value->value);
@@ -888,11 +888,11 @@ gimp_enum_value_get_desc (GEnumClass *enum_class,
* Since: 2.2
**/
const gchar *
-gimp_enum_value_get_help (GEnumClass *enum_class,
- GEnumValue *enum_value)
+gimp_enum_value_get_help (GEnumClass *enum_class,
+ const GEnumValue *enum_value)
{
- GType type = G_TYPE_FROM_CLASS (enum_class);
- GimpEnumDesc *enum_desc;
+ GType type = G_TYPE_FROM_CLASS (enum_class);
+ const GimpEnumDesc *enum_desc;
enum_desc = gimp_enum_get_desc (enum_class, enum_value->value);
@@ -915,11 +915,11 @@ gimp_enum_value_get_help (GEnumClass *enum_class,
* Since: 2.10
**/
const gchar *
-gimp_enum_value_get_abbrev (GEnumClass *enum_class,
- GEnumValue *enum_value)
+gimp_enum_value_get_abbrev (GEnumClass *enum_class,
+ const GEnumValue *enum_value)
{
- GType type = G_TYPE_FROM_CLASS (enum_class);
- GimpEnumDesc *enum_desc;
+ GType type = G_TYPE_FROM_CLASS (enum_class);
+ const GimpEnumDesc *enum_desc;
enum_desc = gimp_enum_get_desc (enum_class, enum_value->value);
@@ -946,7 +946,7 @@ gimp_enum_value_get_abbrev (GEnumClass *enum_class,
*
* Since: 2.2
**/
-GimpFlagsDesc *
+const GimpFlagsDesc *
gimp_flags_get_first_desc (GFlagsClass *flags_class,
guint value)
{
@@ -962,7 +962,7 @@ gimp_flags_get_first_desc (GFlagsClass *flags_class,
while (value_desc->value_desc)
{
if ((value_desc->value & value) == value_desc->value)
- return (GimpFlagsDesc *) value_desc;
+ return value_desc;
value_desc++;
}
@@ -998,8 +998,8 @@ gimp_flags_get_first_value (GType flags_type,
const gchar **value_desc,
const gchar **value_help)
{
- GFlagsClass *flags_class;
- GFlagsValue *flags_value;
+ GFlagsClass *flags_class;
+ const GFlagsValue *flags_value;
g_return_val_if_fail (G_TYPE_IS_FLAGS (flags_type), FALSE);
@@ -1016,7 +1016,7 @@ gimp_flags_get_first_value (GType flags_type,
if (value_desc || value_help)
{
- GimpFlagsDesc *flags_desc;
+ const GimpFlagsDesc *flags_desc;
flags_desc = gimp_flags_get_first_desc (flags_class, value);
@@ -1051,11 +1051,11 @@ gimp_flags_get_first_value (GType flags_type,
* Since: 2.2
**/
const gchar *
-gimp_flags_value_get_desc (GFlagsClass *flags_class,
- GFlagsValue *flags_value)
+gimp_flags_value_get_desc (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value)
{
- GType type = G_TYPE_FROM_CLASS (flags_class);
- GimpFlagsDesc *flags_desc;
+ GType type = G_TYPE_FROM_CLASS (flags_class);
+ const GimpFlagsDesc *flags_desc;
flags_desc = gimp_flags_get_first_desc (flags_class, flags_value->value);
@@ -1090,11 +1090,11 @@ gimp_flags_value_get_desc (GFlagsClass *flags_class,
* Since: 2.2
**/
const gchar *
-gimp_flags_value_get_help (GFlagsClass *flags_class,
- GFlagsValue *flags_value)
+gimp_flags_value_get_help (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value)
{
- GType type = G_TYPE_FROM_CLASS (flags_class);
- GimpFlagsDesc *flags_desc;
+ GType type = G_TYPE_FROM_CLASS (flags_class);
+ const GimpFlagsDesc *flags_desc;
flags_desc = gimp_flags_get_first_desc (flags_class, flags_value->value);
@@ -1117,11 +1117,11 @@ gimp_flags_value_get_help (GFlagsClass *flags_class,
* Since: 2.10
**/
const gchar *
-gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
- GFlagsValue *flags_value)
+gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value)
{
- GType type = G_TYPE_FROM_CLASS (flags_class);
- GimpFlagsDesc *flags_desc;
+ GType type = G_TYPE_FROM_CLASS (flags_class);
+ const GimpFlagsDesc *flags_desc;
flags_desc = gimp_flags_get_first_desc (flags_class, flags_value->value);
diff --git a/libgimpbase/gimputils.h b/libgimpbase/gimputils.h
index dcfb9dad6f..db536658c9 100644
--- a/libgimpbase/gimputils.h
+++ b/libgimpbase/gimputils.h
@@ -26,61 +26,61 @@
G_BEGIN_DECLS
-gchar * gimp_utf8_strtrim (const gchar *str,
- gint max_chars) G_GNUC_MALLOC;
-gchar * gimp_any_to_utf8 (const gchar *str,
- gssize len,
- const gchar *warning_format,
- ...) G_GNUC_PRINTF (3, 4) G_GNUC_MALLOC;
-const gchar * gimp_filename_to_utf8 (const gchar *filename);
+gchar * gimp_utf8_strtrim (const gchar *str,
+ gint max_chars) G_GNUC_MALLOC;
+gchar * gimp_any_to_utf8 (const gchar *str,
+ gssize len,
+ const gchar *warning_format,
+ ...) G_GNUC_PRINTF (3, 4) G_GNUC_MALLOC;
+const gchar * gimp_filename_to_utf8 (const gchar *filename);
-const gchar * gimp_file_get_utf8_name (GFile *file);
-gboolean gimp_file_has_extension (GFile *file,
- const gchar *extension);
-gboolean gimp_file_show_in_file_manager (GFile *file,
- GError **error);
+const gchar * gimp_file_get_utf8_name (GFile *file);
+gboolean gimp_file_has_extension (GFile *file,
+ const gchar *extension);
+gboolean gimp_file_show_in_file_manager (GFile *file,
+ GError **error);
-gchar * gimp_strip_uline (const gchar *str) G_GNUC_MALLOC;
-gchar * gimp_escape_uline (const gchar *str) G_GNUC_MALLOC;
+gchar * gimp_strip_uline (const gchar *str) G_GNUC_MALLOC;
+gchar * gimp_escape_uline (const gchar *str) G_GNUC_MALLOC;
-gboolean gimp_is_canonical_identifier (const gchar *identifier);
-gchar * gimp_canonicalize_identifier (const gchar *identifier) G_GNUC_MALLOC;
+gboolean gimp_is_canonical_identifier (const gchar *identifier);
+gchar * gimp_canonicalize_identifier (const gchar *identifier) G_GNUC_MALLOC;
-GimpEnumDesc * gimp_enum_get_desc (GEnumClass *enum_class,
- gint value);
-gboolean gimp_enum_get_value (GType enum_type,
- gint value,
- const gchar **value_name,
- const gchar **value_nick,
- const gchar **value_desc,
- const gchar **value_help);
-const gchar * gimp_enum_value_get_desc (GEnumClass *enum_class,
- GEnumValue *enum_value);
-const gchar * gimp_enum_value_get_help (GEnumClass *enum_class,
- GEnumValue *enum_value);
-const gchar * gimp_enum_value_get_abbrev (GEnumClass *enum_class,
- GEnumValue *enum_value);
+const GimpEnumDesc * gimp_enum_get_desc (GEnumClass *enum_class,
+ gint value);
+gboolean gimp_enum_get_value (GType enum_type,
+ gint value,
+ const gchar **value_name,
+ const gchar **value_nick,
+ const gchar **value_desc,
+ const gchar **value_help);
+const gchar * gimp_enum_value_get_desc (GEnumClass *enum_class,
+ const GEnumValue *enum_value);
+const gchar * gimp_enum_value_get_help (GEnumClass *enum_class,
+ const GEnumValue *enum_value);
+const gchar * gimp_enum_value_get_abbrev (GEnumClass *enum_class,
+ const GEnumValue *enum_value);
-GimpFlagsDesc * gimp_flags_get_first_desc (GFlagsClass *flags_class,
- guint value);
-gboolean gimp_flags_get_first_value (GType flags_type,
- guint value,
- const gchar **value_name,
- const gchar **value_nick,
- const gchar **value_desc,
- const gchar **value_help);
-const gchar * gimp_flags_value_get_desc (GFlagsClass *flags_class,
- GFlagsValue *flags_value);
-const gchar * gimp_flags_value_get_help (GFlagsClass *flags_class,
- GFlagsValue *flags_value);
-const gchar * gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
- GFlagsValue *flags_value);
+const GimpFlagsDesc * gimp_flags_get_first_desc (GFlagsClass *flags_class,
+ guint value);
+gboolean gimp_flags_get_first_value (GType flags_type,
+ guint value,
+ const gchar **value_name,
+ const gchar **value_nick,
+ const gchar **value_desc,
+ const gchar **value_help);
+const gchar * gimp_flags_value_get_desc (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value);
+const gchar * gimp_flags_value_get_help (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value);
+const gchar * gimp_flags_value_get_abbrev (GFlagsClass *flags_class,
+ const GFlagsValue *flags_value);
-gboolean gimp_stack_trace_available (gboolean optimal);
-gboolean gimp_stack_trace_print (const gchar *prog_name,
- gpointer stream,
- gchar **trace);
-void gimp_stack_trace_query (const gchar *prog_name);
+gboolean gimp_stack_trace_available (gboolean optimal);
+gboolean gimp_stack_trace_print (const gchar *prog_name,
+ gpointer stream,
+ gchar **trace);
+void gimp_stack_trace_query (const gchar *prog_name);
G_END_DECLS
diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c
index 905f0d1242..fdaffd777e 100644
--- a/libgimpwidgets/gimpcolorscales.c
+++ b/libgimpwidgets/gimpcolorscales.c
@@ -253,9 +253,9 @@ create_group (GimpColorScales *scales,
for (i = first_channel, row = 0; i <= last_channel; i++, row++)
{
- GimpEnumDesc *enum_desc;
- gint enum_value = i;
- gboolean is_u8 = FALSE;
+ const GimpEnumDesc *enum_desc;
+ gint enum_value = i;
+ gboolean is_u8 = FALSE;
if (enum_value >= GIMP_COLOR_SELECTOR_RED_U8 &&
enum_value <= GIMP_COLOR_SELECTOR_ALPHA_U8)
diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c
index 66fe0b6b3c..b421850e6c 100644
--- a/libgimpwidgets/gimpcolorselect.c
+++ b/libgimpwidgets/gimpcolorselect.c
@@ -348,7 +348,7 @@ gimp_color_select_init (GimpColorSelect *select)
GtkWidget *vbox;
GEnumClass *model_class;
GEnumClass *channel_class;
- GimpEnumDesc *enum_desc;
+ const GimpEnumDesc *enum_desc;
GimpColorSelectorModel model;
GSList *group = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]