mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Make argv non-const char *
This commit is contained in:
@@ -138,12 +138,12 @@ NB_MODULE(_pipebox, m) {
|
||||
static std::vector<std::string> Args = { "" };
|
||||
append(ArgVector, Args);
|
||||
|
||||
static std::vector<const char *> Argv;
|
||||
for (const std::string &String : Args)
|
||||
Argv.push_back(String.c_str());
|
||||
static std::vector<char *> Argv;
|
||||
for (std::string &String : Args)
|
||||
Argv.push_back(&String[0]);
|
||||
|
||||
static int Argc = Argv.size();
|
||||
static const char **ArgvPtr = Argv.data();
|
||||
static char **ArgvPtr = Argv.data();
|
||||
// use a capsule to call the destructor when the Python module is unloaded
|
||||
m.attr("__init_revng__") = makeCapsule<revng::InitRevng>(Argc, ArgvPtr, "");
|
||||
|
||||
|
||||
@@ -150,8 +150,9 @@ static bool _rp_initialize(int argc,
|
||||
}
|
||||
|
||||
revng_check(not InitRevngInstance.has_value());
|
||||
char **MutableArgv = const_cast<char **>(argv);
|
||||
InitRevngInstance.emplace(argc,
|
||||
argv,
|
||||
MutableArgv,
|
||||
"",
|
||||
llvm::ArrayRef<llvm::cl::OptionCategory *>());
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ static list<std::string> Arguments(Positional,
|
||||
|
||||
} // namespace Options
|
||||
|
||||
int main(int Argc, const char *Argv[]) {
|
||||
int main(int Argc, char *Argv[]) {
|
||||
using namespace revng::pypeline;
|
||||
using namespace revng::pypeline::helpers::native;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ serializeDependencies(const revng::pypeline::ObjectDependencies &Dependencies,
|
||||
OS << "[]";
|
||||
}
|
||||
|
||||
int main(int Argc, const char *Argv[]) {
|
||||
int main(int Argc, char *Argv[]) {
|
||||
using namespace revng::pypeline;
|
||||
using namespace revng::pypeline::helpers::native;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user