//if (opt & 0x4) // -v
argv += optind;
- SET_PTR_TO_GLOBALS(xzalloc(sizeof(struct globals) + sizeof(struct globals2))
+ SET_PTR_TO_GLOBALS((char *)xzalloc(sizeof(struct globals)+sizeof(struct globals2))
+ sizeof(struct globals));
barrier();
#define fsplitter (G.fsplitter )
#define rsplitter (G.rsplitter )
#define INIT_G() do { \
- SET_PTR_TO_GLOBALS(xzalloc(sizeof(G1) + sizeof(G)) + sizeof(G1)); \
+ SET_PTR_TO_GLOBALS((char*)xzalloc(sizeof(G1)+sizeof(G)) + sizeof(G1)); \
G.next_token__ltclass = TC_OPTERM; \
G.evaluate__seed = 1; \
} while (0)
case 'x': /* Exchange hold and pattern space */
{
char *tmp = pattern_space;
- pattern_space = G.hold_space ? : xzalloc(1);
+ pattern_space = G.hold_space ? G.hold_space : xzalloc(1);
last_gets_char = '\n';
G.hold_space = tmp;
break;
/* At least gcc 3.4.6 on mipsel system needs optimization barrier */
#define barrier() __asm__ __volatile__("":::"memory")
#define SET_PTR_TO_GLOBALS(x) do { \
- (*(struct globals**)&ptr_to_globals) = (x); \
+ (*(struct globals**)&ptr_to_globals) = (void*)(x); \
barrier(); \
} while (0)
struct sysinfo info;
if (sysinfo(&info) == 0
- && (info.mem_unit ? : 1) * (long long)info.totalram < 1024*1024
+ && (info.mem_unit ? info.mem_unit : 1) * (long long)info.totalram < 1024*1024
) {
message(L_CONSOLE, "Low memory, forcing swapon");
/* swapon -a requires /proc typically */
rewrite_line:
/* Rewrite the line with the selected history item */
/* change command */
- command_len = load_string(state->history[state->cur_history] ? : "", maxsize);
+ command_len = load_string(state->history[state->cur_history] ?
+ state->history[state->cur_history] : "", maxsize);
/* redraw and go to eol (bol, in vi) */
redraw(cmdedit_y, (state->flags & VI_MODE) ? 9999 : 0);
break;
}
/* Find a loop device. */
- try = *device ? : dev;
+ try = *device ? *device : dev;
for (i = 0; rc; i++) {
sprintf(dev, LOOP_FORMAT, i);
static const char *find_token(const char *const string_array[], const char *key, const char *defvalue)
{
const char *r = NULL;
- for (int i = 0; string_array[i] != 0; i++) {
+ int i;
+ for (i = 0; string_array[i] != NULL; i++) {
if (strcasecmp(string_array[i], key) == 0) {
r = (char *)string_array[i+1];
break;
while (match_status == 0) {
char *new = xasprintf("%s%.*s"HIGHLIGHT"%.*s"NORMAL,
- growline ? : "",
+ growline ? growline : "",
match_structs.rm_so, str,
match_structs.rm_eo - match_structs.rm_so,
str + match_structs.rm_so);
while ((line = xmalloc_fgetline(fp)) != NULL) {
char* space;
+ char* linebuf;
int cur;
if (!line[0]) {
if (*space)
*space++ = '\0';
modinfo[cur].aliases = space;
- modinfo[cur].deps = xmalloc_fgetline(fp) ? : xzalloc(1);
+ linebuf = xmalloc_fgetline(fp);
+ modinfo[cur].deps = linebuf ? linebuf : xzalloc(1);
if (modinfo[cur].deps[0]) {
/* deps are not "", so next line must be empty */
line = xmalloc_fgetline(fp);
memRchr = memchr;
/* Add '\n'-terminated line to ld->inst */
while (1) {
- int l = asprintf(&new, "%s%s\n", ld->inst ? : "", s);
+ int l = asprintf(&new, "%s%s\n", ld->inst ? ld->inst : "", s);
if (l >= 0 && new)
break;
pause_nomem();
* same. For "-vv", emit everything. */
if (verbose > 1 || !user_only_changed) {
bb_info_msg("%s: reset %s context %s->%s",
- applet_name, my_file, context ?: "", newcon);
+ applet_name, my_file, context ? context : "", newcon);
}
}
unsigned cmdlen=0;
for (;;) {
if (!f) putchar('$');
- if (1 > getline(&command, &cmdlen,f ? : stdin)) break;
+ if (1 > getline(&command, &cmdlen, f ? f : stdin)) break;
handle(command);
}
* found. When recursing, quote state is passed in via dest->o_escape.
*/
debug_printf_parse("parse_stream entered, end_trigger='%c'\n",
- end_trigger ? : 'X');
+ end_trigger ? end_trigger : 'X');
debug_enter();
G.ifs = get_local_var_value("IFS");
* bash says "bash: cd: HOME not set" and does nothing
* (exitcode 1)
*/
- newdir = get_local_var_value("HOME") ? : "/";
+ const char *home = get_local_var_value("HOME");
+ newdir = home ? home : "/";
}
if (chdir(newdir)) {
/* Mimic bash message exactly */
}
#endif
-static void setmode(struct fb_var_screeninfo *base,
+static void setfbmode(struct fb_var_screeninfo *base,
struct fb_var_screeninfo *set)
{
if ((int32_t) set->xres > 0)
}
if (options & OPT_CHANGE) {
- setmode(&var, &varset);
+ setfbmode(&var, &varset);
if (options & OPT_ALL)
var.activate = FB_ACTIVATE_ALL;
xioctl(fh, FBIOPUT_VSCREENINFO, &var);