Minor typing/aliasing cleanup
This commit is contained in:
@@ -40,8 +40,8 @@ public:
|
||||
void loadFromFile(const char* filename);
|
||||
bool isValid() const { return (m_maj >= 0) && (m_min >= 0); }
|
||||
|
||||
unsigned int majorVer() const { return m_maj; }
|
||||
unsigned int minorVer() const { return m_min; }
|
||||
int majorVer() const { return m_maj; }
|
||||
int minorVer() const { return m_min; }
|
||||
|
||||
int verCompare(int maj, int min) const
|
||||
{
|
||||
@@ -64,7 +64,7 @@ private:
|
||||
void setVersion(unsigned int magic);
|
||||
|
||||
private:
|
||||
short m_maj, m_min;
|
||||
int m_maj, m_min;
|
||||
bool m_unicode;
|
||||
|
||||
PycRef<PycCode> m_code;
|
||||
|
@@ -151,7 +151,8 @@ bool PycComplex::isEqual(PycRef<PycObject> obj) const
|
||||
/* PycCFloat */
|
||||
void PycCFloat::load(PycData* stream, PycModule*)
|
||||
{
|
||||
m_value_i64 = stream->get64();
|
||||
Pyc_INT64 bits = stream->get64();
|
||||
memcpy(&m_value, &bits, sizeof(bits));
|
||||
}
|
||||
|
||||
|
||||
@@ -159,5 +160,6 @@ void PycCFloat::load(PycData* stream, PycModule*)
|
||||
void PycCComplex::load(PycData* stream, PycModule* mod)
|
||||
{
|
||||
PycCFloat::load(stream, mod);
|
||||
m_imag_i64 = stream->get64();
|
||||
Pyc_INT64 bits = stream->get64();
|
||||
memcpy(&m_imag, &bits, sizeof(bits));
|
||||
}
|
||||
|
@@ -94,11 +94,7 @@ public:
|
||||
double value() const { return m_value; }
|
||||
|
||||
private:
|
||||
union
|
||||
{
|
||||
Pyc_INT64 m_value_i64;
|
||||
double m_value;
|
||||
};
|
||||
double m_value;
|
||||
};
|
||||
|
||||
class PycCComplex : public PycCFloat {
|
||||
@@ -117,11 +113,7 @@ public:
|
||||
double imag() const { return m_imag; }
|
||||
|
||||
private:
|
||||
union
|
||||
{
|
||||
Pyc_INT64 m_imag_i64;
|
||||
double m_imag;
|
||||
};
|
||||
double m_imag;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -28,19 +28,19 @@ PycRef<PycObject> CreateObject(int type)
|
||||
case PycObject::TYPE_ELLIPSIS:
|
||||
return Pyc_Ellipsis;
|
||||
case PycObject::TYPE_INT:
|
||||
return new PycInt();
|
||||
return new PycInt(type);
|
||||
case PycObject::TYPE_INT64:
|
||||
return new PycLong(type);
|
||||
case PycObject::TYPE_FLOAT:
|
||||
return new PycFloat();
|
||||
return new PycFloat(type);
|
||||
case PycObject::TYPE_BINARY_FLOAT:
|
||||
return new PycCFloat();
|
||||
return new PycCFloat(type);
|
||||
case PycObject::TYPE_COMPLEX:
|
||||
return new PycComplex();
|
||||
return new PycComplex(type);
|
||||
case PycObject::TYPE_BINARY_COMPLEX:
|
||||
return new PycCComplex();
|
||||
return new PycCComplex(type);
|
||||
case PycObject::TYPE_LONG:
|
||||
return new PycLong();
|
||||
return new PycLong(type);
|
||||
case PycObject::TYPE_STRING:
|
||||
case PycObject::TYPE_INTERNED:
|
||||
case PycObject::TYPE_STRINGREF:
|
||||
@@ -54,12 +54,12 @@ PycRef<PycObject> CreateObject(int type)
|
||||
case PycObject::TYPE_SMALL_TUPLE:
|
||||
return new PycTuple(type);
|
||||
case PycObject::TYPE_LIST:
|
||||
return new PycList();
|
||||
return new PycList(type);
|
||||
case PycObject::TYPE_DICT:
|
||||
return new PycDict();
|
||||
return new PycDict(type);
|
||||
case PycObject::TYPE_CODE:
|
||||
case PycObject::TYPE_CODE2:
|
||||
return new PycCode();
|
||||
return new PycCode(type);
|
||||
case PycObject::TYPE_SET:
|
||||
case PycObject::TYPE_FROZENSET:
|
||||
return new PycSet(type);
|
||||
|
Reference in New Issue
Block a user