diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-11-02 12:56:21 +0100 |
|---|---|---|
| committer | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2016-11-04 18:41:26 +0300 |
| commit | 182c4939638f6270d934d0df00792cc636e177b2 (patch) | |
| tree | 0dd7763e09e116c8cc040a6b266a3e58b45d1631 | |
| parent | libguile-ssh/common.h: 'const'-qualify pointers to 'symbol_mapping'. (diff) | |
| download | guile-ssh-182c4939638f6270d934d0df00792cc636e177b2.tar.gz | |
libguile-ssh/key-type.c: Improve locality and constness.
* libguile-ssh/key-type.c (key_types): Mark as 'static const'.
(mark_key_smob, free_key_smob, equalp_key): Mark as 'static'.
* libguile-ssh/key-type.h (key_types): Remove declaration.
Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
| -rw-r--r-- | libguile-ssh/key-type.c | 8 | ||||
| -rw-r--r-- | libguile-ssh/key-type.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/libguile-ssh/key-type.c b/libguile-ssh/key-type.c index f4ccdd8..058ed06 100644 --- a/libguile-ssh/key-type.c +++ b/libguile-ssh/key-type.c @@ -36,7 +36,7 @@ scm_t_bits key_tag; /* Smob tag. */ -struct symbol_mapping key_types[] = { +static const struct symbol_mapping key_types[] = { { "dss", SSH_KEYTYPE_DSS }, { "rsa", SSH_KEYTYPE_RSA }, { "rsa1", SSH_KEYTYPE_RSA1 }, @@ -47,7 +47,7 @@ struct symbol_mapping key_types[] = { }; /* Smob marking */ -SCM +static SCM mark_key_smob (SCM key_smob) { struct key_data *kd = _scm_to_key_data (key_smob); @@ -55,7 +55,7 @@ mark_key_smob (SCM key_smob) } /* Free the smob. */ -size_t +static size_t free_key_smob (SCM arg1) { struct key_data *data = (struct key_data *) SCM_SMOB_DATA (arg1); @@ -183,7 +183,7 @@ Return #t if X is a SSH private-key, #f otherwise.\ && _private_key_p (_scm_to_key_data (x))); } -SCM +static SCM equalp_key (SCM x1, SCM x2) { struct key_data *key1 = _scm_to_key_data (x1); diff --git a/libguile-ssh/key-type.h b/libguile-ssh/key-type.h index c3de199..b3e1f68 100644 --- a/libguile-ssh/key-type.h +++ b/libguile-ssh/key-type.h @@ -33,8 +33,6 @@ struct key_data { ssh_key ssh_key; }; -extern struct symbol_mapping key_types[]; - /* Procedures */ |
