Skip to content

Commit

Permalink
Merge pull request #47 from wright/macFixes
Browse files Browse the repository at this point in the history
Fix compile on OS X
  • Loading branch information
johandc committed May 25, 2015
2 parents 480c2d6 + 1f6d457 commit 80c4968
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
4 changes: 4 additions & 0 deletions src/arch/macosx/csp_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ int csp_sys_tasklist(char * out) {
return CSP_ERR_NONE;
}

int csp_sys_tasklist_size(void) {
return 100;
}

uint32_t csp_sys_memfree(void) {
/* TODO: Fix memory free on OSX */
uint32_t total = 0;
Expand Down
38 changes: 18 additions & 20 deletions src/csp_iflist.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,25 @@ void csp_iflist_add(csp_iface_t *ifc) {
}

#ifdef CSP_DEBUG
void csp_iflist_print(void) {

int csp_bytesize(char *buf, int len, unsigned long int n) {

char postfix;
double size;

if (n >= 1048576) {
size = n/1048576.0;
postfix = 'M';
} else if (n >= 1024) {
size = n/1024.;
postfix = 'K';
} else {
size = n;
postfix = 'B';
}

return snprintf(buf, len, "%.1f%c", size, postfix);
}
int csp_bytesize(char *buf, int len, unsigned long int n) {
char postfix;
double size;

if (n >= 1048576) {
size = n/1048576.0;
postfix = 'M';
} else if (n >= 1024) {
size = n/1024.;
postfix = 'K';
} else {
size = n;
postfix = 'B';
}

return snprintf(buf, len, "%.1f%c", size, postfix);
}

void csp_iflist_print(void) {
csp_iface_t * i = interfaces;
char txbuf[25], rxbuf[25];

Expand Down

0 comments on commit 80c4968

Please sign in to comment.