Fixing compiler warnings

This commit is contained in:
Ali Mashtizadeh 2015-01-30 23:02:18 -08:00
parent 3e85210410
commit d729ee868d
6 changed files with 13 additions and 9 deletions

View File

@ -1,11 +1,13 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <syscall.h> #include <unistd.h>
#include <sys/nic.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <syscall.h>
#include <sys/nic.h>
static int nicNo = 1; static int nicNo = 1;
static char buf[4096]; static char buf[4096];
static MBuf mbuf; static MBuf mbuf;

View File

@ -129,9 +129,7 @@ Cmd_Hexdump(int argc, const char *argv[])
void void
Cmd_Spawn(int argc, const char *argv[]) Cmd_Spawn(int argc, const char *argv[])
{ {
int fd;
uint64_t status; uint64_t status;
uintptr_t offset = 0;
if (argc != 2) { if (argc != 2) {
fputs("Requires an argument\n", stdout); fputs("Requires an argument\n", stdout);

View File

@ -31,7 +31,7 @@ struct pthread {
void *result; void *result;
// Condition Variables // Condition Variables
TAILQ_ENTRY(pthread) threadTable; TAILQ_ENTRY(pthread) cvTable;
}; };
typedef TAILQ_HEAD(pthreadList, pthread) pthreadList; typedef TAILQ_HEAD(pthreadList, pthread) pthreadList;

View File

@ -17,10 +17,12 @@ main(int argc, const char *argv[])
if (status == ENOENT) if (status == ENOENT)
continue; continue;
printf("nic%d:\n", nic.nicNo); printf("nic%d:\n", (int)nic.nicNo);
printf(" ether %02x:%02x:%02x:%02x:%02x:%02x\n", printf(" ether %02x:%02x:%02x:%02x:%02x:%02x\n",
nic.mac[0], nic.mac[1], nic.mac[2], nic.mac[0], nic.mac[1], nic.mac[2],
nic.mac[3], nic.mac[4], nic.mac[5]); nic.mac[3], nic.mac[4], nic.mac[5]);
} }
return 0;
} }

View File

@ -233,8 +233,8 @@ void
E1000_RXPoll(E1000Dev *dev) E1000_RXPoll(E1000Dev *dev)
{ {
while (dev->rxDesc[dev->rxTail].status & RDESC_STATUS_DD) { while (dev->rxDesc[dev->rxTail].status & RDESC_STATUS_DD) {
void *data = (void *)DMPA2VA(dev->rxDesc[dev->rxTail].addr); //void *data = (void *)DMPA2VA(dev->rxDesc[dev->rxTail].addr);
uint16_t len = dev->rxDesc[dev->rxTail].len; //uint16_t len = dev->rxDesc[dev->rxTail].len;
// Look for packet fragments up to EOP set in status // Look for packet fragments up to EOP set in status
if ((dev->rxDesc[dev->rxTail].status & RDESC_STATUS_EOP) && if ((dev->rxDesc[dev->rxTail].status & RDESC_STATUS_EOP) &&
@ -372,6 +372,8 @@ E1000_Enqueue(NIC *nic, MBuf *mbuf, NICCB cb, void *arg)
dev->txTail = (dev->txTail + 1) % E1000_TX_QLEN; dev->txTail = (dev->txTail + 1) % E1000_TX_QLEN;
// Wait for transmit to complete // Wait for transmit to complete
return 0;
} }
void void

View File

@ -368,7 +368,7 @@ O2FS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off)
} }
// XXX: Validation and fill in all fields // XXX: Validation and fill in all fields
strcpy(de.d_name, dirEntry.name); strcpy(de.d_name, (char *)dirEntry.name);
status = CopyOut(&de, (uintptr_t)buf, sizeof(de)); status = CopyOut(&de, (uintptr_t)buf, sizeof(de));
if (status != 0) if (status != 0)