quakeforge/ruamoko/qwaq/ui/garray.r
Bill Currie dd183d3ba6 [qfcc] Handle signed-unsigned int comparison better
This fixes the upostop-- test by auto-casting implicit constants to
unsigned (and it gives a warning for signed-unsigned comparisons
otherwise). The generated code isn't quite the best, but the fix for
that is next.

Also clean up the resulting mess, though not properly. There are a few
bogus warnings, and the legit ones could do with a review.
2023-12-20 23:09:06 +09:00

66 lines
1.6 KiB
R

#include <Array.h>
#include "ruamoko/qwaq/ui/event.h"
#include "ruamoko/qwaq/ui/garray.h"
@implementation Array (Group)
- (void) makeObjectsPerformSelector: (SEL)selector
if: (condition_func)condition
with: (void *)data
{
for (unsigned i = 0; i < [self count]; i++) {
if (condition (_objs[i], data)) {
[_objs[i] performSelector: selector];
}
}
}
- (void) makeObjectsPerformSelector: (SEL)selector
withObject: (void *)anObject
if: (condition_func2)condition
with: (void *)data
{
for (unsigned i = 0; i < [self count]; i++) {
if (condition (_objs[i], anObject, data)) {
[_objs[i] performSelector: selector withObject: anObject];
}
}
}
- (void) makeReversedObjectsPerformSelector: (SEL)selector
{
for (int i = [self count]; i-->0; ) {
[_objs[i] performSelector: selector];
}
}
- (void) makeReversedObjectsPerformSelector: (SEL)selector
withObject: (void *)anObject
{
for (int i = [self count]; i-->0; ) {
[_objs[i] performSelector: selector withObject: anObject];
}
}
- (void) makeReversedObjectsPerformSelector: (SEL)selector
if: (condition_func)condition
with: (void *)data
{
for (int i = [self count]; i-->0; ) {
if (condition (_objs[i], data)) {
[_objs[i] performSelector: selector];
}
}
}
- (void) makeReversedObjectsPerformSelector: (SEL)selector
withObject: (void *)anObject
if: (condition_func2)condition
with: (void *)data
{
for (int i = [self count]; i-->0; ) {
if (condition (_objs[i], anObject, data)) {
[_objs[i] performSelector: selector withObject: anObject];
}
}
}
@end