[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use `static const', again
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Use `static const', again |
Date: |
Tue, 03 Jul 2007 20:20:12 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Hi!
> # Slight C code generation improvements.
> #
> # * guile/g-wrap/enumerations.scm (val-array-cg): Use `static const' for
> # arrays of `GWEnumPair's.
Here is an obvious followup to this one.
Thanks,
Ludovic.
# Bazaar revision bundle v0.9
#
# message:
# Accept `const' enum pairs in run-time.
#
# * guile/g-wrap/guile-runtime.c (gw_guile_enum_val2sym): Accept
`const'-qualified
# enum pairs.
# (gw_guile_enum_val2int): Likewise.
#
# * guile/g-wrap/guile-runtime.h: Updated.
#
# committer: Ludovic Courtes <address@hidden>
# date: Tue 2007-07-03 19:33:40.259000063 +0200
=== modified file guile/g-wrap/guile-runtime.c
--- guile/g-wrap/guile-runtime.c
+++ guile/g-wrap/guile-runtime.c
@@ -55,7 +55,7 @@
static void gw_guile_raise_error (GWLangArena arena, const char *proc,
const char *error) GW_NORETURN;
-#if 0 // not used ATM
+#if 0 /* not used ATM */
void
gw_guile_runtime_get_version_info(int *major, int *revision, int *age)
{
@@ -66,11 +66,12 @@
#endif
SCM
-gw_guile_enum_val2sym(GWEnumPair enum_pairs[], SCM scm_val, SCM scm_show_all_p)
+gw_guile_enum_val2sym(const GWEnumPair enum_pairs[], SCM scm_val,
+ SCM scm_show_all_p)
{
int enum_val;
SCM scm_result;
- GWEnumPair *epair;
+ const GWEnumPair *epair;
int return_all_syms = scm_is_true (scm_show_all_p);
if (return_all_syms)
@@ -108,10 +109,10 @@
}
SCM
-gw_guile_enum_val2int (GWEnumPair enum_pairs[], SCM scm_val)
+gw_guile_enum_val2int (const GWEnumPair enum_pairs[], SCM scm_val)
{
char *symstr = NULL;
- GWEnumPair *epair;
+ const GWEnumPair *epair;
if (scm_is_true(scm_integer_p (scm_val)))
{
=== modified file guile/g-wrap/guile-runtime.h
--- guile/g-wrap/guile-runtime.h
+++ guile/g-wrap/guile-runtime.h
@@ -39,9 +39,9 @@
};
void gw_guile_runtime_init (void);
-SCM gw_guile_enum_val2sym(GWEnumPair enum_pairs[], SCM scm_val,
+SCM gw_guile_enum_val2sym(const GWEnumPair enum_pairs[], SCM scm_val,
SCM scm_show_all_p);
-SCM gw_guile_enum_val2int(GWEnumPair enum_pairs[], SCM scm_val);
+SCM gw_guile_enum_val2int(const GWEnumPair enum_pairs[], SCM scm_val);
void gw_guile_set_generics_module_x (SCM module);
void gw_guile_make_latent_variable (SCM sym, SCM proc, SCM arg);
=== modified directory // last-changed:address@hidden
... 7s1
# revision id: address@hidden
# sha1: 3775f8af32d4c3315cad462037c4ebfb9873b813
# inventory sha1: d6865b93e8b9f33b23c144310c5c42434d1fa634
# parent ids:
# address@hidden
# base id: address@hidden
# properties:
# branch-nick: g-wrap
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] Use `static const', again,
Ludovic Courtès <=