diff --git a/ChangeLog b/ChangeLog index a831d4c41..5682bcc78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2006-10-05 Richard Frith-Macdonald * Source/Additions/GSMime.m: Add a couple more charset mappings. + * Source/NSRunLoop.m: Move some variables to GSRunLoopCtxt.m + * Source/GSHTTPURLHandle.m: Make a global static + * Source/NSPort.m: Make two globals static + * Source/unix/GSRunLoopCtxt.m: Make variable static. + * Source/win32/GSRunLoopCtxt.m: Make variable static. 2006-10-04 Richard Frith-Macdonald diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index 2a6aa47ca..b69ac8518 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -81,7 +81,7 @@ typedef void (*NSMT_retain_func_t)(NSMapTable *, const void *); typedef void (*NSMT_release_func_t)(NSMapTable *, void *); typedef NSString *(*NSMT_describe_func_t)(NSMapTable *, const void *); -const NSMapTableKeyCallBacks writeKeyCallBacks = +static const NSMapTableKeyCallBacks writeKeyCallBacks = { (NSMT_hash_func_t) _non_retained_id_hash, (NSMT_is_equal_func_t) _non_retained_id_is_equal, diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 0546aed75..4373e495e 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -669,7 +669,7 @@ typedef struct { @defs(NSBundle) } *bptr; -void +static void _bundle_load_callback(Class theClass, struct objc_category *theCategory) { NSCAssert(_loadingBundle, NSInternalInconsistencyException); diff --git a/Source/NSPort.m b/Source/NSPort.m index eea40bef1..8d949a1b2 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -18,7 +18,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA. + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02111 USA. NSPort class reference $Date$ $Revision$ @@ -53,8 +54,8 @@ */ NSString * const NSPortTimeoutException = @"NSPortTimeoutException"; -Class NSPort_abstract_class; -Class NSPort_concrete_class; +static Class NSPort_abstract_class; +static Class NSPort_concrete_class; + (id) allocWithZone: (NSZone*)aZone { diff --git a/Source/NSRunLoop.m b/Source/NSRunLoop.m index 5e7af174f..9638163dc 100644 --- a/Source/NSRunLoop.m +++ b/Source/NSRunLoop.m @@ -632,11 +632,6 @@ static NSComparisonResult tSort(GSIArrayItem i0, GSIArrayItem i1) @end -extern SEL wRelSel; -extern SEL wRetSel; -extern IMP wRelImp; -extern IMP wRetImp; - /** *

NSRunLoop instances handle various utility tasks that must * be performed repetitively in an application, such as processing input @@ -662,12 +657,6 @@ extern IMP wRetImp; { [self currentRunLoop]; theFuture = RETAIN([NSDate distantFuture]); -#if GS_WITH_GC == 0 - wRelSel = @selector(release); - wRetSel = @selector(retain); - wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; - wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; -#endif } } diff --git a/Source/unix/GSRunLoopCtxt.m b/Source/unix/GSRunLoopCtxt.m index 11ad51221..aebf55267 100644 --- a/Source/unix/GSRunLoopCtxt.m +++ b/Source/unix/GSRunLoopCtxt.m @@ -33,10 +33,10 @@ extern BOOL GSCheckTasks(); #if GS_WITH_GC == 0 -SEL wRelSel; -SEL wRetSel; -IMP wRelImp; -IMP wRetImp; +static SEL wRelSel; +static SEL wRetSel; +static IMP wRelImp; +static IMP wRetImp; static void wRelease(NSMapTable* t, void* w) @@ -61,6 +61,17 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = #endif @implementation GSRunLoopCtxt + ++ (void) initialize +{ +#if GS_WITH_GC == 0 + wRelSel = @selector(release); + wRetSel = @selector(retain); + wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; + wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; +#endif +} + - (void) dealloc { RELEASE(mode); diff --git a/Source/win32/GSRunLoopCtxt.m b/Source/win32/GSRunLoopCtxt.m index 0056115a9..9eebff4bb 100644 --- a/Source/win32/GSRunLoopCtxt.m +++ b/Source/win32/GSRunLoopCtxt.m @@ -20,10 +20,10 @@ extern BOOL GSCheckTasks(); #if GS_WITH_GC == 0 -SEL wRelSel; -SEL wRetSel; -IMP wRelImp; -IMP wRetImp; +static SEL wRelSel; +static SEL wRetSel; +static IMP wRelImp; +static IMP wRetImp; static void wRelease(NSMapTable* t, void* w) @@ -48,6 +48,17 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks = #endif @implementation GSRunLoopCtxt + ++ (void) initialize +{ +#if GS_WITH_GC == 0 + wRelSel = @selector(release); + wRetSel = @selector(retain); + wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel]; + wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel]; +#endif +} + - (void) dealloc { RELEASE(mode);