mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6480 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d4ada5920b
commit
83f27a1170
4 changed files with 11 additions and 9 deletions
|
@ -176,14 +176,14 @@
|
|||
</desc>
|
||||
<standards><GNUstep/><NotOpenStep/><NotMacOS-X/></standards>
|
||||
</function>
|
||||
<function name="GSUSet" type="void">
|
||||
<function name="GSUSet" type="id">
|
||||
<arg type="id">anObject</arg>
|
||||
<arg type="unsigned int">count</arg>
|
||||
<desc>
|
||||
This function sets the count for the specified object. If the
|
||||
count for the object is set to zero then the object is removed
|
||||
from the global uniquing set. The object is added to the set
|
||||
if necessary.
|
||||
if necessary. The object returned is the one stored in the set.
|
||||
The function handles locking as necessary. It can be used to
|
||||
alter the set even when uniquing is turned off.
|
||||
</desc>
|
||||
|
|
|
@ -194,12 +194,12 @@ Standards: NotOpenStep NotMacOS-X<br>
|
|||
|
||||
<hr>
|
||||
<h2><a name="function-14">GSUSet</a></h2>
|
||||
<b>Prototype:</b> void GSUSet(id anObject, unsigned int count)<br>
|
||||
<b>Prototype:</b> id GSUSet(id anObject, unsigned int count)<br>
|
||||
|
||||
This function sets the count for the specified object. If the
|
||||
count for the object is set to zero then the object is removed
|
||||
from the global uniquing set. The object is added to the set
|
||||
if necessary.
|
||||
if necessary. The object returned is the one stored in the set.
|
||||
The function handles locking as necessary. It can be used to
|
||||
alter the set even when uniquing is turned off.
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ id GSUnique(id anObject);
|
|||
* Setting the count to zero will remove the object from the global set.
|
||||
*/
|
||||
void GSUPurge(unsigned count);
|
||||
void GSUSet(id anObject, unsigned count);
|
||||
id GSUSet(id anObject, unsigned count);
|
||||
|
||||
#include <base/KeyedCollecting.h>
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ GSUPurge(unsigned level)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
id
|
||||
GSUSet(id obj, unsigned level)
|
||||
{
|
||||
id found;
|
||||
|
@ -249,6 +249,7 @@ GSUSet(id obj, unsigned level)
|
|||
found = [uniqueSet member: obj];
|
||||
if (found == nil)
|
||||
{
|
||||
found = obj;
|
||||
for (i = 0; i < level; i++)
|
||||
{
|
||||
[uniqueSet addObject: obj];
|
||||
|
@ -256,12 +257,12 @@ GSUSet(id obj, unsigned level)
|
|||
}
|
||||
else
|
||||
{
|
||||
i = [uniqueSet countForObject: obj];
|
||||
i = [uniqueSet countForObject: found];
|
||||
if (i < level)
|
||||
{
|
||||
while (i < level)
|
||||
{
|
||||
[uniqueSet addObject: obj];
|
||||
[uniqueSet addObject: found];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +270,7 @@ GSUSet(id obj, unsigned level)
|
|||
{
|
||||
while (i > level)
|
||||
{
|
||||
[uniqueSet removeObject: obj];
|
||||
[uniqueSet removeObject: found];
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +279,7 @@ GSUSet(id obj, unsigned level)
|
|||
{
|
||||
(*unlockImp)(uniqueLock, @selector(unlock));
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
id
|
||||
|
|
Loading…
Reference in a new issue