1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

Fix missing casts

Copied from Perforce
 Change: 21211
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Pekka Pirinen 2000-05-17 18:19:06 +01:00
parent a693ede7b7
commit 0d520963fe

View file

@ -1,6 +1,6 @@
/*
TEST_HEADER
id = $HopeName$
id = $HopeName: MMQA_test_function!49.c(trunk.5) $
summary = finalization tests with AMC, AWL and LO
language = c
link = testlib.o rankfmt.o
@ -13,12 +13,14 @@ END_HEADER
#include "mpsclo.h"
#include "rankfmt.h"
void *stackpointer;
mps_space_t space;
int final_count = 0;
enum {
FINAL_DISCARD,
FINAL_REREGISTER,
@ -26,17 +28,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;
@ -45,6 +50,7 @@ static int qmt(void) {
}
}
static int dq(mps_message_t *mess) {
if (qhd == qtl) {
return 0;
@ -55,6 +61,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;
@ -80,23 +87,26 @@ 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 finalpoll(mps_addr_t *ref, int faction) {
static void finalpoll(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);
}
}
static void test(void) {
mps_pool_t poolamc, poolawl, poollo;
mps_thr_t thread;
@ -161,10 +171,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);
@ -194,9 +204,10 @@ static void test(void) {
/* now to test leaving messages open for a long time! */
for (j=0; j<1000; j++) {
comment("%d of 1000", j);
if (j % 50 == 0)
comment("%d of 1000", j);
a = allocone(apamc, 10000, MPS_RANK_EXACT);
mps_finalize(space, &a);
mps_finalize(space, (mps_addr_t*)&a);
final_count +=1;
comment("finalize");
finalpoll(&z, FINAL_QUEUE);
@ -268,9 +279,9 @@ static void test(void) {
mps_space_destroy(space);
comment("Destroyed space.");
}
int main(void) {
void *m;
stackpointer=&m; /* hack to get stack pointer */