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.
This commit is contained in:
Colin Snover 2017-11-06 22:45:32 -06:00
parent ef33d8a2fb
commit a5bc89102e
21 changed files with 64 additions and 65 deletions

View file

@ -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