C compat issues
This commit is contained in:
parent
3fc2949c5c
commit
c39c558da0
@ -37,7 +37,9 @@ static FILE fds[FOPEN_MAX] = {
|
||||
FILE *
|
||||
_alloc_file()
|
||||
{
|
||||
for (int i = 0; i < FOPEN_MAX; i++) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < FOPEN_MAX; i++) {
|
||||
if (fds[i].in_use == 0) {
|
||||
fds[i].in_use = 1;
|
||||
return &fds[i];
|
||||
|
@ -151,6 +151,7 @@ Console_Read(Handle *handle, void *buf, uint64_t off, uint64_t len)
|
||||
int
|
||||
Console_Write(Handle *handle, void *buf, uint64_t off, uint64_t len)
|
||||
{
|
||||
int i;
|
||||
uintptr_t b = (uintptr_t)buf;
|
||||
char kbuf[512];
|
||||
uint64_t nbytes = 0;
|
||||
@ -160,7 +161,7 @@ Console_Write(Handle *handle, void *buf, uint64_t off, uint64_t len)
|
||||
CopyIn(b + nbytes, &kbuf, chunksz);
|
||||
nbytes += chunksz;
|
||||
|
||||
for (int i = 0; i < chunksz; i++)
|
||||
for (i = 0; i < chunksz; i++)
|
||||
Console_Putc(kbuf[i]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user