remove keyword "register" in C++

This commit is contained in:
Ruipeng Li 2018-09-06 14:40:27 -07:00
parent 3d99e7e0a5
commit 9c25492b5c
4 changed files with 56 additions and 44 deletions

View File

@ -84,10 +84,10 @@ int MLI_Solver_SGS::solve(MLI_Vector *fIn, MLI_Vector *uIn)
{
int *ADiagI, *ADiagJ, *AOffdI, *AOffdJ;
double *ADiagA, *AOffdA, *uData, *fData;
register int iStart, iEnd, jj;
int iStart, iEnd, jj;
int i, j, is, localNRows, extNRows, *tmpJ, relaxError=0;
int iC, index, nprocs, mypid, nSends, start;
register double res;
double res;
double zero = 0.0, relaxWeight, rnorm;
double *vBufData=NULL, *tmpData, *vExtData=NULL;
MPI_Comm comm;
@ -486,10 +486,10 @@ int MLI_Solver_SGS::findOmega()
{
int *ADiagI, *ADiagJ, *AOffdI, *AOffdJ;
double *ADiagA, *AOffdA, *uData, *fData;
register int iStart, iEnd, jj;
int iStart, iEnd, jj;
int i, j, is, iR, localNRows, extNRows, *tmpJ;
int index, nprocs, mypid, nSends, start;
register double res;
double res;
double zero = 0.0, relaxWeight, rnorm, *relNorms;
double *vBufData=NULL, *tmpData, *vExtData=NULL;
MPI_Comm comm;

View File

@ -1,3 +1,9 @@
#ifdef __cplusplus
#define REGISTER
#else
#define REGISTER register
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -13,7 +19,7 @@ extern "C" {
integer s_cmp(char *a0,const char *b0, ftnlen la, ftnlen lb)
{
register unsigned char *a, *aend, *b, *bend;
REGISTER unsigned char *a, *aend, *b, *bend;
a = (unsigned char *)a0;
b = (unsigned char *)b0;
aend = a + la;
@ -52,7 +58,7 @@ return(0);
integer s_copy(char *a,const char *b, ftnlen la, ftnlen lb)
{
register char *aend, *bend;
REGISTER char *aend, *bend;
aend = a + la;

View File

@ -10,8 +10,11 @@
* $Revision$
***********************************************************************EHEADER*/
#ifdef __cplusplus
#define REGISTER
#else
#define REGISTER register
#endif
/*
* distributed_qsort.c:
@ -47,12 +50,12 @@ static HYPRE_Int mthresh; /* MTHRESHold in chars */
void
hypre_tex_qsort(char* base,HYPRE_Int n,HYPRE_Int size, HYPRE_Int (*compar) (char*,char*))
{
register char *i;
register char *j;
register char *lo;
register char *hi;
register char *min;
register char c;
REGISTER char *i;
REGISTER char *j;
REGISTER char *lo;
REGISTER char *hi;
REGISTER char *min;
REGISTER char c;
char *max;
if (n <= 1)
@ -129,12 +132,12 @@ hypre_tex_qsort(char* base,HYPRE_Int n,HYPRE_Int size, HYPRE_Int (*compar) (char
static void qst(char *base, char *max)
{
register char *i;
register char *j;
register char *jj;
register char *mid;
register HYPRE_Int ii;
register char c;
REGISTER char *i;
REGISTER char *j;
REGISTER char *jj;
REGISTER char *mid;
REGISTER HYPRE_Int ii;
REGISTER char c;
char *tmp;
HYPRE_Int lo;
HYPRE_Int hi;

View File

@ -10,8 +10,11 @@
* $Revision$
***********************************************************************EHEADER*/
#ifdef __cplusplus
#define REGISTER
#else
#define REGISTER register
#endif
/*
* distributed_qsort.c:
@ -43,12 +46,12 @@ static void sdqst(HYPRE_Int *, HYPRE_Int *);
void hypre_sincsort_fast(HYPRE_Int n, HYPRE_Int *base)
{
register HYPRE_Int *i;
register HYPRE_Int *j;
register HYPRE_Int *lo;
register HYPRE_Int *hi;
register HYPRE_Int *min;
register HYPRE_Int c;
REGISTER HYPRE_Int *i;
REGISTER HYPRE_Int *j;
REGISTER HYPRE_Int *lo;
REGISTER HYPRE_Int *hi;
REGISTER HYPRE_Int *min;
REGISTER HYPRE_Int c;
HYPRE_Int *max;
if (n <= 1)
@ -115,11 +118,11 @@ void hypre_sincsort_fast(HYPRE_Int n, HYPRE_Int *base)
static void siqst(HYPRE_Int *base, HYPRE_Int *max)
{
register HYPRE_Int *i;
register HYPRE_Int *j;
register HYPRE_Int *jj;
register HYPRE_Int *mid;
register HYPRE_Int c;
REGISTER HYPRE_Int *i;
REGISTER HYPRE_Int *j;
REGISTER HYPRE_Int *jj;
REGISTER HYPRE_Int *mid;
REGISTER HYPRE_Int c;
HYPRE_Int *tmp;
HYPRE_Int lo;
HYPRE_Int hi;
@ -207,12 +210,12 @@ swap:
**************************************************************************/
void hypre_sdecsort_fast(HYPRE_Int n, HYPRE_Int *base)
{
register HYPRE_Int *i;
register HYPRE_Int *j;
register HYPRE_Int *lo;
register HYPRE_Int *hi;
register HYPRE_Int *min;
register HYPRE_Int c;
REGISTER HYPRE_Int *i;
REGISTER HYPRE_Int *j;
REGISTER HYPRE_Int *lo;
REGISTER HYPRE_Int *hi;
REGISTER HYPRE_Int *min;
REGISTER HYPRE_Int c;
HYPRE_Int *max;
if (n <= 1)
@ -264,11 +267,11 @@ void hypre_sdecsort_fast(HYPRE_Int n, HYPRE_Int *base)
static void sdqst(HYPRE_Int *base, HYPRE_Int *max)
{
register HYPRE_Int *i;
register HYPRE_Int *j;
register HYPRE_Int *jj;
register HYPRE_Int *mid;
register HYPRE_Int c;
REGISTER HYPRE_Int *i;
REGISTER HYPRE_Int *j;
REGISTER HYPRE_Int *jj;
REGISTER HYPRE_Int *mid;
REGISTER HYPRE_Int c;
HYPRE_Int *tmp;
HYPRE_Int lo;
HYPRE_Int hi;