Skip to content

Commit

Permalink
cleanup, prepare for ARC conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
spathiwa committed Jun 7, 2015
1 parent cdba8be commit 9be2c8c
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 55 deletions.
62 changes: 31 additions & 31 deletions Frotz.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -554,41 +554,41 @@
4409C8F31985F8B5003869C2 /* glyph-enter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "glyph-enter.png"; path = "resources/glyph-enter.png"; sourceTree = "<group>"; };
4409C8F41985F8B5003869C2 /* glyph-enter@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "glyph-enter@2x.png"; path = "resources/glyph-enter@2x.png"; sourceTree = "<group>"; };
440DAAFA125D68DE0014A8FD /* TextViewExt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextViewExt.h; sourceTree = "<group>"; };
440DACE1125D8CA70014A8FD /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../frotz/common/main.c; sourceTree = "<group>"; };
440DACE1125D8CA70014A8FD /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
4413B1611071CA2700D39E6A /* RichTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RichTextView.m; sourceTree = "<group>"; };
4413B1621071CA2700D39E6A /* RichTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RichTextView.h; sourceTree = "<group>"; };
4414E2D8104CDA0B008C3F56 /* FrotzWordPicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = FrotzWordPicker.xib; path = resources/FrotzWordPicker.xib; sourceTree = "<group>"; };
4414E2DA104CDA21008C3F56 /* FrotzWordPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrotzWordPicker.h; sourceTree = "<group>"; };
4414E2DB104CDA21008C3F56 /* FrotzWordPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FrotzWordPicker.m; sourceTree = "<group>"; };
441EC82B0E10BD1100E74625 /* buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = buffer.c; path = ../../frotz/common/buffer.c; sourceTree = "<group>"; };
441EC82C0E10BD1100E74625 /* err.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = err.c; path = ../../frotz/common/err.c; sourceTree = "<group>"; };
441EC82D0E10BD1100E74625 /* fastmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = fastmem.c; path = ../../frotz/common/fastmem.c; sourceTree = "<group>"; };
441EC82E0E10BD1100E74625 /* files.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = files.c; path = ../../frotz/common/files.c; sourceTree = "<group>"; };
441EC82F0E10BD1100E74625 /* frotz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = frotz.h; path = ../../frotz/common/frotz.h; sourceTree = "<group>"; };
441EC8300E10BD1100E74625 /* getopt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getopt.c; path = ../../frotz/common/getopt.c; sourceTree = "<group>"; };
441EC8310E10BD1100E74625 /* hotkey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hotkey.c; path = ../../frotz/common/hotkey.c; sourceTree = "<group>"; };
441EC8320E10BD1100E74625 /* input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = input.c; path = ../../frotz/common/input.c; sourceTree = "<group>"; };
441EC8340E10BD1100E74625 /* math.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = math.c; path = ../../frotz/common/math.c; sourceTree = "<group>"; };
441EC8350E10BD1100E74625 /* object.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = object.c; path = ../../frotz/common/object.c; sourceTree = "<group>"; };
441EC8360E10BD1100E74625 /* process.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = process.c; path = ../../frotz/common/process.c; sourceTree = "<group>"; };
441EC8370E10BD1100E74625 /* quetzal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = quetzal.c; path = ../../frotz/common/quetzal.c; sourceTree = "<group>"; };
441EC8380E10BD1100E74625 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = random.c; path = ../../frotz/common/random.c; sourceTree = "<group>"; };
441EC8390E10BD1100E74625 /* redirect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = redirect.c; path = ../../frotz/common/redirect.c; sourceTree = "<group>"; };
441EC83A0E10BD1100E74625 /* screen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = screen.c; path = ../../frotz/common/screen.c; sourceTree = "<group>"; };
441EC83B0E10BD1100E74625 /* setup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = setup.h; path = ../../frotz/common/setup.h; sourceTree = "<group>"; };
441EC83C0E10BD1100E74625 /* sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sound.c; path = ../../frotz/common/sound.c; sourceTree = "<group>"; };
441EC83D0E10BD1100E74625 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stream.c; path = ../../frotz/common/stream.c; sourceTree = "<group>"; };
441EC83E0E10BD1100E74625 /* table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = table.c; path = ../../frotz/common/table.c; sourceTree = "<group>"; };
441EC83F0E10BD1100E74625 /* text.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = text.c; path = ../../frotz/common/text.c; sourceTree = "<group>"; };
441EC8400E10BD1100E74625 /* variable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = variable.c; path = ../../frotz/common/variable.c; sourceTree = "<group>"; };
441EC8570E10BD4400E74625 /* getopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = getopt.h; path = ../../frotz/ios/getopt.h; sourceTree = "<group>"; };
441EC82B0E10BD1100E74625 /* buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = buffer.c; sourceTree = "<group>"; };
441EC82C0E10BD1100E74625 /* err.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = err.c; sourceTree = "<group>"; };
441EC82D0E10BD1100E74625 /* fastmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fastmem.c; sourceTree = "<group>"; };
441EC82E0E10BD1100E74625 /* files.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = files.c; sourceTree = "<group>"; };
441EC82F0E10BD1100E74625 /* frotz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frotz.h; sourceTree = "<group>"; };
441EC8300E10BD1100E74625 /* getopt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getopt.c; sourceTree = "<group>"; };
441EC8310E10BD1100E74625 /* hotkey.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hotkey.c; sourceTree = "<group>"; };
441EC8320E10BD1100E74625 /* input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = input.c; sourceTree = "<group>"; };
441EC8340E10BD1100E74625 /* math.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = math.c; sourceTree = "<group>"; };
441EC8350E10BD1100E74625 /* object.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = object.c; sourceTree = "<group>"; };
441EC8360E10BD1100E74625 /* process.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = process.c; sourceTree = "<group>"; };
441EC8370E10BD1100E74625 /* quetzal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quetzal.c; sourceTree = "<group>"; };
441EC8380E10BD1100E74625 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = random.c; sourceTree = "<group>"; };
441EC8390E10BD1100E74625 /* redirect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = redirect.c; sourceTree = "<group>"; };
441EC83A0E10BD1100E74625 /* screen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = screen.c; sourceTree = "<group>"; };
441EC83B0E10BD1100E74625 /* setup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setup.h; sourceTree = "<group>"; };
441EC83C0E10BD1100E74625 /* sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sound.c; sourceTree = "<group>"; };
441EC83D0E10BD1100E74625 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stream.c; sourceTree = "<group>"; };
441EC83E0E10BD1100E74625 /* table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = table.c; sourceTree = "<group>"; };
441EC83F0E10BD1100E74625 /* text.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = text.c; sourceTree = "<group>"; };
441EC8400E10BD1100E74625 /* variable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = variable.c; sourceTree = "<group>"; };
441EC8570E10BD4400E74625 /* getopt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getopt.h; sourceTree = "<group>"; };
441EC8590E10BD4400E74625 /* iosfrotz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iosfrotz.h; path = ../include/iosfrotz.h; sourceTree = "<group>"; };
441EC85B0E10BD4400E74625 /* ui_audio_none.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_audio_none.c; path = ../../frotz/ios/ui_audio_none.c; sourceTree = "<group>"; };
441EC85D0E10BD4400E74625 /* ui_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_init.c; path = ../../frotz/ios/ui_init.c; sourceTree = "<group>"; };
441EC85F0E10BD4400E74625 /* ui_input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_input.c; path = ../../frotz/ios/ui_input.c; sourceTree = "<group>"; };
441EC8610E10BD4400E74625 /* ui_pic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_pic.c; path = ../../frotz/ios/ui_pic.c; sourceTree = "<group>"; };
441EC8630E10BD4400E74625 /* ui_setup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ui_setup.h; path = ../../frotz/ios/ui_setup.h; sourceTree = "<group>"; };
441EC8640E10BD4400E74625 /* ui_text.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ui_text.c; path = ../../frotz/ios/ui_text.c; sourceTree = "<group>"; };
441EC85B0E10BD4400E74625 /* ui_audio_none.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ui_audio_none.c; sourceTree = "<group>"; };
441EC85D0E10BD4400E74625 /* ui_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ui_init.c; sourceTree = "<group>"; };
441EC85F0E10BD4400E74625 /* ui_input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ui_input.c; sourceTree = "<group>"; };
441EC8610E10BD4400E74625 /* ui_pic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ui_pic.c; sourceTree = "<group>"; };
441EC8630E10BD4400E74625 /* ui_setup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ui_setup.h; sourceTree = "<group>"; };
441EC8640E10BD4400E74625 /* ui_text.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ui_text.c; sourceTree = "<group>"; };
442351CF125E77C000BFB245 /* notes.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = notes.png; path = resources/notes.png; sourceTree = "<group>"; };
442355BD1260497900BFB245 /* accel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = accel.c; path = glulxe/accel.c; sourceTree = "<group>"; };
442355BE1260497900BFB245 /* exec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = exec.c; path = glulxe/exec.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1606,7 +1606,7 @@
441EC83B0E10BD1100E74625 /* setup.h */,
);
name = common;
path = src/common;
path = frotz/common;
sourceTree = "<group>";
};
441EC8560E10BD3400E74625 /* ios */ = {
Expand All @@ -1621,7 +1621,7 @@
441EC8570E10BD4400E74625 /* getopt.h */,
);
name = ios;
path = src/ios;
path = frotz/ios;
sourceTree = "<group>";
};
442355BC1260493A00BFB245 /* glulxe */ = {
Expand Down
1 change: 1 addition & 0 deletions frotz/ios/ui_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <termios.h>

#include "iosfrotz.h"
#include "ui_setup.h"

f_setup_t f_setup;
u_setup_t u_setup;
Expand Down
1 change: 1 addition & 0 deletions frotz/ios/ui_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <sys/time.h>

#include "iosfrotz.h"
#include "ui_setup.h"

static struct timeval global_timeout;

Expand Down
1 change: 1 addition & 0 deletions frotz/ios/ui_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <string.h>

#include "iosfrotz.h"
#include "ui_setup.h"
#include "RichTextStyle.h"

/* When color_enabled is FALSE, we still minimally keep track of colors by
Expand Down
5 changes: 2 additions & 3 deletions include/iosfrotz.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
extern "C" {
#endif

#include "../frotz/common/frotz.h"
#include "frotz.h"

#include "ui_setup.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
Expand All @@ -41,7 +40,7 @@ extern char semi_stripped_story_name[FILENAME_MAX+1];
extern char iosif_filename[MAX_FILE_NAME];

extern f_setup_t f_setup;
extern u_setup_t u_setup;
//extern u_setup_t u_setup;

#define MAX_ROWS 100
#define MAX_COLS 100
Expand Down
1 change: 1 addition & 0 deletions ui/FrotzAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import "StatusLine.h"
#import "StoryInputLine.h"
#import "StoryView.h"
#import "StoryDetailsController.h"
#import <DropboxSDK/DropboxSDK.h>

@interface FrotzWindow : UIWindow
Expand Down
2 changes: 1 addition & 1 deletion ui/FrotzHTTPConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ - (void)processDataChunk:(NSData *)postDataChunk
postInfoComponents = [[postInfoComponents lastObject] componentsSeparatedByString:@"\""];
postInfoComponents = [postInfoComponents[1] componentsSeparatedByString:@"\\"];

NSURL *uri = [NSMakeCollectable(CFHTTPMessageCopyRequestURL(request)) autorelease];
NSURL *uri = CFBridgingRelease(CFHTTPMessageCopyRequestURL(request));
int partEndOffset = indexOfBytes(postDataChunk, dataStartIndex, [partSeparator UTF8String], partSepLen, &partialMatch);
if (partEndOffset >= 0) {
postDataLen = partEndOffset;
Expand Down
1 change: 1 addition & 0 deletions ui/GlkView.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#import "GlkView.h"
#import "FrotzAppDelegate.h"
#import "StoryInputLine.h"
#import "FileBrowser.h"
#import "ui_utils.h"

Expand Down
4 changes: 2 additions & 2 deletions ui/RichTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1905,10 +1905,10 @@ - (RichTextTile *)dequeueReusableTile {
#endif
// the only object retaining the tile is our reusableTiles set, so we have to retain/autorelease it
// before returning it so that it's not immediately deallocated when we remove it from the set
[[tile retain] autorelease];
[tile retain];
[m_reusableTiles removeObject:tile];
}
return tile;
return [tile autorelease];
}

- (void)reloadData {
Expand Down
2 changes: 1 addition & 1 deletion ui/StoryBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int articlePrefix(NSString *str) {
}

static NSInteger sortPathsByFilename(id a, id b, void *context) {
StoryBrowser *sb = (StoryBrowser*)context;
StoryBrowser *sb = (__bridge StoryBrowser*)context;
NSString *str1 = prettyStoryName(sb, a);
NSString *str2 = prettyStoryName(sb, b);
return [str1 caseInsensitiveCompare: str2];
Expand Down
17 changes: 9 additions & 8 deletions ui/StoryMainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
#import "StatusLine.h"
#import "StoryInputLine.h"
#import "StoryView.h"
#import "StoryDetailsController.h"
#import "GlkView.h"

#import "FileBrowser.h"
#import <DropboxSDK/DropboxSDK.h>

#import "ui_setup.h"
#import "ui_utils.h"

#include "glk.h"
Expand Down Expand Up @@ -912,7 +914,6 @@ glui32 iosif_glk_image_draw(int viewNum, glui32 image, glsi32 val1, glsi32 val2,

void run_zinterp(bool autorestore) {
gStoryInterp = kZStory;
os_init_setup();

os_set_default_file_names(story_name);
if (autorestore)
Expand Down Expand Up @@ -1382,8 +1383,8 @@ -(void)updateGlkWin:(NSNumber*)viewNum {
imgView.frame = CGRectMake(0, 0, v.bounds.size.width, v.bounds.size.height);

CGImageRef imgRef = CGBitmapContextCreateImage(cgctx);
[imgView layer].contents = (id)imgRef;
CGImageRelease(imgRef);
[imgView layer].contents = (id)CFBridgingRelease(imgRef);
//CGImageRelease(imgRef);

#if 0
void *data = CGBitmapContextGetData(cgctx);
Expand Down Expand Up @@ -2009,7 +2010,7 @@ - (void) setIgnoreWordSelection:(BOOL)ignore {

-(void)textSelectedAnimDidFinish:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
NSString *origText = [m_inputLine text];
NSString *text = (NSString*)context;
NSString *text = (NSString*)CFBridgingRelease(context);
[UIView setAnimationDelegate: nil];
m_animDuration = 0;
//NSLog(@"textsel did fin: %@ %@", text, finished);
Expand All @@ -2023,7 +2024,7 @@ -(void)textSelectedAnimDidFinish:(NSString *)animationID finished:(NSNumber *)fi
[m_inputLine setText: text];
}
m_ignoreWordSelection = NO;
[text release];
//[text release];
[m_storyView clearSelection];
}

Expand All @@ -2033,8 +2034,8 @@ -(void)textSelected:(NSString*)text animDuration:(CGFloat)animDuration hilightVi
// m_kbShown commented out so this still works with paired hardware keyboards
NSString *origText = [m_inputLine text];
//NSLog(@"textsel: %@", text);
[text retain];
[UIView beginAnimations: @"tsel" context: text];
//[text retain];
[UIView beginAnimations: @"tsel" context: (void*)CFBridgingRetain(text)];
[UIView setAnimationDelay: 0.1];
CGRect frame = [m_inputLine frame];
CGRect origViewFrame = [view frame];
Expand Down Expand Up @@ -4469,7 +4470,7 @@ -(int)statusFixedFontPixelHeight {
}


static int matchWord(NSString *str, NSString *wordArray[]) {
static int matchWord(NSString *str, NSString __strong *wordArray[]) {
int i;
for (i=0; wordArray[i]; ++i) {
if ([wordArray[i] hasPrefix: str]) {
Expand Down
19 changes: 10 additions & 9 deletions ui/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

int main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
os_init_setup(); // todo: move this into frotz-terp-specific section but called only once

NSString* resources = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/locale"];
static char path_locale[1024];
strcpy(path_locale, [resources cStringUsingEncoding:NSASCIIStringEncoding]);
setenv("PATH_LOCALE", path_locale, 1);
setlocale(LC_CTYPE, "en_US.UTF-8");
[pool drain];
@autoreleasepool {

UIApplicationMain(argc, argv, nil, @"FrotzAppDelegate");
[pool release];
NSString* resources = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/locale"];
static char path_locale[1024];
strcpy(path_locale, [resources cStringUsingEncoding:NSASCIIStringEncoding]);
setenv("PATH_LOCALE", path_locale, 1);
setlocale(LC_CTYPE, "en_US.UTF-8");

UIApplicationMain(argc, argv, nil, @"FrotzAppDelegate");
}
fflush(stdout);
fflush(stderr);

Expand Down

0 comments on commit 9be2c8c

Please sign in to comment.