aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorColin Snover2017-11-06 22:45:32 -0600
committerColin Snover2017-12-03 20:27:42 -0600
commita5bc89102e790d38d23a0a220ee2d42baee647a1 (patch)
tree32c3bdb45c8cd7cf3ef9ea1f7af2c9337a079334 /graphics
parentef33d8a2fb987f3fdbeb094aca2ecdfcd5b269ba (diff)
downloadscummvm-rg350-a5bc89102e790d38d23a0a220ee2d42baee647a1.tar.gz
scummvm-rg350-a5bc89102e790d38d23a0a220ee2d42baee647a1.tar.bz2
scummvm-rg350-a5bc89102e790d38d23a0a220ee2d42baee647a1.zip
ALL: Remove obsolete register keyword
The register keyword was deprecated from the C++11 standard, <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4193.html#809>, and removed from the C++17 standard, <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4340>, so cannot exist in a well-formed C++17 program. It has never done anything in GCC <https://gcc.gnu.org/ml/gcc/2010-05/msg00113.html> and because of the way it is specified in the standard, it is “as meaningful as whitespace” <http://www.drdobbs.com/keywords-that-arent-or-comments-by-anoth/184403859>. The one remaining use of the register keyword is in the DS backend, where it is used to create a local register variable using the non-standard GCC Extended Asm feature. Closes gh-1079.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRendererSpec.cpp14
-rw-r--r--graphics/scaler/2xsai.cpp9
-rw-r--r--graphics/scaler/hq2x.cpp2
-rw-r--r--graphics/scaler/hq3x.cpp2
-rw-r--r--graphics/scaler/intern.h4
-rw-r--r--graphics/yuv_to_rgb.cpp6
6 files changed, 18 insertions, 19 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 7d3cdff7c7..028f62101a 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -52,7 +52,7 @@ inline frac_t fp_sqroot(uint32 x) {
// decreasing values. By feeding it the sqrt of the previous old x, as well
// as the old x, it should be possible to compute the correct sqrt with far
// fewer than 23 iterations.
- register uint32 root, remHI, remLO, testDIV, count;
+ uint32 root, remHI, remLO, testDIV, count;
root = 0;
remHI = 0;
@@ -443,10 +443,10 @@ namespace Graphics {
*/
template<typename PixelType>
void colorFill(PixelType *first, PixelType *last, PixelType color) {
- register int count = (last - first);
+ int count = (last - first);
if (!count)
return;
- register int n = (count + 7) >> 3;
+ int n = (count + 7) >> 3;
switch (count % 8) {
case 0: do {
*first++ = color; // fall through
@@ -466,26 +466,26 @@ void colorFillClip(PixelType *first, PixelType *last, PixelType color, int realX
if (realY < clippingArea.top || realY >= clippingArea.bottom)
return;
- register int count = (last - first);
+ int count = (last - first);
if (realX > clippingArea.right || realX + count < clippingArea.left)
return;
if (realX < clippingArea.left) {
- register int diff = (clippingArea.left - realX);
+ int diff = (clippingArea.left - realX);
realX += diff;
count -= diff;
}
if (clippingArea.right <= realX + count) {
- register int diff = (realX + count - clippingArea.right);
+ int diff = (realX + count - clippingArea.right);
count -= diff;
}
if (!count)
return;
- register int n = (count + 7) >> 3;
+ int n = (count + 7) >> 3;
switch (count % 8) {
case 0: do {
*first++ = color; // fall through
diff --git a/graphics/scaler/2xsai.cpp b/graphics/scaler/2xsai.cpp
index 757c1cf8de..4389d52745 100644
--- a/graphics/scaler/2xsai.cpp
+++ b/graphics/scaler/2xsai.cpp
@@ -92,7 +92,7 @@ void Super2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uin
} else if (color5 == color3 && color2 != color6) {
product2b = product1b = color5;
} else if (color5 == color3 && color2 == color6) {
- register int r = 0;
+ int r = 0;
r += GetResult(color6, color5, color1, colorA1);
r += GetResult(color6, color5, color4, colorB1);
@@ -227,7 +227,7 @@ void SuperEagleTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uin
product2a = interpolate_1_1(color2, color3);
}
} else {
- register int r = 0;
+ int r = 0;
r += GetResult(color6, color5, color1, colorA1);
r += GetResult(color6, color5, color4, colorB1);
@@ -282,8 +282,7 @@ void _2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32
for (int i = 0; i < width; ++i) {
- register unsigned colorA, colorB;
- unsigned colorC, colorD,
+ unsigned colorA, colorB, colorC, colorD,
colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO;
unsigned product, product1, product2;
@@ -347,7 +346,7 @@ void _2xSaITemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32
product1 = colorA;
product2 = colorA;
} else {
- register int r = 0;
+ int r = 0;
product1 = interpolate_1_1(colorA, colorC);
product = interpolate_1_1(colorA, colorB);
diff --git a/graphics/scaler/hq2x.cpp b/graphics/scaler/hq2x.cpp
index 74ceebd611..7efbef305c 100644
--- a/graphics/scaler/hq2x.cpp
+++ b/graphics/scaler/hq2x.cpp
@@ -103,7 +103,7 @@ extern "C" uint32 *RGBtoYUV;
*/
template<typename ColorMask>
static void HQ2x_implementation(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- register int w1, w2, w3, w4, w5, w6, w7, w8, w9;
+ int w1, w2, w3, w4, w5, w6, w7, w8, w9;
const uint32 nextlineSrc = srcPitch / sizeof(uint16);
const uint16 *p = (const uint16 *)srcPtr;
diff --git a/graphics/scaler/hq3x.cpp b/graphics/scaler/hq3x.cpp
index f6c86b3017..8ef82aea3d 100644
--- a/graphics/scaler/hq3x.cpp
+++ b/graphics/scaler/hq3x.cpp
@@ -106,7 +106,7 @@ extern "C" uint32 *RGBtoYUV;
*/
template<typename ColorMask>
static void HQ3x_implementation(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
- register int w1, w2, w3, w4, w5, w6, w7, w8, w9;
+ int w1, w2, w3, w4, w5, w6, w7, w8, w9;
const uint32 nextlineSrc = srcPitch / sizeof(uint16);
const uint16 *p = (const uint16 *)srcPtr;
diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h
index 0f3f874675..eddc3c7f3d 100644
--- a/graphics/scaler/intern.h
+++ b/graphics/scaler/intern.h
@@ -46,8 +46,8 @@ static inline uint32 interpolate32_1_1(uint32 p1, uint32 p2) {
*/
template<typename ColorMask>
static inline uint32 interpolate32_3_1(uint32 p1, uint32 p2) {
- register uint32 x = ((p1 & ColorMask::qhighBits) >> 2) * 3 + ((p2 & ColorMask::qhighBits) >> 2);
- register uint32 y = ((p1 & ColorMask::qlowBits) * 3 + (p2 & ColorMask::qlowBits)) >> 2;
+ uint32 x = ((p1 & ColorMask::qhighBits) >> 2) * 3 + ((p2 & ColorMask::qhighBits) >> 2);
+ uint32 y = ((p1 & ColorMask::qlowBits) * 3 + (p2 & ColorMask::qlowBits)) >> 2;
y &= ColorMask::qlowBits;
return x + y;
diff --git a/graphics/yuv_to_rgb.cpp b/graphics/yuv_to_rgb.cpp
index 2a485fa664..f4429cb607 100644
--- a/graphics/yuv_to_rgb.cpp
+++ b/graphics/yuv_to_rgb.cpp
@@ -207,7 +207,7 @@ void convertYUV444ToRGB(byte *dstPtr, int dstPitch, const YUVToRGBLookup *lookup
for (int h = 0; h < yHeight; h++) {
for (int w = 0; w < yWidth; w++) {
- register const uint32 *L;
+ const uint32 *L;
int16 cr_r = Cr_r_tab[*vSrc];
int16 crb_g = Cr_g_tab[*vSrc] + Cb_g_tab[*uSrc];
@@ -256,7 +256,7 @@ void convertYUV420ToRGB(byte *dstPtr, int dstPitch, const YUVToRGBLookup *lookup
for (int h = 0; h < halfHeight; h++) {
for (int w = 0; w < halfWidth; w++) {
- register const uint32 *L;
+ const uint32 *L;
int16 cr_r = Cr_r_tab[*vSrc];
int16 crb_g = Cr_g_tab[*vSrc] + Cb_g_tab[*uSrc];
@@ -346,7 +346,7 @@ void convertYUV410ToRGB(byte *dstPtr, int dstPitch, const YUVToRGBLookup *lookup
// Declare some variables for the following macros
byte u, v;
int16 cr_r, crb_g, cb_b;
- register const uint32 *L;
+ const uint32 *L;
READ_QUAD(uSrc, u);
READ_QUAD(vSrc, v);