summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/capture
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2008-09-01 11:28:56 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2008-09-01 11:28:56 +0000
commit11672356e7f870033e27f934c57a5d48d061991e (patch)
tree635ee22da74184c7c6f540b67e77168767ebd9eb /cpukit/libmisc/capture
parent2008-09-01 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-11672356e7f870033e27f934c57a5d48d061991e.tar.bz2
Convert to using "bool".
Diffstat (limited to 'cpukit/libmisc/capture')
-rw-r--r--cpukit/libmisc/capture/capture-cli.c118
-rw-r--r--cpukit/libmisc/capture/capture.c46
-rw-r--r--cpukit/libmisc/capture/capture.h14
3 files changed, 89 insertions, 89 deletions
diff --git a/cpukit/libmisc/capture/capture-cli.c b/cpukit/libmisc/capture/capture-cli.c
index d65bdb8dc5..bd659f283f 100644
--- a/cpukit/libmisc/capture/capture-cli.c
+++ b/cpukit/libmisc/capture/capture-cli.c
@@ -66,10 +66,10 @@ static void
rtems_capture_cli_open (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
uint32_t size = 0;
- rtems_boolean enable = 0;
+ bool enable = false;
rtems_status_code sc;
int arg;
@@ -84,7 +84,7 @@ rtems_capture_cli_open (int argc,
if (argv[arg][0] == '-')
{
if (argv[arg][1] == 'i')
- enable = 1;
+ enable = true;
else
fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]);
}
@@ -137,7 +137,7 @@ static void
rtems_capture_cli_close (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
@@ -165,7 +165,7 @@ static void
rtems_capture_cli_enable (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
@@ -193,7 +193,7 @@ static void
rtems_capture_cli_disable (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
@@ -221,7 +221,7 @@ static void
rtems_capture_cli_task_list (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_task_priority ceiling = rtems_capture_watch_get_ceiling ();
rtems_task_priority floor = rtems_capture_watch_get_floor ();
@@ -460,7 +460,7 @@ static void
rtems_capture_cli_task_load (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
rtems_task_priority priority;
@@ -533,7 +533,7 @@ static void
rtems_capture_cli_watch_list (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_capture_control_t* control = rtems_capture_get_control_list ();
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_boolean* valid_name,
- rtems_boolean* valid_id,
+ bool* valid_name,
+ bool* valid_id,
rtems_name* name,
rtems_id* id)
{
@@ -648,7 +648,7 @@ rtems_capture_cli_get_name_id (char* arg,
if (i == l)
{
*id = strtoul (arg, 0, 16);
- *valid_id = 1;
+ *valid_id = true;
}
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]);
*name = rname;
- *valid_name = 1;
+ *valid_name = true;
}
return 1;
@@ -685,14 +685,14 @@ static void
rtems_capture_cli_watch_add (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
rtems_name name = 0;
rtems_id id = 0;
- rtems_boolean valid_name = 0;
- rtems_boolean valid_id = 0;
+ bool valid_name = false;
+ bool valid_id = false;
if (argc <= 1)
{
@@ -748,14 +748,14 @@ static void
rtems_capture_cli_watch_del (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
rtems_name name = 0;
rtems_id id = 0;
- rtems_boolean valid_name = 0;
- rtems_boolean valid_id = 0;
+ bool valid_name = false;
+ bool valid_id = false;
if (argc <= 1)
{
@@ -810,15 +810,15 @@ static void
rtems_capture_cli_watch_control (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
rtems_name name = 0;
rtems_id id = 0;
- rtems_boolean valid_name = 0;
- rtems_boolean valid_id = 0;
- rtems_boolean enable = 0;
+ bool valid_name = false;
+ bool valid_id = false;
+ bool enable = false;
if (argc <= 2)
{
@@ -835,9 +835,9 @@ rtems_capture_cli_watch_control (int argc,
else
{
if (strcmp (argv[arg], "on") == 0)
- enable = 1;
+ enable = true;
else if (strcmp (argv[arg], "off") == 0)
- enable = 0;
+ enable = false;
else if (!rtems_capture_cli_get_name_id (argv[arg], &valid_name,
&valid_id, &name, &id))
return;
@@ -877,11 +877,11 @@ static void
rtems_capture_cli_watch_global (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
- rtems_boolean enable = 0;
+ bool enable = false;
if (argc <= 1)
{
@@ -898,9 +898,9 @@ rtems_capture_cli_watch_global (int argc,
else
{
if (strcmp (argv[arg], "on") == 0)
- enable = 1;
+ enable = true;
else if (strcmp (argv[arg], "off") == 0)
- enable = 0;
+ enable = false;
}
}
@@ -931,7 +931,7 @@ static void
rtems_capture_cli_watch_ceiling (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
@@ -982,7 +982,7 @@ static void
rtems_capture_cli_watch_floor (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
int arg;
@@ -1082,20 +1082,20 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
int arg;
int trigger = 0; /* switch */
rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any;
- rtems_boolean trigger_set = 0;
- rtems_boolean is_from = 0;
+ bool trigger_set = false;
+ bool is_from = false;
rtems_name name = 0;
rtems_id id = 0;
- rtems_boolean valid_name = 0;
- rtems_boolean valid_id = 0;
+ bool valid_name = false;
+ bool valid_id = false;
rtems_name from_name = 0;
rtems_id from_id = 0;
- rtems_boolean from_valid_name = 0;
- rtems_boolean from_valid_id = 0;
+ bool from_valid_name = false;
+ bool from_valid_id = false;
rtems_name to_name = 0;
rtems_id to_id = 0;
- rtems_boolean to_valid_name = 0;
- rtems_boolean to_valid_id = 0;
+ bool to_valid_name = false;
+ bool to_valid_id = false;
for (arg = 1; arg < argc; arg++)
{
@@ -1116,18 +1116,18 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
{
if (!trigger_set)
{
- rtems_boolean found = 0;
- int t;
+ bool found = false;
+ int t;
for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
if (strcmp (argv[arg], rtems_capture_cli_triggers[t].name) == 0)
{
trigger = t;
- found = 1;
+ found = true;
break;
}
- trigger_set = 1;
+ trigger_set = true;
/*
* 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)
{
- from_valid_name = 1;
+ from_valid_name = true;
from_name = name;
}
else
@@ -1164,7 +1164,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
}
else if (!to_valid_name && !to_valid_id)
{
- to_valid_name = 1;
+ to_valid_name = true;
to_name = name;
}
else
@@ -1177,7 +1177,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
{
if (!from_valid_name && !from_valid_id)
{
- from_valid_id = 1;
+ from_valid_id = true;
from_id = id;
}
else
@@ -1185,7 +1185,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
}
else if (!to_valid_name && !to_valid_id)
{
- to_valid_id = 1;
+ to_valid_id = true;
to_id = id;
}
else
@@ -1260,7 +1260,7 @@ static void
rtems_capture_cli_trigger_set (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_capture_cli_trigger_worker (1, argc, argv);
}
@@ -1278,7 +1278,7 @@ static void
rtems_capture_cli_trigger_clear (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_capture_cli_trigger_worker (0, argc, argv);
}
@@ -1296,10 +1296,10 @@ static void
rtems_capture_cli_trace_records (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
- rtems_boolean csv = 0;
+ bool csv = false;
static int dump_total = 22;
int total;
int count;
@@ -1312,14 +1312,14 @@ rtems_capture_cli_trace_records (int argc,
if (argv[arg][0] == '-')
{
if (argv[arg][1] == 'c')
- csv = 1;
+ csv = true;
else
fprintf (stdout, "warning: option -%c ignored\n", argv[arg][1]);
}
else
{
- int i;
- int l;
+ size_t i;
+ size_t l;
l = strlen (argv[arg]);
@@ -1427,10 +1427,10 @@ static void
rtems_capture_cli_flush (int argc,
char** argv,
rtems_monitor_command_arg_t* command_arg,
- boolean verbose)
+ bool verbose)
{
rtems_status_code sc;
- rtems_boolean prime = 1;
+ bool prime = true;
int arg;
for (arg = 1; arg < argc; arg++)
@@ -1438,7 +1438,7 @@ rtems_capture_cli_flush (int argc,
if (argv[arg][0] == '-')
{
if (argv[arg][1] == 'n')
- prime = 0;
+ prime = false;
else
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_capture_cli_init (rtems_capture_timestamp timestamp)
{
- int cmd;
+ size_t cmd;
capture_timestamp = timestamp;
diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 5086ae2fec..15d84927e0 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -138,7 +138,7 @@ static inline void rtems_capture_get_time (uint32_t* ticks,
* in RTEMS.
*
*/
-static inline rtems_boolean
+static inline bool
rtems_capture_match_names (rtems_name lhs, rtems_name rhs)
{
return lhs == rhs;
@@ -154,7 +154,7 @@ rtems_capture_match_names (rtems_name lhs, rtems_name rhs)
* in RTEMS.
*
*/
-static inline rtems_boolean
+static inline bool
rtems_capture_match_ids (rtems_id lhs, rtems_id 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.
*/
-static inline rtems_boolean
+static inline bool
rtems_capture_match_name_id (rtems_name lhs_name,
rtems_id lhs_id,
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.
*
*/
-static inline rtems_boolean
+static inline bool
rtems_capture_by_in_to (uint32_t events,
rtems_capture_task_t* by,
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
* cause of a trigger.
*/
-rtems_boolean
+bool
rtems_capture_trigger (rtems_capture_task_t* ft,
rtems_capture_task_t* tt,
uint32_t events)
@@ -655,7 +655,7 @@ rtems_capture_trigger (rtems_capture_task_t* ft,
* This function is called when a task is created.
*
*/
-static rtems_boolean
+static bool
rtems_capture_create_task (rtems_tcb* current_task,
rtems_tcb* new_task)
{
@@ -1146,7 +1146,7 @@ rtems_capture_close (void)
* This function allows control of tracing at a global level.
*/
rtems_status_code
-rtems_capture_control (rtems_boolean enable)
+rtems_capture_control (bool enable)
{
rtems_interrupt_level level;
@@ -1178,7 +1178,7 @@ rtems_capture_control (rtems_boolean enable)
* to profile the load on a system.
*/
rtems_status_code
-rtems_capture_monitor (rtems_boolean enable)
+rtems_capture_monitor (bool enable)
{
rtems_interrupt_level level;
@@ -1209,7 +1209,7 @@ rtems_capture_monitor (rtems_boolean enable)
* capture engine to also be primed again.
*/
rtems_status_code
-rtems_capture_flush (rtems_boolean prime)
+rtems_capture_flush (bool prime)
{
rtems_interrupt_level level;
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** prev_control;
rtems_capture_task_t* task;
- rtems_boolean found = 0;
+ bool found = false;
/*
* Should this test be for wildcards ?
@@ -1318,7 +1318,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
control = *prev_control;
- found = 1;
+ found = true;
}
else
{
@@ -1342,11 +1342,11 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
* disabled.
*/
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_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
@@ -1365,7 +1365,7 @@ rtems_capture_watch_ctrl (rtems_name name, rtems_id id, rtems_boolean enable)
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.
*/
rtems_status_code
-rtems_capture_watch_global (rtems_boolean enable)
+rtems_capture_watch_global (bool enable)
{
rtems_interrupt_level level;
@@ -1412,7 +1412,7 @@ rtems_capture_watch_global (rtems_boolean enable)
*
* This function returns the global watch state.
*/
-rtems_boolean
+bool
rtems_capture_watch_global_on (void)
{
return capture_flags & RTEMS_CAPTURE_GLOBAL_WATCH ? 1 : 0;
@@ -1564,8 +1564,8 @@ rtems_capture_set_trigger (rtems_name from_name,
control->to_triggers |= flags;
else
{
- rtems_boolean done = 0;
- int i;
+ bool done = false;
+ int i;
control->by_triggers |= flags;
@@ -1576,7 +1576,7 @@ rtems_capture_set_trigger (rtems_name from_name,
(from_id && (control->by[i].id == from_id))))
{
control->by[i].trigger |= flags;
- done = 1;
+ done = true;
break;
}
}
@@ -1591,7 +1591,7 @@ rtems_capture_set_trigger (rtems_name from_name,
control->by[i].name = from_name;
control->by[i].id = from_id;
control->by[i].trigger = flags;
- done = 1;
+ done = true;
break;
}
}
@@ -1648,8 +1648,8 @@ rtems_capture_clear_trigger (rtems_name from_name,
control->to_triggers &= ~flags;
else
{
- rtems_boolean done = 0;
- int i;
+ bool done = false;
+ int i;
control->by_triggers &= ~flags;
@@ -1662,7 +1662,7 @@ rtems_capture_clear_trigger (rtems_name from_name,
control->by[i].trigger &= ~trigger;
if (control->by[i].trigger == 0)
control->by_valid &= ~RTEMS_CAPTURE_CONTROL_FROM_MASK (i);
- done = 1;
+ done = true;
break;
}
}
diff --git a/cpukit/libmisc/capture/capture.h b/cpukit/libmisc/capture/capture.h
index 29441e4d70..acc5fcd912 100644
--- a/cpukit/libmisc/capture/capture.h
+++ b/cpukit/libmisc/capture/capture.h
@@ -286,7 +286,7 @@ rtems_capture_close (void);
* This function allows control of tracing at a global level.
*/
rtems_status_code
-rtems_capture_control (rtems_boolean enable);
+rtems_capture_control (bool enable);
/**
* rtems_capture_monitor
@@ -298,7 +298,7 @@ rtems_capture_control (rtems_boolean enable);
* to profile the load on a system.
*/
rtems_status_code
-rtems_capture_monitor (rtems_boolean enable);
+rtems_capture_monitor (bool enable);
/*
* rtems_capture_flush
@@ -309,7 +309,7 @@ rtems_capture_monitor (rtems_boolean enable);
* capture engine to also be primed again.
*/
rtems_status_code
-rtems_capture_flush (rtems_boolean prime);
+rtems_capture_flush (bool prime);
/**
* rtems_capture_watch_add
@@ -347,7 +347,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id);
rtems_status_code
rtems_capture_watch_ctrl (rtems_name name,
rtems_id id,
- rtems_boolean enable);
+ bool enable);
/**
* rtems_capture_watch_global
@@ -359,7 +359,7 @@ rtems_capture_watch_ctrl (rtems_name name,
* the ceiling and above the floor to be traced.
*/
rtems_status_code
-rtems_capture_watch_global (rtems_boolean enable);
+rtems_capture_watch_global (bool enable);
/**
* rtems_capture_watch_global_on
@@ -368,7 +368,7 @@ rtems_capture_watch_global (rtems_boolean enable);
*
* This function returns the global watch state.
*/
-rtems_boolean
+bool
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
* a valid task.
*/
-static inline rtems_boolean
+static inline bool
rtems_capture_task_valid (rtems_capture_task_t* task)
{
return task->tcb != NULL;