Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple of little updates. #483

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion neo/idlib/Lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ RESULTS
Reverses the byte order in each of elcount elements.
===================================================================== */
ID_INLINE static void RevBytesSwap( void *bp, int elsize, int elcount ) {
register unsigned char *p, *q;
unsigned char *p, *q;

p = ( unsigned char * ) bp;

Expand Down Expand Up @@ -515,6 +515,10 @@ void AssertFailed( const char *file, int line, const char *expression ) {
#ifdef _MSC_VER
__debugbreak();
_exit(1);
#elif defined(__clang__)
// More appropriate than __builtin_trap, indeed it does trigger SIGILL
// but SIGTRAP instead. only clang supports for now (so far).
__builtin_debugtrap();
#elif defined(__unix__)
// __builtin_trap() causes an illegal instruction which is kinda ugly.
// especially if you'd like to be able to continue after the assertion during debugging
Expand Down
2 changes: 1 addition & 1 deletion neo/idlib/hashing/MD5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ the data and converts bytes into longwords for this routine.
=================
*/
void MD5_Transform( unsigned int state[4], unsigned int in[16] ) {
register unsigned int a, b, c, d;
unsigned int a, b, c, d;

a = state[0];
b = state[1];
Expand Down
4 changes: 2 additions & 2 deletions neo/idlib/math/Simd_Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ void VPCALL idSIMD_Generic::MatX_LowerTriangularSolve( const idMatX &L, float *x
lptr = L[skip];

int i, j;
register double s0, s1, s2, s3;
double s0, s1, s2, s3;

for ( i = skip; i < n; i++ ) {
s0 = lptr[0] * x[0];
Expand Down Expand Up @@ -1928,7 +1928,7 @@ void VPCALL idSIMD_Generic::MatX_LowerTriangularSolveTranspose( const idMatX &L,
}

int i, j;
register double s0, s1, s2, s3;
double s0, s1, s2, s3;
float *xptr;

lptr = L.ToFloatPtr() + n * nc + n - 4;
Expand Down
6 changes: 3 additions & 3 deletions neo/sound/snd_emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,16 +1147,16 @@ idSlowChannel::Reset
===================
*/
void idSlowChannel::Reset() {
memset( this, 0, sizeof( *this ) );

this->chan = chan;
active = false;
chan = nullptr;

curPosition.Set( 0 );
newPosition.Set( 0 );

curSampleOffset = -10000;
newSampleOffset = -10000;

playbackState = 0;
triggerOffset = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion neo/tools/compilers/roqvq/codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ void codec::IRGBtab(void)
float codec::Snr( byte *old, byte *bnew, int size ) {
int i, j;
float fsnr;
register int ind;
int ind;

ind = 0;

Expand Down