1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-21 10:09:57 +01:00

agent,dirmngr,gpg,scd: Clean up for modern compiler.

* agent/protect.c (agent_get_shadow_info_type): It's a write only
variable, useful for debugging.
* g10/key-check.c (key_check_all_keysigs): Likewise.
* g10/keyedit.c (show_basic_key_info, menu_expire): Likewise.
* scd/app-sc-hsm.c (read_ef_prkd): Likewise.
* dirmngr/crlfetch.c (fetch_next_ksba_cert): Initialize the vars.
* dirmngr/ks-action.c (ks_action_help): Remove unused variables.
* dirmngr/server.c (make_keyserver_item): Likewise.
* dirmngr/validate.c (check_cert_sig): Initialize the variable.
* scd/app-p15.c (select_and_read_record): Likewise.
* tests/gpgscm/scheme.c (scheme_init_new): A function with no args.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-09-14 11:48:42 +09:00
parent e133bcb1cd
commit 3d7dbf1661
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
10 changed files with 11 additions and 8 deletions

View File

@ -1632,6 +1632,7 @@ agent_get_shadow_info_type (const unsigned char *shadowkey,
size_t n, saved_n;
int depth = 0;
(void)depth;
s = shadowkey;
if (*s != '(')
return gpg_error (GPG_ERR_INV_SEXP);

View File

@ -366,8 +366,8 @@ gpg_error_t
fetch_next_ksba_cert (cert_fetch_context_t context, ksba_cert_t *r_cert)
{
gpg_error_t err;
unsigned char *value;
size_t valuelen;
unsigned char *value = NULL;
size_t valuelen = 0;
ksba_cert_t cert;
*r_cert = NULL;

View File

@ -67,8 +67,6 @@ ks_action_help (ctrl_t ctrl, const char *url)
{
gpg_error_t err;
parsed_uri_t parsed_uri; /* The broken down URI. */
char *tmpstr;
const char *s;
if (!url || !*url)
{

View File

@ -2126,7 +2126,6 @@ make_keyserver_item (const char *uri, uri_item_t *r_item)
{
gpg_error_t err;
uri_item_t item;
const char *s;
char *tmpstr = NULL;
*r_item = NULL;

View File

@ -950,7 +950,8 @@ check_cert_sig (ksba_cert_t issuer_cert, ksba_cert_t cert)
int algo;
ksba_sexp_t p;
size_t n;
gcry_sexp_t s_sig, s_hash, s_pkey;
gcry_sexp_t s_sig, s_pkey;
gcry_sexp_t s_hash = NULL;
const char *algo_name; /* hash algorithm name converted to lower case. */
int digestlen;
unsigned char *digest;

View File

@ -261,6 +261,7 @@ key_check_all_keysigs (ctrl_t ctrl, int mode, kbnode_t kb,
int modified = 0;
PKT_signature *sig;
(void)missing_selfsig;
log_assert (kb->pkt->pkttype == PKT_PUBLIC_KEY);
pk = kb->pkt->pkt.public_key;

View File

@ -4069,6 +4069,7 @@ show_basic_key_info (ctrl_t ctrl, kbnode_t keyblock, int print_sec)
}
/* The user IDs. */
(void)i; /* Counting User IDs */
for (i = 0, node = keyblock; node; node = node->next)
{
if (node->pkt->pkttype == PKT_USER_ID)
@ -4768,6 +4769,7 @@ menu_expire (ctrl_t ctrl, kbnode_t pub_keyblock,
kbnode_t node;
u32 keyid[2];
(void)signumber;
if (unattended)
{
only_mainkey = (unattended == 1);

View File

@ -708,7 +708,7 @@ select_and_read_record (app_t app, unsigned short efid, int recno,
unsigned char **buffer, size_t *buflen, int *r_sw)
{
gpg_error_t err;
int sw;
int sw = 0;
if (r_sw)
*r_sw = 0x9000;

View File

@ -666,6 +666,7 @@ read_ef_prkd (app_t app, unsigned short fid, prkdf_object_t *prkdresult,
{
/* Yep, this is the keyReference.
Note: UL is currently not used. */
(void)ul;
for (ul=0; objlen; objlen--)
{
ul <<= 8;

View File

@ -5569,7 +5569,7 @@ static const struct scheme_interface vtbl = {
};
#endif
scheme *scheme_init_new() {
scheme *scheme_init_new(void) {
scheme *sc=(scheme*)malloc(sizeof(scheme));
if(!scheme_init(sc)) {
free(sc);