1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 15:00:42 -08:00

Fix missing casts

Copied from Perforce
 Change: 21207
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Pekka Pirinen 2000-05-17 16:56:26 +01:00
parent 271fc70d73
commit 939e346054

View file

@ -1,6 +1,6 @@
/*
TEST_HEADER
id = $HopeName: MMQA_test_function!150.c(trunk.2) $
id = $HopeName: MMQA_test_function!150.c(trunk.3) $
summary = finalization and collection stats
language = c
link = testlib.o rankfmt.o
@ -18,12 +18,14 @@ END_HEADER
#include "mpscamc.h"
#include "rankfmt.h"
void *stackpointer;
mps_space_t space;
int final_count = 0;
enum {
FINAL_DISCARD,
FINAL_REREGISTER,
@ -31,17 +33,20 @@ enum {
FINAL_QUEUE
};
mps_message_t mqueue[10000];
int qhd = 0;
int qtl = 0;
static void nq(mps_message_t mess) {
mqueue[qhd] = mess;
qhd = (qhd+1) % 10000;
asserts(qhd != qtl, "No space in message queue.");
}
static int qmt(void) {
if (qhd == qtl) {
return 1;
@ -50,6 +55,7 @@ static int qmt(void) {
}
}
static int dq(mps_message_t *mess) {
if (qhd == qtl) {
return 0;
@ -60,6 +66,7 @@ static int dq(mps_message_t *mess) {
}
}
static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) {
mps_addr_t ffref;
@ -85,14 +92,16 @@ static void process_mess(mps_message_t message, int faction, mps_addr_t *ref) {
}
}
static void qpoll(mps_addr_t *ref, int faction) {
static void qpoll(mycell **ref, int faction) {
mps_message_t message;
if (dq(&message)) {
process_mess(message, faction, ref);
process_mess(message, faction, (mps_addr_t*)ref);
}
}
static void process_stats(mps_message_t message) {
report("collect", "true");
report("collect_live", "%ld",
@ -104,18 +113,20 @@ static void process_stats(mps_message_t message) {
mps_message_discard(space, message);
}
static void messagepoll(mps_addr_t *ref, int faction) {
static void messagepoll(mycell **ref, int faction) {
mps_message_t message;
if (mps_message_get(&message, space, mps_message_type_finalization())) {
final_count -=1;
process_mess(message, faction, ref);
process_mess(message, faction, (mps_addr_t*)ref);
}
if (mps_message_get(&message, space, mps_message_type_gc())) {
process_stats(message);
}
}
static void test(void) {
mps_pool_t poolamc, poolawl, poollo;
mps_thr_t thread;
@ -181,10 +192,10 @@ static void test(void) {
a = allocone(apamc, 2, MPS_RANK_EXACT);
c = allocone(apawl, 2, MPS_RANK_WEAK);
d = allocone(aplo, 2, MPS_RANK_EXACT); /* rank irrelevant here! */
mps_finalize(space, &a);
mps_finalize(space, &c);
mps_finalize(space, &d);
mps_finalize(space, &d);
mps_finalize(space, (mps_addr_t*)&a);
mps_finalize(space, (mps_addr_t*)&c);
mps_finalize(space, (mps_addr_t*)&d);
mps_finalize(space, (mps_addr_t*)&d);
final_count += 4;
setref(a, 0, b);
setref(a, 1, c);
@ -218,7 +229,7 @@ static void test(void) {
for (j=0; j<10; j++) {
comment("%d of 10", j);
a = allocone(apamc, 10000, MPS_RANK_EXACT);
mps_finalize(space, &a);
mps_finalize(space, (mps_addr_t*)&a);
final_count +=1;
comment("finalize");
messagepoll(&z, FINAL_QUEUE);
@ -294,9 +305,9 @@ static void test(void) {
mps_space_destroy(space);
comment("Destroyed space.");
}
int main(void) {
void *m;
stackpointer=&m; /* hack to get stack pointer */