Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 12, 2019
1 parent 8a46c60 commit 29744d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static ssize_t proc_show_version(struct proc_entry *UNUSED(entry), char *buf) {
static ssize_t proc_show_stat(struct proc_entry *UNUSED(entry), char *buf) {
struct cpu_usage usage = get_cpu_usage();
size_t n = 0;
n += sprintf(buf + n, "cpu %llu %llu %llu %llu\n", usage.user_ticks, usage.nice_ticks, usage.system_ticks, usage.idle_ticks);
n += sprintf(buf + n, "cpu %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64"\n", usage.user_ticks, usage.nice_ticks, usage.system_ticks, usage.idle_ticks);
return n;
}

Expand Down
8 changes: 4 additions & 4 deletions fs/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ int_t sys_sendmsg(fd_t sock_fd, addr_t msghdr_addr, int_t flags) {
memset(msg_iov, 0, sizeof(msg_iov));
msg.msg_iov = msg_iov;
msg.msg_iovlen = sizeof(msg_iov) / sizeof(msg_iov[0]);
for (int i = 0; i < msg.msg_iovlen; i++) {
for (size_t i = 0; i < msg.msg_iovlen; i++) {
msg_iov[i].iov_len = msg_iov_fake[i].len;
msg_iov[i].iov_base = malloc(msg_iov_fake[i].len);
err = _EFAULT;
Expand Down Expand Up @@ -608,7 +608,7 @@ int_t sys_sendmsg(fd_t sock_fd, addr_t msghdr_addr, int_t flags) {
out_free_control:
free(msg_control);
out_free_iov:
for (int i = 0; i < msg.msg_iovlen; i++)
for (size_t i = 0; i < msg.msg_iovlen; i++)
free(msg_iov[i].iov_base);
return err;
}
Expand Down Expand Up @@ -650,7 +650,7 @@ int_t sys_recvmsg(fd_t sock_fd, addr_t msghdr_addr, int_t flags) {
struct iovec msg_iov[msg_fake.msg_iovlen];
msg.msg_iov = msg_iov;
msg.msg_iovlen = sizeof(msg_iov) / sizeof(msg_iov[0]);
for (int i = 0; i < msg.msg_iovlen; i++) {
for (size_t i = 0; i < msg.msg_iovlen; i++) {
msg_iov[i].iov_len = msg_iov_fake[i].len;
msg_iov[i].iov_base = malloc(msg_iov_fake[i].len);
}
Expand All @@ -663,7 +663,7 @@ int_t sys_recvmsg(fd_t sock_fd, addr_t msghdr_addr, int_t flags) {
size_t n = res;
if (res < 0)
n = 0;
for (int i = 0; i < msg.msg_iovlen; i++) {
for (size_t i = 0; i < msg.msg_iovlen; i++) {
size_t chunk_size = msg_iov[i].iov_len;
if (chunk_size > n)
chunk_size = n;
Expand Down
2 changes: 1 addition & 1 deletion tools/ptraceomatic.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void pt_copy_to_real(int pid, addr_t start, size_t size) {
static void step_tracing(struct cpu_state *cpu, struct tlb *tlb, int pid, int sender, int receiver) {
// step fake cpu
cpu->tf = 1;
int changes = cpu->mem->changes;
unsigned changes = cpu->mem->changes;
int interrupt = cpu_step32(cpu, tlb);
if (interrupt != INT_NONE) {
cpu->trapno = interrupt;
Expand Down

0 comments on commit 29744d3

Please sign in to comment.