mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-18 21:35:25 +00:00
Build warnings cleanup
This commit is contained in:
@ -84,8 +84,8 @@ void PresetLoader::rescan()
|
||||
|
||||
while ( ( dir_entry = readdir ( _dir ) ) != NULL )
|
||||
{
|
||||
if (dir_entry->d_name == 0)
|
||||
continue;
|
||||
if (dir_entry->d_name[0] == 0)
|
||||
continue;
|
||||
|
||||
std::ostringstream out;
|
||||
// Convert char * to friendly string
|
||||
@ -130,11 +130,10 @@ void PresetLoader::rescan()
|
||||
}
|
||||
|
||||
|
||||
std::auto_ptr<Preset> PresetLoader::loadPreset ( unsigned int index ) const
|
||||
std::unique_ptr<Preset> PresetLoader::loadPreset ( unsigned int index ) const
|
||||
{
|
||||
|
||||
// Check that index isn't insane
|
||||
assert ( index >= 0 );
|
||||
assert ( index < _entries.size() );
|
||||
return _presetFactoryManager.allocate
|
||||
( _entries[index], _presetNames[index] );
|
||||
@ -142,7 +141,7 @@ std::auto_ptr<Preset> PresetLoader::loadPreset ( unsigned int index ) const
|
||||
}
|
||||
|
||||
|
||||
std::auto_ptr<Preset> PresetLoader::loadPreset ( const std::string & url ) const
|
||||
std::unique_ptr<Preset> PresetLoader::loadPreset ( const std::string & url ) const
|
||||
{
|
||||
// std::cout << "Loading preset " << url << std::endl;
|
||||
|
||||
@ -155,7 +154,7 @@ std::auto_ptr<Preset> PresetLoader::loadPreset ( const std::string & url ) cons
|
||||
} catch (...) {
|
||||
throw PresetFactoryException("preset factory exception of unknown cause");
|
||||
}
|
||||
return std::auto_ptr<Preset>();
|
||||
return std::unique_ptr<Preset>();
|
||||
}
|
||||
|
||||
void PresetLoader::handleDirectoryError()
|
||||
@ -193,8 +192,6 @@ void PresetLoader::handleDirectoryError()
|
||||
|
||||
void PresetLoader::setRating(unsigned int index, int rating, const PresetRatingType ratingType)
|
||||
{
|
||||
assert ( index >=0 );
|
||||
|
||||
const unsigned int ratingTypeIndex = static_cast<unsigned int>(ratingType);
|
||||
assert (index < _ratings[ratingTypeIndex].size());
|
||||
|
||||
@ -214,10 +211,10 @@ unsigned int PresetLoader::addPresetURL ( const std::string & url, const std::st
|
||||
assert(ratings.size() == TOTAL_RATING_TYPES);
|
||||
assert(ratings.size() == _ratings.size());
|
||||
|
||||
for (int i = 0; i < _ratings.size(); i++)
|
||||
for (unsigned int i = 0; i < _ratings.size(); i++)
|
||||
_ratings[i].push_back(ratings[i]);
|
||||
|
||||
for (int i = 0; i < ratings.size(); i++)
|
||||
for (unsigned int i = 0; i < ratings.size(); i++)
|
||||
_ratingsSums[i] += ratings[i];
|
||||
|
||||
return _entries.size()-1;
|
||||
@ -229,7 +226,7 @@ void PresetLoader::removePreset ( unsigned int index )
|
||||
_entries.erase ( _entries.begin() + index );
|
||||
_presetNames.erase ( _presetNames.begin() + index );
|
||||
|
||||
for (int i = 0; i < _ratingsSums.size(); i++) {
|
||||
for (unsigned int i = 0; i < _ratingsSums.size(); i++) {
|
||||
_ratingsSums[i] -= _ratings[i][index];
|
||||
_ratings[i].erase ( _ratings[i].begin() + index );
|
||||
}
|
||||
@ -272,7 +269,7 @@ void PresetLoader::insertPresetURL ( unsigned int index, const std::string & url
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < _ratingsSums.size();i++) {
|
||||
for (unsigned int i = 0; i < _ratingsSums.size();i++) {
|
||||
_ratingsSums[i] += _ratings[i][index];
|
||||
_ratings[i].insert ( _ratings[i].begin() + index, ratings[i] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user