summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Weidauer <sven.weidauer@gmail.com>2011-01-23 19:32:56 +0000
committerSven Weidauer <sven.weidauer@gmail.com>2011-01-23 19:32:56 +0000
commitdd1e7b893ba5a4b796c848d751f7c73872a47cdb (patch)
treecd945f62ae69c5f7844617bf215a2ca6f2ceb027
parentf9ad37983008cef312e1bcab78d8f92c6ecf1ec3 (diff)
downloadnetsurf-dd1e7b893ba5a4b796c848d751f7c73872a47cdb.tar.gz
netsurf-dd1e7b893ba5a4b796c848d751f7c73872a47cdb.tar.bz2
Activating (and fixing) more warnings in Xcode
svn path=/trunk/netsurf/; revision=11469
-rw-r--r--cocoa/DownloadWindowController.m1
-rw-r--r--cocoa/PSMTabBarControl/PSMOverflowPopUpButton.m2
-rw-r--r--cocoa/PSMTabBarControl/PSMTabBarControl.m12
-rw-r--r--cocoa/config/common.xcconfig5
-rw-r--r--cocoa/fetch.m1
-rw-r--r--cocoa/font.m2
-rw-r--r--cocoa/gui.m1
-rw-r--r--cocoa/plotter.m2
8 files changed, 17 insertions, 9 deletions
diff --git a/cocoa/DownloadWindowController.m b/cocoa/DownloadWindowController.m
index 832ffc01c..ff28d1e9f 100644
--- a/cocoa/DownloadWindowController.m
+++ b/cocoa/DownloadWindowController.m
@@ -19,6 +19,7 @@
#import "DownloadWindowController.h"
#import "desktop/download.h"
+#import "desktop/gui.h"
#define UNIMPL() NSLog( @"Function '%s' unimplemented", __func__ )
diff --git a/cocoa/PSMTabBarControl/PSMOverflowPopUpButton.m b/cocoa/PSMTabBarControl/PSMOverflowPopUpButton.m
index cc96b910f..4ac70451b 100644
--- a/cocoa/PSMTabBarControl/PSMOverflowPopUpButton.m
+++ b/cocoa/PSMTabBarControl/PSMOverflowPopUpButton.m
@@ -16,7 +16,7 @@
- (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag
{
- if (self = [super initWithFrame:frameRect pullsDown:YES]) {
+ if ((self = [super initWithFrame:frameRect pullsDown:YES]) != nil) {
[self setBezelStyle:NSRegularSquareBezelStyle];
[self setBordered:NO];
[self setTitle:@""];
diff --git a/cocoa/PSMTabBarControl/PSMTabBarControl.m b/cocoa/PSMTabBarControl/PSMTabBarControl.m
index 8d1abe122..3c7271b40 100644
--- a/cocoa/PSMTabBarControl/PSMTabBarControl.m
+++ b/cocoa/PSMTabBarControl/PSMTabBarControl.m
@@ -1002,7 +1002,7 @@
if (animate) {
NSMutableArray *targetFrames = [NSMutableArray arrayWithCapacity:[_cells count]];
- for (NSInteger i = 0; i < [_cells count]; i++) {
+ for (NSUInteger i = 0; i < [_cells count]; i++) {
currentCell = [_cells objectAtIndex:i];
//we're going from NSRect -> NSValue -> NSRect -> NSValue here - oh well
@@ -1024,7 +1024,7 @@
[self _animateCells:_animationTimer];
} else {
- for (NSInteger i = 0; i < [_cells count]; i++) {
+ for (NSUInteger i = 0; i < [_cells count]; i++) {
currentCell = [_cells objectAtIndex:i];
[currentCell setFrame:[_controller cellFrameAtIndex:i]];
@@ -1048,7 +1048,7 @@
if ((cellCount > 0) && [animation isAnimating]) {
//compare our target position with the current position and move towards the target
- for (NSInteger i = 0; i < [targetFrames count] && i < cellCount; i++) {
+ for (NSUInteger i = 0; i < [targetFrames count] && i < cellCount; i++) {
currentCell = [_cells objectAtIndex:i];
NSRect cellFrame = [currentCell frame], targetFrame = [[targetFrames objectAtIndex:i] rectValue];
CGFloat sizeChange;
@@ -1084,7 +1084,7 @@
} else {
//put all the cells where they should be in their final position
if (cellCount > 0) {
- for (NSInteger i = 0; i < [targetFrames count] && i < cellCount; i++) {
+ for (NSUInteger i = 0; i < [targetFrames count] && i < cellCount; i++) {
PSMTabBarCell *currentCell = [_cells objectAtIndex:i];
NSRect cellFrame = [currentCell frame], targetFrame = [[targetFrames objectAtIndex:i] rectValue];
@@ -2026,10 +2026,10 @@
- (NSInteger)numberOfVisibleTabs
{
- NSInteger i, cellCount = 0;
+ NSInteger cellCount = 0;
PSMTabBarCell *nextCell;
- for (i = 0; i < [_cells count]; i++) {
+ for (NSUInteger i = 0; i < [_cells count]; i++) {
nextCell = [_cells objectAtIndex:i];
if ([nextCell isInOverflowMenu]) {
diff --git a/cocoa/config/common.xcconfig b/cocoa/config/common.xcconfig
index b45951b79..cf9b7c66e 100644
--- a/cocoa/config/common.xcconfig
+++ b/cocoa/config/common.xcconfig
@@ -5,5 +5,10 @@ OTHER_LDFLAGS =
PREBINDING = NO
HEADER_SEARCH_PATHS = ${SRCROOT}/../
GCC_C_LANGUAGE_STANDARD = gnu99
+
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_UNUSED_VARIABLE = YES
+GCC_WARN_MISSING_PARENTHESES = YES
+GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
+GCC_WARN_UNDECLARED_SELECTOR = YES
+GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
diff --git a/cocoa/fetch.m b/cocoa/fetch.m
index 385826f1d..8c35c4067 100644
--- a/cocoa/fetch.m
+++ b/cocoa/fetch.m
@@ -19,6 +19,7 @@
#import <Cocoa/Cocoa.h>
#import "utils/log.h"
+#import "content/fetch.h"
const char *fetch_filetype(const char *unix_path)
{
diff --git a/cocoa/font.m b/cocoa/font.m
index 77e39a291..3c4e2f2ab 100644
--- a/cocoa/font.m
+++ b/cocoa/font.m
@@ -121,7 +121,7 @@ static NSFont *cocoa_font_get_nsfont( const plot_font_style_t *style )
return font;
}
-NSDictionary *cocoa_font_attributes( const plot_font_style_t *style )
+static NSDictionary *cocoa_font_attributes( const plot_font_style_t *style )
{
return [NSDictionary dictionaryWithObjectsAndKeys:
cocoa_font_get_nsfont( style ), NSFontAttributeName,
diff --git a/cocoa/gui.m b/cocoa/gui.m
index 2841849e2..d8d70b0af 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -28,6 +28,7 @@
#import "desktop/options.h"
#import "desktop/textinput.h"
#import "desktop/selection.h"
+#import "desktop/401login.h"
#import "utils/utils.h"
char *default_stylesheet_url;
diff --git a/cocoa/plotter.m b/cocoa/plotter.m
index 9172d4851..cef0b8a99 100644
--- a/cocoa/plotter.m
+++ b/cocoa/plotter.m
@@ -159,7 +159,7 @@ static bool plot_polygon(const int *p, unsigned int n, const plot_style_t *pstyl
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint: NSMakePoint( p[0], p[1] )];
- for (int i = 1; i < n; i++) {
+ for (unsigned i = 1; i < n; i++) {
[path lineToPoint: NSMakePoint( p[2*i], p[2*i+1] )];
}
[path closePath];