vpx_ports/mem_ops.h: clear some -Wconversion warnings
not strictly necessary, but allows projects using '-Wconversion -Wno-sign-conversion' to reuse these headers. Change-Id: Id1398d726c90173ccba9aea66798fcef6f20fa23
This commit is contained in:
Родитель
185836116c
Коммит
44a9edf406
|
@ -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) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче