Convert to using "bool".

This commit is contained in:
Ralf Corsepius
2008-09-01 11:28:56 +00:00
parent 4d624fead8
commit 11672356e7
11 changed files with 129 additions and 127 deletions

View File

@@ -66,10 +66,10 @@ static void
rtems_capture_cli_open (int argc, rtems_capture_cli_open (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
uint32_t size = 0; uint32_t size = 0;
rtems_boolean enable = 0; bool enable = false;
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
@@ -84,7 +84,7 @@ rtems_capture_cli_open (int argc,
if (argv[arg][0] == '-') if (argv[arg][0] == '-')
{ {
if (argv[arg][1] == 'i') if (argv[arg][1] == 'i')
enable = 1; enable = true;
else else
fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]); fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]);
} }
@@ -137,7 +137,7 @@ static void
rtems_capture_cli_close (int argc, rtems_capture_cli_close (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
@@ -165,7 +165,7 @@ static void
rtems_capture_cli_enable (int argc, rtems_capture_cli_enable (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
@@ -193,7 +193,7 @@ static void
rtems_capture_cli_disable (int argc, rtems_capture_cli_disable (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
@@ -221,7 +221,7 @@ static void
rtems_capture_cli_task_list (int argc, rtems_capture_cli_task_list (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling (); rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
rtems_task_priority floor = rtems_capture_watch_get_floor (); rtems_task_priority floor = rtems_capture_watch_get_floor ();
@@ -460,7 +460,7 @@ static void
rtems_capture_cli_task_load (int argc, rtems_capture_cli_task_load (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
rtems_task_priority priority; rtems_task_priority priority;
@@ -533,7 +533,7 @@ static void
rtems_capture_cli_watch_list (int argc, rtems_capture_cli_watch_list (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_capture_control_t* control = rtems_capture_get_control_list (); rtems_capture_control_t* control = rtems_capture_get_control_list ();
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling (); rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
@@ -619,10 +619,10 @@ rtems_capture_cli_watch_list (int argc,
* *
*/ */
static rtems_boolean static bool
rtems_capture_cli_get_name_id (char* arg, rtems_capture_cli_get_name_id (char* arg,
rtems_boolean* valid_name, bool* valid_name,
rtems_boolean* valid_id, bool* valid_id,
rtems_name* name, rtems_name* name,
rtems_id* id) rtems_id* id)
{ {
@@ -648,7 +648,7 @@ rtems_capture_cli_get_name_id (char* arg,
if (i == l) if (i == l)
{ {
*id = strtoul (arg, 0, 16); *id = strtoul (arg, 0, 16);
*valid_id = 1; *valid_id = true;
} }
else else
{ {
@@ -663,7 +663,7 @@ rtems_capture_cli_get_name_id (char* arg,
rname = rtems_build_name(arg[0], arg[1], arg[2], arg[3]); rname = rtems_build_name(arg[0], arg[1], arg[2], arg[3]);
*name = rname; *name = rname;
*valid_name = 1; *valid_name = true;
} }
return 1; return 1;
@@ -685,14 +685,14 @@ static void
rtems_capture_cli_watch_add (int argc, rtems_capture_cli_watch_add (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
rtems_name name = 0; rtems_name name = 0;
rtems_id id = 0; rtems_id id = 0;
rtems_boolean valid_name = 0; bool valid_name = false;
rtems_boolean valid_id = 0; bool valid_id = false;
if (argc <= 1) if (argc <= 1)
{ {
@@ -748,14 +748,14 @@ static void
rtems_capture_cli_watch_del (int argc, rtems_capture_cli_watch_del (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
rtems_name name = 0; rtems_name name = 0;
rtems_id id = 0; rtems_id id = 0;
rtems_boolean valid_name = 0; bool valid_name = false;
rtems_boolean valid_id = 0; bool valid_id = false;
if (argc <= 1) if (argc <= 1)
{ {
@@ -810,15 +810,15 @@ static void
rtems_capture_cli_watch_control (int argc, rtems_capture_cli_watch_control (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
rtems_name name = 0; rtems_name name = 0;
rtems_id id = 0; rtems_id id = 0;
rtems_boolean valid_name = 0; bool valid_name = false;
rtems_boolean valid_id = 0; bool valid_id = false;
rtems_boolean enable = 0; bool enable = false;
if (argc <= 2) if (argc <= 2)
{ {
@@ -835,9 +835,9 @@ rtems_capture_cli_watch_control (int argc,
else else
{ {
if (strcmp (argv[arg], "on") == 0) if (strcmp (argv[arg], "on") == 0)
enable = 1; enable = true;
else if (strcmp (argv[arg], "off") == 0) else if (strcmp (argv[arg], "off") == 0)
enable = 0; enable = false;
else if (!rtems_capture_cli_get_name_id (argv[arg], &valid_name, else if (!rtems_capture_cli_get_name_id (argv[arg], &valid_name,
&valid_id, &name, &id)) &valid_id, &name, &id))
return; return;
@@ -877,11 +877,11 @@ static void
rtems_capture_cli_watch_global (int argc, rtems_capture_cli_watch_global (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
rtems_boolean enable = 0; bool enable = false;
if (argc <= 1) if (argc <= 1)
{ {
@@ -898,9 +898,9 @@ rtems_capture_cli_watch_global (int argc,
else else
{ {
if (strcmp (argv[arg], "on") == 0) if (strcmp (argv[arg], "on") == 0)
enable = 1; enable = true;
else if (strcmp (argv[arg], "off") == 0) else if (strcmp (argv[arg], "off") == 0)
enable = 0; enable = false;
} }
} }
@@ -931,7 +931,7 @@ static void
rtems_capture_cli_watch_ceiling (int argc, rtems_capture_cli_watch_ceiling (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
@@ -982,7 +982,7 @@ static void
rtems_capture_cli_watch_floor (int argc, rtems_capture_cli_watch_floor (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
int arg; int arg;
@@ -1082,20 +1082,20 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
int arg; int arg;
int trigger = 0; /* switch */ int trigger = 0; /* switch */
rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any; rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any;
rtems_boolean trigger_set = 0; bool trigger_set = false;
rtems_boolean is_from = 0; bool is_from = false;
rtems_name name = 0; rtems_name name = 0;
rtems_id id = 0; rtems_id id = 0;
rtems_boolean valid_name = 0; bool valid_name = false;
rtems_boolean valid_id = 0; bool valid_id = false;
rtems_name from_name = 0; rtems_name from_name = 0;
rtems_id from_id = 0; rtems_id from_id = 0;
rtems_boolean from_valid_name = 0; bool from_valid_name = false;
rtems_boolean from_valid_id = 0; bool from_valid_id = false;
rtems_name to_name = 0; rtems_name to_name = 0;
rtems_id to_id = 0; rtems_id to_id = 0;
rtems_boolean to_valid_name = 0; bool to_valid_name = false;
rtems_boolean to_valid_id = 0; bool to_valid_id = false;
for (arg = 1; arg < argc; arg++) for (arg = 1; arg < argc; arg++)
{ {
@@ -1116,18 +1116,18 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
{ {
if (!trigger_set) if (!trigger_set)
{ {
rtems_boolean found = 0; bool found = false;
int t; int t;
for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++) for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0) if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0)
{ {
trigger = t; trigger = t;
found = 1; found = true;
break; break;
} }
trigger_set = 1; trigger_set = true;
/* /*
* If a trigger was not found assume the default and * If a trigger was not found assume the default and
@@ -1156,7 +1156,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
{ {
if (!from_valid_name && !from_valid_id) if (!from_valid_name && !from_valid_id)
{ {
from_valid_name = 1; from_valid_name = true;
from_name = name; from_name = name;
} }
else else
@@ -1164,7 +1164,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
} }
else if (!to_valid_name && !to_valid_id) else if (!to_valid_name && !to_valid_id)
{ {
to_valid_name = 1; to_valid_name = true;
to_name = name; to_name = name;
} }
else else
@@ -1177,7 +1177,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
{ {
if (!from_valid_name && !from_valid_id) if (!from_valid_name && !from_valid_id)
{ {
from_valid_id = 1; from_valid_id = true;
from_id = id; from_id = id;
} }
else else
@@ -1185,7 +1185,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
} }
else if (!to_valid_name && !to_valid_id) else if (!to_valid_name && !to_valid_id)
{ {
to_valid_id = 1; to_valid_id = true;
to_id = id; to_id = id;
} }
else else
@@ -1260,7 +1260,7 @@ static void
rtems_capture_cli_trigger_set (int argc, rtems_capture_cli_trigger_set (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_capture_cli_trigger_worker (1, argc, argv); rtems_capture_cli_trigger_worker (1, argc, argv);
} }
@@ -1278,7 +1278,7 @@ static void
rtems_capture_cli_trigger_clear (int argc, rtems_capture_cli_trigger_clear (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_capture_cli_trigger_worker (0, argc, argv); rtems_capture_cli_trigger_worker (0, argc, argv);
} }
@@ -1296,10 +1296,10 @@ static void
rtems_capture_cli_trace_records (int argc, rtems_capture_cli_trace_records (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
rtems_boolean csv = 0; bool csv = false;
static int dump_total = 22; static int dump_total = 22;
int total; int total;
int count; int count;
@@ -1312,14 +1312,14 @@ rtems_capture_cli_trace_records (int argc,
if (argv[arg][0] == '-') if (argv[arg][0] == '-')
{ {
if (argv[arg][1] == 'c') if (argv[arg][1] == 'c')
csv = 1; csv = true;
else else
fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]); fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]);
} }
else else
{ {
int i; size_t i;
int l; size_t l;
l = strlen (argv[arg]); l = strlen (argv[arg]);
@@ -1427,10 +1427,10 @@ static void
rtems_capture_cli_flush (int argc, rtems_capture_cli_flush (int argc,
char** argv, char** argv,
rtems_monitor_command_arg_t* command_arg, rtems_monitor_command_arg_t* command_arg,
boolean verbose) bool verbose)
{ {
rtems_status_code sc; rtems_status_code sc;
rtems_boolean prime = 1; bool prime = true;
int arg; int arg;
for (arg = 1; arg < argc; arg++) for (arg = 1; arg < argc; arg++)
@@ -1438,7 +1438,7 @@ rtems_capture_cli_flush (int argc,
if (argv[arg][0] == '-') if (argv[arg][0] == '-')
{ {
if (argv[arg][1] == 'n') if (argv[arg][1] == 'n')
prime = 0; prime = false;
else else
fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]); fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]);
} }
@@ -1609,7 +1609,7 @@ static rtems_monitor_command_entry_t rtems_capture_cli_cmds[] =
rtems_status_code rtems_status_code
rtems_capture_cli_init (rtems_capture_timestamp timestamp) rtems_capture_cli_init (rtems_capture_timestamp timestamp)
{ {
int cmd; size_t cmd;
capture_timestamp = timestamp; capture_timestamp = timestamp;

View File

@@ -138,7 +138,7 @@ static inline void rtems_capture_get_time (uint32_t* ticks,
* in RTEMS. * in RTEMS.
* *
*/ */
static inline rtems_boolean static inline bool
rtems_capture_match_names (rtems_name lhs, rtems_name rhs) rtems_capture_match_names (rtems_name lhs, rtems_name rhs)
{ {
return lhs == rhs; return lhs == rhs;
@@ -154,7 +154,7 @@ rtems_capture_match_names (rtems_name lhs, rtems_name rhs)
* in RTEMS. * in RTEMS.
* *
*/ */
static inline rtems_boolean static inline bool
rtems_capture_match_ids (rtems_id lhs, rtems_id rhs) rtems_capture_match_ids (rtems_id lhs, rtems_id rhs)
{ {
return lhs == rhs; return lhs == rhs;
@@ -167,7 +167,7 @@ rtems_capture_match_ids (rtems_id lhs, rtems_id rhs)
* *
* This function matches a name and/or id. * This function matches a name and/or id.
*/ */
static inline rtems_boolean static inline bool
rtems_capture_match_name_id (rtems_name lhs_name, rtems_capture_match_name_id (rtems_name lhs_name,
rtems_id lhs_id, rtems_id lhs_id,
rtems_name rhs_name, rtems_name rhs_name,
@@ -212,7 +212,7 @@ rtems_capture_dup_name (rtems_name* dst, rtems_name src)
* tasks is the number of bits in uint32_t. * tasks is the number of bits in uint32_t.
* *
*/ */
static inline rtems_boolean static inline bool
rtems_capture_by_in_to (uint32_t events, rtems_capture_by_in_to (uint32_t events,
rtems_capture_task_t* by, rtems_capture_task_t* by,
rtems_capture_control_t* to) rtems_capture_control_t* to)
@@ -582,7 +582,7 @@ rtems_capture_record (rtems_capture_task_t* task,
* See if we have triggered and if not see if this event is a * See if we have triggered and if not see if this event is a
* cause of a trigger. * cause of a trigger.
*/ */
rtems_boolean bool
rtems_capture_trigger (rtems_capture_task_t* ft, rtems_capture_trigger (rtems_capture_task_t* ft,
rtems_capture_task_t* tt, rtems_capture_task_t* tt,
uint32_t events) uint32_t events)
@@ -655,7 +655,7 @@ rtems_capture_trigger (rtems_capture_task_t* ft,
* This function is called when a task is created. * This function is called when a task is created.
* *
*/ */
static rtems_boolean static bool
rtems_capture_create_task (rtems_tcb* current_task, rtems_capture_create_task (rtems_tcb* current_task,
rtems_tcb* new_task) rtems_tcb* new_task)
{ {
@@ -1146,7 +1146,7 @@ rtems_capture_close (void)
* This function allows control of tracing at a global level. * This function allows control of tracing at a global level.
*/ */
rtems_status_code rtems_status_code
rtems_capture_control (rtems_boolean enable) rtems_capture_control (bool enable)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
@@ -1178,7 +1178,7 @@ rtems_capture_control (rtems_boolean enable)
* to profile the load on a system. * to profile the load on a system.
*/ */
rtems_status_code rtems_status_code
rtems_capture_monitor (rtems_boolean enable) rtems_capture_monitor (bool enable)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
@@ -1209,7 +1209,7 @@ rtems_capture_monitor (rtems_boolean enable)
* capture engine to also be primed again. * capture engine to also be primed again.
*/ */
rtems_status_code rtems_status_code
rtems_capture_flush (rtems_boolean prime) rtems_capture_flush (bool prime)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
rtems_capture_task_t* task; rtems_capture_task_t* task;
@@ -1293,7 +1293,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
rtems_capture_control_t* control; rtems_capture_control_t* control;
rtems_capture_control_t** prev_control; rtems_capture_control_t** prev_control;
rtems_capture_task_t* task; rtems_capture_task_t* task;
rtems_boolean found = 0; bool found = false;
/* /*
* Should this test be for wildcards ? * Should this test be for wildcards ?
@@ -1318,7 +1318,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
control = *prev_control; control = *prev_control;
found = 1; found = true;
} }
else else
{ {
@@ -1342,11 +1342,11 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
* disabled. * disabled.
*/ */
rtems_status_code rtems_status_code
rtems_capture_watch_ctrl (rtems_name name, rtems_id id, rtems_boolean enable) rtems_capture_watch_ctrl (rtems_name name, rtems_id id, bool enable)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
rtems_capture_control_t* control; rtems_capture_control_t* control;
rtems_boolean found = 0; bool found = false;
/* /*
* Find the control and then set the watch. It must exist before it can * Find the control and then set the watch. It must exist before it can
@@ -1365,7 +1365,7 @@ rtems_capture_watch_ctrl (rtems_name name, rtems_id id, rtems_boolean enable)
rtems_interrupt_enable (level); rtems_interrupt_enable (level);
found = 1; found = true;
} }
} }
@@ -1385,7 +1385,7 @@ rtems_capture_watch_ctrl (rtems_name name, rtems_id id, rtems_boolean enable)
* the floor to be traced. * the floor to be traced.
*/ */
rtems_status_code rtems_status_code
rtems_capture_watch_global (rtems_boolean enable) rtems_capture_watch_global (bool enable)
{ {
rtems_interrupt_level level; rtems_interrupt_level level;
@@ -1412,7 +1412,7 @@ rtems_capture_watch_global (rtems_boolean enable)
* *
* This function returns the global watch state. * This function returns the global watch state.
*/ */
rtems_boolean bool
rtems_capture_watch_global_on (void) rtems_capture_watch_global_on (void)
{ {
return capture_flags & RTEMS_CAPTURE_GLOBAL_WATCH ? 1 : 0; return capture_flags & RTEMS_CAPTURE_GLOBAL_WATCH ? 1 : 0;
@@ -1564,7 +1564,7 @@ rtems_capture_set_trigger (rtems_name from_name,
control->to_triggers |= flags; control->to_triggers |= flags;
else else
{ {
rtems_boolean done = 0; bool done = false;
int i; int i;
control->by_triggers |= flags; control->by_triggers |= flags;
@@ -1576,7 +1576,7 @@ rtems_capture_set_trigger (rtems_name from_name,
(from_id && (control->by[i].id == from_id)))) (from_id && (control->by[i].id == from_id))))
{ {
control->by[i].trigger |= flags; control->by[i].trigger |= flags;
done = 1; done = true;
break; break;
} }
} }
@@ -1591,7 +1591,7 @@ rtems_capture_set_trigger (rtems_name from_name,
control->by[i].name = from_name; control->by[i].name = from_name;
control->by[i].id = from_id; control->by[i].id = from_id;
control->by[i].trigger = flags; control->by[i].trigger = flags;
done = 1; done = true;
break; break;
} }
} }
@@ -1648,7 +1648,7 @@ rtems_capture_clear_trigger (rtems_name from_name,
control->to_triggers &= ~flags; control->to_triggers &= ~flags;
else else
{ {
rtems_boolean done = 0; bool done = false;
int i; int i;
control->by_triggers &= ~flags; control->by_triggers &= ~flags;
@@ -1662,7 +1662,7 @@ rtems_capture_clear_trigger (rtems_name from_name,
control->by[i].trigger &= ~trigger; control->by[i].trigger &= ~trigger;
if (control->by[i].trigger == 0) if (control->by[i].trigger == 0)
control->by_valid &= ~RTEMS_CAPTURE_CONTROL_FROM_MASK (i); control->by_valid &= ~RTEMS_CAPTURE_CONTROL_FROM_MASK (i);
done = 1; done = true;
break; break;
} }
} }

View File

@@ -286,7 +286,7 @@ rtems_capture_close (void);
* This function allows control of tracing at a global level. * This function allows control of tracing at a global level.
*/ */
rtems_status_code rtems_status_code
rtems_capture_control (rtems_boolean enable); rtems_capture_control (bool enable);
/** /**
* rtems_capture_monitor * rtems_capture_monitor
@@ -298,7 +298,7 @@ rtems_capture_control (rtems_boolean enable);
* to profile the load on a system. * to profile the load on a system.
*/ */
rtems_status_code rtems_status_code
rtems_capture_monitor (rtems_boolean enable); rtems_capture_monitor (bool enable);
/* /*
* rtems_capture_flush * rtems_capture_flush
@@ -309,7 +309,7 @@ rtems_capture_monitor (rtems_boolean enable);
* capture engine to also be primed again. * capture engine to also be primed again.
*/ */
rtems_status_code rtems_status_code
rtems_capture_flush (rtems_boolean prime); rtems_capture_flush (bool prime);
/** /**
* rtems_capture_watch_add * rtems_capture_watch_add
@@ -347,7 +347,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id);
rtems_status_code rtems_status_code
rtems_capture_watch_ctrl (rtems_name name, rtems_capture_watch_ctrl (rtems_name name,
rtems_id id, rtems_id id,
rtems_boolean enable); bool enable);
/** /**
* rtems_capture_watch_global * rtems_capture_watch_global
@@ -359,7 +359,7 @@ rtems_capture_watch_ctrl (rtems_name name,
* the ceiling and above the floor to be traced. * the ceiling and above the floor to be traced.
*/ */
rtems_status_code rtems_status_code
rtems_capture_watch_global (rtems_boolean enable); rtems_capture_watch_global (bool enable);
/** /**
* rtems_capture_watch_global_on * rtems_capture_watch_global_on
@@ -368,7 +368,7 @@ rtems_capture_watch_global (rtems_boolean enable);
* *
* This function returns the global watch state. * This function returns the global watch state.
*/ */
rtems_boolean bool
rtems_capture_watch_global_on (void); rtems_capture_watch_global_on (void);
/** /**
@@ -570,7 +570,7 @@ rtems_capture_next_task (rtems_capture_task_t* task)
* This function returns true if the task control block points to * This function returns true if the task control block points to
* a valid task. * a valid task.
*/ */
static inline rtems_boolean static inline bool
rtems_capture_task_valid (rtems_capture_task_t* task) rtems_capture_task_valid (rtems_capture_task_t* task)
{ {
return task->tcb != NULL; return task->tcb != NULL;

View File

@@ -50,14 +50,14 @@ int serdbg_init_dbg
| rtems_status_code | | rtems_status_code |
\*=========================================================================*/ \*=========================================================================*/
{ {
static boolean is_initialized = FALSE; static bool is_initialized = false;
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
if (is_initialized) { if (is_initialized) {
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
is_initialized = TRUE; is_initialized = true;
/* /*
* try to open serial device * try to open serial device
*/ */

View File

@@ -28,12 +28,13 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct { typedef struct {
uint32_t baudrate; /* debug baud rate, e.g. 57600 */ uint32_t baudrate; /* debug baud rate, e.g. 57600 */
void (*callout)(void); /* callout pointer during polling */ void (*callout)(void); /* callout pointer during polling */
int (*open_io)(const char *dev_name, uint32_t baudrate); /* I/O open fnc */ int (*open_io)(const char *dev_name, uint32_t baudrate); /* I/O open fnc */
const char *devname; /* debug device, e.g. "/dev/tty01" */ const char *devname; /* debug device, e.g. "/dev/tty01" */
uint8_t skip_init_bkpt; /* if TRUE, do not stop when initializing */ bool skip_init_bkpt; /* if TRUE, do not stop when initializing */
} serdbg_conf_t; } serdbg_conf_t;
/* /*

View File

@@ -65,9 +65,9 @@ serdbg_conf_t serdbg_conf = {
CONFIGURE_SERDBG_DEVNAME, CONFIGURE_SERDBG_DEVNAME,
#ifdef CONFIGURE_SERDBG_SKIP_INIT_BKPT #ifdef CONFIGURE_SERDBG_SKIP_INIT_BKPT
TRUE, true,
#else #else
FALSE, false,
#endif #endif
}; };

View File

@@ -67,7 +67,7 @@ int serdbg_open
| 0 on success, -1 and errno otherwise | | 0 on success, -1 and errno otherwise |
\*=========================================================================*/ \*=========================================================================*/
{ {
boolean err_occurred = FALSE; bool err_occurred = false;
rtems_libio_t *iop = NULL; rtems_libio_t *iop = NULL;
struct termios act_termios; struct termios act_termios;
tcflag_t baudcode = B0; tcflag_t baudcode = B0;
@@ -99,7 +99,7 @@ int serdbg_open
case 115200: baudcode = B115200; break; case 115200: baudcode = B115200; break;
case 230400: baudcode = B230400; break; case 230400: baudcode = B230400; break;
case 460800: baudcode = B460800; break; case 460800: baudcode = B460800; break;
default : err_occurred = TRUE; errno = EINVAL; break; default : err_occurred = true; errno = EINVAL; break;
} }
/* /*
@@ -113,12 +113,12 @@ int serdbg_open
do { do {
serdbg_fd = open(dev_name,O_RDWR); serdbg_fd = open(dev_name,O_RDWR);
if (serdbg_fd < 0) { if (serdbg_fd < 0) {
err_occurred = TRUE; err_occurred = true;
} }
else { else {
if (serdbg_fd < 3) { if (serdbg_fd < 3) {
if (fd_store_used >= FD_STORE_CNT) { if (fd_store_used >= FD_STORE_CNT) {
err_occurred = TRUE; err_occurred = true;
} }
else { else {
fd_store[fd_store_used++] = serdbg_fd; fd_store[fd_store_used++] = serdbg_fd;
@@ -153,7 +153,7 @@ int serdbg_open
*/ */
if (!err_occurred && if (!err_occurred &&
(0 != tcgetattr(serdbg_fd,&act_termios))) { (0 != tcgetattr(serdbg_fd,&act_termios))) {
err_occurred = TRUE; err_occurred = true;
} }
if (!err_occurred) { if (!err_occurred) {
act_termios.c_iflag act_termios.c_iflag
@@ -169,7 +169,7 @@ int serdbg_open
cfsetispeed(&act_termios,baudcode); cfsetispeed(&act_termios,baudcode);
if (0 != tcsetattr(serdbg_fd,TCSANOW,&act_termios)) { if (0 != tcsetattr(serdbg_fd,TCSANOW,&act_termios)) {
err_occurred = TRUE; err_occurred = true;
} }
} }
return (err_occurred return (err_occurred

View File

@@ -152,7 +152,7 @@ int termios_printk_open
| 0 on success, -1 and errno otherwise | | 0 on success, -1 and errno otherwise |
\*=========================================================================*/ \*=========================================================================*/
{ {
boolean err_occurred = FALSE; bool err_occurred = false;
rtems_libio_t *iop = NULL; rtems_libio_t *iop = NULL;
struct termios act_termios; struct termios act_termios;
tcflag_t baudcode = B0; tcflag_t baudcode = B0;
@@ -186,7 +186,7 @@ int termios_printk_open
case 115200: baudcode = B115200; break; case 115200: baudcode = B115200; break;
case 230400: baudcode = B230400; break; case 230400: baudcode = B230400; break;
case 460800: baudcode = B460800; break; case 460800: baudcode = B460800; break;
default : err_occurred = TRUE; errno = EINVAL; break; default : err_occurred = true; errno = EINVAL; break;
} }
/* /*
* open device for serdbg operation * open device for serdbg operation
@@ -196,7 +196,7 @@ int termios_printk_open
(dev_name[0] != '\0')) { (dev_name[0] != '\0')) {
termios_printk_fd = open(dev_name,O_RDWR); termios_printk_fd = open(dev_name,O_RDWR);
if (termios_printk_fd < 0) { if (termios_printk_fd < 0) {
err_occurred = TRUE; err_occurred = true;
} }
} }
/* /*
@@ -216,7 +216,7 @@ int termios_printk_open
*/ */
if (!err_occurred && if (!err_occurred &&
(0 != tcgetattr(termios_printk_fd,&act_termios))) { (0 != tcgetattr(termios_printk_fd,&act_termios))) {
err_occurred = TRUE; err_occurred = true;
} }
if (!err_occurred) { if (!err_occurred) {
@@ -224,7 +224,7 @@ int termios_printk_open
cfsetispeed(&act_termios,baudcode); cfsetispeed(&act_termios,baudcode);
if (0 != tcsetattr(termios_printk_fd,TCSANOW,&act_termios)) { if (0 != tcsetattr(termios_printk_fd,TCSANOW,&act_termios)) {
err_occurred = TRUE; err_occurred = true;
} }
} }
if (!err_occurred) { if (!err_occurred) {

View File

@@ -29,7 +29,7 @@ int rtems_shell_main_logoff(
{ {
printf("logoff from the system..."); printf("logoff from the system...");
rtems_current_shell_env->exit_shell = TRUE; rtems_current_shell_env->exit_shell = true;
return 0; return 0;
} }

View File

@@ -446,13 +446,14 @@ int rtems_shell_scanline(
* TODO: Redirection. Tty Signals. ENVVARs. Shell language. * TODO: Redirection. Tty Signals. ENVVARs. Shell language.
* ----------------------------------------------- */ * ----------------------------------------------- */
void rtems_shell_init_issue(void) { void rtems_shell_init_issue(void)
static char issue_inited=FALSE; {
static bool issue_inited=false;
struct stat buf; struct stat buf;
if (issue_inited) if (issue_inited)
return; return;
issue_inited = TRUE; issue_inited = true;
/* dummy call to init /etc dir */ /* dummy call to init /etc dir */
getpwnam("root"); getpwnam("root");
@@ -657,7 +658,7 @@ rtems_task rtems_shell_task(rtems_task_argument task_argument)
#define RTEMS_SHELL_CMD_COUNT (32) #define RTEMS_SHELL_CMD_COUNT (32)
#define RTEMS_SHELL_PROMPT_SIZE (128) #define RTEMS_SHELL_PROMPT_SIZE (128)
rtems_boolean rtems_shell_main_loop( bool rtems_shell_main_loop(
rtems_shell_env_t *shell_env_arg rtems_shell_env_t *shell_env_arg
) )
{ {
@@ -673,8 +674,8 @@ rtems_boolean rtems_shell_main_loop(
char *cmd_argv; char *cmd_argv;
int argc; int argc;
char *argv[RTEMS_SHELL_MAXIMUM_ARGUMENTS]; char *argv[RTEMS_SHELL_MAXIMUM_ARGUMENTS];
rtems_boolean result = TRUE; bool result = true;
rtems_boolean input_file = FALSE; bool input_file = true;
int line = 0; int line = 0;
FILE *stdinToClose = NULL; FILE *stdinToClose = NULL;
FILE *stdoutToClose = NULL; FILE *stdoutToClose = NULL;
@@ -698,7 +699,7 @@ rtems_boolean rtems_shell_main_loop(
); );
if (sc != RTEMS_SUCCESSFUL) { if (sc != RTEMS_SUCCESSFUL) {
rtems_error(sc,"rtems_task_variable_add(current_shell_env):"); rtems_error(sc,"rtems_task_variable_add(current_shell_env):");
return FALSE; return false;
} }
setuid(0); setuid(0);
@@ -723,7 +724,7 @@ rtems_boolean rtems_shell_main_loop(
if (!output) { if (!output) {
fprintf(stderr, "shell: open output %s failed: %s\n", fprintf(stderr, "shell: open output %s failed: %s\n",
shell_env_arg->output, strerror(errno)); shell_env_arg->output, strerror(errno));
return FALSE; return false;
} }
stdout = output; stdout = output;
stdoutToClose = output; stdoutToClose = output;
@@ -735,12 +736,12 @@ rtems_boolean rtems_shell_main_loop(
if (!input) { if (!input) {
fprintf(stderr, "shell: open input %s failed: %s\n", fprintf(stderr, "shell: open input %s failed: %s\n",
shell_env_arg->input, strerror(errno)); shell_env_arg->input, strerror(errno));
return FALSE; return false;
} }
stdin = input; stdin = input;
stdinToClose = input; stdinToClose = input;
shell_env->forever = FALSE; shell_env->forever = false;
input_file = TRUE; input_file =true;
} }
else { else {
/* make a raw terminal,Linux Manuals */ /* make a raw terminal,Linux Manuals */
@@ -796,7 +797,7 @@ rtems_boolean rtems_shell_main_loop(
sc = rtems_libio_set_private_env(); sc = rtems_libio_set_private_env();
if (sc != RTEMS_SUCCESSFUL) { if (sc != RTEMS_SUCCESSFUL) {
rtems_error(sc,"rtems_libio_set_private_env():"); rtems_error(sc,"rtems_libio_set_private_env():");
result = FALSE; result = false;
break; break;
} }
@@ -806,10 +807,10 @@ rtems_boolean rtems_shell_main_loop(
* keep on trucking. * keep on trucking.
*/ */
if ( input_file ) { if ( input_file ) {
result = TRUE; result = true;
} else { } else {
if (rtems_shell_login(stdin,stdout)) result = FALSE; if (rtems_shell_login(stdin,stdout)) result = false;
else result = TRUE; else result = true;
} }
if (result) { if (result) {
@@ -828,7 +829,7 @@ rtems_boolean rtems_shell_main_loop(
else else
chdir("/"); /* XXX: chdir to getpwent homedir */ chdir("/"); /* XXX: chdir to getpwent homedir */
shell_env->exit_shell = FALSE; shell_env->exit_shell = false;
for (;;) { for (;;) {
int cmd; int cmd;
@@ -981,7 +982,7 @@ static rtems_status_code rtems_shell_run (
} }
shell_env->devname = devname; shell_env->devname = devname;
shell_env->taskname = task_name; shell_env->taskname = task_name;
shell_env->exit_shell = FALSE; shell_env->exit_shell = false;
shell_env->forever = forever; shell_env->forever = forever;
shell_env->echo = echo; shell_env->echo = echo;
shell_env->input = strdup (input); shell_env->input = strdup (input);

View File

@@ -181,8 +181,8 @@ typedef struct {
char *devname; char *devname;
char *taskname; char *taskname;
/* user extensions */ /* user extensions */
int exit_shell; /* logout */ bool exit_shell; /* logout */
int forever ; /* repeat login */ bool forever ; /* repeat login */
int errorlevel; int errorlevel;
int echo; int echo;
char cwd[256]; char cwd[256];
@@ -192,7 +192,7 @@ typedef struct {
rtems_id wake_on_end; rtems_id wake_on_end;
} rtems_shell_env_t; } rtems_shell_env_t;
rtems_boolean rtems_shell_main_loop( bool rtems_shell_main_loop(
rtems_shell_env_t *rtems_shell_env rtems_shell_env_t *rtems_shell_env
); );