This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[gold][patch] Minor plugin API fixes


This patch changes the char *format parameter in the message API to
const char *, and fixes a mismatch where the transfer vector was
allocated with new[] but deleted with plain delete.

Committed as trivial and obvious, respectively.

-cary


gold/ChangeLog:

	* plugin.cc (ld_plugin_message): Change format parameter to const.
	Fix mismatch between new[] and delete.

include/ChangeLog:

	* plugin-api.h (ld_plugin_message): Change format parameter to const.


Index: include/plugin-api.h
===================================================================
RCS file: /cvs/src/src/include/plugin-api.h,v
retrieving revision 1.3
diff -u -p -r1.3 plugin-api.h
--- include/plugin-api.h	1 Dec 2008 19:05:46 -0000	1.3
+++ include/plugin-api.h	1 Dec 2008 19:26:41 -0000
@@ -182,7 +182,7 @@ enum ld_plugin_status

 typedef
 enum ld_plugin_status
-(*ld_plugin_message) (int level, char *format, ...);
+(*ld_plugin_message) (int level, const char *format, ...);

 enum ld_plugin_level
 {
Index: gold/plugin.cc
===================================================================
RCS file: /cvs/src/src/gold/plugin.cc,v
retrieving revision 1.2
diff -u -p -r1.2 plugin.cc
--- gold/plugin.cc	2 Oct 2008 18:35:51 -0000	1.2
+++ gold/plugin.cc	1 Dec 2008 19:26:41 -0000
@@ -68,7 +68,7 @@ static enum ld_plugin_status
 add_input_file(char *pathname);

 static enum ld_plugin_status
-message(int level, char *format, ...);
+message(int level, const char *format, ...);

 };

@@ -194,7 +194,7 @@ Plugin::load()
   // Call the onload entry point.
   (*onload)(tv);

-  delete tv;
+  delete[] tv;
 #endif // ENABLE_PLUGINS
 }

@@ -892,7 +892,7 @@ add_input_file(char *pathname)
 // Issue a diagnostic message from a plugin.

 static enum ld_plugin_status
-message(int level, char * format, ...)
+message(int level, const char * format, ...)
 {
   va_list args;
   va_start(args, format);


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