diff options
-rw-r--r-- | lib/opencdk/Makefile.am | 1 | ||||
-rw-r--r-- | lib/opencdk/armor.c | 3 | ||||
-rw-r--r-- | lib/opencdk/keydb.c | 12 | ||||
-rw-r--r-- | lib/opencdk/literal.c | 2 | ||||
-rw-r--r-- | lib/opencdk/misc.c | 2 | ||||
-rw-r--r-- | lib/opencdk/new-packet.c | 4 | ||||
-rw-r--r-- | lib/opencdk/read-packet.c | 13 | ||||
-rw-r--r-- | lib/opencdk/sig-check.c | 5 | ||||
-rw-r--r-- | lib/opencdk/stream.c | 3 |
9 files changed, 18 insertions, 27 deletions
diff --git a/lib/opencdk/Makefile.am b/lib/opencdk/Makefile.am index 3941d3baa0..dbf536a6cc 100644 --- a/lib/opencdk/Makefile.am +++ b/lib/opencdk/Makefile.am @@ -20,7 +20,6 @@ # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA -AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = \ -I$(srcdir)/../gl \ -I$(builddir)/../gl \ diff --git a/lib/opencdk/armor.c b/lib/opencdk/armor.c index a188ef2124..b4e5a27eec 100644 --- a/lib/opencdk/armor.c +++ b/lib/opencdk/armor.c @@ -595,8 +595,7 @@ armor_decode (void *data, FILE * in, FILE * out) afx->crc_okay = (afx->crc == crc2) ? 1 : 0; if (!afx->crc_okay && !rc) { - _cdk_log_debug ("file crc=%08lX afx_crc=%08lX\n", - (unsigned long) crc2, (unsigned long) afx->crc); + _cdk_log_debug ("file crc=%08lX afx_crc=%08lX\n", crc2, afx->crc); rc = CDK_Armor_CRC_Error; } diff --git a/lib/opencdk/keydb.c b/lib/opencdk/keydb.c index c8218c48d7..651a205bb0 100644 --- a/lib/opencdk/keydb.c +++ b/lib/opencdk/keydb.c @@ -48,14 +48,13 @@ static cdk_kbnode_t find_selfsig_node (cdk_kbnode_t key, cdk_pkt_pubkey_t pk); static char * keydb_idx_mkname (const char *file) { - const char *add = ".idx"; - char *fname; + char *fname, *fmt; - fname = cdk_calloc (1, strlen (file) + strlen (add) + 1); + fmt = "%s.idx"; + fname = cdk_calloc (1, strlen (file) + strlen (fmt) + 1); if (!fname) return NULL; - strcpy (fname, file); - strcat (fname, add); + sprintf (fname, fmt, file); return fname; } @@ -662,8 +661,7 @@ keydb_cache_add (cdk_keydb_search_t dbs, off_t offset) k->next = dbs->cache; dbs->cache = k; dbs->ncache++; - _cdk_log_debug ("cache: add entry off=%ld type=%d\n", (signed long) offset, - dbs->type); + _cdk_log_debug ("cache: add entry off=%d type=%d\n", offset, dbs->type); return 0; } diff --git a/lib/opencdk/literal.c b/lib/opencdk/literal.c index 4e680c6e25..fc4ee4fdc3 100644 --- a/lib/opencdk/literal.c +++ b/lib/opencdk/literal.c @@ -200,7 +200,7 @@ literal_encode (void *data, FILE * in, FILE * out) filelen = strlen (pfx->filename); cdk_pkt_new (&pkt); pt = pkt->pkt.literal = cdk_calloc (1, sizeof *pt + filelen); - pt->name = (char*) (pt + sizeof(*pt)); + pt->name = pt + sizeof(*pt); if (!pt) { cdk_pkt_release (pkt); diff --git a/lib/opencdk/misc.c b/lib/opencdk/misc.c index a8acdf8dfe..13e7fd5275 100644 --- a/lib/opencdk/misc.c +++ b/lib/opencdk/misc.c @@ -97,7 +97,7 @@ cdk_strlist_add (cdk_strlist_t * list, const char *string) sl = cdk_calloc (1, sizeof *sl + strlen (string) + 2); if (!sl) return NULL; - sl->d = (char*) (sl + sizeof(*sl)); + sl->d = sl + sizeof(*sl); strcpy (sl->d, string); sl->next = *list; *list = sl; diff --git a/lib/opencdk/new-packet.c b/lib/opencdk/new-packet.c index 85322c5e1f..501d65293f 100644 --- a/lib/opencdk/new-packet.c +++ b/lib/opencdk/new-packet.c @@ -388,7 +388,7 @@ _cdk_copy_userid (cdk_pkt_userid_t * dst, cdk_pkt_userid_t src) u = cdk_calloc (1, sizeof *u + strlen (src->name) + 2); if (!u) return CDK_Out_Of_Core; - u->name = (char*) (u + sizeof(*u)); + u->name = (void*)u + sizeof(*u); memcpy (u, src, sizeof *u); memcpy (u->name, src->name, strlen (src->name)); @@ -627,7 +627,7 @@ cdk_subpkt_new (size_t size) s = cdk_calloc (1, sizeof *s + size + 2); if (!s) return NULL; - s->d = (char*) (s + sizeof(*s)); + s->d = (void*)s + sizeof(*s); return s; } diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c index 4808eb166c..2869c2ce05 100644 --- a/lib/opencdk/read-packet.c +++ b/lib/opencdk/read-packet.c @@ -553,7 +553,7 @@ read_user_id (cdk_stream_t inp, size_t pktlen, cdk_pkt_userid_t user_id) return CDK_Inv_Packet; if (DEBUG_PKT) - _cdk_log_debug ("read_user_id: %lu octets\n", (unsigned long) pktlen); + _cdk_log_debug ("read_user_id: %lu octets\n", pktlen); user_id->len = pktlen; rc = stream_read (inp, user_id->name, pktlen, &nread); @@ -836,7 +836,7 @@ read_literal (cdk_stream_t inp, size_t pktlen, *ret_pt = pt = cdk_realloc (pt, sizeof *pt + pt->namelen + 2); if (!pt) return CDK_Out_Of_Core; - pt->name = (char*) (pt + sizeof(*pt)); + pt->name = (void*)pt + sizeof(*pt); rc = stream_read (inp, pt->name, pt->namelen, &nread); if (rc) return rc; @@ -958,8 +958,7 @@ cdk_pkt_read (cdk_stream_t inp, cdk_packet_t pkt) if (!(ctb & 0x80)) { _cdk_log_info ("cdk_pkt_read: no openpgp data found. " - "(ctb=%02X; fpos=%02lX)\n", ctb, - (unsigned long) cdk_stream_tell (inp)); + "(ctb=%02X; fpos=%02X)\n", ctb, cdk_stream_tell (inp)); return CDK_Inv_Packet; } @@ -999,8 +998,7 @@ cdk_pkt_read (cdk_stream_t inp, cdk_packet_t pkt) + pkt->pktlen + 16 + 1); if (!pkt->pkt.user_id) return CDK_Out_Of_Core; - pkt->pkt.user_id->name = (char*) (pkt->pkt.user_id - + sizeof(*pkt->pkt.user_id)); + pkt->pkt.user_id->name = (void*)pkt->pkt.user_id + sizeof(*pkt->pkt.user_id); rc = read_attribute (inp, pktlen, pkt->pkt.user_id); pkt->pkttype = CDK_PKT_ATTRIBUTE; @@ -1011,8 +1009,7 @@ cdk_pkt_read (cdk_stream_t inp, cdk_packet_t pkt) + pkt->pktlen + 1); if (!pkt->pkt.user_id) return CDK_Out_Of_Core; - pkt->pkt.user_id->name = (char*) (pkt->pkt.user_id - + sizeof(*pkt->pkt.user_id)); + pkt->pkt.user_id->name = (void*)pkt->pkt.user_id + sizeof(*pkt->pkt.user_id); rc = read_user_id (inp, pktlen, pkt->pkt.user_id); break; diff --git a/lib/opencdk/sig-check.c b/lib/opencdk/sig-check.c index 48d407f6ec..38007299fa 100644 --- a/lib/opencdk/sig-check.c +++ b/lib/opencdk/sig-check.c @@ -542,9 +542,8 @@ cdk_pk_check_sigs (cdk_kbnode_t key, cdk_keydb_hd_t keydb, int *r_status) } _cdk_log_debug ("signature %s: signer %08lX keyid %08lX\n", - rc == CDK_Bad_Sig ? "BAD" : "good", - (unsigned long) sig->keyid[1], - (unsigned long) keyid); + rc == CDK_Bad_Sig ? "BAD" : "good", sig->keyid[1], + keyid); if (IS_UID_SIG (sig) && uid_name != NULL) { diff --git a/lib/opencdk/stream.c b/lib/opencdk/stream.c index dcf66c5c32..d1061925b8 100644 --- a/lib/opencdk/stream.c +++ b/lib/opencdk/stream.c @@ -1477,8 +1477,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, len = cdk_stream_get_length (s); if (!len) { - _cdk_log_debug ("cdk_stream_mmap_part: invalid file size %lu\n", - (unsigned long) len); + _cdk_log_debug ("cdk_stream_mmap_part: invalid file size %lu\n", len); gnutls_assert (); return s->error; } |