From a3d14d77f566a41fc61dfdc5c2e0e384c9e6ae8b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 5 Feb 2017 12:08:13 +0000 Subject: [PATCH] One more warning fix: spurious 'const' on functions. These must have been absent-mindedly copied from function declarations of the form 'const type *fn(args)', where the 'const' is meaningful and describes the data pointed to by the returned pointer, to functions of the form 'const type fn(args)' where the 'const' is completely pointless. --- ssh.h | 12 ++++++------ sshecc.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ssh.h b/ssh.h index 16f076c8..371de837 100644 --- a/ssh.h +++ b/ssh.h @@ -156,12 +156,12 @@ const struct ssh_signkey *ec_alg_by_oid(int len, const void *oid, const struct ec_curve **curve); const unsigned char *ec_alg_oid(const struct ssh_signkey *alg, int *oidlen); extern const int ec_nist_curve_lengths[], n_ec_nist_curve_lengths; -const int ec_nist_alg_and_curve_by_bits(int bits, - const struct ec_curve **curve, - const struct ssh_signkey **alg); -const int ec_ed_alg_and_curve_by_bits(int bits, - const struct ec_curve **curve, - const struct ssh_signkey **alg); +int ec_nist_alg_and_curve_by_bits(int bits, + const struct ec_curve **curve, + const struct ssh_signkey **alg); +int ec_ed_alg_and_curve_by_bits(int bits, + const struct ec_curve **curve, + const struct ssh_signkey **alg); struct ssh_signkey; diff --git a/sshecc.c b/sshecc.c index 3ce6c7fe..e1166827 100644 --- a/sshecc.c +++ b/sshecc.c @@ -2940,9 +2940,9 @@ const unsigned char *ec_alg_oid(const struct ssh_signkey *alg, const int ec_nist_curve_lengths[] = { 256, 384, 521 }; const int n_ec_nist_curve_lengths = lenof(ec_nist_curve_lengths); -const int ec_nist_alg_and_curve_by_bits(int bits, - const struct ec_curve **curve, - const struct ssh_signkey **alg) +int ec_nist_alg_and_curve_by_bits(int bits, + const struct ec_curve **curve, + const struct ssh_signkey **alg) { switch (bits) { case 256: *alg = &ssh_ecdsa_nistp256; break; @@ -2954,9 +2954,9 @@ const int ec_nist_alg_and_curve_by_bits(int bits, return TRUE; } -const int ec_ed_alg_and_curve_by_bits(int bits, - const struct ec_curve **curve, - const struct ssh_signkey **alg) +int ec_ed_alg_and_curve_by_bits(int bits, + const struct ec_curve **curve, + const struct ssh_signkey **alg) { switch (bits) { case 256: *alg = &ssh_ecdsa_ed25519; break; -- 2.45.1