[cfe-commits] r92923 - /cfe/trunk/lib/Frontend/InitPreprocessor.cpp
Kovarththanan Rajaratnam
kovarththanan.rajaratnam at gmail.com
Thu Jan 7 10:11:15 PST 2010
Author: krj
Date: Thu Jan 7 12:11:14 2010
New Revision: 92923
URL: http://llvm.org/viewvc/llvm-project?rev=92923&view=rev
Log:
Convert from char pointer to char array
Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=92923&r1=92922&r2=92923&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Thu Jan 7 12:11:14 2010
@@ -30,7 +30,7 @@
// "#define XXX Y z W". To get a #define with no value, use "XXX=".
static void DefineBuiltinMacro(std::vector<char> &Buf, const char *Macro,
Diagnostic *Diags = 0) {
- const char *Command = "#define ";
+ const char Command[] = "#define ";
Buf.insert(Buf.end(), Command, Command+strlen(Command));
if (const char *Equal = strchr(Macro, '=')) {
// Turn the = into ' '.
@@ -61,7 +61,7 @@
// and we emit "#undef XXX".
static void UndefineBuiltinMacro(std::vector<char> &Buf, const char *Macro) {
// Push "macroname".
- const char *Command = "#undef ";
+ const char Command[] = "#undef ";
Buf.insert(Buf.end(), Command, Command+strlen(Command));
Buf.insert(Buf.end(), Macro, Macro+strlen(Macro));
Buf.push_back('\n');
@@ -98,16 +98,16 @@
/// predefines buffer.
static void AddImplicitInclude(std::vector<char> &Buf,
const std::string &File) {
- const char *Inc = "#include ";
- Buf.insert(Buf.end(), Inc, Inc+strlen(Inc));
+ const char Command[] = "#include ";
+ Buf.insert(Buf.end(), Command, Command+strlen(Command));
AddQuotedIncludePath(Buf, File);
Buf.push_back('\n');
}
static void AddImplicitIncludeMacros(std::vector<char> &Buf,
const std::string &File) {
- const char *Inc = "#__include_macros ";
- Buf.insert(Buf.end(), Inc, Inc+strlen(Inc));
+ const char Command[] = "#__include_macros ";
+ Buf.insert(Buf.end(), Command, Command+strlen(Command));
AddQuotedIncludePath(Buf, File);
Buf.push_back('\n');
// Marker token to stop the __include_macros fetch loop.
More information about the cfe-commits
mailing list