[gnumeric] GnmFunc: constify.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GnmFunc: constify.
- Date: Mon, 3 Aug 2020 00:16:43 +0000 (UTC)
commit d618c5e3cea0b9a27e434fc202e8fec7ceec1954
Author: Morten Welinder <terra gnome org>
Date: Sun Aug 2 20:16:25 2020 -0400
GnmFunc: constify.
src/func.c | 38 +++++++++++++++++++-------------------
src/func.h | 26 +++++++++++++-------------
2 files changed, 32 insertions(+), 32 deletions(-)
---
diff --git a/src/func.c b/src/func.c
index 1c2aca8399..ec73298d98 100644
--- a/src/func.c
+++ b/src/func.c
@@ -311,16 +311,16 @@ gnm_func_create_arg_names (GnmFunc *func)
}
gboolean
-gnm_func_is_varargs (GnmFunc *func)
+gnm_func_is_varargs (GnmFunc const *func)
{
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
return func->fn_type == GNM_FUNC_TYPE_NODES;
}
gboolean
-gnm_func_is_fixargs (GnmFunc *func)
+gnm_func_is_fixargs (GnmFunc const *func)
{
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
return func->fn_type == GNM_FUNC_TYPE_ARGS;
}
@@ -410,7 +410,7 @@ gnm_func_set_fixargs (GnmFunc *func, GnmFuncArgs fn, const char *spec)
* Returns: (transfer none) (array length=n) (nullable): @func's help items.
*/
GnmFuncHelp const *
-gnm_func_get_help (GnmFunc *func, int *n)
+gnm_func_get_help (GnmFunc const *func, int *n)
{
if (n) *n = 0;
@@ -621,7 +621,7 @@ gnm_func_lookup_prefix (char const *prefix, Workbook *scope, gboolean trans)
* Returns: (transfer none): the translation domain for @func's help text.
*/
char const *
-gnm_func_get_translation_domain (GnmFunc *func)
+gnm_func_get_translation_domain (GnmFunc const *func)
{
g_return_val_if_fail (GNM_IS_FUNC (func), NULL);
return func->tdomain->str;
@@ -658,7 +658,7 @@ gnm_func_set_translation_domain (GnmFunc *func, const char *tdomain)
* domain.
*/
char const *
-gnm_func_gettext (GnmFunc *func, const char *str)
+gnm_func_gettext (GnmFunc const *func, const char *str)
{
g_return_val_if_fail (GNM_IS_FUNC (func), NULL);
g_return_val_if_fail (str != NULL, NULL);
@@ -668,7 +668,7 @@ gnm_func_gettext (GnmFunc *func, const char *str)
GnmFuncFlags
-gnm_func_get_flags (GnmFunc *func)
+gnm_func_get_flags (GnmFunc const *func)
{
g_return_val_if_fail (GNM_IS_FUNC (func), GNM_FUNC_SIMPLE);
return func->flags;
@@ -682,7 +682,7 @@ gnm_func_set_flags (GnmFunc *func, GnmFuncFlags f)
}
GnmFuncImplStatus
-gnm_func_get_impl_status (GnmFunc *func)
+gnm_func_get_impl_status (GnmFunc const *func)
{
g_return_val_if_fail (GNM_IS_FUNC (func), GNM_FUNC_IMPL_STATUS_UNIMPLEMENTED);
return func->impl_status;
@@ -697,7 +697,7 @@ gnm_func_set_impl_status (GnmFunc *func, GnmFuncImplStatus st)
GnmFuncTestStatus
-gnm_func_get_test_status (GnmFunc *func)
+gnm_func_get_test_status (GnmFunc const *func)
{
g_return_val_if_fail (GNM_IS_FUNC (func), GNM_FUNC_TEST_STATUS_UNKNOWN);
return func->test_status;
@@ -1022,12 +1022,12 @@ gnm_func_get_name (GnmFunc const *func, gboolean localized)
* Returns: (transfer none): the description of the function
**/
char const *
-gnm_func_get_description (GnmFunc *func)
+gnm_func_get_description (GnmFunc const *func)
{
gint i;
g_return_val_if_fail (func != NULL, NULL);
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
for (i = 0; i < func->help_count; i++) {
const char *desc;
@@ -1051,13 +1051,13 @@ gnm_func_get_description (GnmFunc *func)
* For a vararg function, the maximum will be set to G_MAXINT.
**/
void
-gnm_func_count_args (GnmFunc *func, int *min, int *max)
+gnm_func_count_args (GnmFunc const *func, int *min, int *max)
{
g_return_if_fail (min != NULL);
g_return_if_fail (max != NULL);
g_return_if_fail (func != NULL);
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
*min = func->min_args;
*max = func->max_args;
@@ -1071,11 +1071,11 @@ gnm_func_count_args (GnmFunc *func, int *min, int *max)
* Returns: the type of the argument
**/
char
-gnm_func_get_arg_type (GnmFunc *func, int arg_idx)
+gnm_func_get_arg_type (GnmFunc const *func, int arg_idx)
{
g_return_val_if_fail (func != NULL, '?');
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
g_return_val_if_fail (arg_idx >= 0 && arg_idx < func->max_args, '?');
@@ -1090,7 +1090,7 @@ gnm_func_get_arg_type (GnmFunc *func, int arg_idx)
* Return value: (transfer none): the type of the argument as a string
**/
char const *
-gnm_func_get_arg_type_string (GnmFunc *func, int arg_idx)
+gnm_func_get_arg_type_string (GnmFunc const *func, int arg_idx)
{
switch (gnm_func_get_arg_type (func, arg_idx)) {
case 'f':
@@ -1144,12 +1144,12 @@ gnm_func_get_arg_name (GnmFunc const *func, guint arg_idx)
* Returns: (transfer none): the description of the argument
**/
char const *
-gnm_func_get_arg_description (GnmFunc *func, guint arg_idx)
+gnm_func_get_arg_description (GnmFunc const *func, guint arg_idx)
{
gint i;
g_return_val_if_fail (func != NULL, NULL);
- gnm_func_load_if_stub (func);
+ gnm_func_load_if_stub ((GnmFunc *)func);
for (i = 0; i < func->help_count; i++) {
gchar const *desc;
diff --git a/src/func.h b/src/func.h
index 8680ed16eb..8791ac5434 100644
--- a/src/func.h
+++ b/src/func.h
@@ -216,26 +216,26 @@ GnmFunc *gnm_func_inc_usage (GnmFunc *func);
void gnm_func_dec_usage (GnmFunc *func);
gboolean gnm_func_get_in_use (GnmFunc *func);
-char const *gnm_func_get_translation_domain (GnmFunc *func);
+char const *gnm_func_get_translation_domain (GnmFunc const *func);
void gnm_func_set_translation_domain (GnmFunc *func,
const char *tdomain);
-char const *gnm_func_gettext (GnmFunc *func, const char *str);
+char const *gnm_func_gettext (GnmFunc const *func, const char *str);
-GnmFuncFlags gnm_func_get_flags (GnmFunc *func);
+GnmFuncFlags gnm_func_get_flags (GnmFunc const *func);
void gnm_func_set_flags (GnmFunc *func, GnmFuncFlags f);
-GnmFuncImplStatus gnm_func_get_impl_status (GnmFunc *func);
+GnmFuncImplStatus gnm_func_get_impl_status (GnmFunc const *func);
void gnm_func_set_impl_status (GnmFunc *func, GnmFuncImplStatus st);
-GnmFuncTestStatus gnm_func_get_test_status (GnmFunc *func);
+GnmFuncTestStatus gnm_func_get_test_status (GnmFunc const *func);
void gnm_func_set_test_status (GnmFunc *func, GnmFuncTestStatus st);
GnmFuncGroup*gnm_func_get_function_group (GnmFunc *func);
void gnm_func_set_function_group (GnmFunc *func, GnmFuncGroup *group);
-gboolean gnm_func_is_varargs (GnmFunc *func);
-gboolean gnm_func_is_fixargs (GnmFunc *func);
+gboolean gnm_func_is_varargs (GnmFunc const *func);
+gboolean gnm_func_is_fixargs (GnmFunc const *func);
void gnm_func_set_stub (GnmFunc *func);
void gnm_func_set_varargs (GnmFunc *func, GnmFuncNodes fn,
@@ -243,7 +243,7 @@ void gnm_func_set_varargs (GnmFunc *func, GnmFuncNodes fn,
void gnm_func_set_fixargs (GnmFunc *func, GnmFuncArgs fn,
const char *spec);
-GnmFuncHelp const *gnm_func_get_help (GnmFunc *func, int *n);
+GnmFuncHelp const *gnm_func_get_help (GnmFunc const *func, int *n);
void gnm_func_set_help (GnmFunc *func, GnmFuncHelp const *help, int n);
GnmDependentFlags gnm_func_link_dep (GnmFunc *func, GnmFuncEvalInfo *ei, gboolean qlink);
@@ -266,12 +266,12 @@ GnmFunc *gnm_func_add_placeholder_localized (char const *gname, char const *l
GnmFunc *gnm_func_lookup_or_add_placeholder (char const *name);
/* TODO */
-char const *gnm_func_get_description (GnmFunc *func);
-void gnm_func_count_args (GnmFunc *func, gint *min, int *max);
-char gnm_func_get_arg_type (GnmFunc *func, gint arg_idx);
-char const *gnm_func_get_arg_type_string (GnmFunc *func, gint arg_idx);
+char const *gnm_func_get_description (GnmFunc const *func);
+void gnm_func_count_args (GnmFunc const *func, gint *min, int *max);
+char gnm_func_get_arg_type (GnmFunc const *func, gint arg_idx);
+char const *gnm_func_get_arg_type_string (GnmFunc const *func, gint arg_idx);
char *gnm_func_get_arg_name (GnmFunc const *func, guint arg_idx);
-char const *gnm_func_get_arg_description (GnmFunc *func, guint arg_idx);
+char const *gnm_func_get_arg_description (GnmFunc const *func, guint arg_idx);
char *gnm_func_convert_markup_to_pango (char const *desc,
GtkWidget *target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]