aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-04-19 15:36:52 +0000
committerPedro Alves <palves@redhat.com>2013-04-19 15:36:52 +0000
commita398505b407f8197a9efd80490d3c4a725aeaab0 (patch)
treee5c4a533a37eddaee2c9a97982350110df9f5af6
parent9f8afa72d13f221932e25bb15f01799e171d93a1 (diff)
downloadgdb-a398505b407f8197a9efd80490d3c4a725aeaab0.zip
gdb-a398505b407f8197a9efd80490d3c4a725aeaab0.tar.gz
gdb-a398505b407f8197a9efd80490d3c4a725aeaab0.tar.bz2
-Wpointer-sign: ctf.c.
ctf_save_write's second parameter is gdb_byte *, and all these arguments are 'char *'. Since this function is ultimately just writing host bytes to a local file with fwrite, an alternative would be to change ctf_save_write to take a 'void *' instead of 'gdb_byte *', thus removing the need for any cast (we have more calls with casts than without). gdb/ 2013-04-19 Pedro Alves <palves@redhat.com> * ctf.c (ctf_write_uploaded_tsv, ctf_write_uploaded_tp): Add casts to 'gdb_byte *'.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ctf.c15
2 files changed, 13 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f2e672c..379c8d2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-04-19 Pedro Alves <palves@redhat.com>
+ * ctf.c (ctf_write_uploaded_tsv, ctf_write_uploaded_tp): Add casts
+ to 'gdb_byte *'.
+
+2013-04-19 Pedro Alves <palves@redhat.com>
+
* cp-valprint.c (cp_print_class_member): Change type of 'fieldno'
local to int.
diff --git a/gdb/ctf.c b/gdb/ctf.c
index b8252e4..240e909 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -529,7 +529,8 @@ ctf_write_uploaded_tsv (struct trace_file_writer *self,
/* name */
if (tsv->name != NULL)
- ctf_save_write (&writer->tcs, tsv->name, strlen (tsv->name));
+ ctf_save_write (&writer->tcs, (gdb_byte *) tsv->name,
+ strlen (tsv->name));
ctf_save_write (&writer->tcs, &zero, 1);
}
@@ -581,30 +582,30 @@ ctf_write_uploaded_tp (struct trace_file_writer *self,
/* condition */
if (tp->cond != NULL)
- ctf_save_write (&writer->tcs, tp->cond, strlen (tp->cond));
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->cond, strlen (tp->cond));
ctf_save_write (&writer->tcs, &zero, 1);
/* actions */
u32 = VEC_length (char_ptr, tp->actions);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->actions, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
/* step_actions */
u32 = VEC_length (char_ptr, tp->step_actions);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->step_actions, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
/* at_string */
if (tp->at_string != NULL)
- ctf_save_write (&writer->tcs, tp->at_string,
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->at_string,
strlen (tp->at_string));
ctf_save_write (&writer->tcs, &zero, 1);
/* cond_string */
if (tp->cond_string != NULL)
- ctf_save_write (&writer->tcs, tp->cond_string,
+ ctf_save_write (&writer->tcs, (gdb_byte *) tp->cond_string,
strlen (tp->cond_string));
ctf_save_write (&writer->tcs, &zero, 1);
@@ -612,7 +613,7 @@ ctf_write_uploaded_tp (struct trace_file_writer *self,
u32 = VEC_length (char_ptr, tp->cmd_strings);
ctf_save_align_write (&writer->tcs, (gdb_byte *) &u32, 4, 4);
for (a = 0; VEC_iterate (char_ptr, tp->cmd_strings, a, act); ++a)
- ctf_save_write (&writer->tcs, act, strlen (act) + 1);
+ ctf_save_write (&writer->tcs, (gdb_byte *) act, strlen (act) + 1);
}