This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] Constify some parameters like varstring
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 14 Jun 2010 10:28:24 +0200
- Subject: [obv] Constify some parameters like varstring
Hi,
I found a problem with some offtrunk patch needing `(char *)' cast so I rather
changed the prototypes to accept `(const char *)'.
Checked-in as obvious.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2010-06/msg00103.html
--- src/gdb/ChangeLog 2010/06/12 00:05:20 1.11898
+++ src/gdb/ChangeLog 2010/06/14 08:26:54 1.11899
@@ -1,3 +1,21 @@
+2010-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * ada-lang.h (ada_print_type): Make varstring const.
+ * ada-typeprint.c (print_func_type): Make name const.
+ (ada_print_type): Make varstring const.
+ * c-lang.h (c_print_type): Make varstring const.
+ * c-typeprint.c (c_print_type): Likewise.
+ * f-lang.h (f_print_type): Likewise.
+ * f-typeprint.c (f_print_type): Likewise.
+ * jv-lang.h (java_print_type): Likewise.
+ * jv-typeprint.c (java_print_type): Likewise.
+ * language.c (unk_lang_print_type): Likewise.
+ * language.h (struct language_defn) <la_print_type>: Likewise.
+ * m2-lang.h (m2_print_type): Likewise.
+ * m2-typeprint.c (m2_print_type): Likewise.
+ * p-lang.h (pascal_print_type): Likewise.
+ * p-typeprint.c (pascal_print_type): Likewise.
+
2010-06-11 Stan Shebs <stan@codesourcery.com>
Add per-operation permission flags.
--- src/gdb/ada-lang.h 2010/06/11 15:36:02 1.56
+++ src/gdb/ada-lang.h 2010/06/14 08:26:56 1.57
@@ -156,7 +156,7 @@
extern void ada_error (char *); /* Defined in ada-exp.y */
/* Defined in ada-typeprint.c */
-extern void ada_print_type (struct type *, char *, struct ui_file *, int,
+extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
int);
extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
--- src/gdb/ada-typeprint.c 2010/05/18 19:23:37 1.35
+++ src/gdb/ada-typeprint.c 2010/06/14 08:26:56 1.36
@@ -664,7 +664,7 @@
for function or procedure NAME if NAME is not null. */
static void
-print_func_type (struct type *type, struct ui_file *stream, char *name)
+print_func_type (struct type *type, struct ui_file *stream, const char *name)
{
int i, len = TYPE_NFIELDS (type);
@@ -714,8 +714,8 @@
LEVEL indicates level of recursion (for nested definitions). */
void
-ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
- int show, int level)
+ada_print_type (struct type *type0, const char *varstring,
+ struct ui_file *stream, int show, int level)
{
struct type *type = ada_check_typedef (ada_get_base_type (type0));
char *type_name = decoded_type_name (type0);
--- src/gdb/c-lang.h 2010/06/11 15:36:04 1.29
+++ src/gdb/c-lang.h 2010/06/14 08:26:56 1.30
@@ -63,7 +63,7 @@
extern int c_parse_escape (char **, struct obstack *);
/* Defined in c-typeprint.c */
-extern void c_print_type (struct type *, char *, struct ui_file *, int,
+extern void c_print_type (struct type *, const char *, struct ui_file *, int,
int);
extern void c_print_typedef (struct type *, struct symbol *, struct ui_file *);
--- src/gdb/c-typeprint.c 2010/05/13 23:53:32 1.56
+++ src/gdb/c-typeprint.c 2010/06/14 08:26:56 1.57
@@ -56,7 +56,7 @@
/* LEVEL is the depth to indent lines by. */
void
-c_print_type (struct type *type, char *varstring, struct ui_file *stream,
+c_print_type (struct type *type, const char *varstring, struct ui_file *stream,
int show, int level)
{
enum type_code code;
--- src/gdb/f-lang.h 2010/06/11 15:36:04 1.18
+++ src/gdb/f-lang.h 2010/06/14 08:26:56 1.19
@@ -25,7 +25,7 @@
extern void f_error (char *); /* Defined in f-exp.y */
-extern void f_print_type (struct type *, char *, struct ui_file *, int,
+extern void f_print_type (struct type *, const char *, struct ui_file *, int,
int);
extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
--- src/gdb/f-typeprint.c 2010/06/02 22:41:55 1.31
+++ src/gdb/f-typeprint.c 2010/06/14 08:26:56 1.32
@@ -52,7 +52,7 @@
/* LEVEL is the depth to indent lines by. */
void
-f_print_type (struct type *type, char *varstring, struct ui_file *stream,
+f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
int show, int level)
{
enum type_code code;
--- src/gdb/jv-lang.h 2010/06/11 15:36:04 1.16
+++ src/gdb/jv-lang.h 2010/06/14 08:26:56 1.17
@@ -69,7 +69,7 @@
extern int is_object_type (struct type *);
/* Defined in jv-typeprint.c */
-extern void java_print_type (struct type *, char *, struct ui_file *, int,
+extern void java_print_type (struct type *, const char *, struct ui_file *, int,
int);
extern char *java_demangle_type_signature (char *);
--- src/gdb/jv-typeprint.c 2010/05/14 23:41:04 1.19
+++ src/gdb/jv-typeprint.c 2010/06/14 08:26:56 1.20
@@ -332,8 +332,8 @@
int, int, int);
void
-java_print_type (struct type *type, char *varstring, struct ui_file *stream,
- int show, int level)
+java_print_type (struct type *type, const char *varstring,
+ struct ui_file *stream, int show, int level)
{
int demangled_args;
--- src/gdb/language.c 2010/06/11 15:36:04 1.97
+++ src/gdb/language.c 2010/06/14 08:26:56 1.98
@@ -64,7 +64,7 @@
static void unk_lang_printchar (int c, struct type *type,
struct ui_file *stream);
-static void unk_lang_print_type (struct type *, char *, struct ui_file *,
+static void unk_lang_print_type (struct type *, const char *, struct ui_file *,
int, int);
static int unk_lang_value_print (struct value *, struct ui_file *,
@@ -1097,8 +1097,8 @@
}
static void
-unk_lang_print_type (struct type *type, char *varstring, struct ui_file *stream,
- int show, int level)
+unk_lang_print_type (struct type *type, const char *varstring,
+ struct ui_file *stream, int show, int level)
{
error (_("internal error - unimplemented function unk_lang_print_type called."));
}
--- src/gdb/language.h 2010/06/11 15:36:04 1.67
+++ src/gdb/language.h 2010/06/14 08:26:56 1.68
@@ -198,7 +198,7 @@
/* Print a type using syntax appropriate for this language. */
- void (*la_print_type) (struct type *, char *, struct ui_file *, int,
+ void (*la_print_type) (struct type *, const char *, struct ui_file *, int,
int);
/* Print a typedef using syntax appropriate for this language.
--- src/gdb/m2-lang.h 2010/06/11 15:36:04 1.17
+++ src/gdb/m2-lang.h 2010/06/14 08:26:57 1.18
@@ -23,7 +23,7 @@
extern void m2_error (char *); /* Defined in m2-exp.y */
/* Defined in m2-typeprint.c */
-extern void m2_print_type (struct type *, char *, struct ui_file *, int,
+extern void m2_print_type (struct type *, const char *, struct ui_file *, int,
int);
extern void m2_print_typedef (struct type *, struct symbol *,
--- src/gdb/m2-typeprint.c 2010/05/07 00:28:32 1.25
+++ src/gdb/m2-typeprint.c 2010/06/14 08:26:57 1.26
@@ -67,7 +67,7 @@
void
-m2_print_type (struct type *type, char *varstring, struct ui_file *stream,
+m2_print_type (struct type *type, const char *varstring, struct ui_file *stream,
int show, int level)
{
enum type_code code;
--- src/gdb/p-lang.h 2010/06/11 15:36:04 1.22
+++ src/gdb/p-lang.h 2010/06/14 08:26:57 1.23
@@ -30,7 +30,8 @@
extern void pascal_error (char *); /* Defined in p-exp.y */
/* Defined in p-typeprint.c */
-extern void pascal_print_type (struct type *, char *, struct ui_file *, int, int);
+extern void pascal_print_type (struct type *, const char *, struct ui_file *,
+ int, int);
extern void pascal_print_typedef (struct type *, struct symbol *,
struct ui_file *);
--- src/gdb/p-typeprint.c 2010/05/16 01:27:02 1.32
+++ src/gdb/p-typeprint.c 2010/06/14 08:26:57 1.33
@@ -46,8 +46,8 @@
/* LEVEL is the depth to indent lines by. */
void
-pascal_print_type (struct type *type, char *varstring, struct ui_file *stream,
- int show, int level)
+pascal_print_type (struct type *type, const char *varstring,
+ struct ui_file *stream, int show, int level)
{
enum type_code code;
int demangled_args;