vp9: fix -Wclobbered (longjmp + local variables)

Local variables used at the setjmp() site need to be marked volatile.
Relevant excerpt from the 'man longjmp':

===============
The values of automatic variables are unspecified after a call to
longjmp() if they meet all the following criteria:
·  they are local to the function that made the corresponding setjmp(3) call;
·  their values are changed between the calls to setjmp(3) and longjmp(); and
·  they are not declared as volatile.
===============

Change-Id: I093e6eeeedbf5f781d202248ca701ba2c29d3064
This commit is contained in:
James Zern 2014-12-23 11:44:11 -05:00
Родитель 4e04fa6dea
Коммит 59d63e610a
2 изменённых файлов: 5 добавлений и 5 удалений

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

@ -63,8 +63,8 @@ static void vp9_dec_free_mi(VP9_COMMON *cm) {
} }
VP9Decoder *vp9_decoder_create() { VP9Decoder *vp9_decoder_create() {
VP9Decoder *const pbi = vpx_memalign(32, sizeof(*pbi)); VP9Decoder *volatile const pbi = vpx_memalign(32, sizeof(*pbi));
VP9_COMMON *const cm = pbi ? &pbi->common : NULL; VP9_COMMON *volatile const cm = pbi ? &pbi->common : NULL;
if (!cm) if (!cm)
return NULL; return NULL;
@ -243,7 +243,7 @@ static void swap_frame_buffers(VP9Decoder *pbi) {
int vp9_receive_compressed_data(VP9Decoder *pbi, int vp9_receive_compressed_data(VP9Decoder *pbi,
size_t size, const uint8_t **psource) { size_t size, const uint8_t **psource) {
VP9_COMMON *const cm = &pbi->common; VP9_COMMON *volatile const cm = &pbi->common;
const uint8_t *source = *psource; const uint8_t *source = *psource;
int retcode = 0; int retcode = 0;

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

@ -1406,8 +1406,8 @@ static void cal_nmvsadcosts_hp(int *mvsadcost[2]) {
VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) { VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
unsigned int i; unsigned int i;
VP9_COMP *const cpi = vpx_memalign(32, sizeof(VP9_COMP)); VP9_COMP *volatile const cpi = vpx_memalign(32, sizeof(VP9_COMP));
VP9_COMMON *const cm = cpi != NULL ? &cpi->common : NULL; VP9_COMMON *volatile const cm = cpi != NULL ? &cpi->common : NULL;
if (!cm) if (!cm)
return NULL; return NULL;