• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisãof938677d425cd0453e26f7f51d9e94c87c92a25d (tree)
Hora2017-09-27 23:44:55
AutorTom Tromey <tom@trom...>
CommiterTom Tromey

Mensagem de Log

Constify some commands in btrace.c

gdb/ChangeLog
2017-09-27 Tom Tromey <tom@tromey.com>

* btrace.c (get_uint, get_context_size, no_chunk)
(maint_btrace_packet_history_cmd)
(maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd)
(maint_info_btrace_cmd): Constify.

Mudança Sumário

Diff

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
11 2017-09-27 Tom Tromey <tom@tromey.com>
22
3+ * btrace.c (get_uint, get_context_size, no_chunk)
4+ (maint_btrace_packet_history_cmd)
5+ (maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd)
6+ (maint_info_btrace_cmd): Constify.
7+
8+2017-09-27 Tom Tromey <tom@tromey.com>
9+
310 * reverse.c (delete_bookmark_command): Constify.
411
512 2017-09-27 Tom Tromey <tom@tromey.com>
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -3180,9 +3180,10 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo,
31803180 /* Read a number from an argument string. */
31813181
31823182 static unsigned int
3183-get_uint (char **arg)
3183+get_uint (const char **arg)
31843184 {
3185- char *begin, *end, *pos;
3185+ const char *begin, *pos;
3186+ char *end;
31863187 unsigned long number;
31873188
31883189 begin = *arg;
@@ -3203,23 +3204,23 @@ get_uint (char **arg)
32033204 /* Read a context size from an argument string. */
32043205
32053206 static int
3206-get_context_size (char **arg)
3207+get_context_size (const char **arg)
32073208 {
3208- char *pos;
3209- int number;
3210-
3211- pos = skip_spaces (*arg);
3209+ const char *pos = skip_spaces (*arg);
32123210
32133211 if (!isdigit (*pos))
32143212 error (_("Expected positive number, got: %s."), pos);
32153213
3216- return strtol (pos, arg, 10);
3214+ char *end;
3215+ long result = strtol (pos, &end, 10);
3216+ *arg = end;
3217+ return result;
32173218 }
32183219
32193220 /* Complain about junk at the end of an argument string. */
32203221
32213222 static void
3222-no_chunk (char *arg)
3223+no_chunk (const char *arg)
32233224 {
32243225 if (*arg != 0)
32253226 error (_("Junk after argument: %s."), arg);
@@ -3228,7 +3229,7 @@ no_chunk (char *arg)
32283229 /* The "maintenance btrace packet-history" command. */
32293230
32303231 static void
3231-maint_btrace_packet_history_cmd (char *arg, int from_tty)
3232+maint_btrace_packet_history_cmd (const char *arg, int from_tty)
32323233 {
32333234 struct btrace_thread_info *btinfo;
32343235 struct thread_info *tp;
@@ -3333,7 +3334,7 @@ maint_btrace_packet_history_cmd (char *arg, int from_tty)
33333334 /* The "maintenance btrace clear-packet-history" command. */
33343335
33353336 static void
3336-maint_btrace_clear_packet_history_cmd (char *args, int from_tty)
3337+maint_btrace_clear_packet_history_cmd (const char *args, int from_tty)
33373338 {
33383339 struct btrace_thread_info *btinfo;
33393340 struct thread_info *tp;
@@ -3355,7 +3356,7 @@ maint_btrace_clear_packet_history_cmd (char *args, int from_tty)
33553356 /* The "maintenance btrace clear" command. */
33563357
33573358 static void
3358-maint_btrace_clear_cmd (char *args, int from_tty)
3359+maint_btrace_clear_cmd (const char *args, int from_tty)
33593360 {
33603361 struct btrace_thread_info *btinfo;
33613362 struct thread_info *tp;
@@ -3418,7 +3419,7 @@ maint_btrace_pt_show_cmd (char *args, int from_tty)
34183419 /* The "maintenance info btrace" command. */
34193420
34203421 static void
3421-maint_info_btrace_cmd (char *args, int from_tty)
3422+maint_info_btrace_cmd (const char *args, int from_tty)
34223423 {
34233424 struct btrace_thread_info *btinfo;
34243425 struct thread_info *tp;