提交 b746f9c6 编写于 作者: B bae

6989717: media native code compiler warnings

Reviewed-by: jgodinez, prr
上级 7fc5c7c4
......@@ -210,6 +210,8 @@ mlib_status mlib_ImageAffine_alltypes(mlib_image *dst,
t_ind = 4;
else if (type == MLIB_DOUBLE)
t_ind = 5;
else
return MLIB_FAILURE; /* unknown image type */
if (colormap != NULL && filter != MLIB_NEAREST) {
if (t_ind != 0 && t_ind != 1)
......@@ -318,6 +320,10 @@ mlib_status mlib_ImageAffine_alltypes(mlib_image *dst,
}
break;
default:
/* nothing to do for other edge types. */
break;
}
if (param_e->buff_malloc != NULL)
......
......@@ -616,6 +616,9 @@ void mlib_ImageAffineEdgeZero(mlib_affine_param *param,
MLIB_PROCESS_EDGES_ZERO(mlib_d64);
break;
}
default:
/* Image type MLIB_BIT is not used in java, so we can ignore it. */
break;
}
}
......@@ -643,6 +646,9 @@ void mlib_ImageAffineEdgeNearest(mlib_affine_param *param,
case MLIB_DOUBLE:
MLIB_PROCESS_EDGES(MLIB_EDGE_NEAREST_LINE, mlib_d64);
break;
default:
/* Image type MLIB_BIT is not used in java, so we can ignore it. */
break;
}
}
......@@ -673,8 +679,11 @@ mlib_status mlib_ImageAffineEdgeExtend_BL(mlib_affine_param *param,
if (ltype == MLIB_BYTE) {
buff = mlib_malloc(channels * max_xsize);
}
else {
else if (ltype == MLIB_SHORT) {
buff = mlib_malloc(channels * max_xsize * sizeof(mlib_s16));
} else {
/* Unsupported type of lookup table. Report a failure */
return MLIB_FAILURE;
}
if (buff == NULL)
......@@ -691,6 +700,9 @@ mlib_status mlib_ImageAffineEdgeExtend_BL(mlib_affine_param *param,
srcStride >>= 1;
MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_u8i, mlib_s16);
break;
default:
/* Incompatible image type. Ignore it for now. */
break;
}
break;
......@@ -705,9 +717,18 @@ mlib_status mlib_ImageAffineEdgeExtend_BL(mlib_affine_param *param,
srcStride >>= 1;
MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_s16i, mlib_s16);
break;
default:
/* Incompatible image type. Ignore it for now. */
break;
}
break;
default:
/* Unsupported type of lookup table.
* Can not be here due to check on line 685,
* so just ignore it.
*/
break;
}
mlib_free(buff);
......@@ -744,6 +765,10 @@ mlib_status mlib_ImageAffineEdgeExtend_BL(mlib_affine_param *param,
srcStride >>= 3;
MLIB_PROCESS_EDGES(MLIB_EDGE_BL, mlib_d64);
break;
default:
/* Image type MLIB_BIT is not supported, ignore it. */
break;
}
return MLIB_SUCCESS;
......@@ -803,8 +828,11 @@ mlib_status mlib_ImageAffineEdgeExtend_BC(mlib_affine_param *param,
if (ltype == MLIB_BYTE) {
buff = mlib_malloc(channels * max_xsize);
}
else {
else if (ltype == MLIB_SHORT) {
buff = mlib_malloc(channels * max_xsize * sizeof(mlib_s16));
} else {
/* Unsupported type of lookup table. */
return MLIB_FAILURE;
}
if (buff == NULL)
......@@ -821,6 +849,9 @@ mlib_status mlib_ImageAffineEdgeExtend_BC(mlib_affine_param *param,
srcStride >>= 1;
MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_u8i, mlib_s16);
break;
default:
/* Ignore incomatible image type. */
break;
}
break;
......@@ -835,9 +866,19 @@ mlib_status mlib_ImageAffineEdgeExtend_BC(mlib_affine_param *param,
srcStride >>= 1;
MLIB_PROCESS_EDGES(MLIB_EDGE_INDEX_s16i, mlib_s16);
break;
default:
/* Ignore incomatible image type. */
break;
}
break;
default:
/* Unsupported type of lookup table.
* Can not be here due to check on line 836,
* so just ignore it.
*/
break;
}
mlib_free(buff);
......@@ -895,6 +936,10 @@ mlib_status mlib_ImageAffineEdgeExtend_BC(mlib_affine_param *param,
}
break;
default:
/* Ignore unsupported image type MLIB_BIT */
break;
}
return MLIB_SUCCESS;
......
......@@ -2623,9 +2623,10 @@ mlib_status mlib_ImageColorTrue2Index(mlib_image *dst,
return MLIB_FAILURE;
}
}
default:
/* Unsupported type of destination image */
return MLIB_FAILURE;
}
break;
}
case MLIB_SHORT:
......@@ -2678,18 +2679,15 @@ mlib_status mlib_ImageColorTrue2Index(mlib_image *dst,
return MLIB_FAILURE;
}
}
default:
/* Unsupported type of destination image */
return MLIB_FAILURE;
}
break;
}
default:
return MLIB_FAILURE;
}
/* we need to return something to make Microsoft VC happy.
Return FAILURE because on success we likely to return earlier. */
return MLIB_FAILURE;
}
/***************************************************************/
......
......@@ -211,6 +211,13 @@ mlib_status mlib_ImageConvMxN_f(mlib_image *dst,
case MLIB_DOUBLE:
ret = mlib_convMxNnw_d64(dst_i, src_i, kernel, m, n, dm, dn, cmask);
break;
default:
/* For some reasons, there is no convolution routine for type MLIB_BIT.
* For now, we silently ignore it (because this image type is not used by java),
* but probably we have to report an error.
*/
break;
}
}
......@@ -221,6 +228,11 @@ mlib_status mlib_ImageConvMxN_f(mlib_image *dst,
case MLIB_EDGE_DST_COPY_SRC:
mlib_ImageConvCopyEdge(dst_e, src_e, dx_l, dx_r, dy_t, dy_b, cmask);
break;
default:
/* Other edge conditions do not need additional handling.
* Note also that they are not exposed in public Java API
*/
break;
}
}
else { /* MLIB_EDGE_SRC_EXTEND */
......@@ -279,6 +291,12 @@ mlib_status mlib_ImageConvMxN_f(mlib_image *dst,
case MLIB_DOUBLE:
mlib_convMxNext_d64(dst_e, src_e, kernel, m, n, dx_l, dx_r, dy_t, dy_b, cmask);
break;
default:
/* For some reasons, there is no convolution routine for type MLIB_BIT.
* For now, we silently ignore it (because this image type is not used by java),
* but probably we have to report an error.
*/
break;
}
}
......
......@@ -1869,8 +1869,8 @@ static mlib_status mlib_ImageConv1xN_ext(mlib_image *dst,
/***************************************************************/
mlib_status CONV_FUNC_MxN
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
FTYPE buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
FTYPE **buffs = buffs_arr, *buffd;
FTYPE akernel[256], *k = akernel, fscale = DSCALE;
......@@ -2332,8 +2332,8 @@ mlib_status CONV_FUNC_MxN
mlib_status CONV_FUNC_MxN_I
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
mlib_s32 *pbuff = buff;
mlib_s32 **buffs = buffs_arr, *buffd;
......
......@@ -148,8 +148,8 @@ typedef union {
/***************************************************************/
#define DEF_VARS(type) \
type *adr_src, *sl, *sp; \
type *adr_dst, *dl, *dp; \
type *adr_src, *sl, *sp = NULL; \
type *adr_dst, *dl, *dp = NULL; \
FTYPE *pbuff = buff; \
mlib_s32 wid, hgt, sll, dll; \
mlib_s32 nchannel, chan1; \
......@@ -2060,8 +2060,8 @@ mlib_status CONV_FUNC_I(MxN)(mlib_image *dst,
mlib_s32 d0, d1, shift1, shift2;
mlib_s32 k0, k1, k2, k3, k4, k5, k6;
mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 wid, hgt, sll, dll;
mlib_s32 nchannel, chan1;
mlib_s32 i, j, c;
......
......@@ -78,7 +78,7 @@
/***************************************************************/
#define DEF_VARS_MxN(type) \
GET_SRC_DST_PARAMETERS(type); \
type *sl, *sp, *dl, *dp; \
type *sl, *sp = NULL, *dl, *dp = NULL; \
mlib_d64 *pbuff = buff; \
mlib_s32 i, j, c
......
......@@ -1869,8 +1869,8 @@ static mlib_status mlib_ImageConv1xN_ext(mlib_image *dst,
/***************************************************************/
mlib_status CONV_FUNC_MxN
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
FTYPE buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
FTYPE **buffs = buffs_arr, *buffd;
FTYPE akernel[256], *k = akernel, fscale = DSCALE;
......@@ -2332,8 +2332,8 @@ mlib_status CONV_FUNC_MxN
mlib_status CONV_FUNC_MxN_I
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
mlib_s32 *pbuff = buff;
mlib_s32 **buffs = buffs_arr, *buffd;
......
......@@ -149,8 +149,8 @@ typedef union {
/***************************************************************/
#define DEF_VARS(type) \
type *adr_src, *sl, *sp; \
type *adr_dst, *dl, *dp; \
type *adr_src, *sl, *sp = NULL; \
type *adr_dst, *dl, *dp = NULL; \
FTYPE *pbuff = buff; \
mlib_s32 wid, hgt, sll, dll; \
mlib_s32 nchannel, chan1; \
......@@ -2061,8 +2061,8 @@ mlib_status CONV_FUNC_I(MxN)(mlib_image *dst,
mlib_s32 d0, d1, shift1, shift2;
mlib_s32 k0, k1, k2, k3, k4, k5, k6;
mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 wid, hgt, sll, dll;
mlib_s32 nchannel, chan1;
mlib_s32 i, j, c;
......
......@@ -71,8 +71,8 @@
#define DEF_VARS(type) \
GET_SRC_DST_PARAMETERS(type); \
type *sl; \
type *dl, *dp; \
mlib_s32 i, j, c
type *dl, *dp = NULL; \
mlib_s32 i = 0, j, c
/***************************************************************/
#undef KSIZE
......
......@@ -71,7 +71,7 @@
#define DEF_VARS(type) \
GET_SRC_DST_PARAMETERS(type); \
type *sl; \
type *dl, *dp; \
type *dl, *dp = NULL; \
mlib_s32 i, j, c
/***************************************************************/
......
......@@ -1869,8 +1869,8 @@ static mlib_status mlib_ImageConv1xN_ext(mlib_image *dst,
/***************************************************************/
mlib_status CONV_FUNC_MxN
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
FTYPE buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
FTYPE **buffs = buffs_arr, *buffd;
FTYPE akernel[256], *k = akernel, fscale = DSCALE;
......@@ -2332,8 +2332,8 @@ mlib_status CONV_FUNC_MxN
mlib_status CONV_FUNC_MxN_I
{
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 buff[BUFF_SIZE], *buffs_arr[2*(MAX_N + 1)];
mlib_s32 *pbuff = buff;
mlib_s32 **buffs = buffs_arr, *buffd;
......
......@@ -148,8 +148,8 @@ typedef union {
/***************************************************************/
#define DEF_VARS(type) \
type *adr_src, *sl, *sp; \
type *adr_dst, *dl, *dp; \
type *adr_src, *sl, *sp = NULL; \
type *adr_dst, *dl, *dp = NULL; \
FTYPE *pbuff = buff; \
mlib_s32 wid, hgt, sll, dll; \
mlib_s32 nchannel, chan1; \
......@@ -2060,8 +2060,8 @@ mlib_status CONV_FUNC_I(MxN)(mlib_image *dst,
mlib_s32 d0, d1, shift1, shift2;
mlib_s32 k0, k1, k2, k3, k4, k5, k6;
mlib_s32 p0, p1, p2, p3, p4, p5, p6, p7;
DTYPE *adr_src, *sl, *sp;
DTYPE *adr_dst, *dl, *dp;
DTYPE *adr_src, *sl, *sp = NULL;
DTYPE *adr_dst, *dl, *dp = NULL;
mlib_s32 wid, hgt, sll, dll;
mlib_s32 nchannel, chan1;
mlib_s32 i, j, c;
......
......@@ -204,9 +204,9 @@ void mlib_ImageCopy_bit_na(const mlib_u8 *sa,
mlib_u64 *dp; /* 8-byte aligned start points in dst */
mlib_u64 *sp; /* 8-byte aligned start point in src */
mlib_s32 j; /* offset of address in dst */
mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFF;
mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFFULL;
mlib_u64 dmask;
mlib_u64 lsrc, lsrc0, lsrc1, ldst;
mlib_u64 lsrc, lsrc0, lsrc1 = 0ULL, ldst;
mlib_s32 ls_offset, ld_offset, shift;
if (size <= 0) return;
......@@ -427,9 +427,9 @@ void mlib_ImageCopy_bit_na_r(const mlib_u8 *sa,
mlib_u64 *dp; /* 8-byte aligned start points in dst */
mlib_u64 *sp; /* 8-byte aligned start point in src */
mlib_s32 j; /* offset of address in dst */
mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFF;
mlib_u64 lmask0 = 0xFFFFFFFFFFFFFFFFULL;
mlib_u64 dmask;
mlib_u64 lsrc, lsrc0, lsrc1, ldst;
mlib_u64 lsrc, lsrc0, lsrc1 = 0ULL, ldst;
mlib_s32 ls_offset, ld_offset, shift;
if (size <= 0) return;
......
......@@ -334,7 +334,7 @@ mlib_image *mlib_ImageCreateSubimage(mlib_image *img,
mlib_s32 width; /* for parent image */
mlib_s32 height; /* for parent image */
mlib_s32 stride;
mlib_s32 bitoffset;
mlib_s32 bitoffset = 0;
void *data;
/* sanity check */
......@@ -423,7 +423,7 @@ mlib_image *mlib_ImageSetSubimage(mlib_image *dst,
mlib_s32 channels = src -> channels;
mlib_s32 stride = src -> stride;
mlib_u8 *data = src -> data;
mlib_s32 bitoffset;
mlib_s32 bitoffset = 0;
data += y * stride;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册