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.
This commit is contained in:
parent
b0e0ab96cb
commit
f4c25d034c
@ -1,3 +1,29 @@
|
||||
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
|
||||
|
@ -65,7 +65,7 @@ _gpgme_hextobyte (const unsigned char *str)
|
||||
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;
|
||||
|
||||
@ -168,7 +168,7 @@ _gpgme_decode_c_string (const char *src, char **destp, int len)
|
||||
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;
|
||||
|
||||
@ -323,7 +323,7 @@ static struct
|
||||
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))
|
||||
|
@ -119,7 +119,7 @@ gpgme_get_engine_info (gpgme_engine_info_t *info)
|
||||
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++)
|
||||
{
|
||||
|
@ -115,7 +115,7 @@ _gpgme_io_close (int fd)
|
||||
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)
|
||||
{
|
||||
@ -134,7 +134,7 @@ _gpgme_io_set_close_notify (int fd, void (*handler)(int, void*), void *value)
|
||||
{
|
||||
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;
|
||||
@ -315,7 +315,8 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
|
||||
{
|
||||
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;
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
void
|
||||
gpgme_signers_clear (gpgme_ctx_t ctx)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (!ctx || !ctx->signers)
|
||||
return;
|
||||
@ -81,12 +81,14 @@ gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
|
||||
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];
|
||||
}
|
||||
|
@ -72,7 +72,8 @@ int _gpgme_hextobyte (const unsigned char *str);
|
||||
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
|
||||
@ -81,7 +82,7 @@ gpgme_error_t _gpgme_decode_c_string (const char *src, char **destp, int len);
|
||||
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);
|
||||
|
||||
|
@ -202,7 +202,7 @@ _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type,
|
||||
{
|
||||
/* 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)
|
||||
@ -255,7 +255,7 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang)
|
||||
{
|
||||
do
|
||||
{
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
struct ctx_list_item *li;
|
||||
struct fd_table fdt;
|
||||
int nr;
|
||||
@ -314,7 +314,7 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang)
|
||||
{
|
||||
/* 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)
|
||||
|
@ -79,13 +79,13 @@ _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond)
|
||||
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++)
|
||||
@ -113,7 +113,7 @@ _gpgme_wait_on_condition (gpgme_ctx_t ctx, volatile int *cond)
|
||||
{
|
||||
/* 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)
|
||||
|
@ -52,7 +52,7 @@ _gpgme_user_io_cb_handler (void *data, int fd)
|
||||
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)
|
||||
@ -61,7 +61,7 @@ _gpgme_user_io_cb_handler (void *data, int fd)
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ctx->fdt.size; i++)
|
||||
if (ctx->fdt.fds[i].fd != -1)
|
||||
|
@ -56,7 +56,7 @@ _gpgme_fd_table_deinit (fd_table_t fdt)
|
||||
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++)
|
||||
|
Loading…
Reference in New Issue
Block a user