Browse Source

couple of small fixes to Timers, mac file searching and linux build macros

tags/2021-05-28
jules 17 years ago
parent
commit
97ef44e1e6
6 changed files with 18 additions and 10 deletions
  1. +9
    -5
      juce_amalgamated.cpp
  2. +1
    -1
      juce_amalgamated.h
  3. +5
    -0
      src/juce_appframework/events/juce_Timer.cpp
  4. +1
    -1
      src/juce_core/basics/juce_PlatformDefs.h
  5. +1
    -2
      src/juce_core/basics/juce_Random.cpp
  6. +1
    -1
      src/juce_core/io/network/juce_Socket.cpp

+ 9
- 5
juce_amalgamated.cpp View File

@@ -799,7 +799,7 @@ void Random::setSeed (const int64 newSeed) throw()

void Random::setSeedRandomly()
{
Random r1 (SystemStats::getClockCycleCounter());
Random r1 (Time::getMillisecondCounter());
Random r2 (Time::getHighResolutionTicks());
Random r3 (Time::getHighResolutionTicksPerSecond());
Random r4 (Time::currentTimeMillis());
@@ -6510,7 +6510,7 @@ END_JUCE_NAMESPACE
#endif

#else
#ifdef LINUX
#if defined (LINUX) || defined (__linux__)
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/errno.h>
@@ -36848,13 +36848,17 @@ public:
if (instance == 0)
instance = new InternalTimerThread();

const ScopedLock sl (instance->lock);
instance->addTimer (tim);
}

static inline void remove (Timer* const tim) throw()
{
if (instance != 0)
{
const ScopedLock sl (instance->lock);
instance->removeTimer (tim);
}
}

static inline void resetCounter (Timer* const tim,
@@ -36868,6 +36872,7 @@ public:
if ((tim->next != 0 && tim->next->countdownMs < tim->countdownMs)
|| (tim->previous != 0 && tim->previous->countdownMs > tim->countdownMs))
{
const ScopedLock sl (instance->lock);
instance->removeTimer (tim);
instance->addTimer (tim);
}
@@ -262856,8 +262861,7 @@ int64 Time::getHighResolutionTicksPerSecond() throw()

int64 SystemStats::getClockCycleCounter() throw()
{
jassertfalse
return 0;
return (int64) AudioGetCurrentHostTime();
}

bool Time::setSystemTimeToThisTime() const throw()
@@ -264133,7 +264137,7 @@ struct FindFileStruct

if (fnmatch (wildCardUTF8, de->d_name, 0) == 0)
{
result = PlatformUtilities::convertToPrecomposedUnicode (String::fromUTF8 ((const uint8*) de->d_name));
result = String::fromUTF8 ((const uint8*) de->d_name);

const String path (parentDir + result);



+ 1
- 1
juce_amalgamated.h View File

@@ -307,7 +307,7 @@
#if (defined (_WIN32) || defined (_WIN64))
#define JUCE_WIN32 1
#else
#ifdef LINUX
#if defined (LINUX) || defined (__linux__)
#define JUCE_LINUX 1
#else
#define JUCE_MAC 1


+ 5
- 0
src/juce_appframework/events/juce_Timer.cpp View File

@@ -273,13 +273,17 @@ public:
if (instance == 0)
instance = new InternalTimerThread();
const ScopedLock sl (instance->lock);
instance->addTimer (tim);
}
static inline void remove (Timer* const tim) throw()
{
if (instance != 0)
{
const ScopedLock sl (instance->lock);
instance->removeTimer (tim);
}
}
static inline void resetCounter (Timer* const tim,
@@ -293,6 +297,7 @@ public:
if ((tim->next != 0 && tim->next->countdownMs < tim->countdownMs)
|| (tim->previous != 0 && tim->previous->countdownMs > tim->countdownMs))
{
const ScopedLock sl (instance->lock);
instance->removeTimer (tim);
instance->addTimer (tim);
}


+ 1
- 1
src/juce_core/basics/juce_PlatformDefs.h View File

@@ -55,7 +55,7 @@
#if (defined (_WIN32) || defined (_WIN64))
#define JUCE_WIN32 1
#else
#ifdef LINUX
#if defined (LINUX) || defined (__linux__)
#define JUCE_LINUX 1
#else
#define JUCE_MAC 1


+ 1
- 2
src/juce_core/basics/juce_Random.cpp View File

@@ -35,7 +35,6 @@ BEGIN_JUCE_NAMESPACE
#include "juce_Random.h"
#include "juce_Time.h"
#include "juce_SystemStats.h"
//==============================================================================
@@ -55,7 +54,7 @@ void Random::setSeed (const int64 newSeed) throw()
void Random::setSeedRandomly()
{
Random r1 (SystemStats::getClockCycleCounter());
Random r1 (Time::getMillisecondCounter());
Random r2 (Time::getHighResolutionTicks());
Random r3 (Time::getHighResolutionTicksPerSecond());
Random r4 (Time::currentTimeMillis());


+ 1
- 1
src/juce_core/io/network/juce_Socket.cpp View File

@@ -37,7 +37,7 @@
#endif
#else
#ifdef LINUX
#if defined (LINUX) || defined (__linux__)
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/errno.h>


Loading…
Cancel
Save