Changeset 3263
- Timestamp:
- 06/07/06 00:55:32 (2 years ago)
- Files:
-
- trunk/Plug-Ins/AppleScript Support/JVAppleScriptChatPlugin.m (modified) (2 diffs)
- trunk/Plug-Ins/AppleScript Support/JVAppleScriptPluginLoader.m (modified) (1 diff)
- trunk/Plug-Ins/F-Script Support/JVFScriptChatPlugin.m (modified) (3 diffs)
- trunk/Plug-Ins/F-Script Support/JVFScriptPluginLoader.m (modified) (4 diffs)
- trunk/Plug-Ins/Python Support/JVPythonChatPlugin.m (modified) (3 diffs)
- trunk/Plug-Ins/Python Support/JVPythonPluginLoader.m (modified) (4 diffs)
- trunk/Plug-Ins/Ruby Support/JVRubyChatPlugin.m (modified) (3 diffs)
- trunk/Plug-Ins/Ruby Support/JVRubyPluginLoader.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plug-Ins/AppleScript Support/JVAppleScriptChatPlugin.m
r2587 r3263 152 152 - (void) reloadFromDisk { 153 153 NSString *filePath = [self scriptFilePath]; 154 MVChatPluginManager *manager = [self pluginManager];155 154 156 155 NSAppleScript *script = [[[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:filePath] error:NULL] autorelease]; … … 377 376 if( enabled && ! [enabled boolValue] ) [mitem setEnabled:[enabled boolValue]]; 378 377 if( checked ) [mitem setState:[checked intValue]]; 379 if( indent ) [mitem setIndentationLevel:MIN( 15, [indent unsignedIntValue] )]; 378 #define min(a,b) a > b ? b : a 379 if( indent ) [mitem setIndentationLevel:min( 15, [indent unsignedIntValue] )]; 380 380 if( tooltip ) [mitem setToolTip:tooltip]; 381 381 trunk/Plug-Ins/AppleScript Support/JVAppleScriptPluginLoader.m
r2406 r3263 7 7 @implementation JVAppleScriptPluginLoader 8 8 - (id) initWithManager:(MVChatPluginManager *) manager { 9 if( self = [super init] ) {9 if( ( self = [super init] ) ) 10 10 _manager = manager; 11 }12 13 11 return self; 14 12 } trunk/Plug-Ins/F-Script Support/JVFScriptChatPlugin.m
r3233 r3263 20 20 @implementation JVFScriptChatPlugin 21 21 - (id) initWithManager:(MVChatPluginManager *) manager { 22 if( self = [self init]) {22 if( ( self = [self init] ) ) { 23 23 _manager = manager; 24 24 _scriptInterpreter = nil; … … 31 31 32 32 - (id) initWithScriptAtPath:(NSString *) path withManager:(MVChatPluginManager *) manager { 33 if( self = [self initWithManager:manager]) {33 if( ( self = [self initWithManager:manager] ) ) { 34 34 _path = [path copyWithZone:[self zone]]; 35 35 _scriptInterpreter = [[FSInterpreter interpreter] retain]; … … 163 163 if( found && [object isKindOfClass:[Block class]] ) { 164 164 if( ! arguments ) arguments = [NSArray arrayWithObject:[NSNull null]]; 165 if( [(Block *)object argumentCount] > [arguments count] ) {165 if( (unsigned)[(Block *)object argumentCount] > [arguments count] ) { 166 166 NSMutableArray *newArgs = [[arguments mutableCopy] autorelease]; 167 unsigned int i = 0; 168 for( i = [arguments count]; i < [(Block *)object argumentCount]; i++ ) 167 for( unsigned i = [arguments count]; i < (unsigned)[(Block *)object argumentCount]; i++ ) 169 168 [newArgs addObject:[NSNull null]]; 170 169 arguments = newArgs; trunk/Plug-Ins/F-Script Support/JVFScriptPluginLoader.m
r3233 r3263 13 13 @implementation JVFScriptPluginLoader 14 14 - (id) initWithManager:(MVChatPluginManager *) manager { 15 if( self = [super init]) {15 if( ( self = [super init] ) ) { 16 16 _manager = manager; 17 17 _fscriptInstalled = ( NSClassFromString( @"FSInterpreter" ) ? YES : NO ); … … 66 66 JVFScriptChatPlugin *plugin = nil; 67 67 68 while( plugin = [pluginEnum nextObject])68 while( ( plugin = [pluginEnum nextObject] ) ) 69 69 if( [[plugin scriptFilePath] isEqualToString:path] || [[[[plugin scriptFilePath] lastPathComponent] stringByDeletingPathExtension] isEqualToString:path] ) 70 70 break; … … 117 117 NSEnumerator *enumerator = [paths objectEnumerator]; 118 118 NSString *path = nil; 119 while( path = [enumerator nextObject]) {119 while( ( path = [enumerator nextObject] ) ) { 120 120 path = [path stringByAppendingPathComponent:[name stringByDeletingPathExtension]]; 121 121 path = [path stringByAppendingPathExtension:@"fscript"]; … … 144 144 145 145 NSEnumerator *enumerator = [paths objectEnumerator]; 146 while( path = [enumerator nextObject]) {146 while( ( path = [enumerator nextObject] ) ) { 147 147 NSEnumerator *denumerator = [[[NSFileManager defaultManager] directoryContentsAtPath:path] objectEnumerator]; 148 148 while( ( file = [denumerator nextObject] ) ) { trunk/Plug-Ins/Python Support/JVPythonChatPlugin.m
r3233 r3263 11 11 if( ! newname ) newname = name; 12 12 13 PyObject *impModule = PyImport_ImportModule( "imp" );13 PyObject *impModule = PyImport_ImportModule( (char *) "imp" ); 14 14 if( ! impModule ) return NULL; 15 15 16 PyObject *result = PyObject_CallMethod( impModule, "find_module","s[s]", name, directory );16 PyObject *result = PyObject_CallMethod( impModule, (char *) "find_module", (char *) "s[s]", name, directory ); 17 17 if( ! result || PyTuple_Size( result ) != 3 ) return NULL; 18 18 19 PyObject *ret = PyObject_CallMethod( impModule, "load_module","sOOO", newname, PyTuple_GetItem( result, 0 ), PyTuple_GetItem( result, 1 ), PyTuple_GetItem( result, 2 ) );19 PyObject *ret = PyObject_CallMethod( impModule, (char *) "load_module", (char *) "sOOO", newname, PyTuple_GetItem( result, 0 ), PyTuple_GetItem( result, 1 ), PyTuple_GetItem( result, 2 ) ); 20 20 21 21 Py_DECREF( result ); … … 38 38 39 39 - (id) initWithManager:(MVChatPluginManager *) manager { 40 if( self = [self init]) {40 if( ( self = [self init] ) ) { 41 41 _manager = manager; 42 42 _path = nil; … … 48 48 49 49 - (id) initWithScriptAtPath:(NSString *) path withManager:(MVChatPluginManager *) manager { 50 if( self = [self initWithManager:manager]) {50 if( ( self = [self initWithManager:manager] ) ) { 51 51 _path = [path copyWithZone:[self zone]]; 52 53 NSString *moduleName = [[path lastPathComponent] stringByDeletingPathExtension];54 NSString *moduleFolder = [path stringByDeletingLastPathComponent];55 52 _uniqueModuleName = [[NSString locallyUniqueString] retain]; 56 53 _firstLoad = YES; trunk/Plug-Ins/Python Support/JVPythonPluginLoader.m
r3233 r3263 7 7 @implementation JVPythonPluginLoader 8 8 - (id) initWithManager:(MVChatPluginManager *) manager { 9 if( self = [super init]) {9 if( ( self = [super init] ) ) { 10 10 _manager = manager; 11 11 _pyobjcInstalled = ( PyObjC_ImportAPI != NULL ? YES : NO ); … … 49 49 JVPythonChatPlugin *plugin = nil; 50 50 51 while( plugin = [pluginEnum nextObject])51 while( ( plugin = [pluginEnum nextObject] ) ) 52 52 if( [[[plugin scriptFilePath] stringByDeletingPathExtension] isEqualToString:[path stringByDeletingPathExtension]] || [[[[plugin scriptFilePath] lastPathComponent] stringByDeletingPathExtension] isEqualToString:path] ) 53 53 break; … … 97 97 NSEnumerator *enumerator = [paths objectEnumerator]; 98 98 NSString *path = nil; 99 while( path = [enumerator nextObject]) {99 while( ( path = [enumerator nextObject] ) ) { 100 100 path = [path stringByAppendingPathComponent:[name stringByDeletingPathExtension]]; 101 101 NSString *pathExt = [path stringByAppendingPathExtension:@"py"]; … … 130 130 131 131 NSEnumerator *enumerator = [paths objectEnumerator]; 132 while( path = [enumerator nextObject]) {132 while( ( path = [enumerator nextObject] ) ) { 133 133 NSEnumerator *denumerator = [[fm directoryContentsAtPath:path] objectEnumerator]; 134 134 while( ( file = [denumerator nextObject] ) ) { trunk/Plug-Ins/Ruby Support/JVRubyChatPlugin.m
r3057 r3263 10 10 @implementation JVRubyChatPlugin 11 11 + (void) initialize { 12 static tooLate = NO;12 static BOOL tooLate = NO; 13 13 if( ! tooLate ) { 14 14 ruby_init(); … … 20 20 21 21 - (id) initWithManager:(MVChatPluginManager *) manager { 22 if( self = [self init]) {22 if( ( self = [self init] ) ) { 23 23 _manager = manager; 24 24 _path = nil; … … 30 30 31 31 - (id) initWithScriptAtPath:(NSString *) path withManager:(MVChatPluginManager *) manager { 32 if( self = [self initWithManager:manager]) {32 if( ( self = [self initWithManager:manager] ) ) { 33 33 _path = [path copyWithZone:[self zone]]; 34 35 NSString *moduleName = [[path lastPathComponent] stringByDeletingPathExtension];36 NSString *moduleFolder = [path stringByDeletingLastPathComponent];37 34 _firstLoad = YES; 38 35 trunk/Plug-Ins/Ruby Support/JVRubyPluginLoader.m
r2887 r3263 6 6 @implementation JVRubyPluginLoader 7 7 - (id) initWithManager:(MVChatPluginManager *) manager { 8 if( self = [super init]) {8 if( ( self = [super init] ) ) { 9 9 _manager = manager; 10 10 _rubyCocoaInstalled = ( RBRubyCocoaInit != NULL ? YES : NO ); … … 48 48 JVRubyChatPlugin *plugin = nil; 49 49 50 while( plugin = [pluginEnum nextObject])50 while( ( plugin = [pluginEnum nextObject] ) ) 51 51 if( [[[plugin scriptFilePath] stringByDeletingPathExtension] isEqualToString:[path stringByDeletingPathExtension]] || [[[[plugin scriptFilePath] lastPathComponent] stringByDeletingPathExtension] isEqualToString:path] ) 52 52 break; … … 96 96 NSEnumerator *enumerator = [paths objectEnumerator]; 97 97 NSString *path = nil; 98 while( path = [enumerator nextObject]) {98 while( ( path = [enumerator nextObject] ) ) { 99 99 path = [path stringByAppendingPathComponent:[name stringByDeletingPathExtension]]; 100 100 path = [path stringByAppendingPathExtension:@"rb"]; … … 122 122 NSArray *paths = [[_manager class] pluginSearchPaths]; 123 123 NSString *file = nil, *path = nil; 124 125 NSMutableSet *foundModules = [NSMutableSet set];126 124 NSFileManager *fm = [NSFileManager defaultManager]; 127 125 128 126 NSEnumerator *enumerator = [paths objectEnumerator]; 129 while( path = [enumerator nextObject]) {127 while( ( path = [enumerator nextObject] ) ) { 130 128 NSEnumerator *denumerator = [[fm directoryContentsAtPath:path] objectEnumerator]; 131 129 while( ( file = [denumerator nextObject] ) ) {
