[ioquake3] 04/25: Avoid 'register' declarations
Simon McVittie
smcv at debian.org
Sun Mar 12 18:23:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit 2ab109b7729774cdfb791c80e855dea61c7b4d2f
Author: Simon McVittie <smcv at debian.org>
Date: Thu Sep 29 23:37:15 2016 +0100
Avoid 'register' declarations
gcc 6 with -Wall -Wextra warns:
code/botlib/l_precomp.c: In function ‘PC_NameHash’:
code/botlib/l_precomp.c:551:2: warning: ‘register’ is not at beginning of declaration [-Wold-style-declaration]
int register hash, i;
^~~
Modern compilers either ignore the register storage class when
generating code, or generate better code without it, so just remove
most of them.
The remaining uses are in third-party bundled libraries (libjpeg, zlib),
and in a PowerPC-specific inline function consisting of inline
assembler (because I'm not 100% confident that it doesn't have
some practical use there).
---
code/botlib/l_precomp.c | 2 +-
code/game/bg_lib.c | 6 +++---
code/qcommon/md5.c | 2 +-
code/qcommon/vm_interpreted.c | 4 ++--
code/renderergl1/tr_surface.c | 4 ++--
code/ui/ui_shared.c | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/code/botlib/l_precomp.c b/code/botlib/l_precomp.c
index 4414f4c..89f4a05 100644
--- a/code/botlib/l_precomp.c
+++ b/code/botlib/l_precomp.c
@@ -548,7 +548,7 @@ void PC_PrintDefineHashTable(define_t **definehash)
int PC_NameHash(char *name)
{
- int register hash, i;
+ int hash, i;
hash = 0;
for (i = 0; name[i] != '\0'; i++)
diff --git a/code/game/bg_lib.c b/code/game/bg_lib.c
index ff02321..f893f44 100644
--- a/code/game/bg_lib.c
+++ b/code/game/bg_lib.c
@@ -53,10 +53,10 @@ static void swapfunc(char *, char *, int, int);
*/
#define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \
- register TYPE *pi = (TYPE *) (parmi); \
- register TYPE *pj = (TYPE *) (parmj); \
+ TYPE *pi = (TYPE *) (parmi); \
+ TYPE *pj = (TYPE *) (parmj); \
do { \
- register TYPE t = *pi; \
+ TYPE t = *pi; \
*pi++ = *pj; \
*pj++ = t; \
} while (--i > 0); \
diff --git a/code/qcommon/md5.c b/code/qcommon/md5.c
index 994083f..d47560e 100644
--- a/code/qcommon/md5.c
+++ b/code/qcommon/md5.c
@@ -78,7 +78,7 @@ static void MD5Init(struct MD5Context *ctx)
static void MD5Transform(uint32_t buf[4],
uint32_t const in[16])
{
- register uint32_t a, b, c, d;
+ uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c
index aa45fde..f630d05 100644
--- a/code/qcommon/vm_interpreted.c
+++ b/code/qcommon/vm_interpreted.c
@@ -317,8 +317,8 @@ locals from sp
int VM_CallInterpreted( vm_t *vm, int *args ) {
byte stack[OPSTACK_SIZE + 15];
- register int *opStack;
- register uint8_t opStackOfs;
+ int *opStack;
+ uint8_t opStackOfs;
int programCounter;
int programStack;
int stackOnEntry;
diff --git a/code/renderergl1/tr_surface.c b/code/renderergl1/tr_surface.c
index c4a1b2d..9aadf95 100644
--- a/code/renderergl1/tr_surface.c
+++ b/code/renderergl1/tr_surface.c
@@ -563,8 +563,8 @@ static void VectorArrayNormalize(vec4_t *normals, unsigned int count)
#if idppc
{
- register float half = 0.5;
- register float one = 1.0;
+ float half = 0.5;
+ float one = 1.0;
float *components = (float *)normals;
// Vanilla PPC code, but since PPC has a reciprocal square root estimate instruction,
diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c
index c95d386..afef613 100644
--- a/code/ui/ui_shared.c
+++ b/code/ui/ui_shared.c
@@ -4366,7 +4366,7 @@ typedef struct keywordHash_s
} keywordHash_t;
int KeywordHash_Key(char *keyword) {
- int register hash, i;
+ int hash, i;
hash = 0;
for (i = 0; keyword[i] != '\0'; i++) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list