improved usage of random number generator (closes #2109211)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1616 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-09-16 14:02:53 +00:00
parent 570159868e
commit 84ab700f9c
2 changed files with 18 additions and 2 deletions

View File

@@ -1,5 +1,20 @@
2008-09-16 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* src/core/project_journal.cpp:
improved usage of random number generator (closes #2109211)
* plugins/ladspa_effect/tap/tap_pinknoise.c:
* plugins/ladspa_effect/caps/interface.cc:
* src/core/drumsynth.cpp:
* src/core/main.cpp:
don't mis-initialize random number generator with default value
* src/core/journalling_object.cpp:
print name of object which uses ID if another object requests it
* src/core/automation_pattern.cpp:
make sure we don't return NULL in automationPattern::firstObject()
* plugins/ladspa_effect/ladspa_effect.cpp:
* include/engine.h:
* include/effect_rack_view.h:

View File

@@ -105,9 +105,10 @@ void projectJournal::journalEntryAdded( const jo_id_t _id )
jo_id_t projectJournal::allocID( journallingObject * _obj )
{
const jo_id_t EO_ID_MAX = 1 << 24;
const jo_id_t EO_ID_MAX = (1 << 23)-1;
jo_id_t id;
while( m_joIDs.contains( id = static_cast<jo_id_t>( rand() %
while( m_joIDs.contains( id =
static_cast<jo_id_t>( (jo_id_t)rand()*(jo_id_t)rand() %
EO_ID_MAX ) ) )
{
}