/* $Header$ */
double
-hypot(x, y)
-double x, y;
+hypot(double x, double y)
{
/* Computes sqrt(x*x+y*y), avoiding overflow */
void *alloc_contig(size_t len, int flags, phys_bytes *phys)
{
- int r;
vir_bytes buf;
int mmapflags = MAP_PREALLOC|MAP_CONTIG|MAP_ANON;
return r;
/* Do the safemap. */
- if(*length > m.DS_VAL_LEN)
- *length = m.DS_VAL_LEN;
+ if(*length > (size_t) m.DS_VAL_LEN)
+ *length = (size_t) m.DS_VAL_LEN;
*length = (size_t) CLICK_FLOOR(*length);
r = sys_safemap(DS_PROC_NR, m.DS_VAL, 0,
(vir_bytes)vaddr, *length, D, 0);
message m;
static char mon_params[128*sizeof(char *)]; /* copy parameters here */
char *key_value;
- int i, s, keylen;
+ int i, s;
+ size_t keylen;
if (key == NULL)
return EINVAL;
if (env_argv[i][keylen] != '=')
continue;
key_value= env_argv[i]+keylen+1;
- if (strlen(key_value)+1 > max_len)
+ if (strlen(key_value)+1 > (size_t) max_len)
return(E2BIG);
strcpy(value, key_value);
return OK;
/* Value found, see if it fits in the client's buffer. Callers assume that
* their buffer is unchanged on error, so don't make a partial copy.
*/
- if ((strlen(key_value)+1) > max_len) return(E2BIG);
+ if ((strlen(key_value)+1) > (size_t) max_len) return(E2BIG);
/* Make the actual copy. */
strcpy(value, key_value);
return -1;
s = memstr;
for (i = 0; i < maxchunks && !done; i++) {
- phys_bytes base = 0, size = 0, limit;
+ phys_bytes base = 0, size = 0;
memp = &mem_chunks[i]; /* next mem chunk is stored here */
if (*s != 0) { /* get fresh data, unless at end */
* This whole thing should be replaced by something better eventually.
*/
double value;
- int i;
+ size_t i;
value = (double) ex64hi(d);
for (i = 0; i < sizeof(unsigned long); i += 2)
PUBLIC int _kernel_call(int syscallnr, message *msgptr)
{
- int status;
-
msgptr->m_type = syscallnr;
_do_kernel_call(msgptr);
return(msgptr->m_type);
/*===========================================================================*
* kputc *
*===========================================================================*/
-void kputc(c)
-int c;
+void kputc(int c)
{
/* Accumulate another character. If 0 or buffer full, print it. */
static int buf_count; /* # characters in the buffer */
- message m;
if ((c == 0 && buf_count > 0) || buf_count == sizeof(print_buf)) {
sys_sysctl(SYSCTL_CODE_DIAG, print_buf, buf_count);
* inconsistency is detected, e.g., a programming error or illegal
* value of a defined constant.
*/
- message m;
endpoint_t me = NONE;
char name[20];
void (*suicide)(void);
/*===========================================================================*
* pci_reserve_ok *
*===========================================================================*/
-PUBLIC int pci_reserve_ok(devind)
-int devind;
+PUBLIC int pci_reserve_ok(int devind)
{
- int r;
message m;
m.m1_i1= devind;
* of procentry */
PRIVATE int cprof_locked; /* for reentrancy */
-_PROTOTYPE(void procentry, (char *name) );
-_PROTOTYPE(void procexit, (char *name) );
-
FORWARD _PROTOTYPE(void cprof_init, (void) );
FORWARD _PROTOTYPE(void reset, (void) );
FORWARD _PROTOTYPE(void clear_tbl, (void) );
-PUBLIC void procentry (name)
-char *name;
+PUBLIC void procentry (char *name)
{
static int init = 0;
- unsigned hash = 0, i = 0, x = 0;
- unsigned long hi, lo;
+ unsigned hash = 0, x = 0;
+ int i = 0;
struct cprof_tbl_s *last;
char c;
u64_t start;
}
-PUBLIC void procexit (name)
-char *name;
+PUBLIC void procexit (char *name)
{
u64_t stop, spent;
}
-PRIVATE void cprof_init() {
- message m;
+PRIVATE void cprof_init()
+{
int i;
cpath[0] = '\0';
}
PUBLIC int
-cpf_getgrants(grant_ids, n)
-cp_grant_id_t *grant_ids;
-int n;
+cpf_getgrants(cp_grant_id_t *grant_ids, int n)
{
- cp_grant_id_t g;
int i;
for(i = 0; i < n; i++) {
{
/* Refresh SEF debug params. */
clock_t uptime;
- endpoint_t endpoint;
int r;
/* Get boottime the first time. */
/* Build and return a SEF debug header. */
sef_debug_refresh_params();
sprintf(sef_debug_header_buff, "%s: time = %ds %06dus",
- sef_self_name, sef_debug_time_sec, sef_debug_time_us);
+ sef_self_name, (int) sef_debug_time_sec, (int) sef_debug_time_us);
return sef_debug_header_buff;
}
if((r = _kernel_call(SYS_GETINFO, &m)) != OK)
return r;
- lenmin = MIN(len, sizeof(m.GIWHO_NAME)) - 1;
+ lenmin = MIN((size_t) len, sizeof(m.GIWHO_NAME)) - 1;
strncpy(who_name, m.GIWHO_NAME, lenmin);
who_name[lenmin] = '\0';
vir_bytes offset; /* offset from grant */
{
message m_io;
- int result;
m_io.DIO_REQUEST = req;
m_io.DIO_PORT = port;
PUBLIC int sys_vmctl_reply_mapping(int index, vir_bytes addr)
{
- int r;
message m;
m.SVMCTL_WHO = SELF;
void util_timer_start(util_timingdata_t *timingdata, char *name)
{
- unsigned long h, l;
- int i;
+ size_t i;
if(timingdata->names[0] == '\0') {
for(i = 0; i < sizeof(timingdata->names) && *name; i++)
void util_timer_end(util_timingdata_t *timingdata)
{
- unsigned long h, l, d = 0, binsize;
+ unsigned long h, l, d = 0;
int bin;
read_tsc(&h, &l);
PUBLIC int vm_brk(endpoint_t ep, char *addr)
{
message m;
- int result;
m.VMB_ENDPOINT = ep;
m.VMB_ADDR = (void *) addr;
PUBLIC int vm_unmap_phys(endpoint_t who, void *vaddr, size_t len)
{
message m;
- int r;
m.VMUP_EP = who;
m.VMUP_VADDR = vaddr;