cleanup
use function-style or C-style casts, not static_cast; they're identical and easier to read
This commit is contained in:
@@ -38,7 +38,7 @@ int NoteDataWithScoring::GetNumTapNotesWithScore( TapNoteScore tns, const float
|
|||||||
unsigned iStartIndex = BeatToNoteRow( fStartBeat );
|
unsigned iStartIndex = BeatToNoteRow( fStartBeat );
|
||||||
unsigned iEndIndex = BeatToNoteRow( fEndBeat );
|
unsigned iEndIndex = BeatToNoteRow( fEndBeat );
|
||||||
|
|
||||||
for( unsigned i=iStartIndex; i<min(static_cast<float>(iEndIndex), static_cast<float>(m_TapNoteScores[0].size())); i++ )
|
for( unsigned i=iStartIndex; i<min(float(iEndIndex), float(m_TapNoteScores[0].size())); i++ )
|
||||||
{
|
{
|
||||||
for( int t=0; t<GetNumTracks(); t++ )
|
for( int t=0; t<GetNumTracks(); t++ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -391,8 +391,8 @@ retry:
|
|||||||
/* Set the palette. */
|
/* Set the palette. */
|
||||||
GLExt::glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, palette);
|
GLExt::glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, palette);
|
||||||
|
|
||||||
int RealFormat = 0;
|
GLint RealFormat = 0;
|
||||||
GLExt::glGetColorTableParameterivEXT(GL_TEXTURE_2D, GL_COLOR_TABLE_FORMAT, reinterpret_cast<GLint*>(&RealFormat));
|
GLExt::glGetColorTableParameterivEXT(GL_TEXTURE_2D, GL_COLOR_TABLE_FORMAT, &RealFormat);
|
||||||
if(RealFormat != GL_RGBA8)
|
if(RealFormat != GL_RGBA8)
|
||||||
{
|
{
|
||||||
/* This is a case I don't expect to happen; if it does, log,
|
/* This is a case I don't expect to happen; if it does, log,
|
||||||
@@ -444,8 +444,8 @@ retry:
|
|||||||
/* If we're paletted, and didn't get the 8-bit palette we asked for ...*/
|
/* If we're paletted, and didn't get the 8-bit palette we asked for ...*/
|
||||||
if(img->format->BitsPerPixel == 8)
|
if(img->format->BitsPerPixel == 8)
|
||||||
{
|
{
|
||||||
int size = 0;
|
GLint size = 0;
|
||||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INDEX_SIZE_EXT), reinterpret_cast<GLint*>(&size));
|
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GLenum(GL_TEXTURE_INDEX_SIZE_EXT), &size);
|
||||||
if(size != 8)
|
if(size != 8)
|
||||||
{
|
{
|
||||||
/* I don't know any reason this should actually fail (paletted textures
|
/* I don't know any reason this should actually fail (paletted textures
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ void CircBuf::write(const char *buffer, unsigned buffer_size)
|
|||||||
unsigned write_pos = start + size();
|
unsigned write_pos = start + size();
|
||||||
if(write_pos >= buf.size()) write_pos -= buf.size();
|
if(write_pos >= buf.size()) write_pos -= buf.size();
|
||||||
|
|
||||||
int cpy = static_cast<int>(min(buffer_size, buf.size() - write_pos));
|
int cpy = int(min(buffer_size, buf.size() - write_pos));
|
||||||
buf.replace(write_pos, cpy, buffer, cpy);
|
buf.replace(write_pos, cpy, buffer, cpy);
|
||||||
|
|
||||||
cnt += cpy;
|
cnt += cpy;
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ void RageSoundManager::Update(float delta)
|
|||||||
RageSound *s = j->first;
|
RageSound *s = j->first;
|
||||||
FakeSound &fake = j->second;
|
FakeSound &fake = j->second;
|
||||||
|
|
||||||
int bytes = static_cast<int>(min(unsigned(delta * 44100*4), sizeof(buf)));
|
int bytes = int(min(unsigned(delta * 44100*4), sizeof(buf)));
|
||||||
|
|
||||||
int now = int(RageTimer::GetTimeSinceStart() - fake.begin) * 44100;
|
int now = int(RageTimer::GetTimeSinceStart() - fake.begin) * 44100;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user