diff options
| author | Matthieu Darbois <mayeut@users.noreply.github.com> | 2016-09-06 00:49:53 +0200 |
|---|---|---|
| committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2016-09-13 11:00:07 +0200 |
| commit | c8fbf0f5160a78d2d39666f69c95293ca99c0f0d (patch) | |
| tree | 0b1681d9b069c63c8856675c3e22e2f803463b3f /src/lib/openjp2/t1.c | |
| parent | 4d2527aa61286579ecda46a829229786136c041e (diff) | |
Change 'restrict' define to 'OPJ_RESTRICT' (#816)
Visual Studio 2015 does not pass regression tests with `__restrict` so kept disabled for MSVC.
Need to check proper usage of OPJ_RESTRICT (if correct then there’s
probably a bug in vc14)
Closes #661
Diffstat (limited to 'src/lib/openjp2/t1.c')
| -rw-r--r-- | src/lib/openjp2/t1.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 1bf7205e..cb5a1cef 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -1283,14 +1283,14 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1, opj_tcd_resolution_t* res = &tilec->resolutions[resno]; for (bandno = 0; bandno < res->numbands; ++bandno) { - opj_tcd_band_t* restrict band = &res->bands[bandno]; + opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno]; for (precno = 0; precno < res->pw * res->ph; ++precno) { opj_tcd_precinct_t* precinct = &band->precincts[precno]; for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) { opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno]; - OPJ_INT32* restrict datap; + OPJ_INT32* OPJ_RESTRICT datap; OPJ_UINT32 cblk_w, cblk_h; OPJ_INT32 x, y; OPJ_UINT32 i, j; @@ -1333,7 +1333,7 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1, } } if (tccp->qmfbid == 1) { - OPJ_INT32* restrict tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x]; + OPJ_INT32* OPJ_RESTRICT tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x]; for (j = 0; j < cblk_h; ++j) { for (i = 0; i < cblk_w; ++i) { OPJ_INT32 tmp = datap[(j * cblk_w) + i]; @@ -1341,9 +1341,9 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1, } } } else { /* if (tccp->qmfbid == 0) */ - OPJ_FLOAT32* restrict tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x]; + OPJ_FLOAT32* OPJ_RESTRICT tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x]; for (j = 0; j < cblk_h; ++j) { - OPJ_FLOAT32* restrict tiledp2 = tiledp; + OPJ_FLOAT32* OPJ_RESTRICT tiledp2 = tiledp; for (i = 0; i < cblk_w; ++i) { OPJ_FLOAT32 tmp = (OPJ_FLOAT32)*datap * band->stepsize; *tiledp2 = tmp; @@ -1475,7 +1475,7 @@ OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1, opj_tcd_resolution_t *res = &tilec->resolutions[resno]; for (bandno = 0; bandno < res->numbands; ++bandno) { - opj_tcd_band_t* restrict band = &res->bands[bandno]; + opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno]; OPJ_INT32 bandconst = 8192 * 8192 / ((OPJ_INT32) floor(band->stepsize * 8192)); for (precno = 0; precno < res->pw * res->ph; ++precno) { @@ -1483,7 +1483,7 @@ OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1, for (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) { opj_tcd_cblk_enc_t* cblk = &prc->cblks.enc[cblkno]; - OPJ_INT32* restrict tiledp; + OPJ_INT32* OPJ_RESTRICT tiledp; OPJ_UINT32 cblk_w; OPJ_UINT32 cblk_h; OPJ_UINT32 i, j, tileIndex=0, tileLineAdvance; |
