+2003-07-31 Marcus Brinkmann <marcus@g10code.de>
+
+ * util.h (_gpgme_decode_c_string): Change type of LEN argument to
+ size_t.
+ (_gpgme_decode_percent_string): Likewise.
+ * conversion.c (_gpgme_decode_c_string): Likewise.
+ (_gpgme_decode_percent_string): Likewise.
+ (_gpgme_map_gnupg_error): Change type of I to unsigned int.
+ * signers.c (gpgme_signers_clear): Likewise.
+ (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
+ Use SEQNO instead SEQ.
+ * wait.c (fd_table_put): Change type of I and J to unsigned int.
+ * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
+ to unsigned int.
+ (gpgme_wait): Change type of I and IDX to unsigned int.
+ * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
+ and I to unsigned int.
+ * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
+ int to suppress gcc warning.
+ (_gpgme_io_set_close_notify): Likewise.
+ (_gpgme_io_select): Change type of I to unsigned int.
+ * engine.c (gpgme_get_engine_info): Change type of PROTO to
+ unsigned int.
+ * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
+ I to unsigned int.
+
2003-07-29 Marcus Brinkmann <marcus@g10code.de>
* decrypt-verify.c (decrypt_verify_status_handler): Expand silly
is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */
gpgme_error_t
-_gpgme_decode_c_string (const char *src, char **destp, int len)
+_gpgme_decode_c_string (const char *src, char **destp, size_t len)
{
char *dest;
is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */
gpgme_error_t
-_gpgme_decode_percent_string (const char *src, char **destp, int len)
+_gpgme_decode_percent_string (const char *src, char **destp, size_t len)
{
char *dest;
gpgme_error_t
_gpgme_map_gnupg_error (char *err)
{
- int i;
+ unsigned int i;
for (i = 0; i < DIM (gnupg_errors); i++)
if (!strcmp (gnupg_errors[i].name, err))
gpgme_engine_info_t *lastp = &engine_info;
gpgme_protocol_t proto_list[] = { GPGME_PROTOCOL_OpenPGP,
GPGME_PROTOCOL_CMS };
- int proto;
+ unsigned int proto;
for (proto = 0; proto < DIM (proto_list); proto++)
{
return -1;
/* First call the notify handler. */
DEBUG1 ("closing fd %d", fd);
- if (fd >= 0 && fd < DIM (notify_table))
+ if (fd >= 0 && fd < (int) DIM (notify_table))
{
if (notify_table[fd].handler)
{
{
assert (fd != -1);
- if (fd < 0 || fd >= DIM (notify_table))
+ if (fd < 0 || fd >= (int) DIM (notify_table))
return -1;
DEBUG1 ("set notification for fd %d", fd);
notify_table[fd].handler = handler;
{
fd_set readfds;
fd_set writefds;
- int any, i, max_fd, n, count;
+ unsigned int i;
+ int any, max_fd, n, count;
struct timeval timeout = { 1, 0 }; /* Use a 1s timeout. */
void *dbg_help = NULL;
void
gpgme_signers_clear (gpgme_ctx_t ctx)
{
- int i;
+ unsigned int i;
if (!ctx || !ctx->signers)
return;
gpgme_key_t
gpgme_signers_enum (const gpgme_ctx_t ctx, int seq)
{
+ unsigned int seqno;
+
if (!ctx || seq < 0)
return NULL;
- if (seq >= ctx->signers_len)
+ seqno = (unsigned int) seq;
+ if (seqno >= ctx->signers_len)
return NULL;
-
- gpgme_key_ref (ctx->signers[seq]);
- return ctx->signers[seq];
+ gpgme_key_ref (ctx->signers[seqno]);
+ return ctx->signers[seqno];
}
the result. Currently, LEN is only used to specify if allocation
is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */
-gpgme_error_t _gpgme_decode_c_string (const char *src, char **destp, int len);
+gpgme_error_t _gpgme_decode_c_string (const char *src, char **destp,
+ size_t len);
/* Decode the percent escaped string SRC and store the result in the
buffer *DESTP which is LEN bytes long. If LEN is zero, then a
is desired or not, the caller is expected to make sure that *DESTP
is large enough if LEN is not zero. */
gpgme_error_t _gpgme_decode_percent_string (const char *src, char **destp,
- int len);
+ size_t len);
gpgme_error_t _gpgme_map_gnupg_error (char *err);
{
/* An error occured. Close all fds in this context, and
send the error in a done event. */
- int idx;
+ unsigned int idx;
for (idx = 0; idx <= ctx->fdt.size; idx++)
if (ctx->fdt.fds[idx].fd != -1)
{
do
{
- int i = 0;
+ unsigned int i = 0;
struct ctx_list_item *li;
struct fd_table fdt;
int nr;
{
/* An error occured. Close all fds in this context,
and signal it. */
- int idx;
+ unsigned int idx;
for (idx = 0; idx < ictx->fdt.size; idx++)
if (ictx->fdt.fds[idx].fd != -1)
do
{
int nr = _gpgme_io_select (ctx->fdt.fds, ctx->fdt.size, 0);
- int i;
+ unsigned int i;
if (nr < 0)
{
/* An error occured. Close all fds in this context, and
signal it. */
- int idx;
+ unsigned int idx;
err = gpg_error_from_errno (errno);
for (idx = 0; idx < ctx->fdt.size; idx++)
{
/* An error occured. Close all fds in this context,
and signal it. */
- int idx;
+ unsigned int idx;
for (idx = 0; idx < ctx->fdt.size; idx++)
if (ctx->fdt.fds[idx].fd != -1)
err = (*item->handler) (item->handler_value, fd);
if (err)
{
- int idx;
+ unsigned int idx;
for (idx = 0; idx < ctx->fdt.size; idx++)
if (ctx->fdt.fds[idx].fd != -1)
}
else
{
- int i;
+ unsigned int i;
for (i = 0; i < ctx->fdt.size; i++)
if (ctx->fdt.fds[i].fd != -1)
static gpgme_error_t
fd_table_put (fd_table_t fdt, int fd, int dir, void *opaque, int *idx)
{
- int i, j;
+ unsigned int i, j;
struct io_select_fd_s *new_fds;
for (i = 0; i < fdt->size; i++)