This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Add some const-ness to py-cmd.c
- From: Doug Evans <xdje42 at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 08 Dec 2013 00:04:35 -0800
- Subject: [PATCH] Add some const-ness to py-cmd.c
- Authentication-results: sourceware.org; auth=none
Hi.
When can we drop support for older Python versions?
2013-12-08 Doug Evans <xdje42@gmail.com>
* python/py-cmd.c (struct cmdpy_completer): Add comment.
(completers): Make const.
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index c0e9d96..c845c7c 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -32,13 +32,15 @@
/* Struct representing built-in completion types. */
struct cmdpy_completer
{
- /* Python symbol name. */
+ /* Python symbol name.
+ This isn't a const char * for Python 2.4's sake.
+ PyModule_AddIntConstant only takes a char *, sigh. */
char *name;
/* Completion function. */
completer_ftype *completer;
};
-static struct cmdpy_completer completers[] =
+static const struct cmdpy_completer completers[] =
{
{ "COMPLETE_NONE", noop_completer },
{ "COMPLETE_FILENAME", filename_completer },