mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-24 23:31:33 -07:00
Fix missing casts
Copied from Perforce Change: 21210 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
cbd46317cf
commit
32a08b9537
1 changed files with 21 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
TEST_HEADER
|
||||
id = $HopeName$
|
||||
id = $HopeName: MMQA_test_function!50.c(trunk.4) $
|
||||
summary = finalization tests with AMC, AWL and LO
|
||||
language = c
|
||||
link = testlib.o rankfmt.o
|
||||
|
|
@ -17,12 +17,14 @@ END_HEADER
|
|||
#include "mpsclo.h"
|
||||
#include "rankfmt.h"
|
||||
|
||||
|
||||
void *stackpointer;
|
||||
|
||||
mps_space_t space;
|
||||
|
||||
int final_count = 0;
|
||||
|
||||
|
||||
enum {
|
||||
FINAL_DISCARD,
|
||||
FINAL_REREGISTER,
|
||||
|
|
@ -30,17 +32,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;
|
||||
|
|
@ -49,6 +54,7 @@ static int qmt(void) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static int dq(mps_message_t *mess) {
|
||||
if (qhd == qtl) {
|
||||
return 0;
|
||||
|
|
@ -59,6 +65,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;
|
||||
|
||||
|
|
@ -84,23 +91,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;
|
||||
|
|
@ -165,10 +175,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);
|
||||
|
|
@ -200,7 +210,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");
|
||||
finalpoll(&z, FINAL_QUEUE);
|
||||
|
|
@ -276,9 +286,9 @@ static void test(void) {
|
|||
|
||||
mps_space_destroy(space);
|
||||
comment("Destroyed space.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(void) {
|
||||
void *m;
|
||||
stackpointer=&m; /* hack to get stack pointer */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue