Skip to content

Commit

Permalink
Remove use of deprecated register keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 19, 2015
1 parent b45d384 commit 6e47683
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Expand Up @@ -331,11 +331,6 @@ ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
OR (APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.1"))
SET(USE_CXX_11 TRUE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-error=c++11-narrowing")
#deprecated-register breaks Travis builds
IF ((NOT APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3")
OR (APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0"))
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
ENDIF()
ENDIF()
ELSE()
SET(USE_CXX_11 FALSE)
Expand Down
6 changes: 3 additions & 3 deletions src/analysis/vector/mersenne-twister.cpp
Expand Up @@ -67,7 +67,7 @@ static inline void generate_numbers()
*/

static const uint32_t MATRIX[2] = {0, 0x9908b0df};
register uint32_t y, i = 0;
uint32_t y, i = 0;

// i = [0 ... 226]
while ( i < ( DIFF - 1 ) )
Expand Down Expand Up @@ -145,7 +145,7 @@ extern "C" void seed( uint32_t value )
MT[0] = value;
index = 0;

for ( register unsigned i = 1; i < SIZE; ++i )
for ( unsigned i = 1; i < SIZE; ++i )
MT[i] = 0x6c078965 * ( MT[i-1] ^ MT[i-1] >> 30 ) + i;
}

Expand All @@ -154,7 +154,7 @@ extern "C" uint32_t rand_u32()
if ( !index )
generate_numbers();

register uint32_t y = MT[index];
uint32_t y = MT[index];

// Tempering
y ^= y >> 11;
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/labelposition.cpp
Expand Up @@ -65,7 +65,7 @@ namespace pal
while ( this->alpha < 0 )
this->alpha += 2 * M_PI;

register double beta = this->alpha + ( M_PI / 2 );
double beta = this->alpha + ( M_PI / 2 );

double dx1, dx2, dy1, dy2;

Expand Down
6 changes: 3 additions & 3 deletions src/core/pal/problem.cpp
Expand Up @@ -682,8 +682,8 @@ namespace pal
int *sub;

int id;
register int featS;
register int p;
int featS;
int p;
int i;

int n = 0;
Expand Down Expand Up @@ -1390,7 +1390,7 @@ namespace pal
int subSize = part->subSize;
int *sub = part->sub;
int *sol = part->sol;
register int subseed;
int subseed;

double delta;
double delta_min;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dxf2shp_converter/builder.cpp
Expand Up @@ -329,8 +329,8 @@ void Builder::addArc( const DL_ArcData& data )
return;
}

register int i = 0;
register long shpIndex = 0;
int i = 0;
long shpIndex = 0;

// Approximate the arc

Expand Down Expand Up @@ -411,7 +411,7 @@ void Builder::addCircle( const DL_CircleData& data )
DL_PointData myPoint;

// Approximate the circle with 360 line segments connecting points along that circle
register long shpIndex = 0;
long shpIndex = 0;
for ( double i = 0.0; i <= 2*M_PI; i += M_PI / 180.0, shpIndex++ )
{
myPoint.x = data.radius * cos( i ) + data.cx + currentBlockX;
Expand Down

0 comments on commit 6e47683

Please sign in to comment.