Style changes
This commit is contained in:
@@ -202,7 +202,8 @@ void PycModule::loadFromFile(const char* filename)
|
||||
m_code = LoadObject(&in, this).require_cast<PycCode>();
|
||||
}
|
||||
|
||||
void PycModule::loadFromMarshalledFile(const char* filename, int major, int minor) {
|
||||
void PycModule::loadFromMarshalledFile(const char* filename, int major, int minor)
|
||||
{
|
||||
PycFile in (filename);
|
||||
if (!in.isOpen()) {
|
||||
fprintf(stderr, "Error opening file %s\n", filename);
|
||||
@@ -214,8 +215,6 @@ void PycModule::loadFromMarshalledFile(const char* filename, int major, int mino
|
||||
return;
|
||||
}
|
||||
setVersion(magic);
|
||||
m_maj = major;
|
||||
m_min = minor;
|
||||
m_code = LoadObject(&in, this).require_cast<PycCode>();
|
||||
}
|
||||
|
||||
@@ -248,7 +247,8 @@ PycRef<PycObject> PycModule::getRef(int ref) const
|
||||
#define enumVariant(mj, mn) case mn: \
|
||||
return PycMagic::MAGIC_ ## mj ## _ ## mn
|
||||
|
||||
PycMagic version_to_magic(int major, int minor) {
|
||||
PycMagic version_to_magic(int major, int minor)
|
||||
{
|
||||
switch (major) {
|
||||
case 1:
|
||||
switch (minor) {
|
||||
@@ -290,5 +290,5 @@ PycMagic version_to_magic(int major, int minor) {
|
||||
default:
|
||||
return PycMagic::INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
#undef enumVariant
|
@@ -264,7 +264,7 @@ int main(int argc, char* argv[])
|
||||
fputs("Options:\n", stderr);
|
||||
fputs(" -o <filename> Write output to <filename> (default: stdout)\n", stderr);
|
||||
fputs(" -c Specify loading a compiled code object. Requires the version to be set\n", stderr);
|
||||
fputs(" -v <x.y> Specify a Python version\n", stderr);
|
||||
fputs(" -v <x.y> Specify a Python version for loading a compiled code object\n", stderr);
|
||||
fputs(" --help Show this help text and then exit\n", stderr);
|
||||
return 0;
|
||||
} else {
|
||||
@@ -293,7 +293,7 @@ int main(int argc, char* argv[])
|
||||
std::string s(version);
|
||||
auto dot = s.find('.');
|
||||
if (dot == std::string::npos || dot == s.size()-1) {
|
||||
fputs("Unable to read version string (use the format x.y)\n", stderr);
|
||||
fputs("Unable to parse version string (use the format x.y)\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
int major = std::stoi(s.substr(0, dot));
|
||||
|
@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
|
||||
fputs("Options:\n", stderr);
|
||||
fputs(" -o <filename> Write output to <filename> (default: stdout)\n", stderr);
|
||||
fputs(" -c Specify loading a compiled code object. Requires the version to be set\n", stderr);
|
||||
fputs(" -v <x.y> Specify a Python version\n", stderr);
|
||||
fputs(" -v <x.y> Specify a Python version for loading a compiled code object\n", stderr);
|
||||
fputs(" --help Show this help text and then exit\n", stderr);
|
||||
return 0;
|
||||
} else {
|
||||
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
|
||||
std::string s(version);
|
||||
auto dot = s.find('.');
|
||||
if (dot == std::string::npos || dot == s.size()-1) {
|
||||
fputs("Unable to read version string (use the format x.y)\n", stderr);
|
||||
fputs("Unable to parse version string (use the format x.y)\n", stderr);
|
||||
return 1;
|
||||
}
|
||||
int major = std::stoi(s.substr(0, dot));
|
||||
|
Reference in New Issue
Block a user