mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
16 lines
354 B
C
16 lines
354 B
C
#include "variadicBool.h"
|
|
|
|
int numberOfTrues(int count, va_list arguments) {
|
|
int i, total;
|
|
total = 0;
|
|
|
|
for(i = 0; i < count; i++) {
|
|
//we're passing int here because passing bool is actually incorrect since
|
|
//bool is actually promoted to int in C
|
|
if(va_arg(arguments, int) == true) {
|
|
total += 1;
|
|
}
|
|
}
|
|
|
|
return total;
|
|
} |