C++ fixes.

This commit is contained in:
Alex Shinn 2015-03-06 17:35:06 +09:00
parent c16f36ceee
commit 64c148c9ce
3 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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++) {

View file

@ -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);