C compat issues

This commit is contained in:
Ali Mashtizadeh 2014-10-15 02:10:46 -07:00
parent 3fc2949c5c
commit c39c558da0
2 changed files with 5 additions and 2 deletions

View File

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

View File

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