fix -Wsign-compare issues

This commit is contained in:
lukem 2009-02-12 09:05:13 +00:00
parent c7201a0f39
commit f092a45e5d
3 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ atf_dynstr_init_ap(atf_dynstr_t *ad, const char *fmt, va_list ap)
if (ret < 0) {
err = atf_libc_error(errno, "Cannot format string");
} else {
if (ret >= ad->m_datasize) {
if ((size_t)ret >= ad->m_datasize) {
free(ad->m_data);
ad->m_data = NULL;
}

View File

@ -423,7 +423,7 @@ atf_fs_path_branch_path(const atf_fs_path_t *p, atf_fs_path_t *bp)
const ssize_t endpos = atf_dynstr_rfind_ch(&p->m_data, '/');
atf_error_t err;
if (endpos == atf_dynstr_npos)
if ((size_t)endpos == atf_dynstr_npos)
err = atf_fs_path_init_fmt(bp, ".");
else if (endpos == 0)
err = atf_fs_path_init_fmt(bp, "/");
@ -452,7 +452,7 @@ atf_fs_path_leaf_name(const atf_fs_path_t *p, atf_dynstr_t *ln)
ssize_t begpos = atf_dynstr_rfind_ch(&p->m_data, '/');
atf_error_t err;
if (begpos == atf_dynstr_npos)
if ((size_t)begpos == atf_dynstr_npos)
begpos = 0;
else
begpos++;

View File

@ -80,7 +80,7 @@ atf_io_write_ap(int fd, const char *fmt, va_list ap)
"descriptor %d", atf_dynstr_cstring(&str),
fd);
else {
INV(cnt == atf_dynstr_length(&str));
INV((size_t)cnt == atf_dynstr_length(&str));
err = atf_no_error();
}