1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Tidying up and removing some compiler warnings on the mac.

This commit is contained in:
jules 2009-08-13 19:37:19 +00:00
parent 011868e3a1
commit 646732530c
11 changed files with 100 additions and 141 deletions

View file

@ -342,7 +342,7 @@ const StringArray Font::findAllTypefaceNames() throw()
const ScopedAutoReleasePool pool;
NSArray* fonts = [[NSFontManager sharedFontManager] availableFontFamilies];
for (int i = 0; i < [fonts count]; ++i)
for (unsigned int i = 0; i < [fonts count]; ++i)
names.add (nsStringToJuce ((NSString*) [fonts objectAtIndex: i]));
names.sort (true);

View file

@ -89,7 +89,7 @@ void SystemStats::initialiseStats() throw()
{
initialised = true;
// etremely annoying: adding this line stops the apple menu items from working. Of
// extremely annoying: adding this line stops the apple menu items from working. Of
// course, not adding it means that carbon windows (e.g. in plugins) won't get
// any events.
//NSApplicationLoad();
@ -118,42 +118,6 @@ void SystemStats::initialiseStats() throw()
}
}
static const String getCpuInfo (const char* key, bool lastOne = false) throw()
{
String info;
char buf [256];
FILE* f = fopen ("/proc/cpuinfo", "r");
while (f != 0 && fgets (buf, sizeof(buf), f))
{
if (strncmp (buf, key, strlen (key)) == 0)
{
char* p = buf;
while (*p && *p != '\n')
++p;
if (*p != 0)
*p = 0;
p = buf;
while (*p != 0 && *p != ':')
++p;
if (*p != 0 && *(p + 1) != 0)
info = p + 2;
if (! lastOne)
break;
}
}
fclose (f);
return info;
}
//==============================================================================
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw()
{
@ -177,15 +141,11 @@ bool SystemStats::isOperatingSystem64Bit() throw()
int SystemStats::getMemorySizeInMegabytes() throw()
{
#if MACOS_10_4_OR_EARLIER
long bytes;
if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr)
return (int) (((unsigned long) bytes) / (1024 * 1024));
return 0;
#else
return (int) ([[NSProcessInfo processInfo] physicalMemory] / (1024 * 1024));
#endif
uint64 mem = 0;
size_t memSize = sizeof (mem);
int mib[] = { CTL_HW, HW_MEMSIZE };
sysctl (mib, 2, &mem, &memSize, 0, 0);
return mem / (1024 * 1024);
}
bool SystemStats::hasMMX() throw()
@ -237,11 +197,16 @@ const String SystemStats::getCpuVendor() throw()
int SystemStats::getCpuSpeedInMegaherz() throw()
{
#if MACOS_10_4_OR_EARLIER
return GetCPUSpeed();
#else
return roundDoubleToInt (getCpuInfo ("cpu MHz").getDoubleValue());
uint64 speedHz = 0;
size_t speedSize = sizeof (speedHz);
int mib[] = { CTL_HW, HW_CPU_FREQ };
sysctl (mib, 2, &speedHz, &speedSize, 0, 0);
#if JUCE_BIG_ENDIAN
if (speedSize == 4)
speedHz >>= 32;
#endif
return speedHz / 1000000;
}
int SystemStats::getNumCpus() throw()

View file

@ -241,7 +241,7 @@
buildSettings = {
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = "Juce Plugin Host";
PRODUCT_NAME = PluginHost;
USER_HEADER_SEARCH_PATHS = "~/SDKs/vstsdk2.4 $(inherited)";
ZERO_LINK = NO;
};
@ -251,7 +251,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 84FC4CD80CD8894600850651 /* juce.xcconfig */;
buildSettings = {
PRODUCT_NAME = "Juce Plugin Host";
PRODUCT_NAME = PluginHost;
SEPARATE_STRIP = YES;
USER_HEADER_SEARCH_PATHS = "~/SDKs/vstsdk2.4 $(inherited)";
ZERO_LINK = NO;

View file

@ -9,4 +9,12 @@
*/
#include "juce_AppConfig.h"
// This is where all the juce code gets included, via this amalgamated file..
#include "../../../juce_amalgamated.mm"
/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through
the amalgamated file can be slow or impossible for the debugger. But if you use the following line
instead of the one above, then it makes it a lot easier..
*/
//#include "../../../src/juce_amalgamated_template.cpp"

View file

@ -1,12 +1,20 @@
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/
#include "juce_AppConfig.h"
#include "../../../../juce_amalgamated.mm"
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/
#include "juce_AppConfig.h"
// This is where all the juce code gets included, via this amalgamated file..
#include "../../../juce_amalgamated.mm"
/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through
the amalgamated file can be slow or impossible for the debugger. But if you use the following line
instead of the one above, then it makes it a lot easier..
*/
//#include "../../../src/juce_amalgamated_template.cpp"

View file

@ -149,10 +149,6 @@ SOURCE=..\..\src\BinaryData.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\juce_LibrarySource.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\jucedemo_headers.h
# End Source File
# Begin Source File

View file

@ -1,21 +1,20 @@
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/
#include "juce_AppConfig.h"
// This is where all the juce code gets included, via this amalgamated file..
#include "../../../juce_amalgamated.mm"
/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through
the amalgamated file can be slow or impossible for the debugger. But if you use the following line
instead of the one above, then it makes it a lot easier..
*/
//#include "../../../src/juce_amalgamated_template.cpp"
/*
This file includes the entire juce source tree via the amalgamated file.
You could add the amalgamated file directly to your project, but doing it
like this allows you to put your app's config settings in the
juce_AppConfig.h file and have them applied to both the juce headers and
the source code.
*/
#include "juce_AppConfig.h"
// This is where all the juce code gets included, via this amalgamated file..
#include "../../../juce_amalgamated.mm"
/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through
the amalgamated file can be slow or impossible for the debugger. But if you use the following line
instead of the one above, then it makes it a lot easier..
*/
//#include "../../../src/juce_amalgamated_template.cpp"

View file

@ -550,6 +550,8 @@
C0E91AC608A95435008D54AB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
@ -558,6 +560,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = Jucer;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
WRAPPER_EXTENSION = app;
};
name = Debug;
@ -565,6 +568,8 @@
C0E91AC708A95435008D54AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
DEAD_CODE_STRIPPING = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
@ -572,6 +577,7 @@
INSTALL_PATH = "$(HOME)/Applications";
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
PRODUCT_NAME = Jucer;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
STRIP_INSTALLED_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};

View file

@ -9,4 +9,12 @@
*/
#include "juce_AppConfig.h"
// This is where all the juce code gets included, via this amalgamated file..
#include "../../../juce_amalgamated.mm"
/* NB. A handy tip is that if you're doing a lot of debugging into the juce code, then stepping through
the amalgamated file can be slow or impossible for the debugger. But if you use the following line
instead of the one above, then it makes it a lot easier..
*/
//#include "../../../src/juce_amalgamated_template.cpp"

View file

@ -205996,7 +205996,9 @@ namespace pnglibNamespace
#endif /* PNG_SETJMP_SUPPORTED */
#ifdef BSD
#if ! JUCE_MAC
# include <strings.h>
#endif
#else
# include <string.h>
#endif
@ -254530,7 +254532,7 @@ void SystemStats::initialiseStats() throw()
{
initialised = true;
// etremely annoying: adding this line stops the apple menu items from working. Of
// extremely annoying: adding this line stops the apple menu items from working. Of
// course, not adding it means that carbon windows (e.g. in plugins) won't get
// any events.
//NSApplicationLoad();
@ -254559,42 +254561,6 @@ void SystemStats::initialiseStats() throw()
}
}
static const String getCpuInfo (const char* key, bool lastOne = false) throw()
{
String info;
char buf [256];
FILE* f = fopen ("/proc/cpuinfo", "r");
while (f != 0 && fgets (buf, sizeof(buf), f))
{
if (strncmp (buf, key, strlen (key)) == 0)
{
char* p = buf;
while (*p && *p != '\n')
++p;
if (*p != 0)
*p = 0;
p = buf;
while (*p != 0 && *p != ':')
++p;
if (*p != 0 && *(p + 1) != 0)
info = p + 2;
if (! lastOne)
break;
}
}
fclose (f);
return info;
}
SystemStats::OperatingSystemType SystemStats::getOperatingSystemType() throw()
{
return MacOSX;
@ -254617,15 +254583,11 @@ bool SystemStats::isOperatingSystem64Bit() throw()
int SystemStats::getMemorySizeInMegabytes() throw()
{
#if MACOS_10_4_OR_EARLIER
long bytes;
if (Gestalt (gestaltPhysicalRAMSize, &bytes) == noErr)
return (int) (((unsigned long) bytes) / (1024 * 1024));
return 0;
#else
return (int) ([[NSProcessInfo processInfo] physicalMemory] / (1024 * 1024));
#endif
uint64 mem = 0;
size_t memSize = sizeof (mem);
int mib[] = { CTL_HW, HW_MEMSIZE };
sysctl (mib, 2, &mem, &memSize, 0, 0);
return mem / (1024 * 1024);
}
bool SystemStats::hasMMX() throw()
@ -254677,11 +254639,16 @@ const String SystemStats::getCpuVendor() throw()
int SystemStats::getCpuSpeedInMegaherz() throw()
{
#if MACOS_10_4_OR_EARLIER
return GetCPUSpeed();
#else
return roundDoubleToInt (getCpuInfo ("cpu MHz").getDoubleValue());
uint64 speedHz = 0;
size_t speedSize = sizeof (speedHz);
int mib[] = { CTL_HW, HW_CPU_FREQ };
sysctl (mib, 2, &speedHz, &speedSize, 0, 0);
#if JUCE_BIG_ENDIAN
if (speedSize == 4)
speedHz >>= 32;
#endif
return speedHz / 1000000;
}
int SystemStats::getNumCpus() throw()
@ -260711,7 +260678,7 @@ const StringArray Font::findAllTypefaceNames() throw()
const ScopedAutoReleasePool pool;
NSArray* fonts = [[NSFontManager sharedFontManager] availableFontFamilies];
for (int i = 0; i < [fonts count]; ++i)
for (unsigned int i = 0; i < [fonts count]; ++i)
names.add (nsStringToJuce ((NSString*) [fonts objectAtIndex: i]));
names.sort (true);

View file

@ -360,7 +360,9 @@
#endif /* PNG_SETJMP_SUPPORTED */
#ifdef BSD
#if ! JUCE_MAC
# include <strings.h>
#endif
#else
# include <string.h>
#endif