1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-11 23:01:01 +00:00

[dos] compilation fixes

This commit is contained in:
Witold Filipczyk 2022-09-10 12:40:21 +02:00
parent 516d6aa314
commit e7603f2b21
3 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ make -f Makefile.dos install
# get elinks source
RUN dnf -y install pkgconf-pkg-config gettext
RUN cd /root; git clone https://github.com/rkd77/elinks
RUN cd /root; git clone https://github.com/rkd77/elinks
ADD mes_djgpp.sh /root/elinks/mes_djgpp.sh
RUN cd /root/elinks; \
./mes_djgpp.sh;

View File

@ -345,9 +345,9 @@ static void dos_mouse_enqueue(int x, int y, int b)
overalloc();
}
if (dos_mouse_queue == NULL) {
dos_mouse_queue = mem_alloc((dos_mouse_queue_n + 1) * sizeof(struct interlink_event));
dos_mouse_queue = (struct interlink_event *)mem_alloc((dos_mouse_queue_n + 1) * sizeof(struct interlink_event));
} else {
dos_mouse_queue = mem_realloc(dos_mouse_queue, (dos_mouse_queue_n + 1) * sizeof(struct interlink_event));
dos_mouse_queue = (struct interlink_event *)mem_realloc(dos_mouse_queue, (dos_mouse_queue_n + 1) * sizeof(struct interlink_event));
}
set_last:
dos_mouse_queue[dos_mouse_queue_n].ev = EVENT_MOUSE;
@ -510,7 +510,7 @@ void save_terminal(void)
screen_backbuffer = NULL;
mem_free(sc);
}
sc = mem_alloc(2 * screen_backbuffer_x * screen_backbuffer_y);
sc = (unsigned char *)mem_alloc(2 * screen_backbuffer_x * screen_backbuffer_y);
ScreenRetrieve(sc);
ScreenGetCursor(&saved_cursor_y, &saved_cursor_x);
screen_backbuffer = sc;
@ -779,7 +779,7 @@ int dos_write(int fd, const void *buf, size_t size)
/*printf("dos_write(%d,%d) : %d,%d\n", r, errno, fd, size);*/
if (r != -2) return r;
if (fd == 1) {
ansi_write(buf, size);
ansi_write((const unsigned char *)buf, size);
return size;
}
return write(fd, buf, size);
@ -1001,8 +1001,8 @@ void os_seed_random(unsigned char **pool, int *pool_size)
{
unsigned *random_pool, *tmp_pool;
int a, i;
random_pool = mem_alloc(RANDOM_POOL_SIZE);
tmp_pool = mem_alloc(RANDOM_POOL_SIZE);
random_pool = (unsigned *)mem_alloc(RANDOM_POOL_SIZE);
tmp_pool = (unsigned *)mem_alloc(RANDOM_POOL_SIZE);
for (a = 0; a <= 640 * 1024 - RANDOM_POOL_SIZE; a += RANDOM_POOL_SIZE) {
dosmemget(a, RANDOM_POOL_SIZE, tmp_pool);
for (i = 0; i < RANDOM_POOL_SIZE / 4; i++)

View File

@ -147,7 +147,7 @@ static int vpipe_create(int fd[2])
errno = EMFILE;
goto err2;
}
desc = malloc(sizeof(struct virtual_pipe));
desc = (struct virtual_pipe *)malloc(sizeof(struct virtual_pipe));
if (!desc) goto err2;
desc->used = 0;
desc->n_rd = 1;