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>
* Source/GSHTTPURLProtocol.m:

View file

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

View file

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

View file

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

View file

@ -1712,7 +1712,6 @@ lockInfoErr(NSString *str)
if (YES == th->_active && nil != info->wait)
{
BOOL wasLocked;
GSStackTrace *stck;
if (th == self
|| NULL != NSHashGet(_activeBlocked, (const void*)th))
@ -1728,7 +1727,7 @@ lockInfoErr(NSString *str)
wasLocked = NO;
}
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
* is waiting for another lock.

View file

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

View file

@ -185,7 +185,7 @@ static NSString *mainFont = nil;
NSString *kind = (f == YES) ? @"rel=\"gsdoc\" href" : @"name";
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 %@=\"%@%@$%@\">",
kind, hash, t, r];
@ -1286,7 +1286,7 @@ static NSString *mainFont = nil;
[buf appendString: @"<p><b>Date:</b> "];
if (nil == tmp
|| ([tmp type] == XML_TEXT_NODE
&& [(str = [[tmp escapedContent] stringByTrimmingSpaces])
&& [[[tmp escapedContent] stringByTrimmingSpaces]
length] == 0))
{
str = [NSString stringWithFormat: @"Generated at %@",
@ -1369,7 +1369,7 @@ static NSString *mainFont = nil;
NSString *s;
GSXMLNode *tmp;
tmp = children = firstElement(children);
tmp = firstElement(children);
[buf appendString: indent];
[buf appendString: @"<h3>"];
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];
/*
if ([[children name] isEqual: @"desc"] == YES)
{
children = [children nextElement];
}
*/
/*
* List standards with which ivar complies
*/

View file

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

View file

@ -3799,13 +3799,16 @@ countAttributes(NSSet *keys, NSDictionary *a)
NSMutableDictionary *p = 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 skipStatementLine];
}
else
{
NSAssert(nil == p
|| [[p objectForKey: @"Kind"] isEqual: @"Properties"],
NSInternalInconsistencyException);
/* FIXME ... need to handle properties
token = [p objectForKey: @"Name"];
[methods setObject: p forKey: token];