fix dead assignments

This commit is contained in:
rfm 2024-06-21 15:02:55 +01:00
parent 5a09b09fe3
commit 4233f6a9d6
9 changed files with 27 additions and 26 deletions

View file

@ -1,3 +1,15 @@
2024-06-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/Unicode.m:
* Source/GSTLS.m:
* Source/NSDictionary.m:
* Source/NSThread.m:
* Source/NSURLSession.m:
* Tools/AGSHtml.m:
* Tools/AGSOutput.m:
* Tools/AGSParser.m:
Fix dead assignments.
2024-06-21 Richard Frith-Macdonald <rfm@gnu.org> 2024-06-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLProtocol.m: * Source/GSHTTPURLProtocol.m:

View file

@ -746,13 +746,13 @@ GSUnicode(const unichar *chars, unsigned length,
if (isLatin1) *isLatin1 = YES; if (isLatin1) *isLatin1 = YES;
while (i < length) while (i < length)
{ {
if ((c = chars[i++]) > 127) if (chars[i++] > 127)
{ {
if (isASCII) *isASCII = NO; if (isASCII) *isASCII = NO;
i--; i--;
while (i < length) while (i < length)
{ {
if ((c = chars[i++]) > 255) if (chars[i++] > 255)
{ {
if (isLatin1) *isLatin1 = NO; if (isLatin1) *isLatin1 = NO;
i--; i--;

View file

@ -483,7 +483,7 @@ static GSTLSDHParams *paramsCurrent = nil;
* thread since it's likely to be rather slow. * thread since it's likely to be rather slow.
*/ */
if (nil != paramsCurrent && NO == paramsGenerating if (nil != paramsCurrent && NO == paramsGenerating
&& (now = paramsWhen) > 24.0 * 60.0 * 60.0) && paramsWhen > 24.0 * 60.0 * 60.0)
{ {
[NSThread detachNewThreadSelector: @selector(generate) [NSThread detachNewThreadSelector: @selector(generate)
toTarget: self toTarget: self

View file

@ -879,9 +879,7 @@ static SEL appSel;
*/ */
- (NSArray*) allKeysForObject: (id)anObject - (NSArray*) allKeysForObject: (id)anObject
{ {
unsigned c; if (anObject == nil || [self count] == 0)
if (anObject == nil || (c = [self count]) == 0)
{ {
return nil; return nil;
} }
@ -891,12 +889,12 @@ static SEL appSel;
IMP nxtObj = [e methodForSelector: nxtSel]; IMP nxtObj = [e methodForSelector: nxtSel];
IMP myObj = [self methodForSelector: objSel]; IMP myObj = [self methodForSelector: objSel];
BOOL (*eqObj)(id, SEL, id); BOOL (*eqObj)(id, SEL, id);
unsigned c = 0;
id k; id k;
id result; id result;
GS_BEGINIDBUF(a, [self count]); GS_BEGINIDBUF(a, [self count]);
eqObj = (BOOL (*)(id, SEL, id))[anObject methodForSelector: eqSel]; eqObj = (BOOL (*)(id, SEL, id))[anObject methodForSelector: eqSel];
c = 0;
while ((k = (*nxtObj)(e, nxtSel)) != nil) while ((k = (*nxtObj)(e, nxtSel)) != nil)
{ {
id o = (*myObj)(self, objSel, k); id o = (*myObj)(self, objSel, k);

View file

@ -1712,7 +1712,6 @@ lockInfoErr(NSString *str)
if (YES == th->_active && nil != info->wait) if (YES == th->_active && nil != info->wait)
{ {
BOOL wasLocked; BOOL wasLocked;
GSStackTrace *stck;
if (th == self if (th == self
|| NULL != NSHashGet(_activeBlocked, (const void*)th)) || NULL != NSHashGet(_activeBlocked, (const void*)th))
@ -1728,7 +1727,7 @@ lockInfoErr(NSString *str)
wasLocked = NO; wasLocked = NO;
} }
if (nil != info->wait if (nil != info->wait
&& nil != (stck = NSHashGet(info->held, (const void*)want))) && nil != (id)NSHashGet(info->held, (const void*)want))
{ {
/* This thread holds the lock we are interested in and /* This thread holds the lock we are interested in and
* is waiting for another lock. * is waiting for another lock.

View file

@ -840,11 +840,7 @@ static unsigned nextSessionIdentifier()
if ([urlResponse statusCode] == 401) if ([urlResponse statusCode] == 401)
{ {
NSURLProtectionSpace *space; [self _protectionSpaceFrom: urlResponse];
if (nil != (space = [self _protectionSpaceFrom: urlResponse]))
{
}
} }
delegate = [session delegate]; delegate = [session delegate];

View file

@ -185,7 +185,7 @@ static NSString *mainFont = nil;
NSString *kind = (f == YES) ? @"rel=\"gsdoc\" href" : @"name"; NSString *kind = (f == YES) ? @"rel=\"gsdoc\" href" : @"name";
NSString *hash = (f == YES) ? @"#" : @""; NSString *hash = (f == YES) ? @"#" : @"";
if (f == NO || (s = [localRefs globalRef: r type: t]) != nil) if (f == NO || [localRefs globalRef: r type: t] != nil)
{ {
s = [NSString stringWithFormat: @"<a %@=\"%@%@$%@\">", s = [NSString stringWithFormat: @"<a %@=\"%@%@$%@\">",
kind, hash, t, r]; kind, hash, t, r];
@ -1286,7 +1286,7 @@ static NSString *mainFont = nil;
[buf appendString: @"<p><b>Date:</b> "]; [buf appendString: @"<p><b>Date:</b> "];
if (nil == tmp if (nil == tmp
|| ([tmp type] == XML_TEXT_NODE || ([tmp type] == XML_TEXT_NODE
&& [(str = [[tmp escapedContent] stringByTrimmingSpaces]) && [[[tmp escapedContent] stringByTrimmingSpaces]
length] == 0)) length] == 0))
{ {
str = [NSString stringWithFormat: @"Generated at %@", str = [NSString stringWithFormat: @"Generated at %@",
@ -1369,7 +1369,7 @@ static NSString *mainFont = nil;
NSString *s; NSString *s;
GSXMLNode *tmp; GSXMLNode *tmp;
tmp = children = firstElement(children); tmp = firstElement(children);
[buf appendString: indent]; [buf appendString: indent];
[buf appendString: @"<h3>"]; [buf appendString: @"<h3>"];
s = [self makeLink: n ofType: @"ivariable" inUnit: nil isRef: NO]; s = [self makeLink: n ofType: @"ivariable" inUnit: nil isRef: NO];
@ -1390,13 +1390,6 @@ static NSString *mainFont = nil;
} }
[buf appendFormat: @"%@@%@ %@ <b>%@</b>;<br />\n", indent, v, t, n]; [buf appendFormat: @"%@@%@ %@ <b>%@</b>;<br />\n", indent, v, t, n];
/*
if ([[children name] isEqual: @"desc"] == YES)
{
children = [children nextElement];
}
*/
/* /*
* List standards with which ivar complies * List standards with which ivar complies
*/ */

View file

@ -1977,7 +1977,7 @@ static BOOL snuggleStart(NSString *t)
pos++; pos++;
if (pos < ePos if (pos < ePos
&& [identStart characterIsMember: && [identStart characterIsMember:
(c = [tmp characterAtIndex: pos])] == YES) [tmp characterAtIndex: pos]] == YES)
{ {
while (pos < ePos) while (pos < ePos)
{ {

View file

@ -3799,13 +3799,16 @@ countAttributes(NSSet *keys, NSDictionary *a)
NSMutableDictionary *p = nil; NSMutableDictionary *p = nil;
NSMutableDictionary *s = nil; NSMutableDictionary *s = nil;
if (nil == (p = [self parsePropertyGetter: &g andSetter: &s])) if (nil == [self parsePropertyGetter: &g andSetter: &s])
{ {
[self log: @"@property declaration invalid"]; [self log: @"@property declaration invalid"];
[self skipStatementLine]; [self skipStatementLine];
} }
else else
{ {
NSAssert(nil == p
|| [[p objectForKey: @"Kind"] isEqual: @"Properties"],
NSInternalInconsistencyException);
/* FIXME ... need to handle properties /* FIXME ... need to handle properties
token = [p objectForKey: @"Name"]; token = [p objectForKey: @"Name"];
[methods setObject: p forKey: token]; [methods setObject: p forKey: token];