Fix gcc sign-compare warnings
This commit is contained in:
parent
2a69b0a5a8
commit
d63c18136a
|
@ -296,11 +296,11 @@ static int verify_strxcpy(const char *src, int dst_size, int exp_ret,
|
|||
{
|
||||
char dst[6];
|
||||
const char GUARDS[2] = {'@', '\0'};
|
||||
int i, ret;
|
||||
int i, ig, ret;
|
||||
|
||||
PJ_ASSERT_RETURN(src && dst_size <= 5, -700);
|
||||
|
||||
for (int ig=0; ig<sizeof(GUARDS); ++ig) {
|
||||
for (ig=0; ig<(int)sizeof(GUARDS); ++ig) {
|
||||
char GUARD = GUARDS[ig];
|
||||
|
||||
memset(dst, GUARD, sizeof(dst));
|
||||
|
@ -400,11 +400,11 @@ static int verify_strxcpy2(const pj_str_t *src, int dst_size, int exp_ret,
|
|||
{
|
||||
char dst[6];
|
||||
const char GUARDS[2] = {'@', '\0'};
|
||||
int i, ret;
|
||||
int i, ret, ig;
|
||||
|
||||
PJ_ASSERT_RETURN(src && dst_size <= 5, -720);
|
||||
|
||||
for (int ig=0; ig<sizeof(GUARDS); ++ig) {
|
||||
for (ig=0; ig<(int)sizeof(GUARDS); ++ig) {
|
||||
char GUARD = GUARDS[ig];
|
||||
|
||||
memset(dst, GUARD, sizeof(dst));
|
||||
|
@ -432,7 +432,7 @@ static int verify_strxcpy2(const pj_str_t *src, int dst_size, int exp_ret,
|
|||
}
|
||||
|
||||
/* verify not writing pass buffer */
|
||||
for (i=dst_size; i<sizeof(dst); ++i) {
|
||||
for (i=dst_size; i<(int)sizeof(dst); ++i) {
|
||||
if (dst[i] != GUARD) {
|
||||
PJ_LOG(3,("", " strxcpy2 \"%.*s\" slen=%ld, dst_size=%d: "
|
||||
"overflow at %d (chr %d)",
|
||||
|
@ -526,19 +526,19 @@ static int verify_strxcat(const char *cdst, const char *src, int dst_size,
|
|||
{
|
||||
char dst[6];
|
||||
const char GUARDS[2] = {'@', '\0'};
|
||||
int i, ret;
|
||||
int i, ret, ig;
|
||||
|
||||
PJ_ASSERT_RETURN(src && strlen(cdst) <= 4, -730);
|
||||
PJ_ASSERT_RETURN((int)strlen(cdst) < dst_size ||
|
||||
(strlen(cdst)==0 && dst_size==0), -731);
|
||||
|
||||
for (int ig=0; ig<sizeof(GUARDS); ++ig) {
|
||||
for (ig=0; ig<(int)sizeof(GUARDS); ++ig) {
|
||||
char GUARD = GUARDS[ig];
|
||||
|
||||
memset(dst, GUARD, sizeof(dst));
|
||||
if (dst_size) {
|
||||
ret = pj_ansi_strxcpy(dst, cdst, dst_size);
|
||||
PJ_ASSERT_RETURN(ret==strlen(cdst), -732);
|
||||
PJ_ASSERT_RETURN(ret==(int)strlen(cdst), -732);
|
||||
}
|
||||
|
||||
ret = pj_ansi_strxcat(dst, src, dst_size);
|
||||
|
|
|
@ -193,7 +193,7 @@ static void alsa_error_handler (const char *file,
|
|||
}
|
||||
|
||||
va_start (arg, fmt);
|
||||
if (index < sizeof(err_msg)-1) {
|
||||
if (index < (int)sizeof(err_msg)-1) {
|
||||
len = vsnprintf( err_msg+index, sizeof(err_msg)-index, fmt, arg);
|
||||
if (len < 1 || len >= (int)sizeof(err_msg)-index)
|
||||
len = sizeof(err_msg)-index-1;
|
||||
|
@ -201,7 +201,7 @@ static void alsa_error_handler (const char *file,
|
|||
err_msg[index] = '\0';
|
||||
}
|
||||
va_end(arg);
|
||||
if (err && index < sizeof(err_msg)-1) {
|
||||
if (err && index < (int)sizeof(err_msg)-1) {
|
||||
len = snprintf( err_msg+index, sizeof(err_msg)-index, ": %s",
|
||||
snd_strerror(err));
|
||||
if (len < 1 || len >= (int)sizeof(err_msg)-index)
|
||||
|
@ -635,7 +635,7 @@ static pj_status_t open_playback (struct alsa_stream* stream,
|
|||
snd_pcm_uframes_t tmp_buf_size;
|
||||
snd_pcm_uframes_t tmp_period_size;
|
||||
|
||||
if (param->play_id < 0 || param->play_id >= stream->af->dev_cnt)
|
||||
if (param->play_id < 0 || param->play_id >= (int)stream->af->dev_cnt)
|
||||
return PJMEDIA_EAUD_INVDEV;
|
||||
|
||||
/* Open PCM for playback */
|
||||
|
@ -773,7 +773,7 @@ static pj_status_t open_capture (struct alsa_stream* stream,
|
|||
snd_pcm_uframes_t tmp_buf_size;
|
||||
snd_pcm_uframes_t tmp_period_size;
|
||||
|
||||
if (param->rec_id < 0 || param->rec_id >= stream->af->dev_cnt)
|
||||
if (param->rec_id < 0 || param->rec_id >= (int)stream->af->dev_cnt)
|
||||
return PJMEDIA_EAUD_INVDEV;
|
||||
|
||||
/* Open PCM for capture */
|
||||
|
|
|
@ -472,7 +472,8 @@ static pj_status_t silk_enum_codecs(pjmedia_codec_factory *factory,
|
|||
max = *count;
|
||||
*count = 0;
|
||||
|
||||
for (i = 0; i<PJ_ARRAY_SIZE(silk_factory.silk_param) && *count<max; ++i)
|
||||
for (i = 0; i<(int)PJ_ARRAY_SIZE(silk_factory.silk_param) && *count<max;
|
||||
++i)
|
||||
{
|
||||
silk_param *sp = &silk_factory.silk_param[i];
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ static void v4l2_get_supported_size(int fd,
|
|||
if (fmt_map == NULL)
|
||||
return;
|
||||
|
||||
for (;i<PJ_ARRAY_SIZE(v4l_sizes) &&
|
||||
for (;i<(int)PJ_ARRAY_SIZE(v4l_sizes) &&
|
||||
info->fmt_cnt<PJMEDIA_VID_DEV_INFO_FMT_CNT;
|
||||
i++)
|
||||
{
|
||||
|
@ -322,7 +322,7 @@ static pj_status_t v4l2_scan_devs(vid4lin_factory *f)
|
|||
|
||||
PJ_LOG(5,(THIS_FILE, "Found capture device %s", pdi->v4l2_cap.card));
|
||||
PJ_LOG(5,(THIS_FILE, " Enumerating formats:"));
|
||||
for (j=0; fmt_cnt<PJ_ARRAY_SIZE(fmt_cap); ++j) {
|
||||
for (j=0; fmt_cnt<(int)PJ_ARRAY_SIZE(fmt_cap); ++j) {
|
||||
struct v4l2_fmtdesc fdesc;
|
||||
unsigned k;
|
||||
|
||||
|
@ -597,7 +597,7 @@ static pj_status_t vid4lin_factory_create_stream(pjmedia_vid_dev_factory *f,
|
|||
param->fmt.detail_type == PJMEDIA_FORMAT_DETAIL_VIDEO &&
|
||||
param->dir == PJMEDIA_DIR_CAPTURE,
|
||||
PJ_EINVAL);
|
||||
PJ_ASSERT_RETURN(param->cap_id >= 0 && param->cap_id < cf->dev_count,
|
||||
PJ_ASSERT_RETURN(param->cap_id >= 0 && param->cap_id < (int)cf->dev_count,
|
||||
PJMEDIA_EVID_INVDEV);
|
||||
|
||||
fmt_info = pjmedia_get_video_format_info(NULL, param->fmt.id);
|
||||
|
|
|
@ -578,7 +578,7 @@ static pj_status_t ssl_get_srtp_material(dtls_srtp *ds)
|
|||
rx = &ds->rx_crypto;
|
||||
pj_bzero(tx, sizeof(*tx));
|
||||
pj_bzero(rx, sizeof(*rx));
|
||||
for (i=0; i<PJ_ARRAY_SIZE(ossl_profiles); ++i) {
|
||||
for (i=0; i<(int)PJ_ARRAY_SIZE(ossl_profiles); ++i) {
|
||||
if (pj_ansi_stricmp(profile->name, ossl_profiles[i])==0) {
|
||||
pj_strset2(&tx->name, pj_profiles[i]);
|
||||
pj_strset2(&rx->name, pj_profiles[i]);
|
||||
|
|
|
@ -1529,7 +1529,7 @@ LIBG7221_DEF(Word16) i_mult (Word16 a, Word16 b)
|
|||
#ifdef ORIGINAL_G7231
|
||||
return a*b ;
|
||||
#else
|
||||
Word32 register c=a*b;
|
||||
register Word32 c=a*b;
|
||||
#if (WMOPS)
|
||||
multiCounter[currCounter].i_mult++;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue