This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: fix buglet in language_class_name_from_physname


I am checking this in.

An error crept into language_class_name_from_physname via a reformatting
patch -- one of the arguments was renamed, but because the old argument
name shadowed a global, we didn't notice that the uses in the body of
the function were not also renamed.

This patch fixes the code to work as it did before.  I renamed the
argument name to be more clear.

Tom

2011-02-22  Tom Tromey  <tromey@redhat.com>

	* language.c (language_class_name_from_physname): Rename
	'curr_language' argument to 'lang'; use in body.

Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.101
diff -u -r1.101 language.c
--- language.c	9 Jan 2011 03:08:57 -0000	1.101
+++ language.c	22 Feb 2011 18:47:09 -0000
@@ -1014,12 +1014,11 @@
 
 /* Return class name from physname or NULL.  */
 char *
-language_class_name_from_physname (const struct language_defn *curr_language,
+language_class_name_from_physname (const struct language_defn *lang,
 				   const char *physname)
 {
-  if (current_language != NULL
-      && current_language->la_class_name_from_physname)
-    return current_language->la_class_name_from_physname (physname);
+  if (lang != NULL && lang->la_class_name_from_physname)
+    return lang->la_class_name_from_physname (physname);
   return NULL;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]