From b1d5c8ae31ba33d105da26c038eb04d85ba4e85e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 10 May 2009 10:08:37 -0400 Subject: [PATCH] Make the asterisk attached to the type, rather than the variable. --- Source/AppDelegate.h | 10 +-- Source/AppDelegate.m | 2 +- Source/BSLineNumberView.h | 8 +-- Source/BSLineNumberView.m | 12 ++-- Source/BSSourceView.h | 22 +++--- Source/BSSourceView.m | 26 +++---- Source/BSSourceViewTextView.h | 4 +- Source/BSSplitView.m | 8 +-- Source/Breakpoint.h | 12 ++-- Source/Breakpoint.m | 16 ++--- Source/BreakpointController.h | 10 +-- Source/BreakpointController.m | 16 ++--- Source/BreakpointManager.h | 20 +++--- Source/BreakpointManager.m | 26 +++---- Source/DebuggerController.h | 30 ++++---- Source/DebuggerController.m | 42 +++++------ Source/GDBpConnection.h | 32 ++++----- Source/GDBpConnection.m | 90 ++++++++++++------------ Source/NSXMLElementAdditions.h | 10 +-- Source/NSXMLElementAdditions.m | 24 +++---- Source/PreferencesController.h | 12 ++-- Source/PreferencesController.m | 2 +- Source/PreferencesPathsArrayController.m | 2 +- Source/SocketWrapper.h | 14 ++-- Source/SocketWrapper.m | 28 ++++---- Source/StackController.h | 10 +-- Source/StackController.m | 12 ++-- Source/StackFrame.h | 26 +++---- Source/StackFrame.m | 18 ++--- 29 files changed, 272 insertions(+), 272 deletions(-) diff --git a/Source/AppDelegate.h b/Source/AppDelegate.h index 0f43d76..1763721 100644 --- a/Source/AppDelegate.h +++ b/Source/AppDelegate.h @@ -21,13 +21,13 @@ @interface AppDelegate : NSObject { - IBOutlet DebuggerController *debugger; - IBOutlet BreakpointController *breakpoint; - PreferencesController *prefs; + IBOutlet DebuggerController* debugger; + IBOutlet BreakpointController* breakpoint; + PreferencesController* prefs; } -@property(readonly) DebuggerController *debugger; -@property(readonly) BreakpointController *breakpoint; +@property(readonly) DebuggerController* debugger; +@property(readonly) BreakpointController* breakpoint; - (IBAction)showDebuggerWindow:(id)sender; - (IBAction)showInspectorWindow:(id)sender; diff --git a/Source/AppDelegate.m b/Source/AppDelegate.m index 942234a..b984a8c 100644 --- a/Source/AppDelegate.m +++ b/Source/AppDelegate.m @@ -39,7 +39,7 @@ { NSAutoreleasePool* pool = [NSAutoreleasePool new]; - NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys: + NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:9000], @"Port", @"macgdbp", @"IDEKey", [NSNumber numberWithBool:YES], @"BreakpointsWindowVisible", diff --git a/Source/BSLineNumberView.h b/Source/BSLineNumberView.h index 1b52d4b..1a05efc 100644 --- a/Source/BSLineNumberView.h +++ b/Source/BSLineNumberView.h @@ -20,13 +20,13 @@ @interface BSLineNumberView : NSView { - BSSourceView *sourceView; + BSSourceView* sourceView; NSRange lineNumberRange; - NSSet *markers; + NSSet* markers; } -@property(readwrite, assign) BSSourceView *sourceView; +@property(readwrite, assign) BSSourceView* sourceView; @property(readonly) NSRange lineNumberRange; -@property(readwrite, retain) NSSet *markers; +@property(readwrite, retain) NSSet* markers; @end diff --git a/Source/BSLineNumberView.m b/Source/BSLineNumberView.m index 9931edc..d0e1320 100644 --- a/Source/BSLineNumberView.m +++ b/Source/BSLineNumberView.m @@ -62,7 +62,7 @@ [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x, rect.size.height) toPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.size.height)]; // font attributes for the line number - NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Monaco" size:9.0], NSFontAttributeName, [NSColor grayColor], NSForegroundColorAttributeName, nil]; + NSDictionary* attrs = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Monaco" size:9.0], NSFontAttributeName, [NSColor grayColor], NSForegroundColorAttributeName, nil]; lineNumberRange = NSMakeRange(0, 0); @@ -82,10 +82,10 @@ { lineNumberRange.location = (lineNumberRange.length == 0 ? line : lineNumberRange.location); lineNumberRange.length++; - NSString *num = [NSString stringWithFormat:@"%u", line]; + NSString* num = [NSString stringWithFormat:@"%u", line]; NSSize strSize = [num sizeWithAttributes:attrs]; [num drawAtPoint:NSMakePoint([self frame].size.width - strSize.width - 3, fragRect.origin.y + ((fragRect.size.height - strSize.height) / 2)) withAttributes:attrs]; - Breakpoint *test = [[Breakpoint alloc] initWithLine:line inFile:[sourceView file]]; + Breakpoint* test = [[Breakpoint alloc] initWithLine:line inFile:[sourceView file]]; if ([markers containsObject:test]) { [self drawMarkerInRect:fragRect]; @@ -101,9 +101,9 @@ /** * Handles the mouse down event (which is adding, deleting, and toggling breakpoints) */ -- (void)mouseDown:(NSEvent *)event +- (void)mouseDown:(NSEvent*)event { - NSTextView *textView = [sourceView textView]; + NSTextView* textView = [sourceView textView]; NSPoint clickLoc = [self convertPoint:[event locationInWindow] fromView:nil]; @@ -132,7 +132,7 @@ */ - (void)drawMarkerInRect:(NSRect)rect { - NSBezierPath *path = [NSBezierPath bezierPath]; + NSBezierPath* path = [NSBezierPath bezierPath]; [path moveToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 2)]; // initial origin [path lineToPoint:NSMakePoint(rect.size.width - 7, rect.origin.y + 2)]; // upper right diff --git a/Source/BSSourceView.h b/Source/BSSourceView.h index 47e9b14..9cea85b 100644 --- a/Source/BSSourceView.h +++ b/Source/BSSourceView.h @@ -20,29 +20,29 @@ @interface BSSourceView : NSView { - BSLineNumberView *numberView; - BSSourceViewTextView *textView; - NSScrollView *scrollView; + BSLineNumberView* numberView; + BSSourceViewTextView* textView; + NSScrollView* scrollView; - NSString *file; + NSString* file; int markedLine; id delegate; } -@property(readwrite, assign) BSLineNumberView *numberView; -@property(readwrite, assign) BSSourceViewTextView *textView; -@property(readwrite, assign) NSScrollView *scrollView; -@property(readwrite, assign) NSString *file; +@property(readwrite, assign) BSLineNumberView* numberView; +@property(readwrite, assign) BSSourceViewTextView* textView; +@property(readwrite, assign) NSScrollView* scrollView; +@property(readwrite, assign) NSString* file; @property(readwrite, assign) int markedLine; @property(readwrite, assign) id delegate; -- (void)setFile:(NSString *)f; -- (void)setString:(NSString *)source asFile:(NSString *)path; +- (void)setFile:(NSString*)f; +- (void)setString:(NSString*)source asFile:(NSString*)path; - (void)scrollToLine:(int)line; @end @interface NSObject (BSSourceViewDelegate) -- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file; +- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file; @end diff --git a/Source/BSSourceView.m b/Source/BSSourceView.m index a18f119..73d0820 100644 --- a/Source/BSSourceView.m +++ b/Source/BSSourceView.m @@ -18,7 +18,7 @@ @interface BSSourceView (Private) - (void)setupViews; -- (void)errorHighlightingFile:(NSNotification *)notif; +- (void)errorHighlightingFile:(NSNotification*)notif; @end @implementation BSSourceView @@ -60,7 +60,7 @@ /** * Sets the file name as well as the text of the source view */ -- (void)setFile:(NSString *)f +- (void)setFile:(NSString*)f { if (file != f) { @@ -77,9 +77,9 @@ @try { // Attempt to use the PHP CLI to highlight the source file as HTML - NSPipe *outPipe = [NSPipe pipe]; - NSPipe *errPipe = [NSPipe pipe]; - NSTask *task = [[NSTask new] autorelease]; + NSPipe* outPipe = [NSPipe pipe]; + NSPipe* errPipe = [NSPipe pipe]; + NSTask* task = [[NSTask new] autorelease]; [task setLaunchPath:@"/usr/bin/php"]; // This is the path to the default Leopard PHP executable [task setArguments:[NSArray arrayWithObjects:@"-s", f, nil]]; @@ -89,12 +89,12 @@ [[errPipe fileHandleForReading] readToEndOfFileInBackgroundAndNotify]; - NSData *data = [[outPipe fileHandleForReading] readDataToEndOfFile]; - NSAttributedString *source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL]; + NSData* data = [[outPipe fileHandleForReading] readDataToEndOfFile]; + NSAttributedString* source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL]; [[textView textStorage] setAttributedString:source]; [source release]; } - @catch (NSException *exception) + @catch (NSException* exception) { // If the PHP executable is not available then the NSTask will throw an exception [textView setString:[NSString stringWithContentsOfFile:f]]; @@ -104,11 +104,11 @@ /** * Sets the contents of the SourceView via a string rather than loading from a path */ -- (void)setString:(NSString *)source asFile:(NSString *)path +- (void)setString:(NSString*)source asFile:(NSString*)path { // create the temp file - NSError *error = nil; - NSString *tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"MacGDBpHighlighter"]; + NSError* error = nil; + NSString* tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"MacGDBpHighlighter"]; [source writeToFile:tmpPath atomically:NO encoding:NSUTF8StringEncoding error:&error]; if (error) { @@ -133,9 +133,9 @@ /** * If an error occurs in reading the highlighted PHP source, this will merely set the string */ -- (void)errorHighlightingFile:(NSNotification *)notif +- (void)errorHighlightingFile:(NSNotification*)notif { - NSData *data = [[notif userInfo] objectForKey:NSFileHandleNotificationDataItem]; + NSData* data = [[notif userInfo] objectForKey:NSFileHandleNotificationDataItem]; if ([data length] > 0) // there's something on stderr, so the PHP CLI failed [textView setString:[NSString stringWithContentsOfFile:file]]; } diff --git a/Source/BSSourceViewTextView.h b/Source/BSSourceViewTextView.h index de04120..a0e1db0 100644 --- a/Source/BSSourceViewTextView.h +++ b/Source/BSSourceViewTextView.h @@ -20,9 +20,9 @@ @interface BSSourceViewTextView : NSTextView { - BSSourceView *sourceView; + BSSourceView* sourceView; } -@property(readwrite, assign) BSSourceView *sourceView; +@property(readwrite, assign) BSSourceView* sourceView; @end diff --git a/Source/BSSplitView.m b/Source/BSSplitView.m index f0330c7..507bb8a 100644 --- a/Source/BSSplitView.m +++ b/Source/BSSplitView.m @@ -27,9 +27,9 @@ - (void)drawDividerInRect:(NSRect)rect { // draw the gradient - NSColor *startColor = [NSColor colorWithDeviceRed:0.875 green:0.875 blue:0.875 alpha:1.0]; - NSColor *endColor = [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0]; - NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor]; + NSColor* startColor = [NSColor colorWithDeviceRed:0.875 green:0.875 blue:0.875 alpha:1.0]; + NSColor* endColor = [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0]; + NSGradient* gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor]; [gradient drawInRect:rect angle:([self isVertical] ? 0.0 : 90.0)]; [gradient release]; @@ -39,7 +39,7 @@ [NSBezierPath strokeRect:rect]; // draw the dimple - NSImage *dimple = [NSImage imageNamed:@"dimple.png"]; + NSImage* dimple = [NSImage imageNamed:@"dimple.png"]; NSSize dmpSize = [dimple size]; NSPoint origin = NSMakePoint((rect.size.width / 2) + rect.origin.x - (dmpSize.width / 2), (rect.size.height / 2) + rect.origin.y + (dmpSize.height / 2)); [dimple compositeToPoint:origin operation:NSCompositeSourceOver]; diff --git a/Source/Breakpoint.h b/Source/Breakpoint.h index 4d00739..d35da0f 100644 --- a/Source/Breakpoint.h +++ b/Source/Breakpoint.h @@ -19,20 +19,20 @@ @interface Breakpoint : NSObject { - NSString *file; + NSString* file; int line; int debuggerId; } -@property(readonly) NSString *file; +@property(readonly) NSString* file; @property(readonly) int line; @property(readwrite, assign) int debuggerId; -- (id)initWithLine:(int)l inFile:(NSString *)f; -- (id)initWithDictionary:(NSDictionary *)dict; +- (id)initWithLine:(int)l inFile:(NSString*)f; +- (id)initWithDictionary:(NSDictionary*)dict; -- (NSString *)transformedPath; +- (NSString*)transformedPath; -- (NSDictionary *)dictionary; +- (NSDictionary*)dictionary; @end diff --git a/Source/Breakpoint.m b/Source/Breakpoint.m index 3730306..d094db9 100644 --- a/Source/Breakpoint.m +++ b/Source/Breakpoint.m @@ -24,7 +24,7 @@ /** * Initializes a breakpoint with a file and line */ -- (id)initWithLine:(int)l inFile:(NSString *)f +- (id)initWithLine:(int)l inFile:(NSString*)f { if (self = [super init]) { @@ -46,7 +46,7 @@ /** * Creates a Breakpoint from the values of an NSDictionary */ -- (id)initWithDictionary:(NSDictionary *)dict +- (id)initWithDictionary:(NSDictionary*)dict { if (self = [super init]) { @@ -59,15 +59,15 @@ /** * Returns the transformed path for the breakpoint, as Xdebug needs it */ -- (NSString *)transformedPath +- (NSString*)transformedPath { - NSString *path = self.file; + NSString* path = self.file; - NSMutableArray *transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"]; + NSMutableArray* transforms = [[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"PathReplacements"]; if (!transforms || [transforms count] < 1) return path; - for (NSDictionary *replacement in transforms) + for (NSDictionary* replacement in transforms) { path = [path stringByReplacingOccurrencesOfString:[replacement valueForKey:@"local"] @@ -97,7 +97,7 @@ /** * Returns an NSDictionary of the data so it can be stored in NSUserDefaults */ -- (NSDictionary *)dictionary +- (NSDictionary*)dictionary { return [NSDictionary dictionaryWithObjectsAndKeys:file, @"file", [NSNumber numberWithInt:line], @"line", nil]; } @@ -105,7 +105,7 @@ /** * Pretty-print */ -- (NSString *)description +- (NSString*)description { return [NSString stringWithFormat:@"%@:%i", file, line]; } diff --git a/Source/BreakpointController.h b/Source/BreakpointController.h index 16e4348..1c9d34e 100644 --- a/Source/BreakpointController.h +++ b/Source/BreakpointController.h @@ -20,14 +20,14 @@ @interface BreakpointController : NSWindowController { - BreakpointManager *manager; + BreakpointManager* manager; - IBOutlet NSArrayController *arrayController; - IBOutlet BSSourceView *sourceView; + IBOutlet NSArrayController* arrayController; + IBOutlet BSSourceView* sourceView; } -@property(readonly) BSSourceView *sourceView; -@property(readonly) NSArrayController *arrayController; +@property(readonly) BSSourceView* sourceView; +@property(readonly) NSArrayController* arrayController; - (IBAction)addBreakpoint:(id)sender; - (IBAction)removeBreakpoint:(id)sender; diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index 0b80f3a..b5af704 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -42,7 +42,7 @@ */ - (IBAction)addBreakpoint:(id)sender { - NSOpenPanel *panel = [NSOpenPanel openPanel]; + NSOpenPanel* panel = [NSOpenPanel openPanel]; if ([panel runModal] != NSOKButton) { @@ -57,13 +57,13 @@ */ - (IBAction)removeBreakpoint:(id)sender { - NSArray *selection = [arrayController selectedObjects]; + NSArray* selection = [arrayController selectedObjects]; if ([selection count] < 1) { return; } - for (Breakpoint *bp in selection) + for (Breakpoint* bp in selection) { [manager removeBreakpointAt:[bp line] inFile:[bp file]]; } @@ -75,15 +75,15 @@ * NSTableView delegate method that informs the controller that the stack selection did change and that * we should update the source viewer */ -- (void)tableViewSelectionDidChange:(NSNotification *)notif +- (void)tableViewSelectionDidChange:(NSNotification*)notif { - NSArray *selection = [arrayController selectedObjects]; + NSArray* selection = [arrayController selectedObjects]; if ([selection count] < 1) { return; } - Breakpoint *bp = [selection objectAtIndex:0]; + Breakpoint* bp = [selection objectAtIndex:0]; [sourceView setFile:[bp file]]; [sourceView scrollToLine:[bp line]]; [[sourceView numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:[bp file]]]]; @@ -94,7 +94,7 @@ /** * The gutter was clicked, which indicates that a breakpoint needs to be changed */ -- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file +- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file { if ([manager hasBreakpointAt:line inFile:file]) { @@ -102,7 +102,7 @@ } else { - Breakpoint *bp = [[Breakpoint alloc] initWithLine:line inFile:file]; + Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file]; [manager addBreakpoint:bp]; [bp release]; } diff --git a/Source/BreakpointManager.h b/Source/BreakpointManager.h index 11a37f0..d3c1694 100644 --- a/Source/BreakpointManager.h +++ b/Source/BreakpointManager.h @@ -20,19 +20,19 @@ @interface BreakpointManager : NSObject { - NSMutableArray *breakpoints; - NSMutableArray *savedBreakpoints; + NSMutableArray* breakpoints; + NSMutableArray* savedBreakpoints; - GDBpConnection *connection; + GDBpConnection* connection; } -@property(readwrite, assign) GDBpConnection *connection; -@property(readonly) NSMutableArray *breakpoints; +@property(readwrite, assign) GDBpConnection* connection; +@property(readonly) NSMutableArray* breakpoints; -+ (BreakpointManager *)sharedManager; -- (void)addBreakpoint:(Breakpoint *)bp; -- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file; -- (NSArray *)breakpointsForFile:(NSString *)file; -- (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file; ++ (BreakpointManager*)sharedManager; +- (void)addBreakpoint:(Breakpoint*)bp; +- (Breakpoint*)removeBreakpointAt:(int)line inFile:(NSString*)file; +- (NSArray*)breakpointsForFile:(NSString*)file; +- (BOOL)hasBreakpointAt:(int)line inFile:(NSString*)file; @end diff --git a/Source/BreakpointManager.m b/Source/BreakpointManager.m index 620a4cd..38f4070 100644 --- a/Source/BreakpointManager.m +++ b/Source/BreakpointManager.m @@ -18,7 +18,7 @@ #import "AppDelegate.h" @interface BreakpointManager (Private) -- (void)updateDisplaysForFile:(NSString *)file; +- (void)updateDisplaysForFile:(NSString*)file; @end @implementation BreakpointManager @@ -40,7 +40,7 @@ savedBreakpoints = [[[NSUserDefaults standardUserDefaults] mutableArrayValueForKey:@"Breakpoints"] retain]; if (savedBreakpoints) { - for (NSDictionary *d in savedBreakpoints) + for (NSDictionary* d in savedBreakpoints) { [breakpoints addObject:[[[Breakpoint alloc] initWithDictionary:d] autorelease]]; } @@ -52,9 +52,9 @@ /** * Returns the shared manager (singleton) */ -+ (BreakpointManager *)sharedManager ++ (BreakpointManager*)sharedManager { - static BreakpointManager *manager; + static BreakpointManager* manager; if (!manager) { manager = [[BreakpointManager alloc] init]; @@ -65,7 +65,7 @@ /** * Registers a breakpoint at a given line */ -- (void)addBreakpoint:(Breakpoint *)bp; +- (void)addBreakpoint:(Breakpoint*)bp; { if (![breakpoints containsObject:bp]) { @@ -82,9 +82,9 @@ /** * Removes a breakpoint at a given line/file combination, or nil if nothing was removed */ -- (Breakpoint *)removeBreakpointAt:(int)line inFile:(NSString *)file +- (Breakpoint*)removeBreakpointAt:(int)line inFile:(NSString*)file { - for (Breakpoint *b in breakpoints) + for (Breakpoint* b in breakpoints) { if ([b line] == line && [[b file] isEqualToString:file]) { @@ -104,10 +104,10 @@ /** * Returns all the breakpoints for a given file */ -- (NSArray *)breakpointsForFile:(NSString *)file +- (NSArray*)breakpointsForFile:(NSString*)file { - NSMutableArray *matches = [NSMutableArray array]; - for (Breakpoint *b in breakpoints) + NSMutableArray* matches = [NSMutableArray array]; + for (Breakpoint* b in breakpoints) { if ([[b file] isEqualToString:file]) { @@ -121,7 +121,7 @@ /** * Checks to see if a given file has a breakpoint on a given line */ -- (BOOL)hasBreakpointAt:(int)line inFile:(NSString *)file +- (BOOL)hasBreakpointAt:(int)line inFile:(NSString*)file { return [breakpoints containsObject:[[[Breakpoint alloc] initWithLine:line inFile:file] autorelease]]; } @@ -132,9 +132,9 @@ * This marks BSSourceView needsDisplay, rearranges the objects in the breakpoints controller, * and sets the markers for the BSLineNumberView */ -- (void)updateDisplaysForFile:(NSString *)file +- (void)updateDisplaysForFile:(NSString*)file { - AppDelegate *appDel = [NSApp delegate]; + AppDelegate* appDel = [NSApp delegate]; [[[appDel breakpoint] arrayController] rearrangeObjects]; [[[appDel breakpoint] sourceView] setNeedsDisplay:YES]; [[[[appDel breakpoint] sourceView] numberView] setMarkers:[NSSet setWithArray:[self breakpointsForFile:file]]]; diff --git a/Source/DebuggerController.h b/Source/DebuggerController.h index f322dac..50b032e 100644 --- a/Source/DebuggerController.h +++ b/Source/DebuggerController.h @@ -22,31 +22,31 @@ @interface DebuggerController : NSWindowController { - GDBpConnection *connection; + GDBpConnection* connection; - StackController *stackController; - IBOutlet NSArrayController *stackArrayController; + StackController* stackController; + IBOutlet NSArrayController* stackArrayController; - IBOutlet NSTreeController *variablesTreeController; - IBOutlet NSOutlineView *variablesOutlineView; - NSMutableSet *expandedVariables; - NSXMLElement *selectedVariable; + IBOutlet NSTreeController* variablesTreeController; + IBOutlet NSOutlineView* variablesOutlineView; + NSMutableSet* expandedVariables; + NSXMLElement* selectedVariable; - IBOutlet NSWindow *inspector; + IBOutlet NSWindow* inspector; - IBOutlet NSTextField *statusmsg; - IBOutlet NSTextField *errormsg; + IBOutlet NSTextField* statusmsg; + IBOutlet NSTextField* errormsg; - IBOutlet BSSourceView *sourceViewer; + IBOutlet BSSourceView* sourceViewer; } -@property(readonly) GDBpConnection *connection; -@property(readonly) BSSourceView *sourceViewer; -@property(readonly) NSWindow *inspector; +@property(readonly) GDBpConnection* connection; +@property(readonly) BSSourceView* sourceViewer; +@property(readonly) NSWindow* inspector; - (void)resetDisplays; -- (void)setError:(NSString *)anError; +- (void)setError:(NSString*)anError; - (void)startDebugger; diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index ae4d434..e11b0eb 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -40,7 +40,7 @@ { stackController = [[StackController alloc] init]; - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; connection = [[GDBpConnection alloc] initWithPort:[defaults integerForKey:@"Port"] session:[defaults stringForKey:@"IDEKey"]]; expandedVariables = [[NSMutableSet alloc] init]; [[self window] makeKeyAndOrderFront:nil]; @@ -84,7 +84,7 @@ /** * Called right before the window closes so that we can tell the socket to close down */ -- (void)windowWillClose:(NSNotification *)notif +- (void)windowWillClose:(NSNotification*)notif { [[connection socket] close]; } @@ -121,7 +121,7 @@ /** * Sets the status to be "Error" and then displays the error message */ -- (void)setError:(NSString *)anError +- (void)setError:(NSString*)anError { [errormsg setStringValue:anError]; [errormsg setHidden:NO]; @@ -130,7 +130,7 @@ /** * Handles a GDBpConnection error */ -- (void)handleConnectionError:(NSNotification *)notif +- (void)handleConnectionError:(NSNotification*)notif { [self setError:[[notif userInfo] valueForKey:@"NSString"]]; } @@ -148,7 +148,7 @@ */ - (IBAction)run:(id)sender { - NSArray *frames = [connection run]; + NSArray* frames = [connection run]; if ([connection isConnected] && frames != nil) { @@ -176,7 +176,7 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame *frame = [connection stepIn]; + StackFrame* frame = [connection stepIn]; if ([frame isShiftedFrame:[stackController peek]]) [stackController pop]; [stackController push:frame]; @@ -191,7 +191,7 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame *frame = [connection stepOut]; + StackFrame* frame = [connection stepOut]; [stackController pop]; // frame we were out of [stackController pop]; // frame we are returning to [stackController push:frame]; @@ -206,7 +206,7 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame *frame = [connection stepOver]; + StackFrame* frame = [connection stepOver]; [stackController pop]; [stackController push:frame]; [self updateStackViewer]; @@ -216,7 +216,7 @@ * NSTableView delegate method that informs the controller that the stack selection did change and that * we should update the source viewer */ -- (void)tableViewSelectionDidChange:(NSNotification *)notif +- (void)tableViewSelectionDidChange:(NSNotification*)notif { [self updateSourceViewer]; [self expandVariables]; @@ -225,16 +225,16 @@ /** * Called whenver an item is expanded. This allows us to determine if we need to fetch deeper */ -- (void)outlineViewItemDidExpand:(NSNotification *)notif +- (void)outlineViewItemDidExpand:(NSNotification*)notif { - NSTreeNode *node = [[notif userInfo] objectForKey:@"NSObject"]; + NSTreeNode* node = [[notif userInfo] objectForKey:@"NSObject"]; [expandedVariables addObject:[[node representedObject] fullname]]; } /** * Called when an item was collapsed. This allows us to remove it from the list of expanded items */ -- (void)outlineViewItemDidCollapse:(NSNotification *)notif +- (void)outlineViewItemDidCollapse:(NSNotification*)notif { [expandedVariables removeObject:[[[[notif userInfo] objectForKey:@"NSObject"] representedObject] fullname]]; } @@ -251,7 +251,7 @@ return; // get the filename - NSString *filename = [selection valueForKey:@"filename"]; + NSString* filename = [selection valueForKey:@"filename"]; filename = [[NSURL URLWithString:filename] path]; if ([filename isEqualToString:@""]) return; @@ -259,10 +259,10 @@ // replace the source if necessary if (![sourceViewer.file isEqualToString:filename]) { - NSString *source = [selection valueForKey:@"source"]; + NSString* source = [selection valueForKey:@"source"]; [sourceViewer setString:source asFile:filename]; - NSSet *breakpoints = [NSSet setWithArray:[[BreakpointManager sharedManager] breakpointsForFile:filename]]; + NSSet* breakpoints = [NSSet setWithArray:[[BreakpointManager sharedManager] breakpointsForFile:filename]]; [[sourceViewer numberView] setMarkers:breakpoints]; } @@ -288,12 +288,12 @@ */ - (void)expandVariables { - NSString *selection = [selectedVariable fullname]; + NSString* selection = [selectedVariable fullname]; for (int i = 0; i < [variablesOutlineView numberOfRows]; i++) { - NSTreeNode *node = [variablesOutlineView itemAtRow:i]; - NSString *fullname = [[node representedObject] fullname]; + NSTreeNode* node = [variablesOutlineView itemAtRow:i]; + NSString* fullname = [[node representedObject] fullname]; // see if it needs expanding if ([expandedVariables containsObject:fullname]) @@ -310,9 +310,9 @@ /** * The gutter was clicked, which indicates that a breakpoint needs to be changed */ -- (void)gutterClickedAtLine:(int)line forFile:(NSString *)file +- (void)gutterClickedAtLine:(int)line forFile:(NSString*)file { - BreakpointManager *mngr = [BreakpointManager sharedManager]; + BreakpointManager* mngr = [BreakpointManager sharedManager]; if ([mngr hasBreakpointAt:line inFile:file]) { @@ -320,7 +320,7 @@ } else { - Breakpoint *bp = [[Breakpoint alloc] initWithLine:line inFile:file]; + Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file]; [mngr addBreakpoint:bp]; [bp release]; } diff --git a/Source/GDBpConnection.h b/Source/GDBpConnection.h index f334900..7d04448 100644 --- a/Source/GDBpConnection.h +++ b/Source/GDBpConnection.h @@ -19,44 +19,44 @@ #import "Breakpoint.h" #import "StackFrame.h" -extern NSString *kErrorOccurredNotif; +extern NSString* kErrorOccurredNotif; @interface GDBpConnection : NSObject { int port; - NSString *session; + NSString* session; BOOL connected; /** * Human-readable status of the connection */ - NSString *status; + NSString* status; - SocketWrapper *socket; + SocketWrapper* socket; } -@property(readonly, copy) NSString *status; -@property(readonly) SocketWrapper *socket; +@property(readonly, copy) NSString* status; +@property(readonly) SocketWrapper* socket; // initializer -- (id)initWithPort:(int)aPort session:(NSString *)aSession; +- (id)initWithPort:(int)aPort session:(NSString*)aSession; // getter - (int)port; -- (NSString *)session; -- (NSString *)remoteHost; +- (NSString*)session; +- (NSString*)remoteHost; - (BOOL)isConnected; // communication - (void)reconnect; -- (NSArray *)run; -- (StackFrame *)stepIn; -- (StackFrame *)stepOut; -- (StackFrame *)stepOver; -- (void)addBreakpoint:(Breakpoint *)bp; -- (void)removeBreakpoint:(Breakpoint *)bp; +- (NSArray*)run; +- (StackFrame*)stepIn; +- (StackFrame*)stepOut; +- (StackFrame*)stepOver; +- (void)addBreakpoint:(Breakpoint*)bp; +- (void)removeBreakpoint:(Breakpoint*)bp; // helpers -- (NSArray *)getProperty:(NSString *)property; +- (NSArray*)getProperty:(NSString*)property; @end diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index 3a8425a..eb1a612 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -17,15 +17,15 @@ #import "GDBpConnection.h" #import "AppDelegate.h" -NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; +NSString* kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; @interface GDBpConnection() -@property(readwrite, copy) NSString *status; +@property(readwrite, copy) NSString* status; -- (NSString *)createCommand:(NSString *)cmd, ...; -- (NSXMLDocument *)processData:(NSString *)data; -- (StackFrame *)createStackFrame:(int)depth; -- (StackFrame *)createCurrentStackFrame; +- (NSString*)createCommand:(NSString*)cmd, ...; +- (NSXMLDocument*)processData:(NSString*)data; +- (StackFrame*)createStackFrame:(int)depth; +- (StackFrame*)createCurrentStackFrame; - (void)updateStatus; @end @@ -37,7 +37,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; * Creates a new DebuggerConnection and initializes the socket from the given connection * paramters. */ -- (id)initWithPort:(int)aPort session:(NSString *)aSession; +- (id)initWithPort:(int)aPort session:(NSString*)aSession; { if (self = [super init]) { @@ -78,7 +78,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Gets the session name */ -- (NSString *)session +- (NSString*)session { return session; } @@ -86,7 +86,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Returns the name of the remote host */ -- (NSString *)remoteHost +- (NSString*)remoteHost { if (!connected) { @@ -115,7 +115,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; [self updateStatus]; // register any breakpoints that exist offline - for (Breakpoint *bp in [[BreakpointManager sharedManager] breakpoints]) + for (Breakpoint* bp in [[BreakpointManager sharedManager] breakpoints]) { [self addBreakpoint:bp]; } @@ -126,7 +126,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Receives errors from the SocketWrapper and updates the display */ -- (void)errorEncountered:(NSString *)error +- (void)errorEncountered:(NSString*)error { [[NSNotificationCenter defaultCenter] postNotificationName:kErrorOccurredNotif @@ -152,7 +152,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Tells the debugger to continue running the script. Returns an NSArray of the new stack */ -- (NSArray *)run +- (NSArray*)run { [socket send:[self createCommand:@"run"]]; [socket receive]; @@ -164,14 +164,14 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; // get the total stack depth [socket send:[self createCommand:@"stack_depth"]]; - NSXMLDocument *doc = [self processData:[socket receive]]; + NSXMLDocument* doc = [self processData:[socket receive]]; int depth = [[[[doc rootElement] attributeForName:@"depth"] stringValue] intValue]; // get all stack frames - NSMutableArray *stack = [NSMutableArray arrayWithCapacity:depth]; + NSMutableArray* stack = [NSMutableArray arrayWithCapacity:depth]; for (int i = 0; i < depth; i++) { - StackFrame *frame = [self createStackFrame:i]; + StackFrame* frame = [self createStackFrame:i]; [stack insertObject:frame atIndex:i]; } @@ -181,7 +181,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Tells the debugger to step into the current command. */ -- (StackFrame *)stepIn +- (StackFrame*)stepIn { [socket send:[self createCommand:@"step_into"]]; [socket receive]; @@ -197,7 +197,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Tells the debugger to step out of the current context */ -- (StackFrame *)stepOut +- (StackFrame*)stepOut { [socket send:[self createCommand:@"step_out"]]; [socket receive]; @@ -213,7 +213,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Tells the debugger to step over the current function */ -- (StackFrame *)stepOver +- (StackFrame*)stepOver { [socket send:[self createCommand:@"step_over"]]; [socket receive]; @@ -230,11 +230,11 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; * Tells the debugger engine to get a specifc property. This also takes in the NSXMLElement * that requested it so that the child can be attached. */ -- (NSArray *)getProperty:(NSString *)property +- (NSArray*)getProperty:(NSString*)property { [socket send:[self createCommand:[NSString stringWithFormat:@"property_get -n \"%@\"", property]]]; - NSXMLDocument *doc = [self processData:[socket receive]]; + NSXMLDocument* doc = [self processData:[socket receive]]; /* @@ -245,8 +245,8 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; */ // we now have to detach all the children so we can insert them into another document - NSXMLElement *parent = (NSXMLElement *)[[doc rootElement] childAtIndex:0]; - NSArray *children = [parent children]; + NSXMLElement* parent = (NSXMLElement*)[[doc rootElement] childAtIndex:0]; + NSArray* children = [parent children]; [parent setChildren:nil]; return children; } @@ -256,23 +256,23 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Send an add breakpoint command */ -- (void)addBreakpoint:(Breakpoint *)bp +- (void)addBreakpoint:(Breakpoint*)bp { if (!connected) { return; } - NSString *cmd = [self createCommand:[NSString stringWithFormat:@"breakpoint_set -t line -f %@ -n %i", [bp transformedPath], [bp line]]]; + NSString* cmd = [self createCommand:[NSString stringWithFormat:@"breakpoint_set -t line -f %@ -n %i", [bp transformedPath], [bp line]]]; [socket send:cmd]; - NSXMLDocument *info = [self processData:[socket receive]]; + NSXMLDocument* info = [self processData:[socket receive]]; [bp setDebuggerId:[[[[info rootElement] attributeForName:@"id"] stringValue] intValue]]; } /** * Removes a breakpoint */ -- (void)removeBreakpoint:(Breakpoint *)bp +- (void)removeBreakpoint:(Breakpoint*)bp { if (!connected) { @@ -289,12 +289,12 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; * Helper method to create a string command with the -i automatically tacked on. Takes * a variable number of arguments and parses the given command with +[NSString stringWithFormat:] */ -- (NSString *)createCommand:(NSString *)cmd, ... +- (NSString*)createCommand:(NSString*)cmd, ... { // collect varargs va_list argList; va_start(argList, cmd); - NSString *format = [[NSString alloc] initWithFormat:cmd arguments:argList]; // format the command + NSString* format = [[NSString alloc] initWithFormat:cmd arguments:argList]; // format the command va_end(argList); return [NSString stringWithFormat:@"%@ -i %@", [format autorelease], session]; @@ -303,13 +303,13 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Helper function to parse the NSData into an NSXMLDocument */ -- (NSXMLDocument *)processData:(NSString *)data +- (NSXMLDocument*)processData:(NSString*)data { if (data == nil) return nil; - NSError *parseError = nil; - NSXMLDocument *doc = [[NSXMLDocument alloc] initWithXMLString:data options:0 error:&parseError]; + NSError* parseError = nil; + NSXMLDocument* doc = [[NSXMLDocument alloc] initWithXMLString:data options:0 error:&parseError]; if (parseError) { NSLog(@"Could not parse XML? --- %@", parseError); @@ -319,7 +319,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; } // check and see if there's an error - NSArray *error = [[doc rootElement] elementsForName:@"error"]; + NSArray* error = [[doc rootElement] elementsForName:@"error"]; if ([error count] > 0) { NSLog(@"Xdebug error: %@", error); @@ -333,39 +333,39 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Generates a stack frame for the given depth */ -- (StackFrame *)createStackFrame:(int)stackDepth +- (StackFrame*)createStackFrame:(int)stackDepth { // get the stack frame [socket send:[self createCommand:@"stack_get -d %d", stackDepth]]; - NSXMLDocument *doc = [self processData:[socket receive]]; + NSXMLDocument* doc = [self processData:[socket receive]]; if (doc == nil) return nil; - NSXMLElement *xmlframe = [[[doc rootElement] children] objectAtIndex:0]; + NSXMLElement* xmlframe = [[[doc rootElement] children] objectAtIndex:0]; // get the names of all the contexts [socket send:[self createCommand:@"context_names -d 0"]]; - NSXMLElement *contextNames = [[self processData:[socket receive]] rootElement]; - NSMutableArray *variables = [NSMutableArray array]; - for (NSXMLElement *context in [contextNames children]) + NSXMLElement* contextNames = [[self processData:[socket receive]] rootElement]; + NSMutableArray* variables = [NSMutableArray array]; + for (NSXMLElement* context in [contextNames children]) { - NSString *name = [[context attributeForName:@"name"] stringValue]; + NSString* name = [[context attributeForName:@"name"] stringValue]; int cid = [[[context attributeForName:@"id"] stringValue] intValue]; // fetch the contexts [socket send:[self createCommand:[NSString stringWithFormat:@"context_get -d %d -c %d", stackDepth, cid]]]; - NSArray *addVars = [[[self processData:[socket receive]] rootElement] children]; + NSArray* addVars = [[[self processData:[socket receive]] rootElement] children]; if (addVars != nil && name != nil) [variables addObjectsFromArray:addVars]; } // get the source - NSString *filename = [[xmlframe attributeForName:@"filename"] stringValue]; + NSString* filename = [[xmlframe attributeForName:@"filename"] stringValue]; [socket send:[self createCommand:[NSString stringWithFormat:@"source -f %@", filename]]]; - NSString *source = [[[self processData:[socket receive]] rootElement] value]; // decode base64 + NSString* source = [[[self processData:[socket receive]] rootElement] value]; // decode base64 // create stack frame - StackFrame *frame = [[StackFrame alloc] + StackFrame* frame = [[StackFrame alloc] initWithIndex:stackDepth withFilename:filename withSource:source @@ -380,7 +380,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Creates a StackFrame based on the current position in the debugger */ -- (StackFrame *)createCurrentStackFrame +- (StackFrame*)createCurrentStackFrame { return [self createStackFrame:0]; } @@ -391,7 +391,7 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; - (void)updateStatus { [socket send:[self createCommand:@"status"]]; - NSXMLDocument *doc = [self processData:[socket receive]]; + NSXMLDocument* doc = [self processData:[socket receive]]; self.status = [[[[doc rootElement] attributeForName:@"status"] stringValue] capitalizedString]; if (status == nil || [status isEqualToString:@"Stopped"] || [status isEqualToString:@"Stopping"]) diff --git a/Source/NSXMLElementAdditions.h b/Source/NSXMLElementAdditions.h index fddcd00..c021cd0 100644 --- a/Source/NSXMLElementAdditions.h +++ b/Source/NSXMLElementAdditions.h @@ -18,11 +18,11 @@ @interface NSXMLElement (GDBpAdditions) -- (NSString *)fullname; -- (NSString *)variable; +- (NSString*)fullname; +- (NSString*)variable; - (BOOL)isLeaf; -- (NSString *)value; -- (NSString *)type; -- (NSArray *)subnodes; +- (NSString*)value; +- (NSString*)type; +- (NSArray*)subnodes; @end diff --git a/Source/NSXMLElementAdditions.m b/Source/NSXMLElementAdditions.m index c4bd4a8..9642ae2 100644 --- a/Source/NSXMLElementAdditions.m +++ b/Source/NSXMLElementAdditions.m @@ -23,7 +23,7 @@ /** * Return's the property's full name */ -- (NSString *)fullname +- (NSString*)fullname { return [[self attributeForName:@"fullname"] stringValue]; } @@ -31,7 +31,7 @@ /** * Return's the property's name from the attributes list */ -- (NSString *)variable +- (NSString*)variable { return [[self attributeForName:@"name"] stringValue]; } @@ -47,12 +47,12 @@ /** * Override children so we can fetch more depth as needed */ -- (NSArray *)subnodes +- (NSArray*)subnodes { - NSArray *children = [self children]; + NSArray* children = [self children]; if (![self isLeaf] && [children count] < 1) { - return [[[(AppDelegate *)[NSApp delegate] debugger] connection] getProperty:[self fullname]]; + return [[[(AppDelegate*)[NSApp delegate] debugger] connection] getProperty:[self fullname]]; } return children; } @@ -60,7 +60,7 @@ /** * Returns the value of the property */ -- (NSString *)value +- (NSString*)value { // not a leaf, so don't display any value if (![self isLeaf]) @@ -71,10 +71,10 @@ // base64 encoded data if ([[[self attributeForName:@"encoding"] stringValue] isEqualToString:@"base64"]) { - char *str = (char *)[[self stringValue] cStringUsingEncoding:NSASCIIStringEncoding]; + char* str = (char*)[[self stringValue] cStringUsingEncoding:NSASCIIStringEncoding]; int strlen = [[self stringValue] lengthOfBytesUsingEncoding:NSASCIIStringEncoding]; - char *data; + char* data; size_t datalen; if (!base64_decode_alloc(str, strlen, &data, &datalen)) @@ -82,7 +82,7 @@ NSLog(@"error in converting %@ to base64", self); } - NSString *ret = [NSString stringWithCString:data length:datalen]; + NSString* ret = [NSString stringWithCString:data length:datalen]; free(data); return ret; @@ -95,10 +95,10 @@ /** * Returns the type of variable this is */ -- (NSString *)type +- (NSString*)type { - NSXMLNode *className = [self attributeForName:@"classname"]; - NSString *type = [[self attributeForName:@"type"] stringValue]; + NSXMLNode* className = [self attributeForName:@"classname"]; + NSString* type = [[self attributeForName:@"type"] stringValue]; if (className != nil) { return [NSString stringWithFormat:@"%@ (%@)", [className stringValue], type]; diff --git a/Source/PreferencesController.h b/Source/PreferencesController.h index 989a011..d820908 100644 --- a/Source/PreferencesController.h +++ b/Source/PreferencesController.h @@ -19,15 +19,15 @@ @interface PreferencesController : NSWindowController { - IBOutlet NSToolbar *toolbar; + IBOutlet NSToolbar* toolbar; - NSView *blankView; + NSView* blankView; - IBOutlet NSView *generalPreferencesView; - IBOutlet NSToolbarItem *generalPreferencesItem; + IBOutlet NSView* generalPreferencesView; + IBOutlet NSToolbarItem* generalPreferencesItem; - IBOutlet NSView *pathsPreferencesView; - IBOutlet NSToolbarItem *pathsPreferencesItem; + IBOutlet NSView* pathsPreferencesView; + IBOutlet NSToolbarItem* pathsPreferencesItem; } - (void)showPreferencesWindow; diff --git a/Source/PreferencesController.m b/Source/PreferencesController.m index d5125f2..08fbc52 100644 --- a/Source/PreferencesController.m +++ b/Source/PreferencesController.m @@ -101,7 +101,7 @@ NSSize pathsSize; /** * Returns the selection names */ -- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar +- (NSArray*)toolbarSelectableItemIdentifiers:(NSToolbar*)toolbar { return [NSArray arrayWithObjects: [generalPreferencesItem itemIdentifier], diff --git a/Source/PreferencesPathsArrayController.m b/Source/PreferencesPathsArrayController.m index f2b4e31..71c240f 100644 --- a/Source/PreferencesPathsArrayController.m +++ b/Source/PreferencesPathsArrayController.m @@ -24,7 +24,7 @@ */ - (id)newObject { - NSMutableDictionary *obj = (NSMutableDictionary *)[super newObject]; + NSMutableDictionary* obj = (NSMutableDictionary*)[super newObject]; [obj setValue:@"Remote Path" forKey:@"remote"]; [obj setValue:@"Local Path" forKey:@"local"]; return obj; diff --git a/Source/SocketWrapper.h b/Source/SocketWrapper.h index 1d295f4..d9692de 100644 --- a/Source/SocketWrapper.h +++ b/Source/SocketWrapper.h @@ -20,33 +20,33 @@ @interface SocketWrapper : NSObject { - GDBpConnection *connection; + GDBpConnection* connection; int port; int sock; - NSString *hostname; + NSString* hostname; id delegate; } -- (id)initWithConnection:(GDBpConnection *)cnx; +- (id)initWithConnection:(GDBpConnection*)cnx; - (id)delegate; - (void)setDelegate:(id)aDelegate; - (void)connect; - (void)close; -- (NSString *)receive; -- (BOOL)send:(NSString *)data; +- (NSString*)receive; +- (BOOL)send:(NSString*)data; -- (NSString *)remoteHost; +- (NSString*)remoteHost; @end @interface NSObject (SocketWrapperDelegate) // error -- (void)errorEncountered:(NSString *)error; +- (void)errorEncountered:(NSString*)error; // connection components - (void)socketDidAccept:(id)obj; diff --git a/Source/SocketWrapper.m b/Source/SocketWrapper.m index b37f99d..bb91fcf 100644 --- a/Source/SocketWrapper.m +++ b/Source/SocketWrapper.m @@ -22,9 +22,9 @@ #include @interface SocketWrapper () -@property (copy, readwrite, getter=remoteHost) NSString *hostname; +@property (copy, readwrite, getter=remoteHost) NSString* hostname; -- (void)error:(NSString *)msg; +- (void)error:(NSString*)msg; @end @implementation SocketWrapper @@ -33,7 +33,7 @@ /** * Initializes the socket wrapper with a host and port */ -- (id)initWithConnection:(GDBpConnection *)cnx +- (id)initWithConnection:(GDBpConnection*)cnx { if (self = [super init]) { @@ -70,7 +70,7 @@ } /** - * Sets the delegate but does *not* retain it + * Sets the delegate but does* not* retain it */ - (void)setDelegate:(id)aDelegate { @@ -91,7 +91,7 @@ */ - (void)connect:(id)obj { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; // create an INET socket that we'll be listen()ing on int socketOpen = socket(PF_INET, SOCK_STREAM, 0); @@ -109,7 +109,7 @@ // bind the socket... and don't give up until we've tried for a while int tries = 0; - while (bind(socketOpen, (struct sockaddr *)&address, sizeof(address)) < 0) + while (bind(socketOpen, (struct sockaddr*)&address, sizeof(address)) < 0) { if (tries >= 5) { @@ -132,7 +132,7 @@ // accept a connection struct sockaddr_in remoteAddress; socklen_t remoteAddressLen = sizeof(remoteAddress); - sock = accept(socketOpen, (struct sockaddr *)&remoteAddress, &remoteAddressLen); + sock = accept(socketOpen, (struct sockaddr*)&remoteAddress, &remoteAddressLen); if (sock < 0) { close(socketOpen); @@ -146,11 +146,11 @@ struct sockaddr_in addr; socklen_t addrLength; - if (getpeername(sock, (struct sockaddr *)&addr, &addrLength) < 0) + if (getpeername(sock, (struct sockaddr*)&addr, &addrLength) < 0) { [self error:@"Could not get remote hostname."]; } - char *name = inet_ntoa(addr.sin_addr); + char* name = inet_ntoa(addr.sin_addr); [self setHostname:[NSString stringWithUTF8String:name]]; [connection performSelectorOnMainThread:@selector(socketDidAccept:) withObject:nil waitUntilDone:NO]; @@ -164,7 +164,7 @@ * is used either in a threaded environment so the interface does not hang, or when you *know* the server * will return something (which we almost always do). Returns the data that was received from the socket. */ -- (NSString *)receive +- (NSString*)receive { // create a buffer char buffer[1024]; @@ -173,7 +173,7 @@ int recvd = recv(sock, &buffer, sizeof(buffer), 0); // take the received data and put it into an NSData - NSMutableString *str = [NSMutableString string]; + NSMutableString* str = [NSMutableString string]; if (recvd == -1) return nil; @@ -218,7 +218,7 @@ } } - NSString *tmp = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // strip whitespace + NSString* tmp = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // strip whitespace tmp = [tmp substringToIndex:[tmp length] - 1]; // don't want the null byte NSAssert([tmp UTF8String][[tmp length] - 1] == '>', @"-[SocketWrapper receive] buffer is incomplete"); @@ -229,7 +229,7 @@ /** * Sends a given NSString over the socket. Returns YES on complete submission. */ -- (BOOL)send:(NSString *)data +- (BOOL)send:(NSString*)data { data = [NSString stringWithFormat:@"%@\0", data]; int sent = send(sock, [data UTF8String], [data length], 0); @@ -251,7 +251,7 @@ /** * Helper method that just calls -[DebuggerWindowController setError:] on the main thread */ -- (void)error:(NSString *)msg +- (void)error:(NSString*)msg { [delegate performSelectorOnMainThread:@selector(setError:) withObject:msg waitUntilDone:NO]; } diff --git a/Source/StackController.h b/Source/StackController.h index 14f219a..e3c6f3e 100644 --- a/Source/StackController.h +++ b/Source/StackController.h @@ -22,13 +22,13 @@ /** * Array of StackFrame's (LIFO stack) */ - NSMutableArray *stack; + NSMutableArray* stack; } -@property(readonly) NSMutableArray *stack; +@property(readonly) NSMutableArray* stack; -- (StackFrame *)peek; -- (StackFrame *)pop; -- (void)push:(StackFrame *)frame; +- (StackFrame*)peek; +- (StackFrame*)pop; +- (void)push:(StackFrame*)frame; @end diff --git a/Source/StackController.m b/Source/StackController.m index 1310ac2..a478f04 100644 --- a/Source/StackController.m +++ b/Source/StackController.m @@ -45,7 +45,7 @@ /** * Returns a reference to the top of the stack */ -- (StackFrame *)peek +- (StackFrame*)peek { return [stack lastObject]; } @@ -53,14 +53,14 @@ /** * Pops the current frame off the stack and returns the frame */ -- (StackFrame *)pop +- (StackFrame*)pop { - StackFrame *frame = [stack lastObject]; + StackFrame* frame = [stack lastObject]; if (frame != nil) [stack removeLastObject]; - for (StackFrame *f in stack) + for (StackFrame* f in stack) f.index--; return frame; @@ -69,9 +69,9 @@ /** * Pushes a frame onto the end of the stack */ -- (void)push:(StackFrame *)frame +- (void)push:(StackFrame*)frame { - for (StackFrame *f in stack) + for (StackFrame* f in stack) f.index++; [stack insertObject:frame atIndex:[stack count]]; diff --git a/Source/StackFrame.h b/Source/StackFrame.h index b80e008..a5466bb 100644 --- a/Source/StackFrame.h +++ b/Source/StackFrame.h @@ -27,12 +27,12 @@ /** * File the current frame is in */ - NSString *filename; + NSString* filename; /** * Cached, highlighted version of the source */ - NSString *source; + NSString* source; /** * Line number of the source the frame points to @@ -42,28 +42,28 @@ /** * Current-executing function */ - NSString *function; + NSString* function; /** * Variable list */ - NSArray *variables; + NSArray* variables; } @property(readwrite) int index; -@property(readonly, copy) NSString *filename; -@property(readonly, copy) NSString *source; +@property(readonly, copy) NSString* filename; +@property(readonly, copy) NSString* source; @property(readwrite) int lineNumber; -@property(readwrite, copy) NSString *function; -@property(readonly, copy) NSArray *variables; +@property(readwrite, copy) NSString* function; +@property(readonly, copy) NSArray* variables; - (id)initWithIndex:(int)anIndex - withFilename:(NSString *)aFilename - withSource:(NSString *)aSource + withFilename:(NSString*)aFilename + withSource:(NSString*)aSource atLine:(int)aLineNumber - inFunction:(NSString *)function - withVariables:(NSArray *)variables; + inFunction:(NSString*)function + withVariables:(NSArray*)variables; -- (BOOL)isShiftedFrame:(StackFrame *)frame; +- (BOOL)isShiftedFrame:(StackFrame*)frame; @end diff --git a/Source/StackFrame.m b/Source/StackFrame.m index 0a955db..ebb3bed 100644 --- a/Source/StackFrame.m +++ b/Source/StackFrame.m @@ -20,9 +20,9 @@ * Private class continuation */ @interface StackFrame() -@property(readwrite, copy) NSString *filename; -@property(readwrite, copy) NSString *source; -@property(readwrite, copy) NSArray *variables; +@property(readwrite, copy) NSString* filename; +@property(readwrite, copy) NSString* source; +@property(readwrite, copy) NSArray* variables; @end /***/ @@ -34,11 +34,11 @@ * Constructor */ - (id)initWithIndex:(int)anIndex - withFilename:(NSString *)aFilename - withSource:(NSString *)aSource + withFilename:(NSString*)aFilename + withSource:(NSString*)aSource atLine:(int)aLineNumber - inFunction:(NSString *)aFunction - withVariables:(NSArray *)aVariables + inFunction:(NSString*)aFunction + withVariables:(NSArray*)aVariables { if (self = [super init]) { @@ -56,7 +56,7 @@ * Determines whether or not the given frame was shifted, rather than jumped. Essentially, * this checks if it's in the same file/function. */ -- (BOOL)isShiftedFrame:(StackFrame *)frame +- (BOOL)isShiftedFrame:(StackFrame*)frame { return ([filename isEqualToString:frame.filename] && [function isEqualToString:frame.function]); } @@ -64,7 +64,7 @@ /** * Returns a human-readable representation */ -- (NSString *)description +- (NSString*)description { return [NSString stringWithFormat:@"#%d %@ [%@:%d]", index, function, filename, lineNumber]; } -- 2.22.5