Bug 641927: Fix a large number of compiler warnings in Mac OS X code. r=benwa,bsmedberg

This commit is contained in:
Josh Aas 2011-03-23 11:46:57 -07:00
Родитель 1bc8708eb5
Коммит 2cf58f1088
9 изменённых файлов: 25 добавлений и 22 удалений

Просмотреть файл

@ -62,6 +62,8 @@ class nsIWidget;
// called when our corresponding Gecko view goes away
- (void)widgetDestroyed;
- (BOOL)isDragInProgress;
@end
// An informal protocol implemented by the NSWindow of the host application.

Просмотреть файл

@ -215,8 +215,6 @@ PRUint32 nsChildView::sLastInputEventCount = 0;
- (BOOL)isFirstResponder;
- (BOOL)isDragInProgress;
- (void)fireKeyEventForFlagsChanged:(NSEvent*)theEvent keyDown:(BOOL)isKeyDown;
- (BOOL)inactiveWindowAcceptsMouseEvent:(NSEvent*)aEvent;
@ -1254,7 +1252,7 @@ NS_IMETHODIMP nsChildView::GetPluginClipRect(nsIntRect& outClipRect, nsIntPoint&
if (mClipRects) {
nsIntRect clipBounds;
for (PRInt32 i = 0; i < mClipRectCount; ++i) {
for (PRUint32 i = 0; i < mClipRectCount; ++i) {
clipBounds.UnionRect(clipBounds, mClipRects[i]);
}
outClipRect.IntersectRect(outClipRect, clipBounds - outOrigin);

Просмотреть файл

@ -256,6 +256,7 @@ public:
NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous);
NS_IMETHOD Update();
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
virtual LayerManager* GetLayerManager(bool *aAllowRetaining = nsnull);
virtual LayerManager* GetLayerManager(LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nsnull);
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ;

Просмотреть файл

@ -932,6 +932,15 @@ nsCocoaWindow::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)
return NS_OK;
}
LayerManager*
nsCocoaWindow::GetLayerManager(bool *aAllowRetaining)
{
if (mPopupContentView) {
return mPopupContentView->GetLayerManager(aAllowRetaining);
}
return nsnull;
}
LayerManager*
nsCocoaWindow::GetLayerManager(LayerManagerPersistence, bool* aAllowRetaining)
{

Просмотреть файл

@ -53,8 +53,6 @@
#include "nsPIDOMWindow.h"
#include "nsIDOMAbstractView.h"
#include <Carbon/Carbon.h>
void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
{
NS_PRECONDITION(aTargetContent, "null ptr");
@ -88,20 +86,11 @@ NSString* nsMenuUtilsX::GetTruncatedCocoaLabel(const nsString& itemLabel)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#ifdef __LP64__
// Don't do anything on 64-bit Mac OS X for now, there is no API that does
// what we want. We'll probably need to roll our own solution.
// We want to truncate long strings to some reasonable pixel length but there is no
// good API for doing that which works for all OS versions and architectures. For now
// we'll do nothing for consistency and depend on good user interface design to limit
// string lengths.
return [NSString stringWithCharacters:itemLabel.get() length:itemLabel.Length()];
#else
// ::TruncateThemeText() doesn't take the number of characters to truncate to, it takes a pixel with
// to fit the string in. Ugh. I talked it over with sfraser and we couldn't come up with an
// easy way to compute what this should be given the system font, etc, so we're just going
// to hard code it to something reasonable and bigger fonts will just have to deal.
const short kMaxItemPixelWidth = 300;
NSMutableString *label = [NSMutableString stringWithCharacters:itemLabel.get() length:itemLabel.Length()];
::TruncateThemeText((CFMutableStringRef)label, kThemeMenuItemFont, kThemeStateActive, kMaxItemPixelWidth, truncMiddle, NULL);
return label;
#endif
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}

Просмотреть файл

@ -80,6 +80,7 @@ static const int sSnowLeopardThemeColors[][2] = {
{ 0xA7, 0xDE } // gradient end
};
__attribute__((unused))
static int NativeGreyColorAsInt(ColorName name, BOOL isMain)
{
if (nsToolkit::OnSnowLeopardOrLater())
@ -88,11 +89,13 @@ static int NativeGreyColorAsInt(ColorName name, BOOL isMain)
return sLeopardThemeColors[name][isMain ? 0 : 1];
}
__attribute__((unused))
static float NativeGreyColorAsFloat(ColorName name, BOOL isMain)
{
return NativeGreyColorAsInt(name, isMain) / 255.0f;
}
__attribute__((unused))
static void DrawNativeGreyColorInRect(CGContextRef context, ColorName name,
CGRect rect, BOOL isMain)
{

Просмотреть файл

@ -52,11 +52,10 @@ nsScreenManagerCocoa::~nsScreenManagerCocoa()
}
nsScreenCocoa*
nsScreenManagerCocoa::ScreenForCocoaScreen (NSScreen *screen)
nsScreenManagerCocoa::ScreenForCocoaScreen(NSScreen *screen)
{
for (PRInt32 i = 0; i < mScreenList.Length(); ++i) {
for (PRUint32 i = 0; i < mScreenList.Length(); ++i) {
nsScreenCocoa* sc = mScreenList[i];
if (sc->CocoaScreen() == screen) {
// doesn't addref
return sc;

Просмотреть файл

@ -783,7 +783,6 @@ void ScanImportedFunctions(const struct mach_header* mh, intptr_t vmaddr_slide)
#ifdef __i386__
if (jumpTable) {
unsigned char *opcodeAddr = stubs + (i * 5);
unsigned char oldOpcode = opcodeAddr[0];
int32_t *displacementAddr = (int32_t *) (opcodeAddr + 1);
int32_t eip = (int32_t) stubs + (i + 1) * 5;
int32_t displacement = (int32_t) (gHookedFunctions[j].newAddress) - eip;

Просмотреть файл

@ -65,6 +65,7 @@
// See Mozilla bug 163260.
// This file can only be included in an Objective-C context.
__attribute__((unused))
static void nsObjCExceptionLog(NSException* aException)
{
NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]",
@ -149,6 +150,7 @@ static void nsObjCExceptionLog(NSException* aException)
#endif
}
__attribute__((unused))
static void nsObjCExceptionAbort()
{
// We need to raise a mach-o signal here, the Mozilla crash reporter on
@ -158,6 +160,7 @@ static void nsObjCExceptionAbort()
*foo = 1;
}
__attribute__((unused))
static void nsObjCExceptionLogAbort(NSException *e)
{
nsObjCExceptionLog(e);