From d729ee868dedb37c865427d208b0165a97a0d5ef Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Fri, 30 Jan 2015 23:02:18 -0800 Subject: [PATCH] Fixing compiler warnings --- bin/ethinject/ethinject.c | 6 ++++-- bin/shell/shell.c | 2 -- lib/libc/posix/pthread.c | 2 +- sbin/ifconfig/ifconfig.c | 4 +++- sys/dev/e1000.c | 6 ++++-- sys/fs/o2fs/o2fs.c | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bin/ethinject/ethinject.c b/bin/ethinject/ethinject.c index 3e2f18f..fe8f466 100644 --- a/bin/ethinject/ethinject.c +++ b/bin/ethinject/ethinject.c @@ -1,11 +1,13 @@ #include #include -#include -#include +#include #include +#include +#include + static int nicNo = 1; static char buf[4096]; static MBuf mbuf; diff --git a/bin/shell/shell.c b/bin/shell/shell.c index d0e1341..06908e2 100644 --- a/bin/shell/shell.c +++ b/bin/shell/shell.c @@ -129,9 +129,7 @@ Cmd_Hexdump(int argc, const char *argv[]) void Cmd_Spawn(int argc, const char *argv[]) { - int fd; uint64_t status; - uintptr_t offset = 0; if (argc != 2) { fputs("Requires an argument\n", stdout); diff --git a/lib/libc/posix/pthread.c b/lib/libc/posix/pthread.c index d4dc3e7..532f6f0 100644 --- a/lib/libc/posix/pthread.c +++ b/lib/libc/posix/pthread.c @@ -31,7 +31,7 @@ struct pthread { void *result; // Condition Variables - TAILQ_ENTRY(pthread) threadTable; + TAILQ_ENTRY(pthread) cvTable; }; typedef TAILQ_HEAD(pthreadList, pthread) pthreadList; diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 099d016..8ffbb6a 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -17,10 +17,12 @@ main(int argc, const char *argv[]) if (status == ENOENT) continue; - printf("nic%d:\n", nic.nicNo); + printf("nic%d:\n", (int)nic.nicNo); printf(" ether %02x:%02x:%02x:%02x:%02x:%02x\n", nic.mac[0], nic.mac[1], nic.mac[2], nic.mac[3], nic.mac[4], nic.mac[5]); } + + return 0; } diff --git a/sys/dev/e1000.c b/sys/dev/e1000.c index abeb009..2c348f5 100644 --- a/sys/dev/e1000.c +++ b/sys/dev/e1000.c @@ -233,8 +233,8 @@ void E1000_RXPoll(E1000Dev *dev) { while (dev->rxDesc[dev->rxTail].status & RDESC_STATUS_DD) { - void *data = (void *)DMPA2VA(dev->rxDesc[dev->rxTail].addr); - uint16_t len = dev->rxDesc[dev->rxTail].len; + //void *data = (void *)DMPA2VA(dev->rxDesc[dev->rxTail].addr); + //uint16_t len = dev->rxDesc[dev->rxTail].len; // Look for packet fragments up to EOP set in status 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; // Wait for transmit to complete + + return 0; } void diff --git a/sys/fs/o2fs/o2fs.c b/sys/fs/o2fs/o2fs.c index ff22cb0..f813a9a 100644 --- a/sys/fs/o2fs/o2fs.c +++ b/sys/fs/o2fs/o2fs.c @@ -368,7 +368,7 @@ O2FS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off) } // 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)); if (status != 0)