(void) srand((long) my_pid);
#endif /* CONFIG_FEATURE_VI_CRASHME */
- status_buffer = STATUS_BUFFER;
+ status_buffer = (Byte *)STATUS_BUFFER;
last_status_cksum = 0;
#ifdef CONFIG_FEATURE_VI_READONLY
while (isblnk(*buf))
buf++;
strcpy((char *) args, (char *) buf);
- buf1 = last_char_is((char *)cmd, '!');
+ buf1 = (Byte*)last_char_is((char *)cmd, '!');
if (buf1) {
useforce = TRUE;
*buf1 = '\0'; // get rid of !
place_cursor(rows - 1, 0, FALSE); // go to Status line
clear_to_eol(); // clear the line
cookmode();
- system(orig_buf+1); // run the cmd
+ system((char*)(orig_buf+1)); // run the cmd
rawmode();
Hit_Return(); // let user see results
(void) alarm(3); // done waiting for input
psbs("No write since last change (:edit! overrides)");
goto vc1;
}
- if (strlen(args) > 0) {
+ if (strlen((char*)args) > 0) {
// the user supplied a file name
fn= args;
- } else if (cfn != 0 && strlen(cfn) > 0) {
+ } else if (cfn != 0 && strlen((char*)cfn) > 0) {
// no user supplied name- use the current filename
fn= cfn;
goto vc5;
last_status_cksum = 0; // force status update
place_cursor(rows - 1, 0, FALSE); // go to Status line, bottom of screen
clear_to_eol(); // clear the line
- write1(prompt); // write out the :, /, or ? prompt
+ write1((char *) prompt); // write out the :, /, or ? prompt
for (i = strlen((char *) buf); i < BUFSIZ;) {
c = get_one_char(); // read user input
struct stat st_buf;
int cnt, sr;
- if (fn == 0 || strlen(fn) <= 0)
+ if (fn == 0 || strlen((char *)fn) <= 0)
return (-1);
cnt = -1;
sr = stat((char *) fn, &st_buf); // see if file exists
strcat(cm2, "\r"); // start at col 0
// just send out orignal source char to get to correct place
screenp = &screen[row * columns]; // start of screen line
- strncat(cm2, screenp, col);
+ strncat(cm2, (char* )screenp, col);
//----- 3. Try some other way of moving cursor
//---------------------------------------------
memset(screen, ' ', screensize); // clear new screen
}
-static int bufsum(char *buf, int count)
+static int bufsum(unsigned char *buf, int count)
{
int sum = 0;
- char *e = buf + count;
+ unsigned char *e = buf + count;
while (buf < e)
sum += *buf++;
return sum;
if (have_status_msg || ((cnt > 0 && last_status_cksum != cksum))) {
last_status_cksum= cksum; // remember if we have seen this line
place_cursor(rows - 1, 0, FALSE); // put cursor on status line
- write1(status_buffer);
+ write1((char*)status_buffer);
clear_to_eol();
if (have_status_msg) {
- if (((int)strlen(status_buffer) - (have_status_msg - 1)) >
+ if (((int)strlen((char*)status_buffer) - (have_status_msg - 1)) >
(columns - 1) ) {
have_status_msg = 0;
Hit_Return();
// write line out to terminal
{
int nic = ce-cs+1;
- char *out = sp+cs;
+ char *out = (char*)sp+cs;
while(nic-- > 0) {
putchar(*out);
/* XXX - assumes /dev/tty?? */
strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user);
- time(&utent.ut_time);
+ time((time_t*)&utent.ut_time);
}
}
{
utent.ut_type = USER_PROCESS;
strncpy(utent.ut_user, name, sizeof utent.ut_user);
- time(&utent.ut_time);
+ time((time_t*)&utent.ut_time);
/* other fields already filled in by checkutmp above */
setutent();
pututline(&utent);
if (fcntl (fd, F_SETFD, FD_CLOEXEC) != 0)
devfsd_perror_msg_and_die("FD_CLOEXEC");
- do_ioctl_and_die(fd, DEVFSDIOC_GET_PROTO_REV,(int )&proto_rev);
+ if (ioctl (fd, DEVFSDIOC_GET_PROTO_REV, &proto_rev) == -1)
+ msg_logger_and_die(LOG_ERR, "ioctl");
/*setup initial entries */
for (curr = initial_symlinks; curr->dest != NULL; ++curr)
{
no_scsi();
printf(" attempting to unregister hwif#%u\n", hwif);
- bb_ioctl(fd, HDIO_UNREGISTER_HWIF,(int *)hwif,"HDIO_UNREGISTER_HWIF");
+ bb_ioctl(fd, HDIO_UNREGISTER_HWIF,(int *)(unsigned long)hwif,"HDIO_UNREGISTER_HWIF");
}
#endif
#ifdef CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF
else
printf("set UDMA mode to %d\n", (piomode-200));
}
- bb_ioctl(fd, HDIO_SET_PIO_MODE, (int *)piomode, "HDIO_SET_PIO_MODE");
+ bb_ioctl(fd, HDIO_SET_PIO_MODE, (int *)(unsigned long)piomode, "HDIO_SET_PIO_MODE");
}
if (set_io32bit)
{
printf(" setting bus state to %d", busstate);
bus_state_value(busstate);
}
- bb_ioctl(fd, HDIO_SET_BUSSTATE, (int *)busstate, "HDIO_SET_BUSSTATE");
+ bb_ioctl(fd, HDIO_SET_BUSSTATE, (int *)(unsigned long)busstate, "HDIO_SET_BUSSTATE");
}
#endif
#ifdef CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF
client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID;
client_config.clientid[OPT_LEN] = len;
client_config.clientid[OPT_DATA] = '\0';
- strncpy(client_config.clientid + OPT_DATA, optarg, len);
+ strncpy((char*)client_config.clientid + OPT_DATA, optarg, len);
break;
case 'C':
if (client_config.clientid) show_usage();
client_config.vendorclass = xmalloc(len + 2);
client_config.vendorclass[OPT_CODE] = DHCP_VENDOR;
client_config.vendorclass[OPT_LEN] = len;
- strncpy(client_config.vendorclass + OPT_DATA, optarg, len);
+ strncpy((char*)client_config.vendorclass + OPT_DATA, optarg, len);
break;
case 'f':
client_config.foreground = 1;
client_config.hostname = xmalloc(len + 2);
client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
client_config.hostname[OPT_LEN] = len;
- strncpy(client_config.hostname + 2, optarg, len);
+ strncpy((char*)client_config.hostname + 2, optarg, len);
break;
case 'F':
len = strlen(optarg) > 255 ? 255 : strlen(optarg);
client_config.fqdn[OPT_LEN + 1] = 0x1;
client_config.fqdn[OPT_LEN + 2] = 0;
client_config.fqdn[OPT_LEN + 3] = 0;
- strncpy(client_config.fqdn + 5, optarg, len);
+ strncpy((char*)client_config.fqdn + 5, optarg, len);
break;
case 'i':
client_config.interface = optarg;
if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) {
for (i = 0; broken_vendors[i][0]; i++) {
if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) &&
- !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
+ !strncmp((char*)vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
DEBUG(LOG_INFO, "broken client (%s), forcing broadcast",
broken_vendors[i]);
packet->flags |= htons(BROADCAST_FLAG);
{
packet->siaddr = server_config.siaddr;
if (server_config.sname)
- strncpy(packet->sname, server_config.sname, sizeof(packet->sname) - 1);
+ strncpy((char*)packet->sname, server_config.sname, sizeof(packet->sname) - 1);
if (server_config.boot_file)
- strncpy(packet->file, server_config.boot_file, sizeof(packet->file) - 1);
+ strncpy((char*)packet->file, server_config.boot_file, sizeof(packet->file) - 1);
}
char addr[128];
ino_t tmp_inode;
dev_t tmp_dev;
- uint64_t uint64_inode;
+ long long uint64_inode;
int tmp_port;
FILE *f;
char line[FUSER_MAX_LINE + 1];
int major, minor;
ino_t inode;
- uint64_t uint64_inode;
+ long long uint64_inode;
dev_t dev;
if (!(file = fopen(fname, "r"))) return 0;
return -2;
}
- tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (equals - name), name);
+ tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name);
outname = bb_xstrdup(tmpname + strlen(PROC_PATH));
while ((cptr = strchr(tmpname, '.')) != NULL)
#ifdef CONFIG_ASH_MATH_SUPPORT_64
typedef int64_t arith_t;
+#define arith_t_type (long long)
#else
typedef long arith_t;
+#define arith_t_type (long)
#endif
#ifdef CONFIG_ASH_MATH_SUPPORT
char *out;
int len;
char line[EOFMARKLEN + 1];
- struct nodelist *bqlist;
- int quotef;
- int dblquote;
- int varnest; /* levels of variables expansion */
- int arinest; /* levels of arithmetic expansion */
- int parenlevel; /* levels of parens in arithmetic */
- int dqvarnest; /* levels of variables expansion within double quotes */
- int oldstyle;
- int prevsyntax; /* syntax before arithmetic */
+ struct nodelist *bqlist = 0;
+ int quotef = 0;
+ int dblquote = 0;
+ int varnest = 0; /* levels of variables expansion */
+ int arinest = 0; /* levels of arithmetic expansion */
+ int parenlevel = 0; /* levels of parens in arithmetic */
+ int dqvarnest = 0; /* levels of variables expansion within double quotes */
+ int oldstyle = 0;
+ int prevsyntax = 0; /* syntax before arithmetic */
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &out;
struct jmploc jmploc;
struct jmploc *volatile savehandler;
size_t savelen;
- int saveprompt;
+ int saveprompt = 0;
#ifdef __GNUC__
(void) &saveprompt;
#endif
}
/* save to shell variable */
#ifdef CONFIG_ASH_MATH_SUPPORT_64
- snprintf(buf, sizeof(buf), "%lld", rez);
+ snprintf(buf, sizeof(buf), "%lld", arith_t_type rez);
#else
- snprintf(buf, sizeof(buf), "%ld", rez);
+ snprintf(buf, sizeof(buf), "%ld", arith_t_type rez);
#endif
setvar(numptr_m1->var, buf, 0);
/* after saving, make previous value for v++ or v-- */
return 0;
}
-static void mapset(const unsigned char *set, int code)
+static void mapset(const char *set, int code)
{
- const unsigned char *s;
- for (s=set; *s; s++) map[*s] = code;
+ const char *s;
+ for (s=set; *s; s++) map[(int)*s] = code;
}
static void update_ifs_map(void)
char *next_command = NULL;
struct job newjob;
int i;
- int inbg;
+ int inbg = 0;
int status;
#ifdef CONFIG_LASH_JOB_CONTROL
pid_t parent_pgrp;
brkaddr = malloc(AREASIZE);
brktop = brkaddr + AREASIZE;
- while ((int) sbrk(0) & ALIGN)
+ while ((long) sbrk(0) & ALIGN)
sbrk(1);
areabot = (struct region *) sbrk(REGSIZE);