Merge "vpx_ports/mem_ops.h: clear some -Wconversion warnings"

This commit is contained in:
James Zern 2016-04-01 03:31:29 +00:00 коммит произвёл Gerrit Code Review
Родитель 4aac819a18 44a9edf406
Коммит 569c0dfc77
2 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -168,8 +168,8 @@ mem_get_s_generic(le, 32)
static VPX_INLINE void mem_put_be16(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 8) & 0xff;
mem[1] = (val >> 0) & 0xff;
mem[0] = (MAU_T)((val >> 8) & 0xff);
mem[1] = (MAU_T)((val >> 0) & 0xff);
}
#undef mem_put_be24
@ -177,9 +177,9 @@ static VPX_INLINE void mem_put_be16(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_be24(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 16) & 0xff;
mem[1] = (val >> 8) & 0xff;
mem[2] = (val >> 0) & 0xff;
mem[0] = (MAU_T)((val >> 16) & 0xff);
mem[1] = (MAU_T)((val >> 8) & 0xff);
mem[2] = (MAU_T)((val >> 0) & 0xff);
}
#undef mem_put_be32
@ -187,10 +187,10 @@ static VPX_INLINE void mem_put_be24(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_be32(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 24) & 0xff;
mem[1] = (val >> 16) & 0xff;
mem[2] = (val >> 8) & 0xff;
mem[3] = (val >> 0) & 0xff;
mem[0] = (MAU_T)((val >> 24) & 0xff);
mem[1] = (MAU_T)((val >> 16) & 0xff);
mem[2] = (MAU_T)((val >> 8) & 0xff);
mem[3] = (MAU_T)((val >> 0) & 0xff);
}
#undef mem_put_le16
@ -198,8 +198,8 @@ static VPX_INLINE void mem_put_be32(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le16(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
mem[1] = (val >> 8) & 0xff;
mem[0] = (MAU_T)((val >> 0) & 0xff);
mem[1] = (MAU_T)((val >> 8) & 0xff);
}
#undef mem_put_le24
@ -207,9 +207,9 @@ static VPX_INLINE void mem_put_le16(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le24(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
mem[1] = (val >> 8) & 0xff;
mem[2] = (val >> 16) & 0xff;
mem[0] = (MAU_T)((val >> 0) & 0xff);
mem[1] = (MAU_T)((val >> 8) & 0xff);
mem[2] = (MAU_T)((val >> 16) & 0xff);
}
#undef mem_put_le32
@ -217,10 +217,10 @@ static VPX_INLINE void mem_put_le24(void *vmem, MEM_VALUE_T val) {
static VPX_INLINE void mem_put_le32(void *vmem, MEM_VALUE_T val) {
MAU_T *mem = (MAU_T *)vmem;
mem[0] = (val >> 0) & 0xff;
mem[1] = (val >> 8) & 0xff;
mem[2] = (val >> 16) & 0xff;
mem[3] = (val >> 24) & 0xff;
mem[0] = (MAU_T)((val >> 0) & 0xff);
mem[1] = (MAU_T)((val >> 8) & 0xff);
mem[2] = (MAU_T)((val >> 16) & 0xff);
mem[3] = (MAU_T)((val >> 24) & 0xff);
}
#endif // VPX_PORTS_MEM_OPS_H_

Просмотреть файл

@ -28,8 +28,8 @@
* could redefine these macros.
*/
#define swap_endian_16(val,raw) do {\
val = ((raw>>8) & 0x00ff) \
| ((raw<<8) & 0xff00);\
val = (uint16_t)(((raw>>8) & 0x00ff) \
| ((raw<<8) & 0xff00));\
} while(0)
#define swap_endian_32(val,raw) do {\
val = ((raw>>24) & 0x000000ff) \