mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-11 21:31:30 +00:00
9b81d27f1a
That is, updating a variable using a function that takes the same variable, probably very common in iterators, thus the name. It happens to be the first qfcc test specific to Ruamoko. It's really just the typedef, zerolinker, and vkgen type encoding loop stripped down for ease of debugging. Of course, it fails :)
33 lines
658 B
R
33 lines
658 B
R
#include <types.h>
|
|
|
|
// can't link against libr.a (may not be built)
|
|
void *PR_FindGlobal (string name) = #0;
|
|
void printf (string fmt, ...) = #0;
|
|
|
|
qfot_type_encodings_t *encodings;
|
|
qfot_type_t *next_type (qfot_type_t *type);
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
int found_param = 0;
|
|
int found_zero = 0;
|
|
qfot_type_t *type;
|
|
|
|
encodings = PR_FindGlobal (".type_encodings");
|
|
|
|
for (type = encodings.types;
|
|
((int *)type - (int *) encodings.types) < encodings.size;
|
|
type = next_type (type)) {
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
qfot_type_t *
|
|
next_type (qfot_type_t *type)
|
|
{
|
|
int size = type.size;
|
|
if (!size)
|
|
size = 4;
|
|
return (qfot_type_t *) ((int *) type + size);
|
|
}
|