mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
Lots of little fixes to make -base compile with -Werror (now builds without warnings).
Richard: I'm unsure about three of these, which were fixes in memset() calls in: - NSConcreteMapTable.m - NSConcreteHashTable.m - Additions/NSData+GNUstepBase.m Please can you check them? I think they are intended to zero the entire object (rather than the first word), but the lack of comments makes me unsure. Most changes were just tweaks to variable types. I've also removed some dead code from NSInvocation. This was small group of things that were marked for internal use only, but not actually referenced in the code anywhere. Other improvements: - NSArray / NSDictionary fixed up to use the 10.7 (ARC-friendly) prototypes. - getObjects:andKeys: implemented for NSDictionary (10.5 method) - NSPointerArray and NSHashTable now properly support weak objects. - Tests for weak objects in collections. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33621 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ee75164747
commit
ceba92a265
39 changed files with 196 additions and 155 deletions
|
@ -37,7 +37,7 @@ typedef struct {
|
|||
BOOL isGCObject;
|
||||
} GCInfo;
|
||||
|
||||
@interface _GCDictionaryKeyEnumerator : NSObject
|
||||
@interface _GCDictionaryKeyEnumerator : NSEnumerator
|
||||
{
|
||||
@public
|
||||
GCDictionary *dict;
|
||||
|
@ -260,8 +260,8 @@ static Class gcClass = 0;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithObjects: (id*)objects
|
||||
forKeys: (id*)keys
|
||||
- (id) initWithObjects: (const id[])objects
|
||||
forKeys: (const id[])keys
|
||||
count: (NSUInteger)count
|
||||
{
|
||||
NSUInteger size = (count * 4) / 3;
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
_GSInsensitiveDictionary *dictionary;
|
||||
GSIMapEnumerator_t enumerator;
|
||||
}
|
||||
- (id) initWithDictionary: (NSDictionary*)d;
|
||||
@end
|
||||
|
||||
@interface _GSInsensitiveDictionaryObjectEnumerator : _GSInsensitiveDictionaryKeyEnumerator
|
||||
|
@ -169,7 +170,7 @@ static SEL objSel;
|
|||
}
|
||||
|
||||
/* Designated initialiser */
|
||||
- (id) initWithObjects: (id*)objs forKeys: (id*)keys count: (NSUInteger)c
|
||||
- (id) initWithObjects: (const id[])objs forKeys: (const id[])keys count: (NSUInteger)c
|
||||
{
|
||||
NSUInteger i;
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
if ([NSThread isMultiThreaded] == YES)
|
||||
{
|
||||
DESTROY(self);
|
||||
self = [NSLock new];
|
||||
return (GSLazyLock*)[NSLock new];
|
||||
}
|
||||
else if (self != nil)
|
||||
{
|
||||
|
@ -246,7 +246,7 @@
|
|||
if ([NSThread isMultiThreaded] == YES)
|
||||
{
|
||||
DESTROY(self);
|
||||
self = [NSRecursiveLock new];
|
||||
return (GSLazyRecursiveLock*)[NSRecursiveLock new];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -331,7 +331,7 @@ static void MD5Final (unsigned char digest[16], struct MD5Context *ctx)
|
|||
MD5Transform (ctx->buf, (uint32_t *) ctx->in);
|
||||
littleEndian ((unsigned char *) ctx->buf, 4);
|
||||
memcpy (digest, ctx->buf, 16);
|
||||
memset (ctx, 0, sizeof (ctx)); /* In case it's sensitive */
|
||||
memset (ctx, 0, sizeof (*ctx)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue