mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
C++ fixes.
This commit is contained in:
parent
c16f36ceee
commit
64c148c9ce
3 changed files with 5 additions and 5 deletions
|
@ -409,9 +409,9 @@ static sexp sexp_gc_op (sexp ctx, sexp self, sexp_sint_t n) {
|
|||
}
|
||||
|
||||
#if SEXP_USE_GREEN_THREADS
|
||||
static sexp sexp_set_atomic (sexp ctx, sexp self, sexp_sint_t n, sexp new) {
|
||||
static sexp sexp_set_atomic (sexp ctx, sexp self, sexp_sint_t n, sexp new_val) {
|
||||
sexp res = sexp_global(ctx, SEXP_G_ATOMIC_P);
|
||||
sexp_global(ctx, SEXP_G_ATOMIC_P) = new;
|
||||
sexp_global(ctx, SEXP_G_ATOMIC_P) = new_val;
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -74,7 +74,7 @@ static sexp disasm (sexp ctx, sexp self, sexp bc, sexp out, int depth) {
|
|||
sexp_newline(ctx, out);
|
||||
|
||||
/* build a table of labels that are jumped to */
|
||||
labels = calloc(sexp_bytecode_length(bc), sizeof(sexp_sint_t));
|
||||
labels = (sexp_sint_t*)calloc(sexp_bytecode_length(bc), sizeof(sexp_sint_t));
|
||||
ip = sexp_bytecode_data(bc);
|
||||
while (ip - sexp_bytecode_data(bc) < sexp_bytecode_length(bc)) {
|
||||
switch (*ip++) {
|
||||
|
|
|
@ -352,7 +352,7 @@ static sexp sexp_get_signal_handler (sexp ctx, sexp self, sexp_sint_t n, sexp si
|
|||
|
||||
static sexp sexp_make_pollfds (sexp ctx) {
|
||||
sexp res = sexp_alloc_tagged(ctx, sexp_sizeof_pollfds, sexp_unbox_fixnum(sexp_global(ctx, SEXP_G_THREADS_POLLFDS_ID)));
|
||||
sexp_pollfds_fds(res) = malloc(SEXP_INIT_POLLFDS_MAX_FDS * sizeof(struct pollfd));
|
||||
sexp_pollfds_fds(res) = (struct pollfd*)malloc(SEXP_INIT_POLLFDS_MAX_FDS * sizeof(struct pollfd));
|
||||
sexp_pollfds_num_fds(res) = 0;
|
||||
sexp_pollfds_max_fds(res) = SEXP_INIT_POLLFDS_MAX_FDS;
|
||||
return res;
|
||||
|
@ -385,7 +385,7 @@ static sexp sexp_insert_pollfd (sexp ctx, int fd, int events) {
|
|||
if (sexp_pollfds_num_fds(pollfds) == sexp_pollfds_max_fds(pollfds)) {
|
||||
sexp_pollfds_max_fds(pollfds) = i*2;
|
||||
pfd = sexp_pollfds_fds(pollfds);
|
||||
sexp_pollfds_fds(pollfds) = malloc(i*2*sizeof(struct pollfd));
|
||||
sexp_pollfds_fds(pollfds) = (struct pollfd*)malloc(i*2*sizeof(struct pollfd));
|
||||
if (sexp_pollfds_fds(pollfds))
|
||||
memcpy(sexp_pollfds_fds(pollfds), pfd, i*2*sizeof(struct pollfd));
|
||||
free(pfd);
|
||||
|
|
Loading…
Add table
Reference in a new issue