diff --git a/direct/src/dcparser/dcLexer.cxx.prebuilt b/direct/src/dcparser/dcLexer.cxx.prebuilt index c2f607f519..f99b920f81 100644 --- a/direct/src/dcparser/dcLexer.cxx.prebuilt +++ b/direct/src/dcparser/dcLexer.cxx.prebuilt @@ -1550,7 +1550,7 @@ YY_RULE_SETUP dcyylval.u.uint64 = 0; const char *p = dcyytext; while (*p != '\0') { - PN_uint64 next_value = dcyylval.u.uint64 * 10; + uint64_t next_value = dcyylval.u.uint64 * 10; if (next_value < dcyylval.u.uint64) { dcyyerror("Number out of range."); dcyylval.u.uint64 = 1; @@ -1583,9 +1583,9 @@ YY_RULE_SETUP ++p; } - PN_uint64 value = 0; + uint64_t value = 0; while (*p != '\0') { - PN_uint64 next_value = value * 10; + uint64_t next_value = value * 10; if (next_value < value) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; @@ -1597,13 +1597,13 @@ YY_RULE_SETUP } if (neg) { - dcyylval.u.int64 = -(PN_int64)value; + dcyylval.u.int64 = -(int64_t)value; if (dcyylval.u.int64 > 0) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; } } else { - dcyylval.u.int64 = (PN_int64)value; + dcyylval.u.int64 = (int64_t)value; if (dcyylval.u.int64 < 0) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; @@ -1625,7 +1625,7 @@ YY_RULE_SETUP dcyylval.u.uint64 = 0; const char *p = dcyytext + 2; while (*p != '\0') { - PN_uint64 next_value = dcyylval.u.uint64 * 16; + uint64_t next_value = dcyylval.u.uint64 * 16; if (next_value < dcyylval.u.uint64) { dcyyerror("Number out of range."); dcyylval.u.uint64 = 1; diff --git a/direct/src/dcparser/dcLexer.lxx b/direct/src/dcparser/dcLexer.lxx index e6ce9ec44d..4dbd18299d 100644 --- a/direct/src/dcparser/dcLexer.lxx +++ b/direct/src/dcparser/dcLexer.lxx @@ -612,7 +612,7 @@ REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?) dcyylval.u.uint64 = 0; const char *p = dcyytext; while (*p != '\0') { - PN_uint64 next_value = dcyylval.u.uint64 * 10; + uint64_t next_value = dcyylval.u.uint64 * 10; if (next_value < dcyylval.u.uint64) { dcyyerror("Number out of range."); dcyylval.u.uint64 = 1; @@ -642,9 +642,9 @@ REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?) ++p; } - PN_uint64 value = 0; + uint64_t value = 0; while (*p != '\0') { - PN_uint64 next_value = value * 10; + uint64_t next_value = value * 10; if (next_value < value) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; @@ -656,13 +656,13 @@ REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?) } if (neg) { - dcyylval.u.int64 = -(PN_int64)value; + dcyylval.u.int64 = -(int64_t)value; if (dcyylval.u.int64 > 0) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; } } else { - dcyylval.u.int64 = (PN_int64)value; + dcyylval.u.int64 = (int64_t)value; if (dcyylval.u.int64 < 0) { dcyyerror("Number out of range."); dcyylval.u.int64 = 1; @@ -681,7 +681,7 @@ REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?) dcyylval.u.uint64 = 0; const char *p = dcyytext + 2; while (*p != '\0') { - PN_uint64 next_value = dcyylval.u.uint64 * 16; + uint64_t next_value = dcyylval.u.uint64 * 16; if (next_value < dcyylval.u.uint64) { dcyyerror("Number out of range."); dcyylval.u.uint64 = 1; diff --git a/direct/src/dcparser/dcNumericRange.h b/direct/src/dcparser/dcNumericRange.h index f872f39a7a..6539c05422 100644 --- a/direct/src/dcparser/dcNumericRange.h +++ b/direct/src/dcparser/dcNumericRange.h @@ -71,8 +71,8 @@ private: typedef DCNumericRange DCIntRange; typedef DCNumericRange DCUnsignedIntRange; -typedef DCNumericRange DCInt64Range; -typedef DCNumericRange DCUnsignedInt64Range; +typedef DCNumericRange DCInt64Range; +typedef DCNumericRange DCUnsignedInt64Range; typedef DCNumericRange DCDoubleRange; #endif diff --git a/direct/src/dcparser/dcPacker.I b/direct/src/dcparser/dcPacker.I index bb9a10daf9..c159b0cb77 100644 --- a/direct/src/dcparser/dcPacker.I +++ b/direct/src/dcparser/dcPacker.I @@ -178,7 +178,7 @@ pack_uint(unsigned int value) { * Packs the indicated numeric or string value into the stream. */ INLINE void DCPacker:: -pack_int64(PN_int64 value) { +pack_int64(int64_t value) { nassertv(_mode == M_pack || _mode == M_repack); if (_current_field == NULL) { _pack_error = true; @@ -192,7 +192,7 @@ pack_int64(PN_int64 value) { * Packs the indicated numeric or string value into the stream. */ INLINE void DCPacker:: -pack_uint64(PN_uint64 value) { +pack_uint64(uint64_t value) { nassertv(_mode == M_pack || _mode == M_repack); if (_current_field == NULL) { _pack_error = true; @@ -291,9 +291,9 @@ unpack_uint() { /** * Unpacks the current numeric or string value from the stream. */ -INLINE PN_int64 DCPacker:: +INLINE int64_t DCPacker:: unpack_int64() { - PN_int64 value = 0; + int64_t value = 0; nassertr(_mode == M_unpack, value); if (_current_field == NULL) { _pack_error = true; @@ -310,9 +310,9 @@ unpack_int64() { /** * Unpacks the current numeric or string value from the stream. */ -INLINE PN_uint64 DCPacker:: +INLINE uint64_t DCPacker:: unpack_uint64() { - PN_uint64 value = 0; + uint64_t value = 0; nassertr(_mode == M_unpack, value); if (_current_field == NULL) { _pack_error = true; @@ -409,7 +409,7 @@ unpack_uint(unsigned int &value) { * Unpacks the current numeric or string value from the stream. */ INLINE void DCPacker:: -unpack_int64(PN_int64 &value) { +unpack_int64(int64_t &value) { nassertv(_mode == M_unpack); if (_current_field == NULL) { _pack_error = true; @@ -425,7 +425,7 @@ unpack_int64(PN_int64 &value) { * Unpacks the current numeric or string value from the stream. */ INLINE void DCPacker:: -unpack_uint64(PN_uint64 &value) { +unpack_uint64(uint64_t &value) { nassertv(_mode == M_unpack); if (_current_field == NULL) { _pack_error = true; @@ -668,7 +668,7 @@ raw_pack_int32(int value) { * Packs the data into the buffer between packing sessions. */ INLINE void DCPacker:: -raw_pack_int64(PN_int64 value) { +raw_pack_int64(int64_t value) { nassertv(_mode == M_idle); DCPackerInterface::do_pack_int64(_pack_data.get_write_pointer(8), value); } @@ -704,7 +704,7 @@ raw_pack_uint32(unsigned int value) { * Packs the data into the buffer between packing sessions. */ INLINE void DCPacker:: -raw_pack_uint64(PN_uint64 value) { +raw_pack_uint64(uint64_t value) { nassertv(_mode == M_idle); DCPackerInterface::do_pack_uint64(_pack_data.get_write_pointer(8), value); } @@ -761,9 +761,9 @@ raw_unpack_int32() { /** * Unpacks the data from the buffer between unpacking sessions. */ -INLINE PN_int64 DCPacker:: +INLINE int64_t DCPacker:: raw_unpack_int64() { - PN_int64 value = 0; + int64_t value = 0; raw_unpack_int64(value); return value; } @@ -843,9 +843,9 @@ raw_unpack_uint32() { /** * Unpacks the data from the buffer between unpacking sessions. */ -INLINE PN_uint64 DCPacker:: +INLINE uint64_t DCPacker:: raw_unpack_uint64() { - PN_uint64 value = 0; + uint64_t value = 0; raw_unpack_uint64(value); return value; } @@ -874,7 +874,7 @@ raw_unpack_string() { * Unpacks the data from the buffer between unpacking sessions. */ INLINE void DCPacker:: -raw_unpack_int64(PN_int64 &value) { +raw_unpack_int64(int64_t &value) { nassertv(_mode == M_idle && _unpack_data != NULL); if (_unpack_p + 8 > _unpack_length) { _pack_error = true; @@ -930,7 +930,7 @@ raw_unpack_uint32(unsigned int &value) { * Unpacks the data from the buffer between unpacking sessions. */ INLINE void DCPacker:: -raw_unpack_uint64(PN_uint64 &value) { +raw_unpack_uint64(uint64_t &value) { nassertv(_mode == M_idle && _unpack_data != NULL); if (_unpack_p + 8 > _unpack_length) { _pack_error = true; diff --git a/direct/src/dcparser/dcPacker.cxx b/direct/src/dcparser/dcPacker.cxx index 6b789c945c..fe3461a6c1 100644 --- a/direct/src/dcparser/dcPacker.cxx +++ b/direct/src/dcparser/dcPacker.cxx @@ -858,14 +858,14 @@ unpack_object() { case PT_int64: { - PN_int64 value = unpack_int64(); + int64_t value = unpack_int64(); object = PyLong_FromLongLong(value); } break; case PT_uint64: { - PN_uint64 value = unpack_uint64(); + uint64_t value = unpack_uint64(); object = PyLong_FromUnsignedLongLong(value); } break; diff --git a/direct/src/dcparser/dcPacker.h b/direct/src/dcparser/dcPacker.h index df391a8e48..049429e0ec 100644 --- a/direct/src/dcparser/dcPacker.h +++ b/direct/src/dcparser/dcPacker.h @@ -72,8 +72,8 @@ PUBLISHED: INLINE void pack_double(double value); INLINE void pack_int(int value); INLINE void pack_uint(unsigned int value); - INLINE void pack_int64(PN_int64 value); - INLINE void pack_uint64(PN_uint64 value); + INLINE void pack_int64(int64_t value); + INLINE void pack_uint64(uint64_t value); INLINE void pack_string(const string &value); INLINE void pack_literal_value(const string &value); void pack_default_value(); @@ -81,8 +81,8 @@ PUBLISHED: INLINE double unpack_double(); INLINE int unpack_int(); INLINE unsigned int unpack_uint(); - INLINE PN_int64 unpack_int64(); - INLINE PN_uint64 unpack_uint64(); + INLINE int64_t unpack_int64(); + INLINE uint64_t unpack_uint64(); INLINE string unpack_string(); INLINE string unpack_literal_value(); void unpack_validate(); @@ -94,8 +94,8 @@ public: INLINE void unpack_double(double &value); INLINE void unpack_int(int &value); INLINE void unpack_uint(unsigned int &value); - INLINE void unpack_int64(PN_int64 &value); - INLINE void unpack_uint64(PN_uint64 &value); + INLINE void unpack_int64(int64_t &value); + INLINE void unpack_uint64(uint64_t &value); INLINE void unpack_string(string &value); INLINE void unpack_literal_value(string &value); @@ -141,11 +141,11 @@ PUBLISHED: INLINE void raw_pack_int8(int value); INLINE void raw_pack_int16(int value); INLINE void raw_pack_int32(int value); - INLINE void raw_pack_int64(PN_int64 value); + INLINE void raw_pack_int64(int64_t value); INLINE void raw_pack_uint8(unsigned int value); INLINE void raw_pack_uint16(unsigned int value); INLINE void raw_pack_uint32(unsigned int value); - INLINE void raw_pack_uint64(PN_uint64 value); + INLINE void raw_pack_uint64(uint64_t value); INLINE void raw_pack_float64(double value); INLINE void raw_pack_string(const string &value); @@ -158,11 +158,11 @@ PUBLISHED: INLINE int raw_unpack_int8(); INLINE int raw_unpack_int16(); INLINE int raw_unpack_int32(); - INLINE PN_int64 raw_unpack_int64(); + INLINE int64_t raw_unpack_int64(); INLINE unsigned int raw_unpack_uint8(); INLINE unsigned int raw_unpack_uint16(); INLINE unsigned int raw_unpack_uint32(); - INLINE PN_uint64 raw_unpack_uint64(); + INLINE uint64_t raw_unpack_uint64(); INLINE double raw_unpack_float64(); INLINE string raw_unpack_string(); @@ -170,11 +170,11 @@ public: INLINE void raw_unpack_int8(int &value); INLINE void raw_unpack_int16(int &value); INLINE void raw_unpack_int32(int &value); - INLINE void raw_unpack_int64(PN_int64 &value); + INLINE void raw_unpack_int64(int64_t &value); INLINE void raw_unpack_uint8(unsigned int &value); INLINE void raw_unpack_uint16(unsigned int &value); INLINE void raw_unpack_uint32(unsigned int &value); - INLINE void raw_unpack_uint64(PN_uint64 &value); + INLINE void raw_unpack_uint64(uint64_t &value); INLINE void raw_unpack_float64(double &value); INLINE void raw_unpack_string(string &value); diff --git a/direct/src/dcparser/dcPackerInterface.I b/direct/src/dcparser/dcPackerInterface.I index e9ab9f2fb8..a97964bc47 100644 --- a/direct/src/dcparser/dcPackerInterface.I +++ b/direct/src/dcparser/dcPackerInterface.I @@ -142,7 +142,7 @@ do_pack_int32(char *buffer, int value) { * */ INLINE void DCPackerInterface:: -do_pack_int64(char *buffer, PN_int64 value) { +do_pack_int64(char *buffer, int64_t value) { buffer[0] = (char)(value & 0xff); buffer[1] = (char)((value >> 8) & 0xff); buffer[2] = (char)((value >> 16) & 0xff); @@ -185,7 +185,7 @@ do_pack_uint32(char *buffer, unsigned int value) { * */ INLINE void DCPackerInterface:: -do_pack_uint64(char *buffer, PN_uint64 value) { +do_pack_uint64(char *buffer, uint64_t value) { buffer[0] = (char)(value & 0xff); buffer[1] = (char)((value >> 8) & 0xff); buffer[2] = (char)((value >> 16) & 0xff); @@ -244,16 +244,16 @@ do_unpack_int32(const char *buffer) { /** * */ -INLINE PN_int64 DCPackerInterface:: +INLINE int64_t DCPackerInterface:: do_unpack_int64(const char *buffer) { - return (PN_int64)((PN_uint64)(unsigned char)buffer[0] | - ((PN_uint64)(unsigned char)buffer[1] << 8) | - ((PN_uint64)(unsigned char)buffer[2] << 16) | - ((PN_uint64)(unsigned char)buffer[3] << 24) | - ((PN_uint64)(unsigned char)buffer[4] << 32) | - ((PN_uint64)(unsigned char)buffer[5] << 40) | - ((PN_uint64)(unsigned char)buffer[6] << 48) | - ((PN_int64)(signed char)buffer[7] << 54)); + return (int64_t)((uint64_t)(unsigned char)buffer[0] | + ((uint64_t)(unsigned char)buffer[1] << 8) | + ((uint64_t)(unsigned char)buffer[2] << 16) | + ((uint64_t)(unsigned char)buffer[3] << 24) | + ((uint64_t)(unsigned char)buffer[4] << 32) | + ((uint64_t)(unsigned char)buffer[5] << 40) | + ((uint64_t)(unsigned char)buffer[6] << 48) | + ((int64_t)(signed char)buffer[7] << 54)); } /** * @@ -286,16 +286,16 @@ do_unpack_uint32(const char *buffer) { /** * */ -INLINE PN_uint64 DCPackerInterface:: +INLINE uint64_t DCPackerInterface:: do_unpack_uint64(const char *buffer) { - return ((PN_uint64)(unsigned char)buffer[0] | - ((PN_uint64)(unsigned char)buffer[1] << 8) | - ((PN_uint64)(unsigned char)buffer[2] << 16) | - ((PN_uint64)(unsigned char)buffer[3] << 24) | - ((PN_uint64)(unsigned char)buffer[4] << 32) | - ((PN_uint64)(unsigned char)buffer[5] << 40) | - ((PN_uint64)(unsigned char)buffer[6] << 48) | - ((PN_int64)(signed char)buffer[7] << 54)); + return ((uint64_t)(unsigned char)buffer[0] | + ((uint64_t)(unsigned char)buffer[1] << 8) | + ((uint64_t)(unsigned char)buffer[2] << 16) | + ((uint64_t)(unsigned char)buffer[3] << 24) | + ((uint64_t)(unsigned char)buffer[4] << 32) | + ((uint64_t)(unsigned char)buffer[5] << 40) | + ((uint64_t)(unsigned char)buffer[6] << 48) | + ((int64_t)(signed char)buffer[7] << 54)); } @@ -342,8 +342,8 @@ validate_int_limits(int value, int num_bits, bool &range_error) { * true if it does not. */ INLINE void DCPackerInterface:: -validate_int64_limits(PN_int64 value, int num_bits, bool &range_error) { - PN_int64 mask = ((PN_int64)1 << (num_bits - 1)) - 1; +validate_int64_limits(int64_t value, int num_bits, bool &range_error) { + int64_t mask = ((int64_t)1 << (num_bits - 1)) - 1; value |= mask; if (value != mask && value != -1) { @@ -373,8 +373,8 @@ validate_uint_limits(unsigned int value, int num_bits, bool &range_error) { * range_error true if it does not. */ INLINE void DCPackerInterface:: -validate_uint64_limits(PN_uint64 value, int num_bits, bool &range_error) { - PN_uint64 mask = ((PN_uint64)1 << num_bits) - 1; +validate_uint64_limits(uint64_t value, int num_bits, bool &range_error) { + uint64_t mask = ((uint64_t)1 << num_bits) - 1; value &= ~mask; if (value != 0) { diff --git a/direct/src/dcparser/dcPackerInterface.cxx b/direct/src/dcparser/dcPackerInterface.cxx index 796d11039a..dc731a479a 100644 --- a/direct/src/dcparser/dcPackerInterface.cxx +++ b/direct/src/dcparser/dcPackerInterface.cxx @@ -226,7 +226,7 @@ pack_uint(DCPackData &, unsigned int, bool &pack_error, bool &) const { * Packs the indicated numeric or string value into the stream. */ void DCPackerInterface:: -pack_int64(DCPackData &, PN_int64, bool &pack_error, bool &) const { +pack_int64(DCPackData &, int64_t, bool &pack_error, bool &) const { pack_error = true; } @@ -234,7 +234,7 @@ pack_int64(DCPackData &, PN_int64, bool &pack_error, bool &) const { * Packs the indicated numeric or string value into the stream. */ void DCPackerInterface:: -pack_uint64(DCPackData &, PN_uint64, bool &pack_error, bool &) const { +pack_uint64(DCPackData &, uint64_t, bool &pack_error, bool &) const { pack_error = true; } @@ -284,7 +284,7 @@ unpack_uint(const char *, size_t, size_t &, unsigned int &, bool &pack_error, bo * Unpacks the current numeric or string value from the stream. */ void DCPackerInterface:: -unpack_int64(const char *, size_t, size_t &, PN_int64 &, bool &pack_error, bool &) const { +unpack_int64(const char *, size_t, size_t &, int64_t &, bool &pack_error, bool &) const { pack_error = true; } @@ -292,7 +292,7 @@ unpack_int64(const char *, size_t, size_t &, PN_int64 &, bool &pack_error, bool * Unpacks the current numeric or string value from the stream. */ void DCPackerInterface:: -unpack_uint64(const char *, size_t, size_t &, PN_uint64 &, bool &pack_error, bool &) const { +unpack_uint64(const char *, size_t, size_t &, uint64_t &, bool &pack_error, bool &) const { pack_error = true; } diff --git a/direct/src/dcparser/dcPackerInterface.h b/direct/src/dcparser/dcPackerInterface.h index 788feb3fe7..eca03d3257 100644 --- a/direct/src/dcparser/dcPackerInterface.h +++ b/direct/src/dcparser/dcPackerInterface.h @@ -107,9 +107,9 @@ public: bool &pack_error, bool &range_error) const; virtual void pack_uint(DCPackData &pack_data, unsigned int value, bool &pack_error, bool &range_error) const; - virtual void pack_int64(DCPackData &pack_data, PN_int64 value, + virtual void pack_int64(DCPackData &pack_data, int64_t value, bool &pack_error, bool &range_error) const; - virtual void pack_uint64(DCPackData &pack_data, PN_uint64 value, + virtual void pack_uint64(DCPackData &pack_data, uint64_t value, bool &pack_error, bool &range_error) const; virtual void pack_string(DCPackData &pack_data, const string &value, bool &pack_error, bool &range_error) const; @@ -122,9 +122,9 @@ public: virtual void unpack_uint(const char *data, size_t length, size_t &p, unsigned int &value, bool &pack_error, bool &range_error) const; virtual void unpack_int64(const char *data, size_t length, size_t &p, - PN_int64 &value, bool &pack_error, bool &range_error) const; + int64_t &value, bool &pack_error, bool &range_error) const; virtual void unpack_uint64(const char *data, size_t length, size_t &p, - PN_uint64 &value, bool &pack_error, bool &range_error) const; + uint64_t &value, bool &pack_error, bool &range_error) const; virtual void unpack_string(const char *data, size_t length, size_t &p, string &value, bool &pack_error, bool &range_error) const; virtual bool unpack_validate(const char *data, size_t length, size_t &p, @@ -138,30 +138,30 @@ public: INLINE static void do_pack_int8(char *buffer, int value); INLINE static void do_pack_int16(char *buffer, int value); INLINE static void do_pack_int32(char *buffer, int value); - INLINE static void do_pack_int64(char *buffer, PN_int64 value); + INLINE static void do_pack_int64(char *buffer, int64_t value); INLINE static void do_pack_uint8(char *buffer, unsigned int value); INLINE static void do_pack_uint16(char *buffer, unsigned int value); INLINE static void do_pack_uint32(char *buffer, unsigned int value); - INLINE static void do_pack_uint64(char *buffer, PN_uint64 value); + INLINE static void do_pack_uint64(char *buffer, uint64_t value); INLINE static void do_pack_float64(char *buffer, double value); INLINE static int do_unpack_int8(const char *buffer); INLINE static int do_unpack_int16(const char *buffer); INLINE static int do_unpack_int32(const char *buffer); - INLINE static PN_int64 do_unpack_int64(const char *buffer); + INLINE static int64_t do_unpack_int64(const char *buffer); INLINE static unsigned int do_unpack_uint8(const char *buffer); INLINE static unsigned int do_unpack_uint16(const char *buffer); INLINE static unsigned int do_unpack_uint32(const char *buffer); - INLINE static PN_uint64 do_unpack_uint64(const char *buffer); + INLINE static uint64_t do_unpack_uint64(const char *buffer); INLINE static double do_unpack_float64(const char *buffer); INLINE static void validate_int_limits(int value, int num_bits, bool &range_error); - INLINE static void validate_int64_limits(PN_int64 value, int num_bits, + INLINE static void validate_int64_limits(int64_t value, int num_bits, bool &range_error); INLINE static void validate_uint_limits(unsigned int value, int num_bits, bool &range_error); - INLINE static void validate_uint64_limits(PN_uint64 value, int num_bits, + INLINE static void validate_uint64_limits(uint64_t value, int num_bits, bool &range_error); const DCPackerCatalog *get_catalog() const; diff --git a/direct/src/dcparser/dcParserDefs.h b/direct/src/dcparser/dcParserDefs.h index 4b50553bcf..fec0ab95a5 100644 --- a/direct/src/dcparser/dcParserDefs.h +++ b/direct/src/dcparser/dcParserDefs.h @@ -48,8 +48,8 @@ public: union U { int s_int; unsigned int s_uint; - PN_int64 int64; - PN_uint64 uint64; + int64_t int64; + uint64_t uint64; double real; bool flag; DCClass *dclass; diff --git a/direct/src/dcparser/dcSimpleParameter.cxx b/direct/src/dcparser/dcSimpleParameter.cxx index 54f6ab0007..ceead33a5c 100644 --- a/direct/src/dcparser/dcSimpleParameter.cxx +++ b/direct/src/dcparser/dcSimpleParameter.cxx @@ -313,7 +313,7 @@ set_modulus(double modulus) { bool range_error = false; _double_modulus = modulus * _divisor; - _uint64_modulus = (PN_uint64)floor(_double_modulus + 0.5); + _uint64_modulus = (uint64_t)floor(_double_modulus + 0.5); _uint_modulus = (unsigned int)_uint64_modulus; // Check the range. The legitimate range for a modulus value is 1 through @@ -413,8 +413,8 @@ set_range(const DCDoubleRange &range) { case ST_int8array: _int_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_int64 min = (PN_int64)floor(range.get_min(i) * _divisor + 0.5); - PN_int64 max = (PN_int64)floor(range.get_max(i) * _divisor + 0.5); + int64_t min = (int64_t)floor(range.get_min(i) * _divisor + 0.5); + int64_t max = (int64_t)floor(range.get_max(i) * _divisor + 0.5); validate_int64_limits(min, 8, range_error); validate_int64_limits(max, 8, range_error); _int_range.add_range((int)min, (int)max); @@ -425,8 +425,8 @@ set_range(const DCDoubleRange &range) { case ST_int16array: _int_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_int64 min = (PN_int64)floor(range.get_min(i) * _divisor + 0.5); - PN_int64 max = (PN_int64)floor(range.get_max(i) * _divisor + 0.5); + int64_t min = (int64_t)floor(range.get_min(i) * _divisor + 0.5); + int64_t max = (int64_t)floor(range.get_max(i) * _divisor + 0.5); validate_int64_limits(min, 16, range_error); validate_int64_limits(max, 16, range_error); _int_range.add_range((int)min, (int)max); @@ -437,8 +437,8 @@ set_range(const DCDoubleRange &range) { case ST_int32array: _int_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_int64 min = (PN_int64)floor(range.get_min(i) * _divisor + 0.5); - PN_int64 max = (PN_int64)floor(range.get_max(i) * _divisor + 0.5); + int64_t min = (int64_t)floor(range.get_min(i) * _divisor + 0.5); + int64_t max = (int64_t)floor(range.get_max(i) * _divisor + 0.5); validate_int64_limits(min, 32, range_error); validate_int64_limits(max, 32, range_error); _int_range.add_range((int)min, (int)max); @@ -448,8 +448,8 @@ set_range(const DCDoubleRange &range) { case ST_int64: _int64_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_int64 min = (PN_int64)floor(range.get_min(i) * _divisor + 0.5); - PN_int64 max = (PN_int64)floor(range.get_max(i) * _divisor + 0.5); + int64_t min = (int64_t)floor(range.get_min(i) * _divisor + 0.5); + int64_t max = (int64_t)floor(range.get_max(i) * _divisor + 0.5); _int64_range.add_range(min, max); } break; @@ -459,8 +459,8 @@ set_range(const DCDoubleRange &range) { case ST_uint8array: _uint_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); validate_uint64_limits(min, 8, range_error); validate_uint64_limits(max, 8, range_error); _uint_range.add_range((unsigned int)min, (unsigned int)max); @@ -471,8 +471,8 @@ set_range(const DCDoubleRange &range) { case ST_uint16array: _uint_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); validate_uint64_limits(min, 16, range_error); validate_uint64_limits(max, 16, range_error); _uint_range.add_range((unsigned int)min, (unsigned int)max); @@ -483,8 +483,8 @@ set_range(const DCDoubleRange &range) { case ST_uint32array: _uint_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); validate_uint64_limits(min, 32, range_error); validate_uint64_limits(max, 32, range_error); _uint_range.add_range((unsigned int)min, (unsigned int)max); @@ -494,8 +494,8 @@ set_range(const DCDoubleRange &range) { case ST_uint64: _uint64_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); _uint64_range.add_range(min, max); } break; @@ -513,8 +513,8 @@ set_range(const DCDoubleRange &range) { case ST_blob: _uint_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); validate_uint64_limits(min, 16, range_error); validate_uint64_limits(max, 16, range_error); _uint_range.add_range((unsigned int)min, (unsigned int)max); @@ -536,8 +536,8 @@ set_range(const DCDoubleRange &range) { case ST_blob32: _uint_range.clear(); for (i = 0; i < num_ranges; i++) { - PN_uint64 min = (PN_uint64)floor(range.get_min(i) * _divisor + 0.5); - PN_uint64 max = (PN_uint64)floor(range.get_max(i) * _divisor + 0.5); + uint64_t min = (uint64_t)floor(range.get_min(i) * _divisor + 0.5); + uint64_t max = (uint64_t)floor(range.get_max(i) * _divisor + 0.5); validate_uint64_limits(min, 32, range_error); validate_uint64_limits(max, 32, range_error); _uint_range.add_range((unsigned int)min, (unsigned int)max); @@ -634,7 +634,7 @@ pack_double(DCPackData &pack_data, double value, case ST_int64: { - PN_int64 int64_value = (PN_int64)floor(real_value + 0.5); + int64_t int64_value = (int64_t)floor(real_value + 0.5); _int64_range.validate(int64_value, range_error); do_pack_int64(pack_data.get_write_pointer(8), int64_value); } @@ -669,7 +669,7 @@ pack_double(DCPackData &pack_data, double value, case ST_uint64: { - PN_uint64 int64_value = (PN_uint64)floor(real_value + 0.5); + uint64_t int64_value = (uint64_t)floor(real_value + 0.5); _uint64_range.validate(int64_value, range_error); do_pack_uint64(pack_data.get_write_pointer(8), int64_value); } @@ -696,7 +696,7 @@ pack_int(DCPackData &pack_data, int value, if (value != 0 && (int_value / value) != (int)_divisor) { // If we've experienced overflow after applying the divisor, pack it as an // int64 instead. - pack_int64(pack_data, (PN_int64)value, pack_error, range_error); + pack_int64(pack_data, (int64_t)value, pack_error, range_error); return; } @@ -859,9 +859,9 @@ pack_uint(DCPackData &pack_data, unsigned int value, * Packs the indicated numeric or string value into the stream. */ void DCSimpleParameter:: -pack_int64(DCPackData &pack_data, PN_int64 value, +pack_int64(DCPackData &pack_data, int64_t value, bool &pack_error, bool &range_error) const { - PN_int64 int_value = value * _divisor; + int64_t int_value = value * _divisor; if (_has_modulus && _uint64_modulus != 0) { if (int_value < 0) { int_value = _uint64_modulus - 1 - (-int_value - 1) % _uint64_modulus; @@ -899,35 +899,35 @@ pack_int64(DCPackData &pack_data, PN_int64 value, if (int_value < 0) { range_error = true; } - _uint_range.validate((unsigned int)(PN_uint64)int_value, range_error); - validate_uint64_limits((PN_uint64)int_value, 8, range_error); - do_pack_uint8(pack_data.get_write_pointer(1), (unsigned int)(PN_uint64)int_value); + _uint_range.validate((unsigned int)(uint64_t)int_value, range_error); + validate_uint64_limits((uint64_t)int_value, 8, range_error); + do_pack_uint8(pack_data.get_write_pointer(1), (unsigned int)(uint64_t)int_value); break; case ST_uint16: if (int_value < 0) { range_error = true; } - _uint_range.validate((unsigned int)(PN_uint64)int_value, range_error); - validate_uint64_limits((PN_uint64)int_value, 16, range_error); - do_pack_uint16(pack_data.get_write_pointer(2), (unsigned int)(PN_uint64)int_value); + _uint_range.validate((unsigned int)(uint64_t)int_value, range_error); + validate_uint64_limits((uint64_t)int_value, 16, range_error); + do_pack_uint16(pack_data.get_write_pointer(2), (unsigned int)(uint64_t)int_value); break; case ST_uint32: if (int_value < 0) { range_error = true; } - _uint_range.validate((unsigned int)(PN_uint64)int_value, range_error); - validate_uint64_limits((PN_uint64)int_value, 32, range_error); - do_pack_uint32(pack_data.get_write_pointer(4), (unsigned int)(PN_uint64)int_value); + _uint_range.validate((unsigned int)(uint64_t)int_value, range_error); + validate_uint64_limits((uint64_t)int_value, 32, range_error); + do_pack_uint32(pack_data.get_write_pointer(4), (unsigned int)(uint64_t)int_value); break; case ST_uint64: if (int_value < 0) { range_error = true; } - _uint64_range.validate((PN_uint64)int_value, range_error); - do_pack_uint64(pack_data.get_write_pointer(8), (PN_uint64)int_value); + _uint64_range.validate((uint64_t)int_value, range_error); + do_pack_uint64(pack_data.get_write_pointer(8), (uint64_t)int_value); break; case ST_float64: @@ -944,47 +944,47 @@ pack_int64(DCPackData &pack_data, PN_int64 value, * Packs the indicated numeric or string value into the stream. */ void DCSimpleParameter:: -pack_uint64(DCPackData &pack_data, PN_uint64 value, +pack_uint64(DCPackData &pack_data, uint64_t value, bool &pack_error, bool &range_error) const { - PN_uint64 int_value = value * _divisor; + uint64_t int_value = value * _divisor; if (_has_modulus && _uint64_modulus != 0) { int_value = int_value % _uint64_modulus; } switch (_type) { case ST_int8: - if ((PN_int64)int_value < 0) { + if ((int64_t)int_value < 0) { range_error = true; } - _int_range.validate((int)(PN_int64)int_value, range_error); - validate_int64_limits((PN_int64)int_value, 8, range_error); - do_pack_int8(pack_data.get_write_pointer(1), (int)(PN_int64)int_value); + _int_range.validate((int)(int64_t)int_value, range_error); + validate_int64_limits((int64_t)int_value, 8, range_error); + do_pack_int8(pack_data.get_write_pointer(1), (int)(int64_t)int_value); break; case ST_int16: - if ((PN_int64)int_value < 0) { + if ((int64_t)int_value < 0) { range_error = true; } - _int_range.validate((int)(PN_int64)int_value, range_error); - validate_int64_limits((PN_int64)int_value, 16, range_error); - do_pack_int16(pack_data.get_write_pointer(2), (int)(PN_int64)int_value); + _int_range.validate((int)(int64_t)int_value, range_error); + validate_int64_limits((int64_t)int_value, 16, range_error); + do_pack_int16(pack_data.get_write_pointer(2), (int)(int64_t)int_value); break; case ST_int32: - if ((PN_int64)int_value < 0) { + if ((int64_t)int_value < 0) { range_error = true; } - _int_range.validate((int)(PN_int64)int_value, range_error); - validate_int64_limits((PN_int64)int_value, 32, range_error); - do_pack_int32(pack_data.get_write_pointer(4), (int)(PN_int64)int_value); + _int_range.validate((int)(int64_t)int_value, range_error); + validate_int64_limits((int64_t)int_value, 32, range_error); + do_pack_int32(pack_data.get_write_pointer(4), (int)(int64_t)int_value); break; case ST_int64: - if ((PN_int64)int_value < 0) { + if ((int64_t)int_value < 0) { range_error = true; } - _int64_range.validate((PN_int64)int_value, range_error); - do_pack_int64(pack_data.get_write_pointer(8), (PN_int64)int_value); + _int64_range.validate((int64_t)int_value, range_error); + do_pack_int64(pack_data.get_write_pointer(8), (int64_t)int_value); break; case ST_char: @@ -1213,7 +1213,7 @@ unpack_double(const char *data, size_t length, size_t &p, double &value, pack_error = true; return; } - PN_int64 int_value = do_unpack_int64(data + p); + int64_t int_value = do_unpack_int64(data + p); _int64_range.validate(int_value, range_error); value = (double)int_value; p += 8; @@ -1266,7 +1266,7 @@ unpack_double(const char *data, size_t length, size_t &p, double &value, pack_error = true; return; } - PN_uint64 uint_value = do_unpack_uint64(data + p); + uint64_t uint_value = do_unpack_uint64(data + p); _uint64_range.validate(uint_value, range_error); value = (double)uint_value; p += 8; @@ -1340,7 +1340,7 @@ unpack_int(const char *data, size_t length, size_t &p, int &value, pack_error = true; return; } - PN_int64 int_value = do_unpack_uint64(data + p); + int64_t int_value = do_unpack_uint64(data + p); _int64_range.validate(int_value, range_error); value = (int)int_value; if (value != int_value) { @@ -1400,7 +1400,7 @@ unpack_int(const char *data, size_t length, size_t &p, int &value, pack_error = true; return; } - PN_uint64 uint_value = do_unpack_uint64(data + p); + uint64_t uint_value = do_unpack_uint64(data + p); _uint64_range.validate(uint_value, range_error); value = (int)(unsigned int)uint_value; if ((unsigned int)value != uint_value || value < 0) { @@ -1496,7 +1496,7 @@ unpack_uint(const char *data, size_t length, size_t &p, unsigned int &value, pack_error = true; return; } - PN_int64 int_value = do_unpack_int64(data + p); + int64_t int_value = do_unpack_int64(data + p); _int64_range.validate(int_value, range_error); if (int_value < 0) { pack_error = true; @@ -1546,7 +1546,7 @@ unpack_uint(const char *data, size_t length, size_t &p, unsigned int &value, pack_error = true; return; } - PN_uint64 uint_value = do_unpack_uint64(data + p); + uint64_t uint_value = do_unpack_uint64(data + p); _uint64_range.validate(uint_value, range_error); value = (unsigned int)uint_value; if (value != uint_value) { @@ -1585,7 +1585,7 @@ unpack_uint(const char *data, size_t length, size_t &p, unsigned int &value, * Unpacks the current numeric or string value from the stream. */ void DCSimpleParameter:: -unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, +unpack_int64(const char *data, size_t length, size_t &p, int64_t &value, bool &pack_error, bool &range_error) const { switch (_type) { case ST_int8: @@ -1596,7 +1596,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } int int_value = do_unpack_int8(data + p); _int_range.validate(int_value, range_error); - value = (PN_int64)int_value; + value = (int64_t)int_value; p++; } break; @@ -1609,7 +1609,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } int int_value = do_unpack_int16(data + p); _int_range.validate(int_value, range_error); - value = (PN_int64)int_value; + value = (int64_t)int_value; p += 2; } break; @@ -1622,7 +1622,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } int int_value = do_unpack_int32(data + p); _int_range.validate(int_value, range_error); - value = (PN_int64)int_value; + value = (int64_t)int_value; p += 4; } break; @@ -1646,7 +1646,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } unsigned int uint_value = do_unpack_uint8(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_int64)(int)uint_value; + value = (int64_t)(int)uint_value; p++; } break; @@ -1659,7 +1659,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } unsigned int uint_value = do_unpack_uint16(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_int64)(int)uint_value; + value = (int64_t)(int)uint_value; p += 2; } break; @@ -1672,7 +1672,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } unsigned int uint_value = do_unpack_uint32(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_int64)(int)uint_value; + value = (int64_t)(int)uint_value; p += 4; } break; @@ -1683,9 +1683,9 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, pack_error = true; return; } - PN_uint64 uint_value = do_unpack_uint64(data + p); + uint64_t uint_value = do_unpack_uint64(data + p); _uint64_range.validate(uint_value, range_error); - value = (PN_int64)uint_value; + value = (int64_t)uint_value; if (value < 0) { pack_error = true; } @@ -1701,7 +1701,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, } double real_value = do_unpack_float64(data + p); _double_range.validate(real_value, range_error); - value = (PN_int64)real_value; + value = (int64_t)real_value; p += 8; } break; @@ -1722,7 +1722,7 @@ unpack_int64(const char *data, size_t length, size_t &p, PN_int64 &value, * Unpacks the current numeric or string value from the stream. */ void DCSimpleParameter:: -unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, +unpack_uint64(const char *data, size_t length, size_t &p, uint64_t &value, bool &pack_error, bool &range_error) const { switch (_type) { case ST_int8: @@ -1736,7 +1736,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, if (int_value < 0) { pack_error = true; } - value = (PN_uint64)(unsigned int)int_value; + value = (uint64_t)(unsigned int)int_value; p++; } break; @@ -1752,7 +1752,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, if (int_value < 0) { pack_error = true; } - value = (PN_uint64)(unsigned int)int_value; + value = (uint64_t)(unsigned int)int_value; p += 2; } break; @@ -1768,7 +1768,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, if (int_value < 0) { pack_error = true; } - value = (PN_uint64)(unsigned int)int_value; + value = (uint64_t)(unsigned int)int_value; p += 4; } break; @@ -1779,12 +1779,12 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, pack_error = true; return; } - PN_int64 int_value = do_unpack_int64(data + p); + int64_t int_value = do_unpack_int64(data + p); _int64_range.validate(int_value, range_error); if (int_value < 0) { pack_error = true; } - value = (PN_uint64)int_value; + value = (uint64_t)int_value; p += 8; } break; @@ -1798,7 +1798,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, } unsigned int uint_value = do_unpack_uint8(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_uint64)uint_value; + value = (uint64_t)uint_value; p++; } break; @@ -1811,7 +1811,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, } unsigned int uint_value = do_unpack_uint16(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_uint64)uint_value; + value = (uint64_t)uint_value; p += 2; } break; @@ -1824,7 +1824,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, } unsigned int uint_value = do_unpack_uint32(data + p); _uint_range.validate(uint_value, range_error); - value = (PN_uint64)uint_value; + value = (uint64_t)uint_value; p += 4; } break; @@ -1847,7 +1847,7 @@ unpack_uint64(const char *data, size_t length, size_t &p, PN_uint64 &value, } double real_value = do_unpack_float64(data + p); _double_range.validate(real_value, range_error); - value = (PN_uint64)real_value; + value = (uint64_t)real_value; p += 8; } break; @@ -1990,7 +1990,7 @@ unpack_validate(const char *data, size_t length, size_t &p, pack_error = true; return true; } - PN_int64 int_value = do_unpack_int64(data + p); + int64_t int_value = do_unpack_int64(data + p); _int64_range.validate(int_value, range_error); p += 8; } @@ -2039,7 +2039,7 @@ unpack_validate(const char *data, size_t length, size_t &p, pack_error = true; return true; } - PN_uint64 uint_value = do_unpack_uint64(data + p); + uint64_t uint_value = do_unpack_uint64(data + p); _uint64_range.validate(uint_value, range_error); p += 8; } diff --git a/direct/src/dcparser/dcSimpleParameter.h b/direct/src/dcparser/dcSimpleParameter.h index 3a8d53c2aa..747950939a 100644 --- a/direct/src/dcparser/dcSimpleParameter.h +++ b/direct/src/dcparser/dcSimpleParameter.h @@ -56,9 +56,9 @@ public: bool &pack_error, bool &range_error) const; virtual void pack_uint(DCPackData &pack_data, unsigned int value, bool &pack_error, bool &range_error) const; - virtual void pack_int64(DCPackData &pack_data, PN_int64 value, + virtual void pack_int64(DCPackData &pack_data, int64_t value, bool &pack_error, bool &range_error) const; - virtual void pack_uint64(DCPackData &pack_data, PN_uint64 value, + virtual void pack_uint64(DCPackData &pack_data, uint64_t value, bool &pack_error, bool &range_error) const; virtual void pack_string(DCPackData &pack_data, const string &value, bool &pack_error, bool &range_error) const; @@ -71,9 +71,9 @@ public: virtual void unpack_uint(const char *data, size_t length, size_t &p, unsigned int &value, bool &pack_error, bool &range_error) const; virtual void unpack_int64(const char *data, size_t length, size_t &p, - PN_int64 &value, bool &pack_error, bool &range_error) const; + int64_t &value, bool &pack_error, bool &range_error) const; virtual void unpack_uint64(const char *data, size_t length, size_t &p, - PN_uint64 &value, bool &pack_error, bool &range_error) const; + uint64_t &value, bool &pack_error, bool &range_error) const; virtual void unpack_string(const char *data, size_t length, size_t &p, string &value, bool &pack_error, bool &range_error) const; virtual bool unpack_validate(const char *data, size_t length, size_t &p, @@ -125,7 +125,7 @@ private: // All of these modulus values will be filled in, regardless of the type. unsigned int _uint_modulus; - PN_uint64 _uint64_modulus; + uint64_t _uint64_modulus; double _double_modulus; static DCClassParameter *_uint32uint8_type; diff --git a/direct/src/dcparser/dcbase.h b/direct/src/dcparser/dcbase.h index 2e28fca2ef..fae53a46f8 100644 --- a/direct/src/dcparser/dcbase.h +++ b/direct/src/dcparser/dcbase.h @@ -102,17 +102,7 @@ typedef string Filename; #define pmap map #define pset set -#ifdef WIN32 -typedef __int64 PN_int64; -typedef unsigned __int64 PN_uint64; -#else -typedef long long PN_int64; -typedef unsigned long long PN_uint64; -#endif - -typedef unsigned char PN_uint8; -typedef unsigned short PN_uint16; -typedef unsigned int PN_uint32; +#include typedef ifstream pifstream; typedef ofstream pofstream; @@ -121,8 +111,8 @@ typedef fstream pfstream; #endif // WITHIN_PANDA // typedef unsigned long CHANNEL_TYPE; -typedef PN_uint64 CHANNEL_TYPE; -typedef PN_uint32 DOID_TYPE; -typedef PN_uint32 ZONEID_TYPE; +typedef uint64_t CHANNEL_TYPE; +typedef uint32_t DOID_TYPE; +typedef uint32_t ZONEID_TYPE; #endif // DCBASE_H diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.I b/direct/src/distributed/cDistributedSmoothNodeBase.I index 5eba579e2b..56dd8595d3 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.I +++ b/direct/src/distributed/cDistributedSmoothNodeBase.I @@ -184,7 +184,7 @@ d_setSmPosHpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_std * */ INLINE void CDistributedSmoothNodeBase:: -d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_uint64 l) { +d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, uint64_t l) { // cout << "d_setSmPosHprL: " << x << ", " << y << ", " << z << ", " << h << // ", " << p << ", " << r << l << endl; DCPacker packer; diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.cxx b/direct/src/distributed/cDistributedSmoothNodeBase.cxx index 45b65353ee..70a50f33f5 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.cxx +++ b/direct/src/distributed/cDistributedSmoothNodeBase.cxx @@ -358,7 +358,7 @@ finish_send_update(DCPacker &packer) { * Appends the timestamp and sends the update. */ void CDistributedSmoothNodeBase:: -set_curr_l(PN_uint64 l) { +set_curr_l(uint64_t l) { _currL[1] = l; } diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.h b/direct/src/distributed/cDistributedSmoothNodeBase.h index b59bd9af2a..53763a6a47 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.h +++ b/direct/src/distributed/cDistributedSmoothNodeBase.h @@ -51,7 +51,7 @@ PUBLISHED: void broadcast_pos_hpr_xyh(); void broadcast_pos_hpr_xy(); - void set_curr_l(PN_uint64 l); + void set_curr_l(uint64_t l); void print_curr_l(); private: @@ -67,7 +67,7 @@ private: INLINE void d_setSmXYH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat h); INLINE void d_setSmXYZH(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h); INLINE void d_setSmPosHpr(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r); - INLINE void d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, PN_uint64 l); + INLINE void d_setSmPosHprL(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r, uint64_t l); void begin_send_update(DCPacker &packer, const string &field_name); void finish_send_update(DCPacker &packer); @@ -97,7 +97,7 @@ private: bool _store_stop; // contains most recently sent location info as index 0, index 1 contains // most recently set location info - PN_uint64 _currL[2]; + uint64_t _currL[2]; }; #include "cDistributedSmoothNodeBase.I" diff --git a/dtool/src/dtoolbase/addHash.I b/dtool/src/dtoolbase/addHash.I index ddc1c737fb..57084af72c 100644 --- a/dtool/src/dtoolbase/addHash.I +++ b/dtool/src/dtoolbase/addHash.I @@ -15,8 +15,8 @@ * Adds a linear sequence of uint32 words to the hash. */ INLINE size_t AddHash:: -add_hash(size_t start, const PN_uint32 *words, size_t num_words) { - return (size_t)hashword(words, num_words, (PN_uint32)start); +add_hash(size_t start, const uint32_t *words, size_t num_words) { + return (size_t)hashword(words, num_words, (uint32_t)start); } /** @@ -24,7 +24,7 @@ add_hash(size_t start, const PN_uint32 *words, size_t num_words) { */ INLINE size_t AddHash:: add_hash(size_t start, const PN_float32 *floats, size_t num_floats) { - return add_hash(start, (const PN_uint32 *)floats, num_floats); + return add_hash(start, (const uint32_t *)floats, num_floats); } /** @@ -32,5 +32,5 @@ add_hash(size_t start, const PN_float32 *floats, size_t num_floats) { */ INLINE size_t AddHash:: add_hash(size_t start, const PN_float64 *floats, size_t num_floats) { - return add_hash(start, (const PN_uint32 *)floats, num_floats * 2); + return add_hash(start, (const uint32_t *)floats, num_floats * 2); } diff --git a/dtool/src/dtoolbase/addHash.cxx b/dtool/src/dtoolbase/addHash.cxx index fd3717960d..5d7698b726 100644 --- a/dtool/src/dtoolbase/addHash.cxx +++ b/dtool/src/dtoolbase/addHash.cxx @@ -17,33 +17,33 @@ * Adds a linear sequence of bytes to the hash. */ size_t AddHash:: -add_hash(size_t start, const PN_uint8 *bytes, size_t num_bytes) { +add_hash(size_t start, const uint8_t *bytes, size_t num_bytes) { size_t num_words = num_bytes >> 2; size_t remaining_bytes = num_bytes - (num_words << 2); - size_t hash = (size_t)hashword((const PN_uint32 *)bytes, num_words, (PN_uint32)start); + size_t hash = (size_t)hashword((const uint32_t *)bytes, num_words, (uint32_t)start); switch (remaining_bytes) { case 3: { - PN_uint32 remaining; + uint32_t remaining; remaining = (bytes[num_bytes - 3] << 16) | (bytes[num_bytes - 2] << 8) | (bytes[num_bytes - 1]); - hash = (size_t)hashword(&remaining, 1, (PN_uint32)hash); + hash = (size_t)hashword(&remaining, 1, (uint32_t)hash); } break; case 2: { - PN_uint32 remaining; + uint32_t remaining; remaining = (bytes[num_bytes - 2] << 8) | (bytes[num_bytes - 1]); - hash = (size_t)hashword(&remaining, 1, (PN_uint32)hash); + hash = (size_t)hashword(&remaining, 1, (uint32_t)hash); } break; case 1: { - PN_uint32 remaining; + uint32_t remaining; remaining = (bytes[num_bytes - 1]); - hash = (size_t)hashword(&remaining, 1, (PN_uint32)hash); + hash = (size_t)hashword(&remaining, 1, (uint32_t)hash); } break; diff --git a/dtool/src/dtoolbase/addHash.h b/dtool/src/dtoolbase/addHash.h index fba194b688..11fabf77ce 100644 --- a/dtool/src/dtoolbase/addHash.h +++ b/dtool/src/dtoolbase/addHash.h @@ -25,8 +25,8 @@ */ class EXPCL_DTOOL AddHash { public: - INLINE static size_t add_hash(size_t start, const PN_uint32 *words, size_t num_words); - static size_t add_hash(size_t start, const PN_uint8 *bytes, size_t num_bytes); + INLINE static size_t add_hash(size_t start, const uint32_t *words, size_t num_words); + static size_t add_hash(size_t start, const uint8_t *bytes, size_t num_bytes); INLINE static size_t add_hash(size_t start, const PN_float32 *floats, size_t num_floats); INLINE static size_t add_hash(size_t start, const PN_float64 *floats, size_t num_floats); }; diff --git a/dtool/src/dtoolbase/atomicAdjustI386Impl.h b/dtool/src/dtoolbase/atomicAdjustI386Impl.h index c9db9a806d..3084a7172b 100644 --- a/dtool/src/dtoolbase/atomicAdjustI386Impl.h +++ b/dtool/src/dtoolbase/atomicAdjustI386Impl.h @@ -28,7 +28,7 @@ */ class EXPCL_DTOOL AtomicAdjustI386Impl { public: - typedef ALIGN_4BYTE PN_int32 Integer; + typedef ALIGN_4BYTE int32_t Integer; typedef void *UnalignedPointer; typedef ALIGN_4BYTE UnalignedPointer Pointer; diff --git a/dtool/src/dtoolbase/lookup3.c b/dtool/src/dtoolbase/lookup3.c index 1cd36c58d0..34c8eaa94a 100644 --- a/dtool/src/dtoolbase/lookup3.c +++ b/dtool/src/dtoolbase/lookup3.c @@ -149,25 +149,25 @@ and these came close: /* -------------------------------------------------------------------- This works on all machines. To be useful, it requires - -- that the key be an array of PN_uint32's, and - -- that the length be the number of PN_uint32's in the key + -- that the key be an array of uint32_t's, and + -- that the length be the number of uint32_t's in the key The function hashword() is identical to hashlittle() on little-endian machines, and identical to hashbig() on big-endian machines, - except that the length has to be measured in PN_uint32s rather than in + except that the length has to be measured in uint32_ts rather than in bytes. hashlittle() is more complicated than hashword() only because hashlittle() has to dance around fitting the key bytes into registers. -------------------------------------------------------------------- */ -PN_uint32 hashword( -const PN_uint32 *k, /* the key, an array of PN_uint32 values */ -size_t length, /* the length of the key, in PN_uint32s */ -PN_uint32 initval) /* the previous hash, or an arbitrary value */ +uint32_t hashword( +const uint32_t *k, /* the key, an array of uint32_t values */ +size_t length, /* the length of the key, in uint32_ts */ +uint32_t initval) /* the previous hash, or an arbitrary value */ { - PN_uint32 a,b,c; + uint32_t a,b,c; /* Set up the internal state */ - a = b = c = 0xdeadbeef + (((PN_uint32)length)<<2) + initval; + a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval; /*------------------------------------------------- handle most of the key */ while (length > 3) @@ -180,7 +180,7 @@ PN_uint32 initval) /* the previous hash, or an arbitrary value */ k += 3; } - /*------------------------------------------- handle the last 3 PN_uint32's */ + /*------------------------------------------- handle the last 3 uint32_t's */ switch(length) /* all the case statements fall through */ { case 3 : c+=k[2]; @@ -211,7 +211,7 @@ use a bitmask. For example, if you need only 10 bits, do h = (h & hashmask(10)); In which case, the hash table should have hashsize(10) elements. -If you are hashing n strings (PN_uint8 **)k, do it like this: +If you are hashing n strings (uint8_t **)k, do it like this: for (i=0, h=0; i 12) { - a += k[0] + (((PN_uint32)k[1])<<16); - b += k[2] + (((PN_uint32)k[3])<<16); - c += k[4] + (((PN_uint32)k[5])<<16); + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); mix(a,b,c); length -= 12; k += 6; } /*----------------------------- handle the last (probably partial) block */ - k8 = (const PN_uint8 *)k; + k8 = (const uint8_t *)k; switch(length) { - case 12: c+=k[4]+(((PN_uint32)k[5])<<16); - b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; - case 11: c+=((PN_uint32)k8[10])<<16; /* fall through */ + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ case 10: c+=k[4]; - b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; - case 7 : b+=((PN_uint32)k8[6])<<16; /* fall through */ + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ case 6 : b+=k[2]; - a+=k[0]+(((PN_uint32)k[1])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((PN_uint32)k[1])<<16); + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); break; - case 3 : a+=((PN_uint32)k8[2])<<16; /* fall through */ + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ case 2 : a+=k[0]; break; case 1 : a+=k8[0]; @@ -347,23 +347,23 @@ PN_uint32 hashlittle( const void *key, size_t length, PN_uint32 initval) } } else { /* need to read the key one byte at a time */ - const PN_uint8 *k =(PN_uint8*) key; + const uint8_t *k =(uint8_t*) key; /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) { a += k[0]; - a += ((PN_uint32)k[1])<<8; - a += ((PN_uint32)k[2])<<16; - a += ((PN_uint32)k[3])<<24; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; b += k[4]; - b += ((PN_uint32)k[5])<<8; - b += ((PN_uint32)k[6])<<16; - b += ((PN_uint32)k[7])<<24; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; c += k[8]; - c += ((PN_uint32)k[9])<<8; - c += ((PN_uint32)k[10])<<16; - c += ((PN_uint32)k[11])<<24; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; mix(a,b,c); length -= 12; k += 12; @@ -372,17 +372,17 @@ PN_uint32 hashlittle( const void *key, size_t length, PN_uint32 initval) /*-------------------------------- last block: affect all 32 bits of (c) */ switch(length) /* all the case statements fall through */ { - case 12: c+=((PN_uint32)k[11])<<24; - case 11: c+=((PN_uint32)k[10])<<16; - case 10: c+=((PN_uint32)k[9])<<8; + case 12: c+=((uint32_t)k[11])<<24; + case 11: c+=((uint32_t)k[10])<<16; + case 10: c+=((uint32_t)k[9])<<8; case 9 : c+=k[8]; - case 8 : b+=((PN_uint32)k[7])<<24; - case 7 : b+=((PN_uint32)k[6])<<16; - case 6 : b+=((PN_uint32)k[5])<<8; + case 8 : b+=((uint32_t)k[7])<<24; + case 7 : b+=((uint32_t)k[6])<<16; + case 6 : b+=((uint32_t)k[5])<<8; case 5 : b+=k[4]; - case 4 : a+=((PN_uint32)k[3])<<24; - case 3 : a+=((PN_uint32)k[2])<<16; - case 2 : a+=((PN_uint32)k[1])<<8; + case 4 : a+=((uint32_t)k[3])<<24; + case 3 : a+=((uint32_t)k[2])<<16; + case 2 : a+=((uint32_t)k[1])<<8; case 1 : a+=k[0]; break; case 0 : return c; @@ -407,21 +407,21 @@ PN_uint32 hashlittle( const void *key, size_t length, PN_uint32 initval) void hashlittle2( const void *key, /* the key to hash */ size_t length, /* length of the key */ - PN_uint32 *pc, /* IN: primary initval, OUT: primary hash */ - PN_uint32 *pb) /* IN: secondary initval, OUT: secondary hash */ + uint32_t *pc, /* IN: primary initval, OUT: primary hash */ + uint32_t *pb) /* IN: secondary initval, OUT: secondary hash */ { - PN_uint32 a,b,c; /* internal state */ + uint32_t a,b,c; /* internal state */ union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((PN_uint32)length) + *pc; + a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc; c += *pb; u.ptr = key; if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - const PN_uint32 *k = (PN_uint32*)key; /* read 32-bit chunks */ + const uint32_t *k = (uint32_t*)key; /* read 32-bit chunks */ #ifdef VALGRIND - const PN_uint8 *k8; + const uint8_t *k8; #endif /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ @@ -466,20 +466,20 @@ void hashlittle2( #else /* make valgrind happy */ - k8 = (const PN_uint8 *)k; + k8 = (const uint8_t *)k; switch(length) { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((PN_uint32)k8[10])<<16; /* fall through */ - case 10: c+=((PN_uint32)k8[9])<<8; /* fall through */ + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ case 9 : c+=k8[8]; /* fall through */ case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((PN_uint32)k8[6])<<16; /* fall through */ - case 6 : b+=((PN_uint32)k8[5])<<8; /* fall through */ + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ case 5 : b+=k8[4]; /* fall through */ case 4 : a+=k[0]; break; - case 3 : a+=((PN_uint32)k8[2])<<16; /* fall through */ - case 2 : a+=((PN_uint32)k8[1])<<8; /* fall through */ + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ case 1 : a+=k8[0]; break; case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ } @@ -487,45 +487,45 @@ void hashlittle2( #endif /* !valgrind */ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const PN_uint16 *k = (PN_uint16*)key; /* read 16-bit chunks */ - const PN_uint8 *k8; + const uint16_t *k = (uint16_t*)key; /* read 16-bit chunks */ + const uint8_t *k8; /*--------------- all but last block: aligned reads and different mixing */ while (length > 12) { - a += k[0] + (((PN_uint32)k[1])<<16); - b += k[2] + (((PN_uint32)k[3])<<16); - c += k[4] + (((PN_uint32)k[5])<<16); + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); mix(a,b,c); length -= 12; k += 6; } /*----------------------------- handle the last (probably partial) block */ - k8 = (const PN_uint8 *)k; + k8 = (const uint8_t *)k; switch(length) { - case 12: c+=k[4]+(((PN_uint32)k[5])<<16); - b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; - case 11: c+=((PN_uint32)k8[10])<<16; /* fall through */ + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ case 10: c+=k[4]; - b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((PN_uint32)k[3])<<16); - a+=k[0]+(((PN_uint32)k[1])<<16); + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; - case 7 : b+=((PN_uint32)k8[6])<<16; /* fall through */ + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ case 6 : b+=k[2]; - a+=k[0]+(((PN_uint32)k[1])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); break; case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((PN_uint32)k[1])<<16); + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); break; - case 3 : a+=((PN_uint32)k8[2])<<16; /* fall through */ + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ case 2 : a+=k[0]; break; case 1 : a+=k8[0]; @@ -534,23 +534,23 @@ void hashlittle2( } } else { /* need to read the key one byte at a time */ - const PN_uint8 *k = (PN_uint8*)key; + const uint8_t *k = (uint8_t*)key; /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) { a += k[0]; - a += ((PN_uint32)k[1])<<8; - a += ((PN_uint32)k[2])<<16; - a += ((PN_uint32)k[3])<<24; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; b += k[4]; - b += ((PN_uint32)k[5])<<8; - b += ((PN_uint32)k[6])<<16; - b += ((PN_uint32)k[7])<<24; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; c += k[8]; - c += ((PN_uint32)k[9])<<8; - c += ((PN_uint32)k[10])<<16; - c += ((PN_uint32)k[11])<<24; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; mix(a,b,c); length -= 12; k += 12; @@ -559,17 +559,17 @@ void hashlittle2( /*-------------------------------- last block: affect all 32 bits of (c) */ switch(length) /* all the case statements fall through */ { - case 12: c+=((PN_uint32)k[11])<<24; - case 11: c+=((PN_uint32)k[10])<<16; - case 10: c+=((PN_uint32)k[9])<<8; + case 12: c+=((uint32_t)k[11])<<24; + case 11: c+=((uint32_t)k[10])<<16; + case 10: c+=((uint32_t)k[9])<<8; case 9 : c+=k[8]; - case 8 : b+=((PN_uint32)k[7])<<24; - case 7 : b+=((PN_uint32)k[6])<<16; - case 6 : b+=((PN_uint32)k[5])<<8; + case 8 : b+=((uint32_t)k[7])<<24; + case 7 : b+=((uint32_t)k[6])<<16; + case 6 : b+=((uint32_t)k[5])<<8; case 5 : b+=k[4]; - case 4 : a+=((PN_uint32)k[3])<<24; - case 3 : a+=((PN_uint32)k[2])<<16; - case 2 : a+=((PN_uint32)k[1])<<8; + case 4 : a+=((uint32_t)k[3])<<24; + case 3 : a+=((uint32_t)k[2])<<16; + case 2 : a+=((uint32_t)k[1])<<8; case 1 : a+=k[0]; break; case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ @@ -588,19 +588,19 @@ void hashlittle2( * from hashlittle() on all machines. hashbig() takes advantage of * big-endian byte ordering. */ -PN_uint32 hashbig( const void *key, size_t length, PN_uint32 initval) +uint32_t hashbig( const void *key, size_t length, uint32_t initval) { - PN_uint32 a,b,c; + uint32_t a,b,c; union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */ /* Set up the internal state */ - a = b = c = 0xdeadbeef + ((PN_uint32)length) + initval; + a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; u.ptr = key; if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) { - const PN_uint32 *k = (PN_uint32*)key; /* read 32-bit chunks */ + const uint32_t *k = (uint32_t*)key; /* read 32-bit chunks */ #ifdef VALGRIND - const PN_uint8 *k8; + const uint8_t *k8; #endif /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ @@ -645,44 +645,44 @@ PN_uint32 hashbig( const void *key, size_t length, PN_uint32 initval) #else /* make valgrind happy */ - k8 = (const PN_uint8 *)k; + k8 = (const uint8_t *)k; switch(length) /* all the case statements fall through */ { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((PN_uint32)k8[10])<<8; /* fall through */ - case 10: c+=((PN_uint32)k8[9])<<16; /* fall through */ - case 9 : c+=((PN_uint32)k8[8])<<24; /* fall through */ + case 11: c+=((uint32_t)k8[10])<<8; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<16; /* fall through */ + case 9 : c+=((uint32_t)k8[8])<<24; /* fall through */ case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((PN_uint32)k8[6])<<8; /* fall through */ - case 6 : b+=((PN_uint32)k8[5])<<16; /* fall through */ - case 5 : b+=((PN_uint32)k8[4])<<24; /* fall through */ + case 7 : b+=((uint32_t)k8[6])<<8; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<16; /* fall through */ + case 5 : b+=((uint32_t)k8[4])<<24; /* fall through */ case 4 : a+=k[0]; break; - case 3 : a+=((PN_uint32)k8[2])<<8; /* fall through */ - case 2 : a+=((PN_uint32)k8[1])<<16; /* fall through */ - case 1 : a+=((PN_uint32)k8[0])<<24; break; + case 3 : a+=((uint32_t)k8[2])<<8; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<16; /* fall through */ + case 1 : a+=((uint32_t)k8[0])<<24; break; case 0 : return c; } #endif /* !VALGRIND */ } else { /* need to read the key one byte at a time */ - const PN_uint8 *k = (PN_uint8*)key; + const uint8_t *k = (uint8_t*)key; /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) { - a += ((PN_uint32)k[0])<<24; - a += ((PN_uint32)k[1])<<16; - a += ((PN_uint32)k[2])<<8; - a += ((PN_uint32)k[3]); - b += ((PN_uint32)k[4])<<24; - b += ((PN_uint32)k[5])<<16; - b += ((PN_uint32)k[6])<<8; - b += ((PN_uint32)k[7]); - c += ((PN_uint32)k[8])<<24; - c += ((PN_uint32)k[9])<<16; - c += ((PN_uint32)k[10])<<8; - c += ((PN_uint32)k[11]); + a += ((uint32_t)k[0])<<24; + a += ((uint32_t)k[1])<<16; + a += ((uint32_t)k[2])<<8; + a += ((uint32_t)k[3]); + b += ((uint32_t)k[4])<<24; + b += ((uint32_t)k[5])<<16; + b += ((uint32_t)k[6])<<8; + b += ((uint32_t)k[7]); + c += ((uint32_t)k[8])<<24; + c += ((uint32_t)k[9])<<16; + c += ((uint32_t)k[10])<<8; + c += ((uint32_t)k[11]); mix(a,b,c); length -= 12; k += 12; @@ -692,17 +692,17 @@ PN_uint32 hashbig( const void *key, size_t length, PN_uint32 initval) switch(length) /* all the case statements fall through */ { case 12: c+=k[11]; - case 11: c+=((PN_uint32)k[10])<<8; - case 10: c+=((PN_uint32)k[9])<<16; - case 9 : c+=((PN_uint32)k[8])<<24; + case 11: c+=((uint32_t)k[10])<<8; + case 10: c+=((uint32_t)k[9])<<16; + case 9 : c+=((uint32_t)k[8])<<24; case 8 : b+=k[7]; - case 7 : b+=((PN_uint32)k[6])<<8; - case 6 : b+=((PN_uint32)k[5])<<16; - case 5 : b+=((PN_uint32)k[4])<<24; + case 7 : b+=((uint32_t)k[6])<<8; + case 6 : b+=((uint32_t)k[5])<<16; + case 5 : b+=((uint32_t)k[4])<<24; case 4 : a+=k[3]; - case 3 : a+=((PN_uint32)k[2])<<8; - case 2 : a+=((PN_uint32)k[1])<<16; - case 1 : a+=((PN_uint32)k[0])<<24; + case 3 : a+=((uint32_t)k[2])<<8; + case 2 : a+=((uint32_t)k[1])<<16; + case 1 : a+=((uint32_t)k[0])<<24; break; case 0 : return c; } @@ -718,9 +718,9 @@ PN_uint32 hashbig( const void *key, size_t length, PN_uint32 initval) /* used for timings */ void driver1() { - PN_uint8 buf[256]; - PN_uint32 i; - PN_uint32 h=0; + uint8_t buf[256]; + uint32_t i; + uint32_t h=0; time_t a,z; time(&a); @@ -740,11 +740,11 @@ void driver1() #define MAXLEN 70 void driver2() { - PN_uint8 qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1]; - PN_uint32 c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z; - PN_uint32 e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE]; - PN_uint32 x[HASHSTATE],y[HASHSTATE]; - PN_uint32 hlen; + uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1]; + uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z; + uint32_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE]; + uint32_t x[HASHSTATE],y[HASHSTATE]; + uint32_t hlen; printf("No more than %d trials should ever be needed \n",MAXPAIR/2); for (hlen=0; hlen < MAXLEN; ++hlen) @@ -757,14 +757,14 @@ void driver2() for (m=1; m<8; ++m) /*------------ for serveral possible initvals, */ { for (l=0; l>(8-j)); @@ -810,23 +810,23 @@ void driver2() /* Check for reading beyond the end of the buffer and alignment problems */ void driver3() { - PN_uint8 buf[MAXLEN+20], *b; - PN_uint32 len; - PN_uint8 q[] = "This is the time for all good men to come to the aid of their country..."; - PN_uint32 h; - PN_uint8 qq[] = "xThis is the time for all good men to come to the aid of their country..."; - PN_uint32 i; - PN_uint8 qqq[] = "xxThis is the time for all good men to come to the aid of their country..."; - PN_uint32 j; - PN_uint8 qqqq[] = "xxxThis is the time for all good men to come to the aid of their country..."; - PN_uint32 ref,x,y; - PN_uint8 *p; + uint8_t buf[MAXLEN+20], *b; + uint32_t len; + uint8_t q[] = "This is the time for all good men to come to the aid of their country..."; + uint32_t h; + uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country..."; + uint32_t i; + uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country..."; + uint32_t j; + uint8_t qqqq[] = "xxxThis is the time for all good men to come to the aid of their country..."; + uint32_t ref,x,y; + uint8_t *p; printf("Endianness. These lines should all be the same (for values filled in):\n"); printf("%.8x %.8x %.8x\n", - hashword((const PN_uint32 *)q, (sizeof(q)-1)/4, 13), - hashword((const PN_uint32 *)q, (sizeof(q)-5)/4, 13), - hashword((const PN_uint32 *)q, (sizeof(q)-9)/4, 13)); + hashword((const uint32_t *)q, (sizeof(q)-1)/4, 13), + hashword((const uint32_t *)q, (sizeof(q)-5)/4, 13), + hashword((const uint32_t *)q, (sizeof(q)-9)/4, 13)); p = q; printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13), @@ -868,11 +868,11 @@ void driver3() for (j=0; j typedef double PN_float64; typedef float PN_float32; diff --git a/dtool/src/dtoolbase/stl_compares.I b/dtool/src/dtoolbase/stl_compares.I index 5e087faa3e..501435f547 100644 --- a/dtool/src/dtoolbase/stl_compares.I +++ b/dtool/src/dtoolbase/stl_compares.I @@ -99,7 +99,7 @@ is_equal(const Key &a, const Key &b) const { template INLINE size_t integer_hash:: add_hash(size_t hash, const Key &key) { - PN_uint32 key32 = (PN_uint32)(key); + uint32_t key32 = (uint32_t)(key); return AddHash::add_hash(hash, &key32, 1); } @@ -109,7 +109,7 @@ add_hash(size_t hash, const Key &key) { INLINE size_t pointer_hash:: add_hash(size_t hash, const void *key) { // We don't mind if this loses precision. - PN_uint32 key32 = (PN_uint32)reinterpret_cast(key); + uint32_t key32 = (uint32_t)reinterpret_cast(key); return AddHash::add_hash(hash, &key32, 1); } @@ -147,7 +147,7 @@ operator () (const Key &a, const Key &b) const { template INLINE size_t floating_point_hash:: add_hash(size_t hash, const Key &key) const { - PN_uint32 key32 = (PN_uint32)(key / _threshold + 0.5f); + uint32_t key32 = (uint32_t)(key / _threshold + 0.5f); return AddHash::add_hash(hash, &key32, 1); } @@ -173,7 +173,7 @@ add_hash(size_t hash, const Key &key) { } #endif size_t num_bytes = (key.size() * sizeof(key[0])); - return AddHash::add_hash(hash, (const PN_uint8 *)&key[0], num_bytes); + return AddHash::add_hash(hash, (const uint8_t *)&key[0], num_bytes); } /** diff --git a/dtool/src/dtoolbase/typeRegistry.cxx b/dtool/src/dtoolbase/typeRegistry.cxx index a0393cb81c..99ac09be10 100644 --- a/dtool/src/dtoolbase/typeRegistry.cxx +++ b/dtool/src/dtoolbase/typeRegistry.cxx @@ -511,10 +511,10 @@ TypeRegistry() { // Here's a few sanity checks on the sizes of our words. We have to put it // here, at runtime, since there doesn't appear to be a cross-platform // compile-time way to verify that we've chosen the right word sizes. - assert(sizeof(PN_uint8) == 1 && sizeof(PN_int8) == 1); - assert(sizeof(PN_uint16) == 2 && sizeof(PN_int16) == 2); - assert(sizeof(PN_uint32) == 4 && sizeof(PN_int32) == 4); - assert(sizeof(PN_uint64) == 8 && sizeof(PN_int64) == 8); + assert(sizeof(uint8_t) == 1 && sizeof(int8_t) == 1); + assert(sizeof(uint16_t) == 2 && sizeof(int16_t) == 2); + assert(sizeof(uint32_t) == 4 && sizeof(int32_t) == 4); + assert(sizeof(uint64_t) == 8 && sizeof(int64_t) == 8); assert(sizeof(PN_float32) == 4); assert(sizeof(PN_float64) == 8); diff --git a/dtool/src/dtoolutil/string_utils.I b/dtool/src/dtoolutil/string_utils.I index 597a7f603b..e4e71766f8 100644 --- a/dtool/src/dtoolutil/string_utils.I +++ b/dtool/src/dtoolutil/string_utils.I @@ -80,13 +80,13 @@ format_string(int value) { } INLINE string -format_string(PN_int64 value) { +format_string(int64_t value) { char buffer[21]; char *p = buffer + 20; *p = 0; if (value < 0) { - PN_uint64 posv = (PN_uint64)-value; + uint64_t posv = (uint64_t)-value; do { *--p = '0' + (posv % 10); posv /= 10; diff --git a/dtool/src/dtoolutil/string_utils.h b/dtool/src/dtoolutil/string_utils.h index 2737566cdf..a3d931af6e 100644 --- a/dtool/src/dtoolutil/string_utils.h +++ b/dtool/src/dtoolutil/string_utils.h @@ -73,7 +73,7 @@ INLINE string format_string(float value); INLINE string format_string(double value); INLINE string format_string(unsigned int value); INLINE string format_string(int value); -INLINE string format_string(PN_int64 value); +INLINE string format_string(int64_t value); #include "string_utils.I" diff --git a/dtool/src/prc/configDeclaration.I b/dtool/src/prc/configDeclaration.I index 889a01a4c4..a93fbdab10 100644 --- a/dtool/src/prc/configDeclaration.I +++ b/dtool/src/prc/configDeclaration.I @@ -187,7 +187,7 @@ get_int_word(size_t n) const { * Returns the int64 value of the nth word of the declaration's value, or 0 if * there is no nth value. See also has_int64_word(). */ -INLINE PN_int64 ConfigDeclaration:: +INLINE int64_t ConfigDeclaration:: get_int64_word(size_t n) const { // We use has_string_word() instead of has_int64_word(), so we can return a // partial answer if there was one. diff --git a/dtool/src/prc/configDeclaration.cxx b/dtool/src/prc/configDeclaration.cxx index 2c7550e90d..d692bec013 100644 --- a/dtool/src/prc/configDeclaration.cxx +++ b/dtool/src/prc/configDeclaration.cxx @@ -108,7 +108,7 @@ set_int_word(size_t n, int value) { * words. */ void ConfigDeclaration:: -set_int64_word(size_t n, PN_int64 value) { +set_int64_word(size_t n, int64_t value) { set_string_word(n, format_string(value)); _words[n]._flags |= (F_checked_int64 | F_valid_int64); @@ -294,8 +294,8 @@ check_int64_word(size_t n) { ++pi; // Negative number. while (pi != word._str.end() && isdigit(*pi)) { - PN_int64 next = word._int_64 * 10 - (int)((*pi) - '0'); - if ((PN_int64)(next / 10) != word._int_64) { + int64_t next = word._int_64 * 10 - (int)((*pi) - '0'); + if ((int64_t)(next / 10) != word._int_64) { // Overflow. overflow = true; } @@ -306,8 +306,8 @@ check_int64_word(size_t n) { } else { // Positive number. while (pi != word._str.end() && isdigit(*pi)) { - PN_int64 next = word._int_64 * 10 + (int)((*pi) - '0'); - if ((PN_int64)(next / 10) != word._int_64) { + int64_t next = word._int_64 * 10 + (int)((*pi) - '0'); + if ((int64_t)(next / 10) != word._int_64) { // Overflow. overflow = true; } diff --git a/dtool/src/prc/configDeclaration.h b/dtool/src/prc/configDeclaration.h index 7e9c96b6a5..696f4771d4 100644 --- a/dtool/src/prc/configDeclaration.h +++ b/dtool/src/prc/configDeclaration.h @@ -59,13 +59,13 @@ PUBLISHED: INLINE string get_string_word(size_t n) const; INLINE bool get_bool_word(size_t n) const; INLINE int get_int_word(size_t n) const; - INLINE PN_int64 get_int64_word(size_t n) const; + INLINE int64_t get_int64_word(size_t n) const; INLINE double get_double_word(size_t n) const; void set_string_word(size_t n, const string &value); void set_bool_word(size_t n, bool value); void set_int_word(size_t n, int value); - void set_int64_word(size_t n, PN_int64 value); + void set_int64_word(size_t n, int64_t value); void set_double_word(size_t n, double value); INLINE int get_decl_seq() const; @@ -106,7 +106,7 @@ private: string _str; bool _bool; int _int; - PN_int64 _int_64; + int64_t _int_64; double _double; short _flags; }; diff --git a/dtool/src/prc/configVariable.I b/dtool/src/prc/configVariable.I index 65ef0380aa..b46bc63529 100644 --- a/dtool/src/prc/configVariable.I +++ b/dtool/src/prc/configVariable.I @@ -196,7 +196,7 @@ get_int_word(size_t n) const { * Returns the int64 value of the nth word of the variable's value, or 0 if * there is no nth value. See also has_int_word(). */ -INLINE PN_int64 ConfigVariable:: +INLINE int64_t ConfigVariable:: get_int64_word(size_t n) const { nassertr(is_constructed(), 0); const ConfigDeclaration *decl = _core->get_declaration(0); @@ -249,7 +249,7 @@ set_int_word(size_t n, int value) { * words. */ INLINE void ConfigVariable:: -set_int64_word(size_t n, PN_int64 value) { +set_int64_word(size_t n, int64_t value) { nassertv(is_constructed()); _core->make_local_value()->set_int64_word(n, value); } diff --git a/dtool/src/prc/configVariable.h b/dtool/src/prc/configVariable.h index a937b1cdea..c8adb39e65 100644 --- a/dtool/src/prc/configVariable.h +++ b/dtool/src/prc/configVariable.h @@ -56,13 +56,13 @@ protected: INLINE string get_string_word(size_t n) const; INLINE bool get_bool_word(size_t n) const; INLINE int get_int_word(size_t n) const; - INLINE PN_int64 get_int64_word(size_t n) const; + INLINE int64_t get_int64_word(size_t n) const; INLINE double get_double_word(size_t n) const; INLINE void set_string_word(size_t n, const string &value); INLINE void set_bool_word(size_t n, bool value); INLINE void set_int_word(size_t n, int value); - INLINE void set_int64_word(size_t n, PN_int64 value); + INLINE void set_int64_word(size_t n, int64_t value); INLINE void set_double_word(size_t n, double value); protected: diff --git a/dtool/src/prc/configVariableInt64.I b/dtool/src/prc/configVariableInt64.I index 94d405cd76..f7c1c5d66b 100644 --- a/dtool/src/prc/configVariableInt64.I +++ b/dtool/src/prc/configVariableInt64.I @@ -26,7 +26,7 @@ ConfigVariableInt64(const string &name) : * */ INLINE ConfigVariableInt64:: -ConfigVariableInt64(const string &name, PN_int64 default_value, +ConfigVariableInt64(const string &name, int64_t default_value, const string &description, int flags) : #ifdef PRC_SAVE_DESCRIPTIONS ConfigVariable(name, ConfigVariableCore::VT_int64, description, flags), @@ -60,7 +60,7 @@ ConfigVariableInt64(const string &name, const string &default_value, * Reassigns the variable's local value. */ INLINE void ConfigVariableInt64:: -operator = (PN_int64 value) { +operator = (int64_t value) { set_value(value); } @@ -68,7 +68,7 @@ operator = (PN_int64 value) { * Returns the variable's value. */ INLINE ConfigVariableInt64:: -operator PN_int64 () const { +operator int64_t () const { return get_value(); } @@ -83,7 +83,7 @@ size() const { /** * Returns the value of the variable's nth word. */ -INLINE PN_int64 ConfigVariableInt64:: +INLINE int64_t ConfigVariableInt64:: operator [] (size_t n) const { return get_word(n); } @@ -92,7 +92,7 @@ operator [] (size_t n) const { * Reassigns the variable's local value. */ INLINE void ConfigVariableInt64:: -set_value(PN_int64 value) { +set_value(int64_t value) { set_string_value(""); set_int64_word(0, value); } @@ -100,9 +100,9 @@ set_value(PN_int64 value) { /** * Returns the variable's value. */ -INLINE PN_int64 ConfigVariableInt64:: +INLINE int64_t ConfigVariableInt64:: get_value() const { - TAU_PROFILE("PN_int64 ConfigVariableInt64::get_value() const", " ", TAU_USER); + TAU_PROFILE("int64_t ConfigVariableInt64::get_value() const", " ", TAU_USER); if (!is_cache_valid(_local_modified)) { mark_cache_valid(((ConfigVariableInt64 *)this)->_local_modified); ((ConfigVariableInt64 *)this)->_cache = get_int64_word(0); @@ -113,7 +113,7 @@ get_value() const { /** * Returns the variable's default value. */ -INLINE PN_int64 ConfigVariableInt64:: +INLINE int64_t ConfigVariableInt64:: get_default_value() const { const ConfigDeclaration *decl = ConfigVariable::get_default_value(); if (decl != (ConfigDeclaration *)NULL) { @@ -125,7 +125,7 @@ get_default_value() const { /** * Returns the variable's nth value. */ -INLINE PN_int64 ConfigVariableInt64:: +INLINE int64_t ConfigVariableInt64:: get_word(size_t n) const { return get_int64_word(n); } @@ -135,6 +135,6 @@ get_word(size_t n) const { * variable's overall value. */ INLINE void ConfigVariableInt64:: -set_word(size_t n, PN_int64 value) { +set_word(size_t n, int64_t value) { set_int64_word(n, value); } diff --git a/dtool/src/prc/configVariableInt64.cxx b/dtool/src/prc/configVariableInt64.cxx index 5545678685..1b8166d496 100644 --- a/dtool/src/prc/configVariableInt64.cxx +++ b/dtool/src/prc/configVariableInt64.cxx @@ -18,6 +18,6 @@ * */ void ConfigVariableInt64:: -set_default_value(PN_int64 default_value) { +set_default_value(int64_t default_value) { _core->set_default_value(format_string(default_value)); } diff --git a/dtool/src/prc/configVariableInt64.h b/dtool/src/prc/configVariableInt64.h index 835c165f8a..40477f87cc 100644 --- a/dtool/src/prc/configVariableInt64.h +++ b/dtool/src/prc/configVariableInt64.h @@ -25,34 +25,34 @@ class EXPCL_DTOOLCONFIG ConfigVariableInt64 : public ConfigVariable { PUBLISHED: INLINE ConfigVariableInt64(const string &name); - INLINE ConfigVariableInt64(const string &name, PN_int64 default_value, + INLINE ConfigVariableInt64(const string &name, int64_t default_value, const string &description = string(), int flags = 0); INLINE ConfigVariableInt64(const string &name, const string &default_value, const string &description = string(), int flags = 0); - INLINE void operator = (PN_int64 value); - INLINE operator PN_int64 () const; + INLINE void operator = (int64_t value); + INLINE operator int64_t () const; INLINE size_t size() const; - INLINE PN_int64 operator [] (size_t n) const; + INLINE int64_t operator [] (size_t n) const; - INLINE void set_value(PN_int64 value); - INLINE PN_int64 get_value() const; - INLINE PN_int64 get_default_value() const; + INLINE void set_value(int64_t value); + INLINE int64_t get_value() const; + INLINE int64_t get_default_value() const; MAKE_PROPERTY(value, get_value, set_value); MAKE_PROPERTY(default_value, get_default_value); - INLINE PN_int64 get_word(size_t n) const; - INLINE void set_word(size_t n, PN_int64 value); + INLINE int64_t get_word(size_t n) const; + INLINE void set_word(size_t n, int64_t value); private: - void set_default_value(PN_int64 default_value); + void set_default_value(int64_t default_value); private: AtomicAdjust::Integer _local_modified; - PN_int64 _cache; + int64_t _cache; }; #include "configVariableInt64.I" diff --git a/dtool/src/prc/encryptStreamBuf.cxx b/dtool/src/prc/encryptStreamBuf.cxx index a308412797..acf76f9c0a 100644 --- a/dtool/src/prc/encryptStreamBuf.cxx +++ b/dtool/src/prc/encryptStreamBuf.cxx @@ -276,12 +276,12 @@ open_write(ostream *dest, bool owns_dest, const string &password) { // Now write the header information to the stream. StreamWriter sw(_dest, false); - nassertv((PN_uint16)nid == nid); - sw.add_uint16((PN_uint16)nid); - nassertv((PN_uint16)key_length == key_length); - sw.add_uint16((PN_uint16)key_length); - nassertv((PN_uint16)count == count); - sw.add_uint16((PN_uint16)count); + nassertv((uint16_t)nid == nid); + sw.add_uint16((uint16_t)nid); + nassertv((uint16_t)key_length == key_length); + sw.add_uint16((uint16_t)key_length); + nassertv((uint16_t)count == count); + sw.add_uint16((uint16_t)count); sw.append_data(iv, iv_length); _write_valid = true; diff --git a/dtool/src/prc/nativeNumericData.I b/dtool/src/prc/nativeNumericData.I index 9a43707c9f..9f08e4cfe3 100644 --- a/dtool/src/prc/nativeNumericData.I +++ b/dtool/src/prc/nativeNumericData.I @@ -54,24 +54,24 @@ get_data() const { // this is for a intel compile .. it is native format and it is readable off // word boundries -inline void TS_SetVal1(const PN_int8 * src, PN_int8 *dst) +inline void TS_SetVal1(const int8_t * src, int8_t *dst) { *dst = *src; } inline void TS_SetVal2(const char * src, char *dst) { - *(reinterpret_cast(dst)) = *(reinterpret_cast (src)); + *(reinterpret_cast(dst)) = *(reinterpret_cast (src)); } inline void TS_SetVal4(const char * src, char *dst) { - *(reinterpret_cast (dst)) = *(reinterpret_cast (src)); + *(reinterpret_cast (dst)) = *(reinterpret_cast (src)); } inline void TS_SetVal8(const char * src, char *dst) { - *(reinterpret_cast(dst)) = *(reinterpret_cast(src)); + *(reinterpret_cast(dst)) = *(reinterpret_cast(src)); } template inline type TS_GetInteger(type &val,const char * _src) diff --git a/dtool/src/prc/streamReader.I b/dtool/src/prc/streamReader.I index e02e3e9aec..8f96aa85f4 100644 --- a/dtool/src/prc/streamReader.I +++ b/dtool/src/prc/streamReader.I @@ -83,25 +83,25 @@ get_bool() { /** * Extracts a signed 8-bit integer. */ -INLINE PN_int8 StreamReader:: +INLINE int8_t StreamReader:: get_int8() { - return (PN_int8)_in->get(); + return (int8_t)_in->get(); } /** * Extracts an unsigned 8-bit integer. */ -INLINE PN_uint8 StreamReader:: +INLINE uint8_t StreamReader:: get_uint8() { - return (PN_uint8)_in->get(); + return (uint8_t)_in->get(); } /** * Extracts a signed 16-bit integer. */ -INLINE PN_int16 StreamReader:: +INLINE int16_t StreamReader:: get_int16() { - PN_int16 readval, retval; + int16_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -111,9 +111,9 @@ get_int16() { /** * Extracts a signed 32-bit integer. */ -INLINE PN_int32 StreamReader:: +INLINE int32_t StreamReader:: get_int32() { - PN_int32 readval, retval; + int32_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -123,9 +123,9 @@ get_int32() { /** * Extracts a signed 64-bit integer. */ -INLINE PN_int64 StreamReader:: +INLINE int64_t StreamReader:: get_int64() { - PN_int64 readval, retval; + int64_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -135,9 +135,9 @@ get_int64() { /** * Extracts an unsigned 16-bit integer. */ -INLINE PN_uint16 StreamReader:: +INLINE uint16_t StreamReader:: get_uint16() { - PN_uint16 readval, retval; + uint16_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -147,9 +147,9 @@ get_uint16() { /** * Extracts an unsigned 32-bit integer. */ -INLINE PN_uint32 StreamReader:: +INLINE uint32_t StreamReader:: get_uint32() { - PN_uint32 readval, retval; + uint32_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -159,9 +159,9 @@ get_uint32() { /** * Extracts an unsigned 64-bit integer. */ -INLINE PN_uint64 StreamReader:: +INLINE uint64_t StreamReader:: get_uint64() { - PN_uint64 readval, retval; + uint64_t readval, retval; _in->read((char *)&readval, sizeof(readval)); LittleEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -202,9 +202,9 @@ get_float64() { /** * Extracts a signed big-endian 16-bit integer. */ -INLINE PN_int16 StreamReader:: +INLINE int16_t StreamReader:: get_be_int16() { - PN_int16 readval, retval; + int16_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -214,9 +214,9 @@ get_be_int16() { /** * Extracts a signed big-endian 32-bit integer. */ -INLINE PN_int32 StreamReader:: +INLINE int32_t StreamReader:: get_be_int32() { - PN_int32 readval, retval; + int32_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -226,9 +226,9 @@ get_be_int32() { /** * Extracts a signed big-endian 64-bit integer. */ -INLINE PN_int64 StreamReader:: +INLINE int64_t StreamReader:: get_be_int64() { - PN_int64 readval, retval; + int64_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -238,9 +238,9 @@ get_be_int64() { /** * Extracts an unsigned big-endian 16-bit integer. */ -INLINE PN_uint16 StreamReader:: +INLINE uint16_t StreamReader:: get_be_uint16() { - PN_uint16 readval, retval; + uint16_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -250,9 +250,9 @@ get_be_uint16() { /** * Extracts an unsigned big-endian 32-bit integer. */ -INLINE PN_uint32 StreamReader:: +INLINE uint32_t StreamReader:: get_be_uint32() { - PN_uint32 readval, retval; + uint32_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); @@ -262,9 +262,9 @@ get_be_uint32() { /** * Extracts an unsigned big-endian 64-bit integer. */ -INLINE PN_uint64 StreamReader:: +INLINE uint64_t StreamReader:: get_be_uint64() { - PN_uint64 readval, retval; + uint64_t readval, retval; _in->read((char *)&readval, sizeof(readval)); BigEndian s(&readval, 0, sizeof(readval)); s.store_value(&retval, sizeof(retval)); diff --git a/dtool/src/prc/streamReader.h b/dtool/src/prc/streamReader.h index f281a88f1c..1c820253c1 100644 --- a/dtool/src/prc/streamReader.h +++ b/dtool/src/prc/streamReader.h @@ -37,24 +37,24 @@ PUBLISHED: MAKE_PROPERTY(istream, get_istream); BLOCKING INLINE bool get_bool(); - BLOCKING INLINE PN_int8 get_int8(); - BLOCKING INLINE PN_uint8 get_uint8(); + BLOCKING INLINE int8_t get_int8(); + BLOCKING INLINE uint8_t get_uint8(); - BLOCKING INLINE PN_int16 get_int16(); - BLOCKING INLINE PN_int32 get_int32(); - BLOCKING INLINE PN_int64 get_int64(); - BLOCKING INLINE PN_uint16 get_uint16(); - BLOCKING INLINE PN_uint32 get_uint32(); - BLOCKING INLINE PN_uint64 get_uint64(); + BLOCKING INLINE int16_t get_int16(); + BLOCKING INLINE int32_t get_int32(); + BLOCKING INLINE int64_t get_int64(); + BLOCKING INLINE uint16_t get_uint16(); + BLOCKING INLINE uint32_t get_uint32(); + BLOCKING INLINE uint64_t get_uint64(); BLOCKING INLINE float get_float32(); BLOCKING INLINE PN_float64 get_float64(); - BLOCKING INLINE PN_int16 get_be_int16(); - BLOCKING INLINE PN_int32 get_be_int32(); - BLOCKING INLINE PN_int64 get_be_int64(); - BLOCKING INLINE PN_uint16 get_be_uint16(); - BLOCKING INLINE PN_uint32 get_be_uint32(); - BLOCKING INLINE PN_uint64 get_be_uint64(); + BLOCKING INLINE int16_t get_be_int16(); + BLOCKING INLINE int32_t get_be_int32(); + BLOCKING INLINE int64_t get_be_int64(); + BLOCKING INLINE uint16_t get_be_uint16(); + BLOCKING INLINE uint32_t get_be_uint32(); + BLOCKING INLINE uint64_t get_be_uint64(); BLOCKING INLINE float get_be_float32(); BLOCKING INLINE PN_float64 get_be_float64(); diff --git a/dtool/src/prc/streamWriter.I b/dtool/src/prc/streamWriter.I index 9db035094f..8bbe23af62 100644 --- a/dtool/src/prc/streamWriter.I +++ b/dtool/src/prc/streamWriter.I @@ -92,7 +92,7 @@ add_bool(bool b) { * Adds a signed 8-bit integer to the stream. */ INLINE void StreamWriter:: -add_int8(PN_int8 value) { +add_int8(int8_t value) { append_data(&value, 1); } @@ -100,7 +100,7 @@ add_int8(PN_int8 value) { * Adds an unsigned 8-bit integer to the stream. */ INLINE void StreamWriter:: -add_uint8(PN_uint8 value) { +add_uint8(uint8_t value) { append_data(&value, 1); } @@ -108,7 +108,7 @@ add_uint8(PN_uint8 value) { * Adds a signed 16-bit integer to the stream. */ INLINE void StreamWriter:: -add_int16(PN_int16 value) { +add_int16(int16_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -117,7 +117,7 @@ add_int16(PN_int16 value) { * Adds a signed 32-bit integer to the stream. */ INLINE void StreamWriter:: -add_int32(PN_int32 value) { +add_int32(int32_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -126,7 +126,7 @@ add_int32(PN_int32 value) { * Adds a signed 64-bit integer to the stream. */ INLINE void StreamWriter:: -add_int64(PN_int64 value) { +add_int64(int64_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -135,7 +135,7 @@ add_int64(PN_int64 value) { * Adds an unsigned 16-bit integer to the stream. */ INLINE void StreamWriter:: -add_uint16(PN_uint16 value) { +add_uint16(uint16_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -144,7 +144,7 @@ add_uint16(PN_uint16 value) { * Adds an unsigned 32-bit integer to the stream. */ INLINE void StreamWriter:: -add_uint32(PN_uint32 value) { +add_uint32(uint32_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -153,7 +153,7 @@ add_uint32(PN_uint32 value) { * Adds an unsigned 64-bit integer to the stream. */ INLINE void StreamWriter:: -add_uint64(PN_uint64 value) { +add_uint64(uint64_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -186,7 +186,7 @@ add_float64(PN_float64 value) { * Adds a signed 16-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_int16(PN_int16 value) { +add_be_int16(int16_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -195,7 +195,7 @@ add_be_int16(PN_int16 value) { * Adds a signed 32-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_int32(PN_int32 value) { +add_be_int32(int32_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -204,7 +204,7 @@ add_be_int32(PN_int32 value) { * Adds a signed 64-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_int64(PN_int64 value) { +add_be_int64(int64_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -213,7 +213,7 @@ add_be_int64(PN_int64 value) { * Adds an unsigned 16-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_uint16(PN_uint16 value) { +add_be_uint16(uint16_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -222,7 +222,7 @@ add_be_uint16(PN_uint16 value) { * Adds an unsigned 32-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_uint32(PN_uint32 value) { +add_be_uint32(uint32_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -231,7 +231,7 @@ add_be_uint32(PN_uint32 value) { * Adds an unsigned 64-bit big-endian integer to the streamWriter. */ INLINE void StreamWriter:: -add_be_uint64(PN_uint64 value) { +add_be_uint64(uint64_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -267,10 +267,10 @@ add_be_float64(PN_float64 value) { INLINE void StreamWriter:: add_string(const string &str) { // The max sendable length for a string is 2^16. - nassertv(str.length() <= (PN_uint16)0xffff); + nassertv(str.length() <= (uint16_t)0xffff); // Strings always are preceded by their length - add_uint16((PN_uint16)str.length()); + add_uint16((uint16_t)str.length()); // Add the string append_data(str); @@ -282,7 +282,7 @@ add_string(const string &str) { INLINE void StreamWriter:: add_string32(const string &str) { // Strings always are preceded by their length - add_uint32((PN_uint32)str.length()); + add_uint32((uint32_t)str.length()); // Add the string append_data(str); diff --git a/dtool/src/prc/streamWriter.h b/dtool/src/prc/streamWriter.h index 42157db277..2f04a9ab8d 100644 --- a/dtool/src/prc/streamWriter.h +++ b/dtool/src/prc/streamWriter.h @@ -39,26 +39,26 @@ PUBLISHED: MAKE_PROPERTY(ostream, get_ostream); BLOCKING INLINE void add_bool(bool value); - BLOCKING INLINE void add_int8(PN_int8 value); - BLOCKING INLINE void add_uint8(PN_uint8 value); + BLOCKING INLINE void add_int8(int8_t value); + BLOCKING INLINE void add_uint8(uint8_t value); // The default numeric packing is little-endian. - BLOCKING INLINE void add_int16(PN_int16 value); - BLOCKING INLINE void add_int32(PN_int32 value); - BLOCKING INLINE void add_int64(PN_int64 value); - BLOCKING INLINE void add_uint16(PN_uint16 value); - BLOCKING INLINE void add_uint32(PN_uint32 value); - BLOCKING INLINE void add_uint64(PN_uint64 value); + BLOCKING INLINE void add_int16(int16_t value); + BLOCKING INLINE void add_int32(int32_t value); + BLOCKING INLINE void add_int64(int64_t value); + BLOCKING INLINE void add_uint16(uint16_t value); + BLOCKING INLINE void add_uint32(uint32_t value); + BLOCKING INLINE void add_uint64(uint64_t value); BLOCKING INLINE void add_float32(float value); BLOCKING INLINE void add_float64(PN_float64 value); // These functions pack numbers big-endian, in case that's desired. - BLOCKING INLINE void add_be_int16(PN_int16 value); - BLOCKING INLINE void add_be_int32(PN_int32 value); - BLOCKING INLINE void add_be_int64(PN_int64 value); - BLOCKING INLINE void add_be_uint16(PN_uint16 value); - BLOCKING INLINE void add_be_uint32(PN_uint32 value); - BLOCKING INLINE void add_be_uint64(PN_uint64 value); + BLOCKING INLINE void add_be_int16(int16_t value); + BLOCKING INLINE void add_be_int32(int32_t value); + BLOCKING INLINE void add_be_int64(int64_t value); + BLOCKING INLINE void add_be_uint16(uint16_t value); + BLOCKING INLINE void add_be_uint32(uint32_t value); + BLOCKING INLINE void add_be_uint64(uint64_t value); BLOCKING INLINE void add_be_float32(float value); BLOCKING INLINE void add_be_float64(PN_float64 value); diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 07df329f51..ea89dc7c22 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2203,7 +2203,7 @@ DTOOL_CONFIG=[ ("PHAVE_DIRENT_H", 'UNDEF', '1'), ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'), ("PHAVE_UCONTEXT_H", 'UNDEF', '1'), - ("PHAVE_STDINT_H", 'UNDEF', '1'), + ("PHAVE_STDINT_H", '1', '1'), ("HAVE_RTTI", '1', '1'), ("HAVE_X11", 'UNDEF', '1'), ("HAVE_XRANDR", 'UNDEF', '1'), diff --git a/panda/src/audiotraits/openalAudioManager.cxx b/panda/src/audiotraits/openalAudioManager.cxx index c32407970c..ba1b4684a3 100644 --- a/panda/src/audiotraits/openalAudioManager.cxx +++ b/panda/src/audiotraits/openalAudioManager.cxx @@ -438,7 +438,7 @@ get_sound_data(MovieAudio *movie, int mode) { } int channels = stream->audio_channels(); int samples = (int)(stream->length() * stream->audio_rate()); - PN_int16 *data = new PN_int16[samples * channels]; + int16_t *data = new int16_t[samples * channels]; stream->read_samples(samples, data); alBufferData(sd->_sample, (channels>1) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16, diff --git a/panda/src/audiotraits/openalAudioSound.cxx b/panda/src/audiotraits/openalAudioSound.cxx index 7237b2fefe..43ebd149cb 100644 --- a/panda/src/audiotraits/openalAudioSound.cxx +++ b/panda/src/audiotraits/openalAudioSound.cxx @@ -383,8 +383,8 @@ read_stream_data(int bytelen, unsigned char *buffer) { if (samples > _sd->_stream->ready()) { samples = _sd->_stream->ready(); } - cursor->read_samples(samples, (PN_int16 *)buffer); - size_t hval = AddHash::add_hash(0, (PN_uint8*)buffer, samples*channels*2); + cursor->read_samples(samples, (int16_t *)buffer); + size_t hval = AddHash::add_hash(0, (uint8_t*)buffer, samples*channels*2); audio_debug("Streaming " << cursor->get_source()->get_name() << " at " << t << " hash " << hval); fill += samples; space -= samples; diff --git a/panda/src/display/displayInformation.cxx b/panda/src/display/displayInformation.cxx index aa83cfdf97..60e3a69e8b 100644 --- a/panda/src/display/displayInformation.cxx +++ b/panda/src/display/displayInformation.cxx @@ -81,8 +81,8 @@ DisplayInformation() { DisplayMode *display_mode_array; int video_memory; int texture_memory; - PN_uint64 physical_memory; - PN_uint64 available_physical_memory; + uint64_t physical_memory; + uint64_t available_physical_memory; state = DisplayInformation::DS_unknown; get_adapter_display_mode_state = false; @@ -325,7 +325,7 @@ update_memory_information() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_physical_memory() { return _physical_memory; } @@ -333,7 +333,7 @@ get_physical_memory() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_available_physical_memory() { return _available_physical_memory; } @@ -341,7 +341,7 @@ get_available_physical_memory() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_page_file_size() { return _page_file_size; } @@ -349,7 +349,7 @@ get_page_file_size() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_available_page_file_size() { return _available_page_file_size; } @@ -357,7 +357,7 @@ get_available_page_file_size() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_process_virtual_memory() { return _process_virtual_memory; } @@ -365,7 +365,7 @@ get_process_virtual_memory() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_available_process_virtual_memory() { return _available_process_virtual_memory; } @@ -381,7 +381,7 @@ get_memory_load() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_page_fault_count() { return _page_fault_count; } @@ -389,7 +389,7 @@ get_page_fault_count() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_process_memory() { return _process_memory; } @@ -397,7 +397,7 @@ get_process_memory() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_peak_process_memory() { return _peak_process_memory; } @@ -405,7 +405,7 @@ get_peak_process_memory() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_page_file_usage() { return _page_file_usage; } @@ -413,7 +413,7 @@ get_page_file_usage() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_peak_page_file_usage() { return _peak_page_file_usage; } @@ -570,7 +570,7 @@ get_cpu_brand_index() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_cpu_frequency() { return _cpu_frequency; } @@ -578,9 +578,9 @@ get_cpu_frequency() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_cpu_time() { - PN_uint64 cpu_time; + uint64_t cpu_time; cpu_time = 0; if (_cpu_time_function) { @@ -593,7 +593,7 @@ get_cpu_time() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_maximum_cpu_frequency() { return _maximum_cpu_frequency; } @@ -601,7 +601,7 @@ get_maximum_cpu_frequency() { /** * */ -PN_uint64 DisplayInformation:: +uint64_t DisplayInformation:: get_current_cpu_frequency() { return _current_cpu_frequency; } diff --git a/panda/src/display/displayInformation.h b/panda/src/display/displayInformation.h index e8ddfd2a72..440e3e8ee8 100644 --- a/panda/src/display/displayInformation.h +++ b/panda/src/display/displayInformation.h @@ -69,18 +69,18 @@ PUBLISHED: int get_texture_memory(); void update_memory_information(); - PN_uint64 get_physical_memory(); - PN_uint64 get_available_physical_memory(); - PN_uint64 get_page_file_size(); - PN_uint64 get_available_page_file_size(); - PN_uint64 get_process_virtual_memory(); - PN_uint64 get_available_process_virtual_memory(); + uint64_t get_physical_memory(); + uint64_t get_available_physical_memory(); + uint64_t get_page_file_size(); + uint64_t get_available_page_file_size(); + uint64_t get_process_virtual_memory(); + uint64_t get_available_process_virtual_memory(); int get_memory_load(); - PN_uint64 get_page_fault_count(); - PN_uint64 get_process_memory(); - PN_uint64 get_peak_process_memory(); - PN_uint64 get_page_file_usage(); - PN_uint64 get_peak_page_file_usage(); + uint64_t get_page_fault_count(); + uint64_t get_process_memory(); + uint64_t get_peak_process_memory(); + uint64_t get_page_file_usage(); + uint64_t get_peak_page_file_usage(); int get_vendor_id(); int get_device_id(); @@ -103,11 +103,11 @@ PUBLISHED: unsigned int get_cpu_version_information(); unsigned int get_cpu_brand_index(); - PN_uint64 get_cpu_frequency(); - PN_uint64 get_cpu_time(); + uint64_t get_cpu_frequency(); + uint64_t get_cpu_time(); - PN_uint64 get_maximum_cpu_frequency(); - PN_uint64 get_current_cpu_frequency(); + uint64_t get_maximum_cpu_frequency(); + uint64_t get_current_cpu_frequency(); void update_cpu_frequency(int processor_number); int get_num_cpu_cores(); @@ -131,18 +131,18 @@ public: int _video_memory; int _texture_memory; - PN_uint64 _physical_memory; - PN_uint64 _available_physical_memory; - PN_uint64 _page_file_size; - PN_uint64 _available_page_file_size; - PN_uint64 _process_virtual_memory; - PN_uint64 _available_process_virtual_memory; + uint64_t _physical_memory; + uint64_t _available_physical_memory; + uint64_t _page_file_size; + uint64_t _available_page_file_size; + uint64_t _process_virtual_memory; + uint64_t _available_process_virtual_memory; - PN_uint64 _page_fault_count; - PN_uint64 _process_memory; - PN_uint64 _peak_process_memory; - PN_uint64 _page_file_usage; - PN_uint64 _peak_page_file_usage; + uint64_t _page_fault_count; + uint64_t _process_memory; + uint64_t _peak_process_memory; + uint64_t _page_file_usage; + uint64_t _peak_page_file_usage; int _memory_load; @@ -167,16 +167,16 @@ public: unsigned int _cpu_version_information; unsigned int _cpu_brand_index; - PN_uint64 _cpu_frequency; + uint64_t _cpu_frequency; - PN_uint64 _maximum_cpu_frequency; - PN_uint64 _current_cpu_frequency; + uint64_t _maximum_cpu_frequency; + uint64_t _current_cpu_frequency; int _num_cpu_cores; int _num_logical_cpus; void (*_get_memory_information_function) (DisplayInformation *display_information); - PN_uint64 (*_cpu_time_function) (void); + uint64_t (*_cpu_time_function) (void); int (*_update_cpu_frequency_function) (int processor_number, DisplayInformation *display_information); int _os_version_major; diff --git a/panda/src/downloader/downloadDb.cxx b/panda/src/downloader/downloadDb.cxx index 7e56101ffa..f2a734af17 100644 --- a/panda/src/downloader/downloadDb.cxx +++ b/panda/src/downloader/downloadDb.cxx @@ -23,13 +23,13 @@ // Defines // Written at the top of the file so we know this is a downloadDb -PN_uint32 DownloadDb::_magic_number = 0xfeedfeed; +uint32_t DownloadDb::_magic_number = 0xfeedfeed; // Written at the top of the file to signify we are not done writing to the // file yet. If you load a db with this magic number that means the previous // time it got written out was probably interrupted in the middle of the // write. -PN_uint32 DownloadDb::_bogus_magic_number = 0x11111111; +uint32_t DownloadDb::_bogus_magic_number = 0x11111111; static string @@ -505,7 +505,7 @@ add_file_record(PT(FileRecord) fr) { DownloadDb::Db:: Db() { // The head is a magic number and the number of multifiles in the db - _header_length = sizeof(_magic_number) + sizeof(PN_int32); + _header_length = sizeof(_magic_number) + sizeof(int32_t); } @@ -588,7 +588,7 @@ parse_header(const string &data) { // Make sure we have a good header DatagramIterator di(dg); - PN_uint32 magic_number = di.get_uint32(); + uint32_t magic_number = di.get_uint32(); downloader_cat.debug() << "Parsed magic number: " << magic_number << endl; // If the magic number is equal to the bogus magic number it signifies that @@ -608,7 +608,7 @@ parse_header(const string &data) { return -1; } - PN_int32 num_multifiles = di.get_int32(); + int32_t num_multifiles = di.get_int32(); downloader_cat.debug() << "Parsed number of multifiles: " << num_multifiles << endl; @@ -626,7 +626,7 @@ int DownloadDb::Db:: parse_record_header(const string &data) { Datagram dg(data); DatagramIterator di(dg); - PN_int32 record_length = di.get_int32(); + int32_t record_length = di.get_int32(); downloader_cat.spam() << "Parsed record header length: " << record_length << endl; @@ -645,7 +645,7 @@ parse_mfr(const string &data) { Datagram dg(data); DatagramIterator di(dg); - PN_int32 mfr_name_length = di.get_int32(); + int32_t mfr_name_length = di.get_int32(); mfr->_name = di.extract_bytes(mfr_name_length); mfr->_phase = di.get_float64(); mfr->_size = di.get_int32(); @@ -682,7 +682,7 @@ parse_fr(const string &data) { Datagram dg(data); DatagramIterator di(dg); - PN_int32 fr_name_length = di.get_int32(); + int32_t fr_name_length = di.get_int32(); fr->_name = di.extract_bytes(fr_name_length); // At one time, we stored files in the database with a backslash separator. @@ -725,7 +725,7 @@ read(StreamReader &sr, bool want_server_info) { for (int i = 0; i < num_multifiles; i++) { // The multifile record header is just one int which represents the size // of the record - int mfr_header_length = sizeof(PN_int32); + int mfr_header_length = sizeof(int32_t); string mfr_header = sr.extract_bytes(mfr_header_length); if (mfr_header.size() != (size_t)mfr_header_length) { @@ -755,7 +755,7 @@ read(StreamReader &sr, bool want_server_info) { for (int j = 0; j < mfr->_num_files; j++) { // The file record header is just one int which represents the size of // the record - int fr_header_length = sizeof(PN_int32); + int fr_header_length = sizeof(int32_t); // Read the header string fr_header = sr.extract_bytes(fr_header_length); @@ -802,11 +802,11 @@ write(StreamWriter &sw, bool want_server_info) { // Declare these outside the loop so we do not keep creating and deleting // them PN_float64 phase; - PN_int32 size; - PN_int32 status; - PN_int32 num_files; - PN_int32 name_length; - PN_int32 header_length; + int32_t size; + int32_t status; + int32_t num_files; + int32_t name_length; + int32_t header_length; // Iterate over the multifiles writing them to the stream pvector< PT(MultifileRecord) >::const_iterator i = _mfile_records.begin(); @@ -825,7 +825,7 @@ write(StreamWriter &sw, bool want_server_info) { (*i)->_name.length() + // Size of the name string sizeof(phase) + sizeof(size) + sizeof(status) + sizeof(num_files) + - sizeof(PN_uint32)*4; // Size of hash value + sizeof(uint32_t)*4; // Size of hash value // Add the length of this entire datagram sw.add_int32(header_length); diff --git a/panda/src/downloader/downloadDb.h b/panda/src/downloader/downloadDb.h index d46f3a1890..e1605f6295 100644 --- a/panda/src/downloader/downloadDb.h +++ b/panda/src/downloader/downloadDb.h @@ -156,7 +156,7 @@ public: int _size; int _status; HashVal _hash; - PN_int32 _num_files; + int32_t _num_files; FileRecords _file_records; }; @@ -182,7 +182,7 @@ public: bool write_header(ostream &write_stream); bool write_bogus_header(StreamWriter &sw); private: - PN_int32 _header_length; + int32_t _header_length; }; PUBLISHED: @@ -197,8 +197,8 @@ public: Db _server_db; // Magic number for knowing this is a download Db - static PN_uint32 _magic_number; - static PN_uint32 _bogus_magic_number; + static uint32_t _magic_number; + static uint32_t _bogus_magic_number; typedef pvector VectorHash; typedef pmap VersionMap; diff --git a/panda/src/express/config_express.cxx b/panda/src/express/config_express.cxx index 8bf5dff316..dd590fcb38 100644 --- a/panda/src/express/config_express.cxx +++ b/panda/src/express/config_express.cxx @@ -127,15 +127,15 @@ init_libexpress() { // This is a fine place to ensure that the numeric types have been chosen // correctly. - nassertv(sizeof(PN_int8) == 1 && sizeof(PN_uint8) == 1); - nassertv(sizeof(PN_int16) == 2 && sizeof(PN_uint16) == 2); - nassertv(sizeof(PN_int32) == 4 && sizeof(PN_uint32) == 4); - nassertv(sizeof(PN_int64) == 8 && sizeof(PN_uint64) == 8); + nassertv(sizeof(int8_t) == 1 && sizeof(uint8_t) == 1); + nassertv(sizeof(int16_t) == 2 && sizeof(uint16_t) == 2); + nassertv(sizeof(int32_t) == 4 && sizeof(uint32_t) == 4); + nassertv(sizeof(int64_t) == 8 && sizeof(uint64_t) == 8); nassertv(sizeof(PN_float32) == 4); nassertv(sizeof(PN_float64) == 8); // Also, ensure that we have the right endianness. - PN_uint32 word; + uint32_t word; memcpy(&word, "\1\2\3\4", 4); #ifdef WORDS_BIGENDIAN nassertv(word == 0x01020304); diff --git a/panda/src/express/datagram.I b/panda/src/express/datagram.I index ded1a56d09..0ad4007b26 100644 --- a/panda/src/express/datagram.I +++ b/panda/src/express/datagram.I @@ -106,7 +106,7 @@ add_bool(bool b) { * Adds a signed 8-bit integer to the datagram. */ INLINE void Datagram:: -add_int8(PN_int8 value) { +add_int8(int8_t value) { append_data(&value, 1); } @@ -114,7 +114,7 @@ add_int8(PN_int8 value) { * Adds an unsigned 8-bit integer to the datagram. */ INLINE void Datagram:: -add_uint8(PN_uint8 value) { +add_uint8(uint8_t value) { append_data(&value, 1); } @@ -122,7 +122,7 @@ add_uint8(PN_uint8 value) { * Adds a signed 16-bit integer to the datagram. */ INLINE void Datagram:: -add_int16(PN_int16 value) { +add_int16(int16_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -131,7 +131,7 @@ add_int16(PN_int16 value) { * Adds a signed 32-bit integer to the datagram. */ INLINE void Datagram:: -add_int32(PN_int32 value) { +add_int32(int32_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -140,7 +140,7 @@ add_int32(PN_int32 value) { * Adds a signed 64-bit integer to the datagram. */ INLINE void Datagram:: -add_int64(PN_int64 value) { +add_int64(int64_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -149,7 +149,7 @@ add_int64(PN_int64 value) { * Adds an unsigned 16-bit integer to the datagram. */ INLINE void Datagram:: -add_uint16(PN_uint16 value) { +add_uint16(uint16_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -158,7 +158,7 @@ add_uint16(PN_uint16 value) { * Adds an unsigned 32-bit integer to the datagram. */ INLINE void Datagram:: -add_uint32(PN_uint32 value) { +add_uint32(uint32_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -167,7 +167,7 @@ add_uint32(PN_uint32 value) { * Adds an unsigned 64-bit integer to the datagram. */ INLINE void Datagram:: -add_uint64(PN_uint64 value) { +add_uint64(uint64_t value) { LittleEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -209,7 +209,7 @@ add_stdfloat(PN_stdfloat value) { * Adds a signed 16-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_int16(PN_int16 value) { +add_be_int16(int16_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -218,7 +218,7 @@ add_be_int16(PN_int16 value) { * Adds a signed 32-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_int32(PN_int32 value) { +add_be_int32(int32_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -227,7 +227,7 @@ add_be_int32(PN_int32 value) { * Adds a signed 64-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_int64(PN_int64 value) { +add_be_int64(int64_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -236,7 +236,7 @@ add_be_int64(PN_int64 value) { * Adds an unsigned 16-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_uint16(PN_uint16 value) { +add_be_uint16(uint16_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -245,7 +245,7 @@ add_be_uint16(PN_uint16 value) { * Adds an unsigned 32-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_uint32(PN_uint32 value) { +add_be_uint32(uint32_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -254,7 +254,7 @@ add_be_uint32(PN_uint32 value) { * Adds an unsigned 64-bit big-endian integer to the datagram. */ INLINE void Datagram:: -add_be_uint64(PN_uint64 value) { +add_be_uint64(uint64_t value) { BigEndian s(&value, sizeof(value)); append_data(s.get_data(), sizeof(value)); } @@ -285,10 +285,10 @@ add_be_float64(PN_float64 value) { INLINE void Datagram:: add_string(const string &str) { // The max sendable length for a string is 2^16. - nassertv(str.length() <= (PN_uint16)0xffff); + nassertv(str.length() <= (uint16_t)0xffff); // Strings always are preceded by their length - add_uint16((PN_uint16)str.length()); + add_uint16((uint16_t)str.length()); // Add the string append_data(str); @@ -301,7 +301,7 @@ add_string(const string &str) { INLINE void Datagram:: add_string32(const string &str) { // Strings always are preceded by their length - add_uint32((PN_uint32)str.length()); + add_uint32((uint32_t)str.length()); // Add the string append_data(str); diff --git a/panda/src/express/datagram.cxx b/panda/src/express/datagram.cxx index cf0d442e14..1121953948 100644 --- a/panda/src/express/datagram.cxx +++ b/panda/src/express/datagram.cxx @@ -82,13 +82,13 @@ dump_hex(ostream &out, unsigned int indent) const { void Datagram:: add_wstring(const wstring &str) { // By convention, wstrings are marked with 32-bit lengths. - add_uint32((PN_uint32)str.length()); + add_uint32((uint32_t)str.length()); // Now append each character in the string. We store each code little- // endian, for no real good reason. wstring::const_iterator ci; for (ci = str.begin(); ci != str.end(); ++ci) { - add_uint16((PN_uint16)*ci); + add_uint16((uint16_t)*ci); } } diff --git a/panda/src/express/datagram.h b/panda/src/express/datagram.h index b599fca10b..c2cb3b4c8b 100644 --- a/panda/src/express/datagram.h +++ b/panda/src/express/datagram.h @@ -54,27 +54,27 @@ PUBLISHED: void dump_hex(ostream &out, unsigned int indent=0) const; INLINE void add_bool(bool value); - INLINE void add_int8(PN_int8 value); - INLINE void add_uint8(PN_uint8 value); + INLINE void add_int8(int8_t value); + INLINE void add_uint8(uint8_t value); // The default numeric packing is little-endian. - INLINE void add_int16(PN_int16 value); - INLINE void add_int32(PN_int32 value); - INLINE void add_int64(PN_int64 value); - INLINE void add_uint16(PN_uint16 value); - INLINE void add_uint32(PN_uint32 value); - INLINE void add_uint64(PN_uint64 value); + INLINE void add_int16(int16_t value); + INLINE void add_int32(int32_t value); + INLINE void add_int64(int64_t value); + INLINE void add_uint16(uint16_t value); + INLINE void add_uint32(uint32_t value); + INLINE void add_uint64(uint64_t value); INLINE void add_float32(PN_float32 value); INLINE void add_float64(PN_float64 value); INLINE void add_stdfloat(PN_stdfloat value); // These functions pack numbers big-endian, in case that's desired. - INLINE void add_be_int16(PN_int16 value); - INLINE void add_be_int32(PN_int32 value); - INLINE void add_be_int64(PN_int64 value); - INLINE void add_be_uint16(PN_uint16 value); - INLINE void add_be_uint32(PN_uint32 value); - INLINE void add_be_uint64(PN_uint64 value); + INLINE void add_be_int16(int16_t value); + INLINE void add_be_int32(int32_t value); + INLINE void add_be_int64(int64_t value); + INLINE void add_be_uint16(uint16_t value); + INLINE void add_be_uint32(uint32_t value); + INLINE void add_be_uint64(uint64_t value); INLINE void add_be_float32(PN_float32 value); INLINE void add_be_float64(PN_float64 value); diff --git a/panda/src/express/datagramIterator.I b/panda/src/express/datagramIterator.I index 0e4fff93f4..6f85656b47 100644 --- a/panda/src/express/datagramIterator.I +++ b/panda/src/express/datagramIterator.I @@ -75,14 +75,14 @@ get_bool() { /** * Extracts a signed 8-bit integer. */ -INLINE PN_int8 DatagramIterator:: +INLINE int8_t DatagramIterator:: get_int8() { nassertr(_datagram != (const Datagram *)NULL, 0); // Avoid reading junk data off the end of the datagram: nassertr(_current_index < _datagram->get_length(), 0); // Get the Data: const char *ptr = (const char *)_datagram->get_data(); - PN_int8 tempvar = (PN_int8)ptr[_current_index]; + int8_t tempvar = (int8_t)ptr[_current_index]; ++_current_index; return tempvar; @@ -91,14 +91,14 @@ get_int8() { /** * Extracts an unsigned 8-bit integer. */ -INLINE PN_uint8 DatagramIterator:: +INLINE uint8_t DatagramIterator:: get_uint8() { nassertr(_datagram != (const Datagram *)NULL, 0); // Avoid reading junk data off the end of the datagram: nassertr(_current_index < _datagram->get_length(), 0); // Get the Data: const char *ptr = (const char *)_datagram->get_data(); - PN_uint8 tempvar = (PN_uint8)ptr[_current_index]; + uint8_t tempvar = (uint8_t)ptr[_current_index]; ++_current_index; return tempvar; @@ -107,12 +107,12 @@ get_uint8() { /** * Extracts a signed 16-bit integer. */ -INLINE PN_int16 DatagramIterator:: +INLINE int16_t DatagramIterator:: get_int16() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int16 tempvar; + int16_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -126,12 +126,12 @@ get_int16() { /** * Extracts a signed 32-bit integer. */ -INLINE PN_int32 DatagramIterator:: +INLINE int32_t DatagramIterator:: get_int32() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int32 tempvar; + int32_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -145,12 +145,12 @@ get_int32() { /** * Extracts a signed 64-bit integer. */ -INLINE PN_int64 DatagramIterator:: +INLINE int64_t DatagramIterator:: get_int64() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int64 tempvar; + int64_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -164,12 +164,12 @@ get_int64() { /** * Extracts an unsigned 16-bit integer. */ -INLINE PN_uint16 DatagramIterator:: +INLINE uint16_t DatagramIterator:: get_uint16() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint16 tempvar; + uint16_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -183,12 +183,12 @@ get_uint16() { /** * Extracts an unsigned 32-bit integer. */ -INLINE PN_uint32 DatagramIterator:: +INLINE uint32_t DatagramIterator:: get_uint32() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint32 tempvar; + uint32_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -202,12 +202,12 @@ get_uint32() { /** * Extracts an unsigned 64-bit integer. */ -INLINE PN_uint64 DatagramIterator:: +INLINE uint64_t DatagramIterator:: get_uint64() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint64 tempvar; + uint64_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -274,12 +274,12 @@ get_stdfloat() { /** * Extracts a signed 16-bit big-endian integer. */ -INLINE PN_int16 DatagramIterator:: +INLINE int16_t DatagramIterator:: get_be_int16() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int16 tempvar; + int16_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -293,12 +293,12 @@ get_be_int16() { /** * Extracts a signed 32-bit big-endian integer. */ -INLINE PN_int32 DatagramIterator:: +INLINE int32_t DatagramIterator:: get_be_int32() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int32 tempvar; + int32_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -312,12 +312,12 @@ get_be_int32() { /** * Extracts a signed 64-bit big-endian integer. */ -INLINE PN_int64 DatagramIterator:: +INLINE int64_t DatagramIterator:: get_be_int64() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_int64 tempvar; + int64_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -331,12 +331,12 @@ get_be_int64() { /** * Extracts an unsigned 16-bit big-endian integer. */ -INLINE PN_uint16 DatagramIterator:: +INLINE uint16_t DatagramIterator:: get_be_uint16() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint16 tempvar; + uint16_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -350,12 +350,12 @@ get_be_uint16() { /** * Extracts an unsigned 32-bit big-endian integer. */ -INLINE PN_uint32 DatagramIterator:: +INLINE uint32_t DatagramIterator:: get_be_uint32() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint32 tempvar; + uint32_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: @@ -369,12 +369,12 @@ get_be_uint32() { /** * Extracts an unsigned 64-bit big-endian integer. */ -INLINE PN_uint64 DatagramIterator:: +INLINE uint64_t DatagramIterator:: get_be_uint64() { nassertr(_datagram != (const Datagram *)NULL, 0); nassertr(_current_index < _datagram->get_length(), 0); - PN_uint64 tempvar; + uint64_t tempvar; // Avoid reading junk data off the end of the datagram: nassertr(_current_index + sizeof(tempvar) <= _datagram->get_length(), 0); // Get the Data: diff --git a/panda/src/express/datagramIterator.cxx b/panda/src/express/datagramIterator.cxx index 3dca573cad..22ac9ecb19 100644 --- a/panda/src/express/datagramIterator.cxx +++ b/panda/src/express/datagramIterator.cxx @@ -22,7 +22,7 @@ TypeHandle DatagramIterator::_type_handle; string DatagramIterator:: get_string() { // First, get the length of the string - PN_uint16 s_len = get_uint16(); + uint16_t s_len = get_uint16(); nassertr(_datagram != (const Datagram *)NULL, ""); nassertr(_current_index + s_len <= _datagram->get_length(), ""); @@ -41,7 +41,7 @@ get_string() { string DatagramIterator:: get_string32() { // First, get the length of the string - PN_uint32 s_len = get_uint32(); + uint32_t s_len = get_uint32(); nassertr(_datagram != (const Datagram *)NULL, ""); nassertr(_current_index + s_len <= _datagram->get_length(), ""); @@ -100,7 +100,7 @@ get_fixed_string(size_t size) { wstring DatagramIterator:: get_wstring() { // First, get the length of the string - PN_uint32 s_len = get_uint32(); + uint32_t s_len = get_uint32(); nassertr(_datagram != (const Datagram *)NULL, wstring()); nassertr(_current_index + s_len * 2 <= _datagram->get_length(), wstring()); diff --git a/panda/src/express/datagramIterator.h b/panda/src/express/datagramIterator.h index a6d1dc0b6e..b3a94c6670 100644 --- a/panda/src/express/datagramIterator.h +++ b/panda/src/express/datagramIterator.h @@ -36,25 +36,25 @@ PUBLISHED: INLINE ~DatagramIterator(); INLINE bool get_bool(); - INLINE PN_int8 get_int8(); - INLINE PN_uint8 get_uint8(); + INLINE int8_t get_int8(); + INLINE uint8_t get_uint8(); - INLINE PN_int16 get_int16(); - INLINE PN_int32 get_int32(); - INLINE PN_int64 get_int64(); - INLINE PN_uint16 get_uint16(); - INLINE PN_uint32 get_uint32(); - INLINE PN_uint64 get_uint64(); + INLINE int16_t get_int16(); + INLINE int32_t get_int32(); + INLINE int64_t get_int64(); + INLINE uint16_t get_uint16(); + INLINE uint32_t get_uint32(); + INLINE uint64_t get_uint64(); INLINE PN_float32 get_float32(); INLINE PN_float64 get_float64(); INLINE PN_stdfloat get_stdfloat(); - INLINE PN_int16 get_be_int16(); - INLINE PN_int32 get_be_int32(); - INLINE PN_int64 get_be_int64(); - INLINE PN_uint16 get_be_uint16(); - INLINE PN_uint32 get_be_uint32(); - INLINE PN_uint64 get_be_uint64(); + INLINE int16_t get_be_int16(); + INLINE int32_t get_be_int32(); + INLINE int64_t get_be_int64(); + INLINE uint16_t get_be_uint16(); + INLINE uint32_t get_be_uint32(); + INLINE uint64_t get_be_uint64(); INLINE PN_float32 get_be_float32(); INLINE PN_float64 get_be_float64(); diff --git a/panda/src/express/hashVal.cxx b/panda/src/express/hashVal.cxx index 34a2a3c116..7d52dc5a5e 100644 --- a/panda/src/express/hashVal.cxx +++ b/panda/src/express/hashVal.cxx @@ -258,7 +258,7 @@ hash_buffer(const char *buffer, int length) { * at the indicated buffer and the following 8 positions. */ void HashVal:: -encode_hex(PN_uint32 val, char *buffer) { +encode_hex(uint32_t val, char *buffer) { buffer[0] = tohex(val >> 28); buffer[1] = tohex(val >> 24); buffer[2] = tohex(val >> 20); @@ -273,7 +273,7 @@ encode_hex(PN_uint32 val, char *buffer) { * Decodes the indicated eight-digit hex string into an unsigned integer. */ void HashVal:: -decode_hex(const char *buffer, PN_uint32 &val) { +decode_hex(const char *buffer, uint32_t &val) { unsigned int bytes[8]; for (int i = 0; i < 8; i++) { bytes[i] = fromhex(buffer[i]); diff --git a/panda/src/express/hashVal.h b/panda/src/express/hashVal.h index 3d29fa87af..1002669e43 100644 --- a/panda/src/express/hashVal.h +++ b/panda/src/express/hashVal.h @@ -72,12 +72,12 @@ PUBLISHED: #endif // HAVE_OPENSSL private: - static void encode_hex(PN_uint32 val, char *buffer); - static void decode_hex(const char *buffer, PN_uint32 &val); + static void encode_hex(uint32_t val, char *buffer); + static void decode_hex(const char *buffer, uint32_t &val); INLINE static char tohex(unsigned int nibble); INLINE static unsigned int fromhex(char digit); - PN_uint32 _hv[4]; + uint32_t _hv[4]; }; INLINE ostream &operator << (ostream &out, const HashVal &hv); diff --git a/panda/src/express/memoryUsage.cxx b/panda/src/express/memoryUsage.cxx index 7c689fd1cd..1aea4fe825 100644 --- a/panda/src/express/memoryUsage.cxx +++ b/panda/src/express/memoryUsage.cxx @@ -460,7 +460,7 @@ MemoryUsage(const MemoryHook ©) : MemoryHook(copy) { _count_memory_usage = false; - PN_int64 max_heap_size = ConfigVariableInt64 + int64_t max_heap_size = ConfigVariableInt64 ("max-heap-size", 0, PRC_DESC("If this is nonzero, it is the maximum number of bytes expected " "to be allocated on the heap before we enter report-memory-usage " diff --git a/panda/src/express/multifile.cxx b/panda/src/express/multifile.cxx index 21befb49dc..b0a1952a6c 100644 --- a/panda/src/express/multifile.cxx +++ b/panda/src/express/multifile.cxx @@ -860,7 +860,7 @@ add_signature(const Multifile::CertChain &cert_chain, EVP_PKEY *pkey) { // Now encode that list of certs to a stream in DER form. stringstream der_stream; StreamWriter der_writer(der_stream); - der_writer.add_uint32((PN_uint32)cert_chain.size()); + der_writer.add_uint32((uint32_t)cert_chain.size()); CertChain::const_iterator ci; for (ci = cert_chain.begin(); ci != cert_chain.end(); ++ci) { diff --git a/panda/src/express/patchfile.cxx b/panda/src/express/patchfile.cxx index b43e58456c..73b04139a0 100644 --- a/panda/src/express/patchfile.cxx +++ b/panda/src/express/patchfile.cxx @@ -61,19 +61,19 @@ const int _v1_header_length = 4 + 2 + 4 + 16 + 4 + 16; */ // Defines -const PN_uint32 Patchfile::_v0_magic_number = 0xfeebfaab; -const PN_uint32 Patchfile::_magic_number = 0xfeebfaac; +const uint32_t Patchfile::_v0_magic_number = 0xfeebfaab; +const uint32_t Patchfile::_magic_number = 0xfeebfaac; // Created version 1 on 11202 to store length and MD5 of original file. To // version 2 on 11202 to store copy offsets as relative. -const PN_uint16 Patchfile::_current_version = 2; +const uint16_t Patchfile::_current_version = 2; -const PN_uint32 Patchfile::_HASH_BITS = 24; -const PN_uint32 Patchfile::_HASHTABLESIZE = PN_uint32(1) << Patchfile::_HASH_BITS; -const PN_uint32 Patchfile::_DEFAULT_FOOTPRINT_LENGTH = 9; // this produced the smallest patch file for libpanda.dll when tested, 12/20/2000 -const PN_uint32 Patchfile::_NULL_VALUE = PN_uint32(0) - 1; -const PN_uint32 Patchfile::_MAX_RUN_LENGTH = (PN_uint32(1) << 16) - 1; -const PN_uint32 Patchfile::_HASH_MASK = (PN_uint32(1) << Patchfile::_HASH_BITS) - 1; +const uint32_t Patchfile::_HASH_BITS = 24; +const uint32_t Patchfile::_HASHTABLESIZE = uint32_t(1) << Patchfile::_HASH_BITS; +const uint32_t Patchfile::_DEFAULT_FOOTPRINT_LENGTH = 9; // this produced the smallest patch file for libpanda.dll when tested, 12/20/2000 +const uint32_t Patchfile::_NULL_VALUE = uint32_t(0) - 1; +const uint32_t Patchfile::_MAX_RUN_LENGTH = (uint32_t(1) << 16) - 1; +const uint32_t Patchfile::_HASH_MASK = (uint32_t(1) << Patchfile::_HASH_BITS) - 1; /** * Create a patch file and initializes internal data @@ -118,7 +118,7 @@ init(PT(Buffer) buffer) { */ Patchfile:: ~Patchfile() { - if (_hash_table != (PN_uint32 *)NULL) { + if (_hash_table != (uint32_t *)NULL) { PANDA_FREE_ARRAY(_hash_table); } @@ -261,9 +261,9 @@ run() { // Now patch the file using the given buffer int buflen; int bytes_read; - PN_uint16 ADD_length; - PN_uint16 COPY_length; - PN_int32 COPY_offset; + uint16_t ADD_length; + uint16_t COPY_length; + int32_t COPY_offset; if (_initiated == false) { express_cat.error() @@ -305,9 +305,9 @@ run() { << _write_stream.tellp() << ")" << endl; } - PN_uint32 bytes_left = (PN_uint32)ADD_length; + uint32_t bytes_left = (uint32_t)ADD_length; while (bytes_left > 0) { - PN_uint32 bytes_this_time = (PN_uint32) min(bytes_left, (PN_uint32) buflen); + uint32_t bytes_this_time = (uint32_t) min(bytes_left, (uint32_t) buflen); _patch_stream->read(_buffer->_buffer, bytes_this_time); if (_patch_stream->fail()) { express_cat.error() @@ -368,10 +368,10 @@ run() { } // read the copy bytes from original file and write them to output - PN_uint32 bytes_left = (PN_uint32)COPY_length; + uint32_t bytes_left = (uint32_t)COPY_length; while (bytes_left > 0) { - PN_uint32 bytes_this_time = (PN_uint32) min(bytes_left, (PN_uint32) buflen); + uint32_t bytes_this_time = (uint32_t) min(bytes_left, (uint32_t) buflen); _origfile_stream->read(_buffer->_buffer, bytes_this_time); if (_origfile_stream->fail()) { express_cat.error() @@ -535,7 +535,7 @@ internal_read_header(const Filename &patch_file) { // check the magic number nassertr(_buffer->get_length() >= _v0_header_length, false); - PN_uint32 magic_number = patch_reader.get_uint32(); + uint32_t magic_number = patch_reader.get_uint32(); if (magic_number != _magic_number && magic_number != _v0_magic_number) { express_cat.error() << "Invalid patch file: " << _patch_file << endl; @@ -555,7 +555,7 @@ internal_read_header(const Filename &patch_file) { if (_version_number >= 1) { // Get the length of the source file. - /*PN_uint32 source_file_length =*/ patch_reader.get_uint32(); + /*uint32_t source_file_length =*/ patch_reader.get_uint32(); // get the MD5 of the source file. _MD5_ofSource.read_stream(patch_reader); @@ -578,22 +578,22 @@ internal_read_header(const Filename &patch_file) { /** * */ -PN_uint32 Patchfile:: +uint32_t Patchfile:: calc_hash(const char *buffer) { #ifdef USE_MD5_FOR_HASHTABLE_INDEX_VALUES HashVal hash; hash.hash_buffer(buffer, _footprint_length); - // cout << PN_uint16(hash.get_value(0)) << " "; + // cout << uint16_t(hash.get_value(0)) << " "; - return PN_uint16(hash.get_value(0)); + return uint16_t(hash.get_value(0)); #else - PN_uint32 hash_value = 0; + uint32_t hash_value = 0; for(int i = 0; i < (int)_footprint_length; i++) { // this is probably not such a good hash. to be replaced --> TRIED MD5, // was not worth it for the execution-time hit on 800Mhz PC - hash_value ^= PN_uint32(*buffer) << ((i * 2) % Patchfile::_HASH_BITS); + hash_value ^= uint32_t(*buffer) << ((i * 2) % Patchfile::_HASH_BITS); buffer++; } @@ -624,10 +624,10 @@ calc_hash(const char *buffer) { * can rapidly produce a list of offsets that all have the same footprint. */ void Patchfile:: -build_hash_link_tables(const char *buffer_orig, PN_uint32 length_orig, - PN_uint32 *hash_table, PN_uint32 *link_table) { +build_hash_link_tables(const char *buffer_orig, uint32_t length_orig, + uint32_t *hash_table, uint32_t *link_table) { - PN_uint32 i; + uint32_t i; // clear hash table for(i = 0; i < _HASHTABLESIZE; i++) { @@ -644,7 +644,7 @@ build_hash_link_tables(const char *buffer_orig, PN_uint32 length_orig, // run through original file and hash each footprint for(i = 0; i < (length_orig - _footprint_length); i++) { - PN_uint32 hash_value = calc_hash(&buffer_orig[i]); + uint32_t hash_value = calc_hash(&buffer_orig[i]); // we must now store this file index in the hash table at the offset of // the hash value @@ -669,7 +669,7 @@ build_hash_link_tables(const char *buffer_orig, PN_uint32 length_orig, hash_table[hash_value] = i; } else { // hash entry is taken, go to the link table - PN_uint32 link_offset = hash_table[hash_value]; + uint32_t link_offset = hash_table[hash_value]; while (_NULL_VALUE != link_table[link_offset]) { link_offset = link_table[link_offset]; @@ -684,9 +684,9 @@ build_hash_link_tables(const char *buffer_orig, PN_uint32 length_orig, * * This function calculates the length of a match between two strings of bytes */ -PN_uint32 Patchfile:: -calc_match_length(const char* buf1, const char* buf2, PN_uint32 max_length, - PN_uint32 min_length) { +uint32_t Patchfile:: +calc_match_length(const char* buf1, const char* buf2, uint32_t max_length, + uint32_t min_length) { // early out: look ahead and sample the end of the minimum range if (min_length > 2) { if (min_length >= max_length) @@ -698,7 +698,7 @@ calc_match_length(const char* buf1, const char* buf2, PN_uint32 max_length, } } - PN_uint32 length = 0; + uint32_t length = 0; while ((length < max_length) && (*buf1 == *buf2)) { buf1++, buf2++, length++; } @@ -711,15 +711,15 @@ calc_match_length(const char* buf1, const char* buf2, PN_uint32 max_length, * matches a string in the new file. */ void Patchfile:: -find_longest_match(PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_length, - PN_uint32 *hash_table, PN_uint32 *link_table, const char* buffer_orig, - PN_uint32 length_orig, const char* buffer_new, PN_uint32 length_new) { +find_longest_match(uint32_t new_pos, uint32_t ©_pos, uint16_t ©_length, + uint32_t *hash_table, uint32_t *link_table, const char* buffer_orig, + uint32_t length_orig, const char* buffer_new, uint32_t length_new) { // set length to a safe value copy_length = 0; // get offset of matching string (in orig file) from hash table - PN_uint32 hash_value = calc_hash(&buffer_new[new_pos]); + uint32_t hash_value = calc_hash(&buffer_new[new_pos]); // if no match, bail if (_NULL_VALUE == hash_table[hash_value]) @@ -728,7 +728,7 @@ find_longest_match(PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_lengt copy_pos = hash_table[hash_value]; // calc match length - copy_length = (PN_uint16)calc_match_length(&buffer_new[new_pos], + copy_length = (uint16_t)calc_match_length(&buffer_new[new_pos], &buffer_orig[copy_pos], min(min((length_new - new_pos), (length_orig - copy_pos)), @@ -736,12 +736,12 @@ find_longest_match(PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_lengt 0); // run through link table, see if we find any longer matches - PN_uint32 match_offset; - PN_uint16 match_length; + uint32_t match_offset; + uint16_t match_length; match_offset = link_table[copy_pos]; while (match_offset != _NULL_VALUE) { - match_length = (PN_uint16)calc_match_length(&buffer_new[new_pos], + match_length = (uint16_t)calc_match_length(&buffer_new[new_pos], &buffer_orig[match_offset], min(min((length_new - new_pos), (length_orig - match_offset)), @@ -763,8 +763,8 @@ find_longest_match(PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_lengt * */ void Patchfile:: -emit_ADD(ostream &write_stream, PN_uint32 length, const char* buffer) { - nassertv(length == (PN_uint16)length); //we only write a uint16 +emit_ADD(ostream &write_stream, uint32_t length, const char* buffer) { + nassertv(length == (uint16_t)length); //we only write a uint16 if (express_cat.is_spam()) { express_cat.spam() @@ -773,11 +773,11 @@ emit_ADD(ostream &write_stream, PN_uint32 length, const char* buffer) { // write ADD length StreamWriter patch_writer(write_stream); - patch_writer.add_uint16((PN_uint16)length); + patch_writer.add_uint16((uint16_t)length); // if there are bytes to add, add them if (length > 0) { - patch_writer.append_data(buffer, (PN_uint16)length); + patch_writer.append_data(buffer, (uint16_t)length); } _add_pos += length; @@ -787,10 +787,10 @@ emit_ADD(ostream &write_stream, PN_uint32 length, const char* buffer) { * */ void Patchfile:: -emit_COPY(ostream &write_stream, PN_uint32 length, PN_uint32 copy_pos) { - nassertv(length == (PN_uint16)length); //we only write a uint16 +emit_COPY(ostream &write_stream, uint32_t length, uint32_t copy_pos) { + nassertv(length == (uint16_t)length); //we only write a uint16 - PN_int32 offset = (int)copy_pos - (int)_last_copy_pos; + int32_t offset = (int)copy_pos - (int)_last_copy_pos; if (express_cat.is_spam()) { express_cat.spam() << "COPY: " << length << " bytes from offset " << offset @@ -799,9 +799,9 @@ emit_COPY(ostream &write_stream, PN_uint32 length, PN_uint32 copy_pos) { // write COPY length StreamWriter patch_writer(write_stream); - patch_writer.add_uint16((PN_uint16)length); + patch_writer.add_uint16((uint16_t)length); - if ((PN_uint16)length != 0) { + if ((uint16_t)length != 0) { // write COPY offset patch_writer.add_int32(offset); _last_copy_pos = copy_pos + length; @@ -816,14 +816,14 @@ emit_COPY(ostream &write_stream, PN_uint32 length, PN_uint32 copy_pos) { */ void Patchfile:: emit_add_and_copy(ostream &write_stream, - PN_uint32 add_length, const char *add_buffer, - PN_uint32 copy_length, PN_uint32 copy_pos) { + uint32_t add_length, const char *add_buffer, + uint32_t copy_length, uint32_t copy_pos) { if (add_length == 0 && copy_length == 0) { // Don't accidentally emit a termination code. return; } - static const PN_uint16 max_write = 65535; + static const uint16_t max_write = 65535; while (add_length > max_write) { // Overflow. This chunk is too large to fit into a single ADD block, so // we have to write it as multiple ADDs. @@ -852,8 +852,8 @@ emit_add_and_copy(ostream &write_stream, */ void Patchfile:: cache_add_and_copy(ostream &write_stream, - PN_uint32 add_length, const char *add_buffer, - PN_uint32 copy_length, PN_uint32 copy_pos) { + uint32_t add_length, const char *add_buffer, + uint32_t copy_length, uint32_t copy_pos) { if (add_length != 0) { if (_cache_copy_length != 0) { // Have to flush. @@ -912,7 +912,7 @@ write_header(ostream &write_stream, stream_orig.seekg(0, ios::end); streampos source_file_length = stream_orig.tellg(); - patch_writer.add_uint32((PN_uint32)source_file_length); + patch_writer.add_uint32((uint32_t)source_file_length); // calc MD5 of original file _MD5_ofSource.hash_stream(stream_orig); @@ -926,7 +926,7 @@ write_header(ostream &write_stream, stream_new.seekg(0, ios::end); streampos result_file_length = stream_new.tellg(); - patch_writer.add_uint32((PN_uint32)result_file_length); + patch_writer.add_uint32((uint32_t)result_file_length); // calc MD5 of resultant patched file _MD5_ofResult.hash_stream(stream_new); @@ -958,12 +958,12 @@ write_terminator(ostream &write_stream) { */ bool Patchfile:: compute_file_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new) { // read in original file stream_orig.seekg(0, ios::end); nassertr(stream_orig, false); - PN_uint32 source_file_length = stream_orig.tellg(); + uint32_t source_file_length = stream_orig.tellg(); if (express_cat.is_debug()) { express_cat.debug() << "Allocating " << source_file_length << " bytes to read orig\n"; @@ -975,7 +975,7 @@ compute_file_patches(ostream &write_stream, // read in new file stream_new.seekg(0, ios::end); - PN_uint32 result_file_length = stream_new.tellg(); + uint32_t result_file_length = stream_new.tellg(); nassertr(stream_new, false); if (express_cat.is_debug()) { express_cat.debug() @@ -987,12 +987,12 @@ compute_file_patches(ostream &write_stream, stream_new.read(buffer_new, result_file_length); // allocate hashlink tables - if (_hash_table == (PN_uint32 *)NULL) { + if (_hash_table == (uint32_t *)NULL) { if (express_cat.is_debug()) { express_cat.debug() << "Allocating hashtable of size " << _HASHTABLESIZE << " * 4\n"; } - _hash_table = (PN_uint32 *)PANDA_MALLOC_ARRAY(_HASHTABLESIZE * sizeof(PN_uint32)); + _hash_table = (uint32_t *)PANDA_MALLOC_ARRAY(_HASHTABLESIZE * sizeof(uint32_t)); } if (express_cat.is_debug()) { @@ -1000,23 +1000,23 @@ compute_file_patches(ostream &write_stream, << "Allocating linktable of size " << source_file_length << " * 4\n"; } - PN_uint32 *link_table = (PN_uint32 *)PANDA_MALLOC_ARRAY(source_file_length * sizeof(PN_uint32)); + uint32_t *link_table = (uint32_t *)PANDA_MALLOC_ARRAY(source_file_length * sizeof(uint32_t)); // build hash and link tables for original file build_hash_link_tables(buffer_orig, source_file_length, _hash_table, link_table); // run through new file - PN_uint32 new_pos = 0; - PN_uint32 start_pos = new_pos; // this is the position for the start of ADD operations + uint32_t new_pos = 0; + uint32_t start_pos = new_pos; // this is the position for the start of ADD operations - if(((PN_uint32) result_file_length) >= _footprint_length) + if(((uint32_t) result_file_length) >= _footprint_length) { while (new_pos < (result_file_length - _footprint_length)) { // find best match for current position - PN_uint32 COPY_pos; - PN_uint16 COPY_length; + uint32_t COPY_pos; + uint16_t COPY_length; find_longest_match(new_pos, COPY_pos, COPY_length, _hash_table, link_table, buffer_orig, source_file_length, buffer_new, result_file_length); @@ -1036,7 +1036,7 @@ compute_file_patches(ostream &write_stream, } cache_add_and_copy(write_stream, num_skipped, &buffer_new[start_pos], COPY_length, COPY_pos + offset_orig); - new_pos += (PN_uint32)COPY_length; + new_pos += (uint32_t)COPY_length; start_pos = new_pos; } } @@ -1053,7 +1053,7 @@ compute_file_patches(ostream &write_stream, if (start_pos != result_file_length) { // emit ADD for all remaining bytes - PN_uint32 remaining_bytes = result_file_length - start_pos; + uint32_t remaining_bytes = result_file_length - start_pos; cache_add_and_copy(write_stream, remaining_bytes, &buffer_new[start_pos], 0, 0); start_pos += remaining_bytes; @@ -1075,7 +1075,7 @@ compute_file_patches(ostream &write_stream, */ bool Patchfile:: compute_mf_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new) { Multifile mf_orig, mf_new; IStreamWrapper stream_origw(stream_orig); @@ -1219,7 +1219,7 @@ read_tar(TarDef &tar, istream &stream) { */ bool Patchfile:: compute_tar_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new, TarDef &tar_orig, TarDef &tar_new) { @@ -1424,7 +1424,7 @@ build(Filename file_orig, Filename file_new, Filename patch_name) { bool Patchfile:: do_compute_patches(const Filename &file_orig, const Filename &file_new, ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new) { nassertr(_add_pos + _cache_add_data.size() + _cache_copy_length == offset_new, false); @@ -1505,7 +1505,7 @@ do_compute_patches(const Filename &file_orig, const Filename &file_new, */ bool Patchfile:: patch_subfile(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, const Filename &filename, IStreamWrapper &stream_orig, streampos orig_start, streampos orig_end, IStreamWrapper &stream_new, streampos new_start, streampos new_end) { diff --git a/panda/src/express/patchfile.h b/panda/src/express/patchfile.h index eee70c0f21..c67b5a039e 100644 --- a/panda/src/express/patchfile.h +++ b/panda/src/express/patchfile.h @@ -79,23 +79,23 @@ private: private: // stuff for the build operation - void build_hash_link_tables(const char *buffer_orig, PN_uint32 length_orig, - PN_uint32 *hash_table, PN_uint32 *link_table); - PN_uint32 calc_hash(const char *buffer); - void find_longest_match(PN_uint32 new_pos, PN_uint32 ©_pos, PN_uint16 ©_length, - PN_uint32 *hash_table, PN_uint32 *link_table, const char* buffer_orig, - PN_uint32 length_orig, const char* buffer_new, PN_uint32 length_new); - PN_uint32 calc_match_length(const char* buf1, const char* buf2, PN_uint32 max_length, - PN_uint32 min_length); + void build_hash_link_tables(const char *buffer_orig, uint32_t length_orig, + uint32_t *hash_table, uint32_t *link_table); + uint32_t calc_hash(const char *buffer); + void find_longest_match(uint32_t new_pos, uint32_t ©_pos, uint16_t ©_length, + uint32_t *hash_table, uint32_t *link_table, const char* buffer_orig, + uint32_t length_orig, const char* buffer_new, uint32_t length_new); + uint32_t calc_match_length(const char* buf1, const char* buf2, uint32_t max_length, + uint32_t min_length); - void emit_ADD(ostream &write_stream, PN_uint32 length, const char* buffer); - void emit_COPY(ostream &write_stream, PN_uint32 length, PN_uint32 COPY_pos); + void emit_ADD(ostream &write_stream, uint32_t length, const char* buffer); + void emit_COPY(ostream &write_stream, uint32_t length, uint32_t COPY_pos); void emit_add_and_copy(ostream &write_stream, - PN_uint32 add_length, const char *add_buffer, - PN_uint32 copy_length, PN_uint32 copy_pos); + uint32_t add_length, const char *add_buffer, + uint32_t copy_length, uint32_t copy_pos); void cache_add_and_copy(ostream &write_stream, - PN_uint32 add_length, const char *add_buffer, - PN_uint32 copy_length, PN_uint32 copy_pos); + uint32_t add_length, const char *add_buffer, + uint32_t copy_length, uint32_t copy_pos); void cache_flush(ostream &write_stream); void write_header(ostream &write_stream, @@ -103,10 +103,10 @@ private: void write_terminator(ostream &write_stream); bool compute_file_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new); bool compute_mf_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new); #ifdef HAVE_TAR class TarSubfile { @@ -124,7 +124,7 @@ private: bool read_tar(TarDef &tar, istream &stream); bool compute_tar_patches(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new, TarDef &tar_orig, TarDef &tar_new); @@ -140,33 +140,33 @@ private: bool do_compute_patches(const Filename &file_orig, const Filename &file_new, ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, istream &stream_orig, istream &stream_new); bool patch_subfile(ostream &write_stream, - PN_uint32 offset_orig, PN_uint32 offset_new, + uint32_t offset_orig, uint32_t offset_new, const Filename &filename, IStreamWrapper &stream_orig, streampos orig_start, streampos orig_end, IStreamWrapper &stream_new, streampos new_start, streampos new_end); - static const PN_uint32 _HASH_BITS; - static const PN_uint32 _HASHTABLESIZE; - static const PN_uint32 _DEFAULT_FOOTPRINT_LENGTH; - static const PN_uint32 _NULL_VALUE; - static const PN_uint32 _MAX_RUN_LENGTH; - static const PN_uint32 _HASH_MASK; + static const uint32_t _HASH_BITS; + static const uint32_t _HASHTABLESIZE; + static const uint32_t _DEFAULT_FOOTPRINT_LENGTH; + static const uint32_t _NULL_VALUE; + static const uint32_t _MAX_RUN_LENGTH; + static const uint32_t _HASH_MASK; bool _allow_multifile; - PN_uint32 _footprint_length; + uint32_t _footprint_length; - PN_uint32 *_hash_table; + uint32_t *_hash_table; - PN_uint32 _add_pos; - PN_uint32 _last_copy_pos; + uint32_t _add_pos; + uint32_t _last_copy_pos; string _cache_add_data; - PN_uint32 _cache_copy_start; - PN_uint32 _cache_copy_length; + uint32_t _cache_copy_start; + uint32_t _cache_copy_length; private: PT(Buffer) _buffer; // this is the work buffer for apply -- used to prevent virtual memory swapping @@ -174,14 +174,14 @@ private: // async patch apply state variables bool _initiated; - PN_uint16 _version_number; + uint16_t _version_number; HashVal _MD5_ofSource; HashVal _MD5_ofResult; - PN_uint32 _total_bytes_to_process; - PN_uint32 _total_bytes_processed; + uint32_t _total_bytes_to_process; + uint32_t _total_bytes_processed; istream *_patch_stream; pofstream _write_stream; @@ -193,9 +193,9 @@ private: bool _rename_output_to_orig; bool _delete_patchfile; - static const PN_uint32 _v0_magic_number; - static const PN_uint32 _magic_number; - static const PN_uint16 _current_version; + static const uint32_t _v0_magic_number; + static const uint32_t _magic_number; + static const uint16_t _current_version; }; #include "patchfile.I" diff --git a/panda/src/express/trueClock.cxx b/panda/src/express/trueClock.cxx index c3db68bbd9..d2104f0ae0 100644 --- a/panda/src/express/trueClock.cxx +++ b/panda/src/express/trueClock.cxx @@ -90,7 +90,7 @@ get_short_raw_time() { * accurate and seems to lose seconds of time per hour, and (d) someone could * be running a program such as Speed Gear which munges this value anyway. */ - PN_int64 count; + int64_t count; QueryPerformanceCounter((LARGE_INTEGER *)&count); time = (double)(count - _init_count) * _recip_frequency; @@ -114,7 +114,7 @@ typedef BOOL (WINAPI * PFNSETPROCESSAFFINITYMASK)(HANDLE, DWORD_PTR); typedef BOOL (WINAPI * PFNGETPROCESSAFFINITYMASK)(HANDLE, DWORD_PTR*, DWORD_PTR*); bool TrueClock:: -set_cpu_affinity(PN_uint32 mask) const { +set_cpu_affinity(uint32_t mask) const { HMODULE hker = GetModuleHandle("kernel32"); if (hker != 0) { PFNGETPROCESSAFFINITYMASK gp = (PFNGETPROCESSAFFINITYMASK) @@ -163,7 +163,7 @@ TrueClock() { } if (get_use_high_res_clock()) { - PN_int64 int_frequency; + int64_t int_frequency; _has_high_res = (QueryPerformanceFrequency((LARGE_INTEGER *)&int_frequency) != 0); if (_has_high_res) { @@ -223,7 +223,7 @@ TrueClock() { double TrueClock:: correct_time(double time) { // First, get the current time of day measurement. - PN_uint64 int_tod; + uint64_t int_tod; GetSystemTimeAsFileTime((FILETIME *)&int_tod); double tod = (double)(int_tod - _init_tod) * _00000001; @@ -545,7 +545,7 @@ get_short_raw_time() { * */ bool TrueClock:: -set_cpu_affinity(PN_uint32 mask) const { +set_cpu_affinity(uint32_t mask) const { return false; } diff --git a/panda/src/express/trueClock.h b/panda/src/express/trueClock.h index 8b7699da96..45ab097e8b 100644 --- a/panda/src/express/trueClock.h +++ b/panda/src/express/trueClock.h @@ -54,7 +54,7 @@ PUBLISHED: INLINE static TrueClock *get_global_ptr(); - bool set_cpu_affinity(PN_uint32 mask) const; + bool set_cpu_affinity(uint32_t mask) const; protected: TrueClock(); @@ -69,10 +69,10 @@ protected: void set_time_scale(double time, double new_time_scale); bool _has_high_res; - PN_int64 _init_count; + int64_t _init_count; double _frequency, _recip_frequency; int _init_tc; - PN_uint64 _init_tod; + uint64_t _init_tod; // The rest of the data structures in this block are strictly for // implementing paranoid_clock: they are designed to allow us to cross-check diff --git a/panda/src/express/typedef.h b/panda/src/express/typedef.h index 32822ae52d..5030e6d77f 100644 --- a/panda/src/express/typedef.h +++ b/panda/src/express/typedef.h @@ -22,8 +22,8 @@ typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; -typedef PN_int64 longlong; -typedef PN_uint64 ulonglong; +typedef int64_t longlong; +typedef uint64_t ulonglong; #endif diff --git a/panda/src/ffmpeg/ffmpegAudioCursor.cxx b/panda/src/ffmpeg/ffmpegAudioCursor.cxx index 132f2ff9f9..2f73cff60c 100644 --- a/panda/src/ffmpeg/ffmpegAudioCursor.cxx +++ b/panda/src/ffmpeg/ffmpegAudioCursor.cxx @@ -153,7 +153,7 @@ FfmpegAudioCursor(FfmpegAudio *src) : _packet = new AVPacket; _buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / 2; - _buffer_alloc = new PN_int16[_buffer_size + 64]; + _buffer_alloc = new int16_t[_buffer_size + 64]; // Allocate enough space for 1024 samples per channel. if ((_packet == 0)||(_buffer_alloc == 0)) { @@ -362,8 +362,8 @@ reload_buffer() { */ void FfmpegAudioCursor:: seek(double t) { - PN_int64 target_ts = (PN_int64)(t / _audio_timebase); - if (target_ts < (PN_int64)(_initial_dts)) { + int64_t target_ts = (int64_t)(t / _audio_timebase); + if (target_ts < (int64_t)(_initial_dts)) { // Attempts to seek before the first packet will fail. target_ts = _initial_dts; } @@ -404,7 +404,7 @@ seek(double t) { * audio will be interleaved. */ void FfmpegAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int desired = n * _audio_channels; while (desired > 0) { diff --git a/panda/src/ffmpeg/ffmpegAudioCursor.h b/panda/src/ffmpeg/ffmpegAudioCursor.h index 6d3ddcffb1..21f79dc62d 100644 --- a/panda/src/ffmpeg/ffmpegAudioCursor.h +++ b/panda/src/ffmpeg/ffmpegAudioCursor.h @@ -48,7 +48,7 @@ PUBLISHED: virtual void seek(double offset); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); protected: void fetch_packet(); @@ -66,9 +66,9 @@ protected: double _audio_timebase; AVFrame *_frame; - PN_int16 *_buffer; + int16_t *_buffer; int _buffer_size; - PN_int16 *_buffer_alloc; + int16_t *_buffer_alloc; int _buffer_head; int _buffer_tail; diff --git a/panda/src/ffmpeg/ffmpegVideoCursor.cxx b/panda/src/ffmpeg/ffmpegVideoCursor.cxx index eb33490384..8affe3c116 100644 --- a/panda/src/ffmpeg/ffmpegVideoCursor.cxx +++ b/panda/src/ffmpeg/ffmpegVideoCursor.cxx @@ -884,8 +884,8 @@ seek(int frame, bool backward) { */ void FfmpegVideoCursor:: do_seek(int frame, bool backward) { - PN_int64 target_ts = (PN_int64)frame; - if (target_ts < (PN_int64)(_initial_dts)) { + int64_t target_ts = (int64_t)frame; + if (target_ts < (int64_t)(_initial_dts)) { // Attempts to seek before the first packet will fail. target_ts = _initial_dts; } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 50a18790a2..f078ce0d8b 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -10683,7 +10683,7 @@ upload_usage_texture(int width, int height) { // Allocate a temporary array large enough to contain the toplevel mipmap. - PN_uint32 *buffer = (PN_uint32 *)PANDA_MALLOC_ARRAY(width * height * 4); + uint32_t *buffer = (uint32_t *)PANDA_MALLOC_ARRAY(width * height * 4); int n = 0; while (true) { @@ -10696,7 +10696,7 @@ upload_usage_texture(int width, int height) { struct { unsigned char r, g, b, a; } b; - PN_uint32 w; + uint32_t w; } store; store.b.r = (unsigned char)(c[0] * 255.0f); diff --git a/panda/src/gobj/geomVertexColumn.cxx b/panda/src/gobj/geomVertexColumn.cxx index 9ebe98a1e8..3227eb7b42 100644 --- a/panda/src/gobj/geomVertexColumn.cxx +++ b/panda/src/gobj/geomVertexColumn.cxx @@ -165,12 +165,12 @@ setup() { switch (_numeric_type) { case NT_uint16: case NT_int16: - _component_bytes = 2; // sizeof(PN_uint16) + _component_bytes = 2; // sizeof(uint16_t) break; case NT_uint32: case NT_int32: - _component_bytes = 4; // sizeof(PN_uint32) + _component_bytes = 4; // sizeof(uint32_t) break; case NT_uint8: @@ -180,7 +180,7 @@ setup() { case NT_packed_dcba: case NT_packed_dabc: - _component_bytes = 4; // sizeof(PN_uint32) + _component_bytes = 4; // sizeof(uint32_t) _num_values *= 4; break; @@ -197,7 +197,7 @@ setup() { break; case NT_packed_ufloat: - _component_bytes = 4; // sizeof(PN_uint32) + _component_bytes = 4; // sizeof(uint32_t) _num_values *= 3; break; } @@ -451,23 +451,23 @@ float GeomVertexColumn::Packer:: get_data1f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: - return *(const PN_uint8 *)pointer; + return *(const uint8_t *)pointer; case NT_uint16: - return *(const PN_uint16 *)pointer; + return *(const uint16_t *)pointer; case NT_uint32: - return *(const PN_uint32 *)pointer; + return *(const uint32_t *)pointer; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_d(dword); } case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_b(dword); } @@ -478,17 +478,17 @@ get_data1f(const unsigned char *pointer) { return *(const PN_float64 *)pointer; case NT_int8: - return *(const PN_int8 *)pointer; + return *(const int8_t *)pointer; case NT_int16: - return *(const PN_int16 *)pointer; + return *(const int16_t *)pointer; case NT_int32: - return *(const PN_int32 *)pointer; + return *(const int32_t *)pointer; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_ufloat_a(dword); } @@ -512,28 +512,28 @@ get_data2f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -541,7 +541,7 @@ get_data2f(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -567,21 +567,21 @@ get_data2f(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v2.set(pi[0], pi[1]); } return _v2; @@ -616,28 +616,28 @@ get_data3f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword)); @@ -646,7 +646,7 @@ get_data3f(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword)); @@ -673,28 +673,28 @@ get_data3f(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); } return _v3; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3.set(GeomVertexData::unpack_ufloat_a(dword), GeomVertexData::unpack_ufloat_b(dword), GeomVertexData::unpack_ufloat_c(dword)); @@ -734,28 +734,28 @@ get_data4f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -765,7 +765,7 @@ get_data4f(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -793,21 +793,21 @@ get_data4f(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; @@ -828,23 +828,23 @@ double GeomVertexColumn::Packer:: get_data1d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: - return *(const PN_uint8 *)pointer; + return *(const uint8_t *)pointer; case NT_uint16: - return *(const PN_uint16 *)pointer; + return *(const uint16_t *)pointer; case NT_uint32: - return *(const PN_uint32 *)pointer; + return *(const uint32_t *)pointer; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_d(dword); } case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_b(dword); } @@ -859,17 +859,17 @@ get_data1d(const unsigned char *pointer) { return 0.0; case NT_int8: - return *(const PN_int8 *)pointer; + return *(const int8_t *)pointer; case NT_int16: - return *(const PN_int16 *)pointer; + return *(const int16_t *)pointer; case NT_int32: - return *(const PN_int32 *)pointer; + return *(const int32_t *)pointer; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_ufloat_a(dword); } } @@ -890,28 +890,28 @@ get_data2d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2d.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -919,7 +919,7 @@ get_data2d(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2d.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -945,21 +945,21 @@ get_data2d(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v2d.set(pi[0], pi[1]); } return _v2d; @@ -994,28 +994,28 @@ get_data3d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3d.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword)); @@ -1024,7 +1024,7 @@ get_data3d(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3d.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword)); @@ -1051,28 +1051,28 @@ get_data3d(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); } return _v3d; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3d.set(GeomVertexData::unpack_ufloat_a(dword), GeomVertexData::unpack_ufloat_b(dword), GeomVertexData::unpack_ufloat_c(dword)); @@ -1112,28 +1112,28 @@ get_data4d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -1143,7 +1143,7 @@ get_data4d(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -1171,21 +1171,21 @@ get_data4d(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; @@ -1209,20 +1209,20 @@ get_data1i(const unsigned char *pointer) { return *pointer; case NT_uint16: - return *(const PN_uint16 *)pointer; + return *(const uint16_t *)pointer; case NT_uint32: - return *(const PN_uint32 *)pointer; + return *(const uint32_t *)pointer; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_d(dword); } case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_b(dword); } @@ -1237,17 +1237,17 @@ get_data1i(const unsigned char *pointer) { break; case NT_int8: - return *(const PN_int8 *)pointer; + return *(const int8_t *)pointer; case NT_int16: - return *(const PN_int16 *)pointer; + return *(const int16_t *)pointer; case NT_int32: - return *(const PN_int32 *)pointer; + return *(const int32_t *)pointer; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return (int)GeomVertexData::unpack_ufloat_a(dword); } } @@ -1273,21 +1273,21 @@ get_data2i(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v2i.set(pi[0], pi[1]); } return _v2i; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v2i.set(pi[0], pi[1]); } return _v2i; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2i.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -1295,7 +1295,7 @@ get_data2i(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v2i.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword)); } @@ -1321,21 +1321,21 @@ get_data2i(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v2i.set(pi[0], pi[1]); } return _v2i; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v2i.set(pi[0], pi[1]); } return _v2i; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v2i.set(pi[0], pi[1]); } return _v2i; @@ -1374,21 +1374,21 @@ get_data3i(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v3i.set(pi[0], pi[1], pi[2]); } return _v3i; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v3i.set(pi[0], pi[1], pi[2]); } return _v3i; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3i.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword)); @@ -1397,7 +1397,7 @@ get_data3i(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3i.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword)); @@ -1424,28 +1424,28 @@ get_data3i(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v3i.set(pi[0], pi[1], pi[2]); } return _v3i; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v3i.set(pi[0], pi[1], pi[2]); } return _v3i; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v3i.set(pi[0], pi[1], pi[2]); } return _v3i; case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3i.set((int)GeomVertexData::unpack_ufloat_a(dword), (int)GeomVertexData::unpack_ufloat_b(dword), (int)GeomVertexData::unpack_ufloat_c(dword)); @@ -1489,21 +1489,21 @@ get_data4i(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4i.set(pi[0], pi[1], pi[2], pi[3]); } return _v4i; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4i.set(pi[0], pi[1], pi[2], pi[3]); } return _v4i; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4i.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -1513,7 +1513,7 @@ get_data4i(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4i.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -1541,21 +1541,21 @@ get_data4i(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v4i.set(pi[0], pi[1], pi[2], pi[3]); } return _v4i; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v4i.set(pi[0], pi[1], pi[2], pi[3]); } return _v4i; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v4i.set(pi[0], pi[1], pi[2], pi[3]); } return _v4i; @@ -1578,15 +1578,15 @@ set_data1f(unsigned char *pointer, float data) { case 1: switch (_column->get_numeric_type()) { case NT_uint8: - *(PN_uint8 *)pointer = (unsigned int)data; + *(uint8_t *)pointer = (unsigned int)data; break; case NT_uint16: - *(PN_uint16 *)pointer = (unsigned int)data; + *(uint16_t *)pointer = (unsigned int)data; break; case NT_uint32: - *(PN_uint32 *)pointer = (unsigned int)data; + *(uint32_t *)pointer = (unsigned int)data; break; case NT_packed_dcba: @@ -1607,15 +1607,15 @@ set_data1f(unsigned char *pointer, float data) { break; case NT_int8: - *(PN_int8 *)pointer = (int)data; + *(int8_t *)pointer = (int)data; break; case NT_int16: - *(PN_int16 *)pointer = (int)data; + *(int16_t *)pointer = (int)data; break; case NT_int32: - *(PN_int32 *)pointer = (int)data; + *(int32_t *)pointer = (int)data; break; case NT_packed_ufloat: @@ -1652,7 +1652,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -1660,7 +1660,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -1668,7 +1668,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -1701,7 +1701,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -1709,7 +1709,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -1717,7 +1717,7 @@ set_data2f(unsigned char *pointer, const LVecBase2f &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -1757,7 +1757,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1766,7 +1766,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1775,7 +1775,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1811,7 +1811,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1820,7 +1820,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1829,7 +1829,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1837,7 +1837,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { break; case NT_packed_ufloat: - *(PN_uint32 *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); break; } break; @@ -1870,7 +1870,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1880,7 +1880,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1890,7 +1890,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -1899,11 +1899,11 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { break; case NT_packed_dcba: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); break; case NT_packed_dabc: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); break; case NT_float32: @@ -1932,7 +1932,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1942,7 +1942,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1952,7 +1952,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -1977,15 +1977,15 @@ set_data1d(unsigned char *pointer, double data) { case 1: switch (_column->get_numeric_type()) { case NT_uint8: - *(PN_uint8 *)pointer = (unsigned int)data; + *(uint8_t *)pointer = (unsigned int)data; break; case NT_uint16: - *(PN_uint16 *)pointer = (unsigned int)data; + *(uint16_t *)pointer = (unsigned int)data; break; case NT_uint32: - *(PN_uint32 *)pointer = (unsigned int)data; + *(uint32_t *)pointer = (unsigned int)data; break; case NT_packed_dcba: @@ -2006,15 +2006,15 @@ set_data1d(unsigned char *pointer, double data) { break; case NT_int8: - *(PN_int8 *)pointer = (int)data; + *(int8_t *)pointer = (int)data; break; case NT_int16: - *(PN_int16 *)pointer = (int)data; + *(int16_t *)pointer = (int)data; break; case NT_int32: - *(PN_int32 *)pointer = (int)data; + *(int32_t *)pointer = (int)data; break; case NT_packed_ufloat: @@ -2050,7 +2050,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -2058,7 +2058,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -2066,7 +2066,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; } @@ -2099,7 +2099,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -2107,7 +2107,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -2115,7 +2115,7 @@ set_data2d(unsigned char *pointer, const LVecBase2d &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; } @@ -2155,7 +2155,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2164,7 +2164,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2173,7 +2173,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2209,7 +2209,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2218,7 +2218,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2227,7 +2227,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2235,7 +2235,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { break; case NT_packed_ufloat: - *(PN_uint32 *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); break; } break; @@ -2268,7 +2268,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2278,7 +2278,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2288,7 +2288,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -2297,11 +2297,11 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { break; case NT_packed_dcba: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); break; case NT_packed_dabc: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); break; case NT_float32: @@ -2330,7 +2330,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2340,7 +2340,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2350,7 +2350,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -2380,12 +2380,12 @@ set_data1i(unsigned char *pointer, int data) { break; case NT_uint16: - *(PN_uint16 *)pointer = data; - nassertv(*(PN_uint16 *)pointer == data); + *(uint16_t *)pointer = data; + nassertv(*(uint16_t *)pointer == data); break; case NT_uint32: - *(PN_uint32 *)pointer = data; + *(uint32_t *)pointer = data; break; case NT_packed_dcba: @@ -2406,17 +2406,17 @@ set_data1i(unsigned char *pointer, int data) { break; case NT_int8: - *(PN_int8 *)pointer = data; - nassertv(*(PN_int8 *)pointer == data); + *(int8_t *)pointer = data; + nassertv(*(int8_t *)pointer == data); break; case NT_int16: - *(PN_int16 *)pointer = data; - nassertv(*(PN_int16 *)pointer == data); + *(int16_t *)pointer = data; + nassertv(*(int16_t *)pointer == data); break; case NT_int32: - *(PN_int32 *)pointer = data; + *(int32_t *)pointer = data; break; case NT_packed_ufloat: @@ -2458,7 +2458,7 @@ set_data2i(unsigned char *pointer, const LVecBase2i &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; } @@ -2466,7 +2466,7 @@ set_data2i(unsigned char *pointer, const LVecBase2i &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; } @@ -2499,7 +2499,7 @@ set_data2i(unsigned char *pointer, const LVecBase2i &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; } @@ -2507,7 +2507,7 @@ set_data2i(unsigned char *pointer, const LVecBase2i &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; } @@ -2515,7 +2515,7 @@ set_data2i(unsigned char *pointer, const LVecBase2i &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; } @@ -2561,7 +2561,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2570,7 +2570,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2606,7 +2606,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2615,7 +2615,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2624,7 +2624,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2632,7 +2632,7 @@ set_data3i(unsigned char *pointer, const LVecBase3i &data) { break; case NT_packed_ufloat: - *(PN_uint32 *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); break; } break; @@ -2672,7 +2672,7 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2682,7 +2682,7 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2691,11 +2691,11 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { break; case NT_packed_dcba: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); break; case NT_packed_dabc: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); break; case NT_float32: @@ -2724,7 +2724,7 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2734,7 +2734,7 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2744,7 +2744,7 @@ set_data4i(unsigned char *pointer, const LVecBase4i &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = data[0]; pi[1] = data[1]; pi[2] = data[2]; @@ -2829,28 +2829,28 @@ get_data4f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -2860,7 +2860,7 @@ get_data4f(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -2888,21 +2888,21 @@ get_data4f(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); } return _v4; @@ -2985,28 +2985,28 @@ get_data4d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -3016,7 +3016,7 @@ get_data4d(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -3044,21 +3044,21 @@ get_data4d(const unsigned char *pointer) { case NT_int8: { - const PN_int8 *pi = (const PN_int8 *)pointer; + const int8_t *pi = (const int8_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_int16: { - const PN_int16 *pi = (const PN_int16 *)pointer; + const int16_t *pi = (const int16_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; case NT_int32: { - const PN_int32 *pi = (const PN_int32 *)pointer; + const int32_t *pi = (const int32_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); } return _v4d; @@ -3130,7 +3130,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3140,7 +3140,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3150,7 +3150,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3159,11 +3159,11 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { break; case NT_packed_dcba: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); break; case NT_packed_dabc: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); break; case NT_float32: @@ -3192,7 +3192,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3202,7 +3202,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3212,7 +3212,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3286,7 +3286,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { switch (_column->get_numeric_type()) { case NT_uint8: { - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3296,7 +3296,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint16: { - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3306,7 +3306,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint32: { - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3315,11 +3315,11 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { break; case NT_packed_dcba: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[2], data[1], data[0]); break; case NT_packed_dabc: - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_abcd(data[3], data[0], data[1], data[2]); break; case NT_float32: @@ -3348,7 +3348,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int8: { - PN_int8 *pi = (PN_int8 *)pointer; + int8_t *pi = (int8_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3358,7 +3358,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int16: { - PN_int16 *pi = (PN_int16 *)pointer; + int16_t *pi = (int16_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3368,7 +3368,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_int32: { - PN_int32 *pi = (PN_int32 *)pointer; + int32_t *pi = (int32_t *)pointer; pi[0] = (int)data[0]; pi[1] = (int)data[1]; pi[2] = (int)data[2]; @@ -3391,23 +3391,23 @@ float GeomVertexColumn::Packer_color:: get_data1f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: - return (*(const PN_uint8 *)pointer) / 255.0f; + return (*(const uint8_t *)pointer) / 255.0f; case NT_uint16: - return (*(const PN_uint16 *)pointer) / 65535.0f; + return (*(const uint16_t *)pointer) / 65535.0f; case NT_uint32: - return (*(const PN_uint32 *)pointer) / 4294967295.0f; + return (*(const uint32_t *)pointer) / 4294967295.0f; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_d(dword) / 255.0f; } case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_b(dword) / 255.0f; } @@ -3449,7 +3449,7 @@ get_data3f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); _v3 /= 255.0f; } @@ -3457,7 +3457,7 @@ get_data3f(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); _v3 /= 65535.0f; } @@ -3465,7 +3465,7 @@ get_data3f(const unsigned char *pointer) { case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v3.set(pi[0], pi[1], pi[2]); _v3 /= 4294967295.0f; } @@ -3499,7 +3499,7 @@ get_data3f(const unsigned char *pointer) { case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3.set(GeomVertexData::unpack_ufloat_a(dword), GeomVertexData::unpack_ufloat_b(dword), GeomVertexData::unpack_ufloat_c(dword)); @@ -3528,7 +3528,7 @@ get_data4f(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); _v4 /= 255.0f; } @@ -3536,7 +3536,7 @@ get_data4f(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); _v4 /= 65535.0f; } @@ -3544,7 +3544,7 @@ get_data4f(const unsigned char *pointer) { case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4.set(pi[0], pi[1], pi[2], pi[3]); _v4 /= 4294967295.0f; } @@ -3552,7 +3552,7 @@ get_data4f(const unsigned char *pointer) { case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -3563,7 +3563,7 @@ get_data4f(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -3606,23 +3606,23 @@ double GeomVertexColumn::Packer_color:: get_data1d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: - return (*(const PN_uint8 *)pointer) / 255.0; + return (*(const uint8_t *)pointer) / 255.0; case NT_uint16: - return (*(const PN_uint16 *)pointer) / 65535.0; + return (*(const uint16_t *)pointer) / 65535.0; case NT_uint32: - return (*(const PN_uint32 *)pointer) / 4294967295.0; + return (*(const uint32_t *)pointer) / 4294967295.0; case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_d(dword) / 255.0; } case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; return GeomVertexData::unpack_abcd_b(dword) / 255.0; } @@ -3664,7 +3664,7 @@ get_data3d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); _v3d /= 255.0; } @@ -3672,7 +3672,7 @@ get_data3d(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); _v3d /= 65535.0; } @@ -3680,7 +3680,7 @@ get_data3d(const unsigned char *pointer) { case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v3d.set(pi[0], pi[1], pi[2]); _v3d /= 4294967295.0; } @@ -3714,7 +3714,7 @@ get_data3d(const unsigned char *pointer) { case NT_packed_ufloat: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v3d.set(GeomVertexData::unpack_ufloat_a(dword), GeomVertexData::unpack_ufloat_b(dword), GeomVertexData::unpack_ufloat_c(dword)); @@ -3743,7 +3743,7 @@ get_data4d(const unsigned char *pointer) { switch (_column->get_numeric_type()) { case NT_uint8: { - const PN_uint8 *pi = (const PN_uint8 *)pointer; + const uint8_t *pi = (const uint8_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); _v4d /= 255.0; } @@ -3751,7 +3751,7 @@ get_data4d(const unsigned char *pointer) { case NT_uint16: { - const PN_uint16 *pi = (const PN_uint16 *)pointer; + const uint16_t *pi = (const uint16_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); _v4d /= 65535.0; } @@ -3759,7 +3759,7 @@ get_data4d(const unsigned char *pointer) { case NT_uint32: { - const PN_uint32 *pi = (const PN_uint32 *)pointer; + const uint32_t *pi = (const uint32_t *)pointer; _v4d.set(pi[0], pi[1], pi[2], pi[3]); _v4d /= 4294967295.0; } @@ -3767,7 +3767,7 @@ get_data4d(const unsigned char *pointer) { case NT_packed_dcba: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_d(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_b(dword), @@ -3778,7 +3778,7 @@ get_data4d(const unsigned char *pointer) { case NT_packed_dabc: { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4d.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -3848,7 +3848,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_uint8: { LVecBase3f scaled = data * 255.0f; - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -3858,7 +3858,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_uint16: { LVecBase3f scaled = data * 65535.0f; - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -3868,7 +3868,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_uint32: { LVecBase3f scaled = data * 4294967295.0f; - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3878,7 +3878,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_packed_dcba: { LVecBase3f scaled = data * 255.0f; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( 1.0f, scaled[2], scaled[1], scaled[0]); } break; @@ -3886,7 +3886,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { case NT_packed_dabc: { LVecBase3f scaled = data * 255.0f; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( 1.0f, scaled[0], scaled[1], scaled[2]); } break; @@ -3917,7 +3917,7 @@ set_data3f(unsigned char *pointer, const LVecBase3f &data) { break; case NT_packed_ufloat: - *(PN_uint32 *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); break; } } else { @@ -3937,7 +3937,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint8: { LVecBase4f scaled = data * 255.0f; - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -3948,7 +3948,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint16: { LVecBase4f scaled = data * 65535.0f; - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -3959,7 +3959,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_uint32: { LVecBase4f scaled = data * 4294967295.0f; - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -3970,7 +3970,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_packed_dcba: { LVecBase4f scaled = data * 255.0f; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( scaled[3], scaled[2], scaled[1], scaled[0]); } break; @@ -3978,7 +3978,7 @@ set_data4f(unsigned char *pointer, const LVecBase4f &data) { case NT_packed_dabc: { LVecBase4f scaled = data * 255.0f; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( scaled[3], scaled[0], scaled[1], scaled[2]); } break; @@ -4051,7 +4051,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_uint8: { LVecBase3d scaled = data * 255.0; - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -4061,7 +4061,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_uint16: { LVecBase3d scaled = data * 65535.0; - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -4071,7 +4071,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_uint32: { LVecBase3d scaled = data * 4294967295.0; - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -4081,7 +4081,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_packed_dcba: { LVecBase3d scaled = data * 255.0; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( 1.0, scaled[2], scaled[1], scaled[0]); } break; @@ -4089,7 +4089,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { case NT_packed_dabc: { LVecBase3d scaled = data * 255.0; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( 1.0, scaled[0], scaled[1], scaled[2]); } break; @@ -4120,7 +4120,7 @@ set_data3d(unsigned char *pointer, const LVecBase3d &data) { break; case NT_packed_ufloat: - *(PN_uint32 *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); + *(uint32_t *)pointer = GeomVertexData::pack_ufloat(data[0], data[1], data[2]); break; } } else { @@ -4140,7 +4140,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint8: { LVecBase4d scaled = data * 255.0; - PN_uint8 *pi = (PN_uint8 *)pointer; + uint8_t *pi = (uint8_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -4151,7 +4151,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint16: { LVecBase4d scaled = data * 65535.0; - PN_uint16 *pi = (PN_uint16 *)pointer; + uint16_t *pi = (uint16_t *)pointer; pi[0] = (unsigned int)scaled[0]; pi[1] = (unsigned int)scaled[1]; pi[2] = (unsigned int)scaled[2]; @@ -4162,7 +4162,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_uint32: { LVecBase4d scaled = data * 4294967295.0; - PN_uint32 *pi = (PN_uint32 *)pointer; + uint32_t *pi = (uint32_t *)pointer; pi[0] = (unsigned int)data[0]; pi[1] = (unsigned int)data[1]; pi[2] = (unsigned int)data[2]; @@ -4173,7 +4173,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_packed_dcba: { LVecBase4d scaled = data * 255.0; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( scaled[3], scaled[2], scaled[1], scaled[0]); } break; @@ -4181,7 +4181,7 @@ set_data4d(unsigned char *pointer, const LVecBase4d &data) { case NT_packed_dabc: { LVecBase4d scaled = data * 255.0; - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd( + *(uint32_t *)pointer = GeomVertexData::pack_abcd( scaled[3], scaled[0], scaled[1], scaled[2]); } break; @@ -4457,7 +4457,7 @@ get_data4d(const unsigned char *pointer) { */ const LVecBase4f &GeomVertexColumn::Packer_argb_packed:: get_data4f(const unsigned char *pointer) { - PN_uint32 dword = *(const PN_uint32 *)pointer; + uint32_t dword = *(const uint32_t *)pointer; _v4.set(GeomVertexData::unpack_abcd_b(dword), GeomVertexData::unpack_abcd_c(dword), GeomVertexData::unpack_abcd_d(dword), @@ -4473,7 +4473,7 @@ void GeomVertexColumn::Packer_argb_packed:: set_data4f(unsigned char *pointer, const LVecBase4f &data) { // when packing an argb, we want to make sure we cap the input values at 1 // since going above one will cause the value to be truncated. - *(PN_uint32 *)pointer = GeomVertexData::pack_abcd + *(uint32_t *)pointer = GeomVertexData::pack_abcd ((unsigned int)(min(max(data[3], 0.0f), 1.0f) * 255.0f), (unsigned int)(min(max(data[0], 0.0f), 1.0f) * 255.0f), (unsigned int)(min(max(data[1], 0.0f), 1.0f) * 255.0f), @@ -4537,7 +4537,7 @@ get_data4f(const unsigned char *pointer) { */ int GeomVertexColumn::Packer_uint16_1:: get_data1i(const unsigned char *pointer) { - return *(const PN_uint16 *)pointer; + return *(const uint16_t *)pointer; } /** @@ -4545,6 +4545,6 @@ get_data1i(const unsigned char *pointer) { */ void GeomVertexColumn::Packer_uint16_1:: set_data1i(unsigned char *pointer, int data) { - *(PN_uint16 *)pointer = data; - nassertv(*(PN_uint16 *)pointer == data); + *(uint16_t *)pointer = data; + nassertv(*(uint16_t *)pointer == data); } diff --git a/panda/src/gobj/geomVertexData.I b/panda/src/gobj/geomVertexData.I index 0d32813912..dfb2138c1a 100644 --- a/panda/src/gobj/geomVertexData.I +++ b/panda/src/gobj/geomVertexData.I @@ -273,7 +273,7 @@ get_modified(Thread *current_thread) const { /** * Packs four values in a DirectX-style NT_packed_abcd value. */ -INLINE PN_uint32 GeomVertexData:: +INLINE uint32_t GeomVertexData:: pack_abcd(unsigned int a, unsigned int b, unsigned int c, unsigned int d) { return (((a & 0xff) << 24) | @@ -286,7 +286,7 @@ pack_abcd(unsigned int a, unsigned int b, * Returns the first packed value from a DirectX-style NT_packed_abcd. */ INLINE unsigned int GeomVertexData:: -unpack_abcd_a(PN_uint32 data) { +unpack_abcd_a(uint32_t data) { return (data >> 24) & 0xff; } @@ -294,7 +294,7 @@ unpack_abcd_a(PN_uint32 data) { * Returns the second packed value from a DirectX-style NT_packed_abcd. */ INLINE unsigned int GeomVertexData:: -unpack_abcd_b(PN_uint32 data) { +unpack_abcd_b(uint32_t data) { return (data >> 16) & 0xff; } @@ -302,7 +302,7 @@ unpack_abcd_b(PN_uint32 data) { * Returns the third packed value from a DirectX-style NT_packed_abcd. */ INLINE unsigned int GeomVertexData:: -unpack_abcd_c(PN_uint32 data) { +unpack_abcd_c(uint32_t data) { return (data >> 8) & 0xff; } @@ -310,19 +310,19 @@ unpack_abcd_c(PN_uint32 data) { * Returns the fourth packed value from a DirectX-style NT_packed_abcd. */ INLINE unsigned int GeomVertexData:: -unpack_abcd_d(PN_uint32 data) { +unpack_abcd_d(uint32_t data) { return data & 0xff; } /** * Packs three float values in an unsigned 32-bit int. */ -INLINE PN_uint32 GeomVertexData:: +INLINE uint32_t GeomVertexData:: pack_ufloat(float a, float b, float c) { // Since we have to clamp both low exponents and negative numbers to 0, it's // easier to see a float as having a 9-bit signed exponent. union { - PN_int32 _packed; + int32_t _packed; float _float; } f0, f1, f2; @@ -335,7 +335,7 @@ pack_ufloat(float a, float b, float c) { // normalized float 4. exponent 0: denormal float 5. zero or anything // negative, clamped to 0 - PN_uint32 packed = 0; + uint32_t packed = 0; if ((f0._packed & 0x7f800000) == 0x7f800000 && (unsigned)f0._packed != 0xff800000u) { packed |= (f0._packed >> 17) & 0x7ffu; @@ -374,14 +374,14 @@ pack_ufloat(float a, float b, float c) { * Unpacks an unsigned float11 value from an uint32. */ INLINE float GeomVertexData:: -unpack_ufloat_a(PN_uint32 data) { +unpack_ufloat_a(uint32_t data) { if ((data & 0x7c0) == 0) { // Denormal float (includes zero). return ldexpf((data & 63) / 64.0f, -14); } union { - PN_uint32 _packed; + uint32_t _packed; float _float; } value; value._packed = ((data & 0x7ff) << 17); @@ -400,14 +400,14 @@ unpack_ufloat_a(PN_uint32 data) { * Unpacks an unsigned float11 value from an uint32. */ INLINE float GeomVertexData:: -unpack_ufloat_b(PN_uint32 data) { +unpack_ufloat_b(uint32_t data) { if ((data & 0x3e0000) == 0) { // Denormal float (includes zero). return ldexpf(((data >> 11) & 63) / 64.0f, -14); } union { - PN_uint32 _packed; + uint32_t _packed; float _float; } value; value._packed = ((data & 0x3ff800) << 6); @@ -426,14 +426,14 @@ unpack_ufloat_b(PN_uint32 data) { * Unpacks an unsigned float10 value from an uint32. */ INLINE float GeomVertexData:: -unpack_ufloat_c(PN_uint32 data) { +unpack_ufloat_c(uint32_t data) { if ((data & 0xf8000000u) == 0) { // Denormal float (includes zero). return ldexpf(((data >> 22) & 31) / 32.0f, -14); } union { - PN_uint32 _packed; + uint32_t _packed; float _float; } value; value._packed = ((data & 0xffc00000u) >> 4); diff --git a/panda/src/gobj/geomVertexData.cxx b/panda/src/gobj/geomVertexData.cxx index 9b1aa50d84..6b73e4fe0f 100644 --- a/panda/src/gobj/geomVertexData.cxx +++ b/panda/src/gobj/geomVertexData.cxx @@ -1434,7 +1434,7 @@ packed_argb_to_uint8_rgba(unsigned char *to, int to_stride, } while (num_records > 0) { - PN_uint32 dword = *(const PN_uint32 *)from; + uint32_t dword = *(const uint32_t *)from; to[0] = unpack_abcd_b(dword); to[1] = unpack_abcd_c(dword); to[2] = unpack_abcd_d(dword); @@ -1461,7 +1461,7 @@ uint8_rgba_to_packed_argb(unsigned char *to, int to_stride, } while (num_records > 0) { - *(PN_uint32 *)to = pack_abcd(from[3], from[0], from[1], from[2]); + *(uint32_t *)to = pack_abcd(from[3], from[0], from[1], from[2]); to += to_stride; from += from_stride; @@ -2515,7 +2515,7 @@ set_num_rows(int n) { case NT_packed_ufloat: while (pointer < stop) { - *(PN_int32 *)pointer = 0x781e03c0; + *(int32_t *)pointer = 0x781e03c0; pointer += stride; } break; diff --git a/panda/src/gobj/geomVertexData.h b/panda/src/gobj/geomVertexData.h index 11f76df880..cfb592529d 100644 --- a/panda/src/gobj/geomVertexData.h +++ b/panda/src/gobj/geomVertexData.h @@ -170,17 +170,17 @@ PUBLISHED: void clear_cache_stage(); public: - static INLINE PN_uint32 pack_abcd(unsigned int a, unsigned int b, + static INLINE uint32_t pack_abcd(unsigned int a, unsigned int b, unsigned int c, unsigned int d); - static INLINE unsigned int unpack_abcd_a(PN_uint32 data); - static INLINE unsigned int unpack_abcd_b(PN_uint32 data); - static INLINE unsigned int unpack_abcd_c(PN_uint32 data); - static INLINE unsigned int unpack_abcd_d(PN_uint32 data); + static INLINE unsigned int unpack_abcd_a(uint32_t data); + static INLINE unsigned int unpack_abcd_b(uint32_t data); + static INLINE unsigned int unpack_abcd_c(uint32_t data); + static INLINE unsigned int unpack_abcd_d(uint32_t data); - static INLINE PN_uint32 pack_ufloat(float a, float b, float c); - static INLINE float unpack_ufloat_a(PN_uint32 data); - static INLINE float unpack_ufloat_b(PN_uint32 data); - static INLINE float unpack_ufloat_c(PN_uint32 data); + static INLINE uint32_t pack_ufloat(float a, float b, float c); + static INLINE float unpack_ufloat_a(uint32_t data); + static INLINE float unpack_ufloat_b(uint32_t data); + static INLINE float unpack_ufloat_c(uint32_t data); private: static void do_set_color(GeomVertexData *vdata, const LColor &color); diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index 1238fc5410..166343f10d 100644 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -635,7 +635,7 @@ ShaderPtrData(const LVecBase2i &vec) : INLINE void Shader::ShaderPtrData:: write_datagram(Datagram &dg) const { dg.add_uint8(_type); - dg.add_uint32((PN_uint32)_size); + dg.add_uint32((uint32_t)_size); if (_type == SPT_double) { const double *data = (const double *) _ptr; diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index f8654d265c..915be360f6 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -1035,7 +1035,7 @@ clear_ram_mipmap_image(int n) { PTA_uchar Texture:: modify_simple_ram_image() { CDWriter cdata(_cycler, true); - cdata->_simple_image_date_generated = (PN_int32)time(NULL); + cdata->_simple_image_date_generated = (int32_t)time(NULL); return cdata->_simple_ram_image._image; } @@ -1053,7 +1053,7 @@ new_simple_ram_image(int x_size, int y_size) { cdata->_simple_y_size = y_size; cdata->_simple_ram_image._image = PTA_uchar::empty_array(expected_page_size); cdata->_simple_ram_image._page_size = expected_page_size; - cdata->_simple_image_date_generated = (PN_int32)time(NULL); + cdata->_simple_image_date_generated = (int32_t)time(NULL); cdata->inc_simple_image_modified(); return cdata->_simple_ram_image._image; @@ -1139,7 +1139,7 @@ generate_simple_ram_image() { convert_from_pnmimage(image, expected_page_size, x_size, 0, 0, 0, scaled, 4, 1); do_set_simple_ram_image(cdata, image, x_size, y_size); - cdata->_simple_image_date_generated = (PN_int32)time(NULL); + cdata->_simple_image_date_generated = (int32_t)time(NULL); } /** @@ -5206,7 +5206,7 @@ do_uncompress_ram_image_bc4(const RamImage &compressed_image, unsigned const char *src = compressed_image._image.p() + z * compressed_image._page_size; // Unconvert one 4 x 4 block at a time. - PN_uint8 tbl[8]; + uint8_t tbl[8]; for (int y = 0; y < y_blocks; ++y) { for (int x = 0; x < x_blocks; ++x) { unsigned char *blk = dest; @@ -5273,8 +5273,8 @@ do_uncompress_ram_image_bc5(const RamImage &compressed_image, unsigned const char *src = compressed_image._image.p() + z * compressed_image._page_size; // Unconvert one 4 x 4 block at a time. - PN_uint8 red[8]; - PN_uint8 grn[8]; + uint8_t red[8]; + uint8_t grn[8]; for (int y = 0; y < y_blocks; ++y) { for (int x = 0; x < x_blocks; ++x) { unsigned char *blk = dest; @@ -6168,11 +6168,11 @@ get_ram_image_as(const string &requested_format) { // These ifs are for optimization of commonly used image types. if (cdata->_component_width == 1) { if (format == "RGBA" && cdata->_num_components == 4) { - const PN_uint32 *src = (const PN_uint32 *)data.p(); - PN_uint32 *dst = (PN_uint32 *)newdata.p(); + const uint32_t *src = (const uint32_t *)data.p(); + uint32_t *dst = (uint32_t *)newdata.p(); for (int p = 0; p < imgsize; ++p) { - PN_uint32 v = *src++; + uint32_t v = *src++; *dst++ = ((v & 0xff00ff00u)) | ((v & 0x00ff0000u) >> 16) | ((v & 0x000000ffu) << 16); @@ -6180,17 +6180,17 @@ get_ram_image_as(const string &requested_format) { return newdata; } if (format == "RGB" && cdata->_num_components == 4) { - const PN_uint32 *src = (const PN_uint32 *)data.p(); - PN_uint32 *dst = (PN_uint32 *)newdata.p(); + const uint32_t *src = (const uint32_t *)data.p(); + uint32_t *dst = (uint32_t *)newdata.p(); // Convert blocks of 4 pixels at a time, so that we can treat both the // source and destination as 32-bit integers. int blocks = imgsize >> 2; for (int i = 0; i < blocks; ++i) { - PN_uint32 v0 = *src++; - PN_uint32 v1 = *src++; - PN_uint32 v2 = *src++; - PN_uint32 v3 = *src++; + uint32_t v0 = *src++; + uint32_t v1 = *src++; + uint32_t v2 = *src++; + uint32_t v3 = *src++; *dst++ = ((v0 & 0x00ff0000u) >> 16) | ((v0 & 0x0000ff00u)) | ((v0 & 0x000000ffu) << 16) | @@ -6207,9 +6207,9 @@ get_ram_image_as(const string &requested_format) { // If the image size wasn't a multiple of 4, we may have a handful of // pixels left over. Convert those the slower way. - PN_uint8 *tail = (PN_uint8 *)dst; + uint8_t *tail = (uint8_t *)dst; for (int i = (imgsize & ~0x3); i < imgsize; ++i) { - PN_uint32 v = *src++; + uint32_t v = *src++; *tail++ = (v & 0x00ff0000u) >> 16; *tail++ = (v & 0x0000ff00u) >> 8; *tail++ = (v & 0x000000ffu); @@ -6217,17 +6217,17 @@ get_ram_image_as(const string &requested_format) { return newdata; } if (format == "BGR" && cdata->_num_components == 4) { - const PN_uint32 *src = (const PN_uint32 *)data.p(); - PN_uint32 *dst = (PN_uint32 *)newdata.p(); + const uint32_t *src = (const uint32_t *)data.p(); + uint32_t *dst = (uint32_t *)newdata.p(); // Convert blocks of 4 pixels at a time, so that we can treat both the // source and destination as 32-bit integers. int blocks = imgsize >> 2; for (int i = 0; i < blocks; ++i) { - PN_uint32 v0 = *src++; - PN_uint32 v1 = *src++; - PN_uint32 v2 = *src++; - PN_uint32 v3 = *src++; + uint32_t v0 = *src++; + uint32_t v1 = *src++; + uint32_t v2 = *src++; + uint32_t v3 = *src++; *dst++ = (v0 & 0x00ffffffu) | ((v1 & 0x000000ffu) << 24); *dst++ = ((v1 & 0x00ffff00u) >> 8) | ((v2 & 0x0000ffffu) << 16); *dst++ = ((v2 & 0x00ff0000u) >> 16) | ((v3 & 0x00ffffffu) << 8); @@ -6235,17 +6235,17 @@ get_ram_image_as(const string &requested_format) { // If the image size wasn't a multiple of 4, we may have a handful of // pixels left over. Convert those the slower way. - PN_uint8 *tail = (PN_uint8 *)dst; + uint8_t *tail = (uint8_t *)dst; for (int i = (imgsize & ~0x3); i < imgsize; ++i) { - PN_uint32 v = *src++; + uint32_t v = *src++; *tail++ = (v & 0x000000ffu); *tail++ = (v & 0x0000ff00u) >> 8; *tail++ = (v & 0x00ff0000u) >> 16; } return newdata; } - const PN_uint8 *src = (const PN_uint8 *)data.p(); - PN_uint8 *dst = (PN_uint8 *)newdata.p(); + const uint8_t *src = (const uint8_t *)data.p(); + uint8_t *dst = (uint8_t *)newdata.p(); if (format == "RGB" && cdata->_num_components == 3) { for (int i = 0; i < imgsize; ++i) { @@ -6335,7 +6335,7 @@ do_set_simple_ram_image(CData *cdata, CPTA_uchar image, int x_size, int y_size) cdata->_simple_y_size = y_size; cdata->_simple_ram_image._image = image.cast_non_const(); cdata->_simple_ram_image._page_size = image.size(); - cdata->_simple_image_date_generated = (PN_int32)time(NULL); + cdata->_simple_image_date_generated = (int32_t)time(NULL); cdata->inc_simple_image_modified(); } @@ -7019,9 +7019,9 @@ read_dds_level_abgr8(Texture *tex, CData *cdata, const DDSHeader &header, int n, unsigned char *p = image.p() + y * row_bytes; in.read((char *)p, row_bytes); - PN_uint32 *pw = (PN_uint32 *)p; + uint32_t *pw = (uint32_t *)p; for (int x = 0; x < x_size; ++x) { - PN_uint32 w = *pw; + uint32_t w = *pw; #ifdef WORDS_BIGENDIAN // bigendian: convert R, G, B, A to B, G, R, A. w = ((w & 0xff00) << 16) | ((w & 0xff000000U) >> 16) | (w & 0xff00ff); @@ -7075,7 +7075,7 @@ read_dds_level_abgr16(Texture *tex, CData *cdata, const DDSHeader &header, int n unsigned char *p = image.p() + y * row_bytes; in.read((char *)p, row_bytes); - PN_uint16 *pw = (PN_uint16 *)p; + uint16_t *pw = (uint16_t *)p; for (int x = 0; x < x_size; ++x) { swap(pw[0], pw[2]); pw += 4; @@ -7102,7 +7102,7 @@ read_dds_level_abgr32(Texture *tex, CData *cdata, const DDSHeader &header, int n unsigned char *p = image.p() + y * row_bytes; in.read((char *)p, row_bytes); - PN_uint32 *pw = (PN_uint32 *)p; + uint32_t *pw = (uint32_t *)p; for (int x = 0; x < x_size; ++x) { swap(pw[0], pw[2]); pw += 4; @@ -7331,8 +7331,8 @@ read_dds_level_bc1(Texture *tex, CData *cdata, const DDSHeader &header, int n, i for (int ci = 0; ci < num_cols; ++ci) { // . . . and (b) within each block, we reverse the 4 individual rows // of 4 pixels. - PN_uint32 *cells = (PN_uint32 *)p; - PN_uint32 w = cells[1]; + uint32_t *cells = (uint32_t *)p; + uint32_t w = cells[1]; w = ((w & 0xff) << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | ((w & 0xff000000U) >> 24); cells[1] = w; @@ -7346,8 +7346,8 @@ read_dds_level_bc1(Texture *tex, CData *cdata, const DDSHeader &header, int n, i in.read((char *)p, row_length); for (int ci = 0; ci < num_cols; ++ci) { - PN_uint32 *cells = (PN_uint32 *)p; - PN_uint32 w = cells[1]; + uint32_t *cells = (uint32_t *)p; + uint32_t w = cells[1]; w = ((w & 0xff) << 8) | ((w & 0xff00) >> 8); cells[1] = w; @@ -7401,11 +7401,11 @@ read_dds_level_bc2(Texture *tex, CData *cdata, const DDSHeader &header, int n, i for (int ci = 0; ci < num_cols; ++ci) { // . . . and (b) within each block, we reverse the 4 individual rows // of 4 pixels. - PN_uint32 *cells = (PN_uint32 *)p; + uint32_t *cells = (uint32_t *)p; // Alpha. The block is four 16-bit words of pixel data. - PN_uint32 w0 = cells[0]; - PN_uint32 w1 = cells[1]; + uint32_t w0 = cells[0]; + uint32_t w1 = cells[1]; w0 = ((w0 & 0xffff) << 16) | ((w0 & 0xffff0000U) >> 16); w1 = ((w1 & 0xffff) << 16) | ((w1 & 0xffff0000U) >> 16); cells[0] = w1; @@ -7413,7 +7413,7 @@ read_dds_level_bc2(Texture *tex, CData *cdata, const DDSHeader &header, int n, i // Color. Only the second 32-bit dword of the color block represents // the pixel data. - PN_uint32 w = cells[3]; + uint32_t w = cells[3]; w = ((w & 0xff) << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | ((w & 0xff000000U) >> 24); cells[3] = w; @@ -7427,13 +7427,13 @@ read_dds_level_bc2(Texture *tex, CData *cdata, const DDSHeader &header, int n, i in.read((char *)p, row_length); for (int ci = 0; ci < num_cols; ++ci) { - PN_uint32 *cells = (PN_uint32 *)p; + uint32_t *cells = (uint32_t *)p; - PN_uint32 w0 = cells[0]; + uint32_t w0 = cells[0]; w0 = ((w0 & 0xffff) << 16) | ((w0 & 0xffff0000U) >> 16); cells[0] = w0; - PN_uint32 w = cells[3]; + uint32_t w = cells[3]; w = ((w & 0xff) << 8) | ((w & 0xff00) >> 8); cells[3] = w; @@ -7487,7 +7487,7 @@ read_dds_level_bc3(Texture *tex, CData *cdata, const DDSHeader &header, int n, i for (int ci = 0; ci < num_cols; ++ci) { // . . . and (b) within each block, we reverse the 4 individual rows // of 4 pixels. - PN_uint32 *cells = (PN_uint32 *)p; + uint32_t *cells = (uint32_t *)p; // Alpha. The block is one 16-bit word of reference values, followed // by six words of pixel values, in 12-bit rows. Tricky to invert. @@ -7507,7 +7507,7 @@ read_dds_level_bc3(Texture *tex, CData *cdata, const DDSHeader &header, int n, i // Color. Only the second 32-bit dword of the color block represents // the pixel data. - PN_uint32 w = cells[3]; + uint32_t w = cells[3]; w = ((w & 0xff) << 24) | ((w & 0xff00) << 8) | ((w & 0xff0000) >> 8) | ((w & 0xff000000U) >> 24); cells[3] = w; @@ -7521,7 +7521,7 @@ read_dds_level_bc3(Texture *tex, CData *cdata, const DDSHeader &header, int n, i in.read((char *)p, row_length); for (int ci = 0; ci < num_cols; ++ci) { - PN_uint32 *cells = (PN_uint32 *)p; + uint32_t *cells = (uint32_t *)p; unsigned char p2 = p[2]; unsigned char p3 = p[3]; @@ -7531,11 +7531,11 @@ read_dds_level_bc3(Texture *tex, CData *cdata, const DDSHeader &header, int n, i p[3] = ((p2 & 0xf) << 4) | ((p4 & 0xf0) >> 4); p[4] = ((p3 & 0xf) << 4) | ((p2 & 0xf0) >> 4); - PN_uint32 w0 = cells[0]; + uint32_t w0 = cells[0]; w0 = ((w0 & 0xffff) << 16) | ((w0 & 0xffff0000U) >> 16); cells[0] = w0; - PN_uint32 w = cells[3]; + uint32_t w = cells[3]; w = ((w & 0xff) << 8) | ((w & 0xff00) >> 8); cells[3] = w; diff --git a/panda/src/gobj/texture.h b/panda/src/gobj/texture.h index a7115d4664..71d5784dcf 100644 --- a/panda/src/gobj/texture.h +++ b/panda/src/gobj/texture.h @@ -977,7 +977,7 @@ protected: RamImage _simple_ram_image; int _simple_x_size; int _simple_y_size; - PN_int32 _simple_image_date_generated; + int32_t _simple_image_date_generated; // This is the color that should be used when no image was given. bool _has_clear_color; diff --git a/panda/src/mathutil/fftCompressor.cxx b/panda/src/mathutil/fftCompressor.cxx index 47193445b9..f96c6f5f7c 100644 --- a/panda/src/mathutil/fftCompressor.cxx +++ b/panda/src/mathutil/fftCompressor.cxx @@ -849,7 +849,7 @@ write_run(Datagram &datagram, FFTCompressor::RunWidth run_width, // In the case of RW_double, we only write the numbers one at a time, // each time preceded by the RW_double flag. Hopefully this will happen // only rarely. - datagram.add_int8((PN_int8)RW_double); + datagram.add_int8((int8_t)RW_double); datagram.add_float64(*ri); } break; @@ -869,7 +869,7 @@ write_run(Datagram &datagram, FFTCompressor::RunWidth run_width, */ int FFTCompressor:: read_run(DatagramIterator &di, vector_double &run) { - PN_uint8 start = di.get_uint8(); + uint8_t start = di.get_uint8(); RunWidth run_width; int length; diff --git a/panda/src/movies/flacAudioCursor.cxx b/panda/src/movies/flacAudioCursor.cxx index 5618062536..3ea294c7ce 100644 --- a/panda/src/movies/flacAudioCursor.cxx +++ b/panda/src/movies/flacAudioCursor.cxx @@ -114,7 +114,7 @@ seek(double t) { * audio will be interleaved. */ void FlacAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int desired = n * _audio_channels; _samples_read += drflac_read_s16(_drflac, desired, data) / _audio_channels; } diff --git a/panda/src/movies/flacAudioCursor.h b/panda/src/movies/flacAudioCursor.h index 2b4633c871..4f68eb62a8 100644 --- a/panda/src/movies/flacAudioCursor.h +++ b/panda/src/movies/flacAudioCursor.h @@ -35,7 +35,7 @@ PUBLISHED: virtual void seek(double offset); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); bool _is_valid; diff --git a/panda/src/movies/microphoneAudioDS.cxx b/panda/src/movies/microphoneAudioDS.cxx index 6df15f1cfc..95412fb961 100644 --- a/panda/src/movies/microphoneAudioDS.cxx +++ b/panda/src/movies/microphoneAudioDS.cxx @@ -91,7 +91,7 @@ public: int _samples_per_buffer; public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); virtual int ready() const; public: @@ -324,7 +324,7 @@ MicrophoneAudioCursorDS:: * */ void MicrophoneAudioCursorDS:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int orign = n; if (_handle) { while (1) { @@ -334,7 +334,7 @@ read_samples(int n, PN_int16 *data) { } // Find start of data in buffer. - PN_int16 *src = (PN_int16*)(_buffers[index]._storage); + int16_t *src = (int16_t*)(_buffers[index]._storage); src += (_offset * _audio_channels); // Decide how many samples to extract from this buffer. diff --git a/panda/src/movies/movieAudioCursor.I b/panda/src/movies/movieAudioCursor.I index adbb4dd7ba..64e14886fd 100644 --- a/panda/src/movies/movieAudioCursor.I +++ b/panda/src/movies/movieAudioCursor.I @@ -100,5 +100,5 @@ tell() const { */ INLINE void MovieAudioCursor:: skip_samples(int n) { - read_samples(n, (PN_int16*)0); + read_samples(n, (int16_t*)0); } diff --git a/panda/src/movies/movieAudioCursor.cxx b/panda/src/movies/movieAudioCursor.cxx index 2776dbe030..f386401103 100644 --- a/panda/src/movies/movieAudioCursor.cxx +++ b/panda/src/movies/movieAudioCursor.cxx @@ -46,7 +46,7 @@ MovieAudioCursor:: * audio will be interleaved. */ void MovieAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { // This is the null implementation, which generates pure silence. Normally, // this method will be overridden by a subclass. @@ -71,7 +71,7 @@ read_samples(int n, PN_int16 *data) { */ void MovieAudioCursor:: read_samples(int n, Datagram *dg) { - PN_int16 tmp[4096]; + int16_t tmp[4096]; while (n > 0) { int blocksize = (4096 / _audio_channels); if (blocksize > n) blocksize = n; @@ -95,14 +95,14 @@ read_samples(int n, Datagram *dg) { string MovieAudioCursor:: read_samples(int n) { ostringstream result; - PN_int16 tmp[4096]; + int16_t tmp[4096]; while (n > 0) { int blocksize = (4096 / _audio_channels); if (blocksize > n) blocksize = n; int words = blocksize * _audio_channels; read_samples(blocksize, tmp); for (int i=0; i>8) & 255)); } diff --git a/panda/src/movies/movieAudioCursor.h b/panda/src/movies/movieAudioCursor.h index 731bc28f98..8d49c26ccf 100644 --- a/panda/src/movies/movieAudioCursor.h +++ b/panda/src/movies/movieAudioCursor.h @@ -51,7 +51,7 @@ PUBLISHED: string read_samples(int n); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); protected: PT(MovieAudio) _source; @@ -62,7 +62,7 @@ protected: bool _can_seek_fast; bool _aborted; double _last_seek; - PN_int64 _samples_read; + int64_t _samples_read; public: static TypeHandle get_class_type() { diff --git a/panda/src/movies/userDataAudio.cxx b/panda/src/movies/userDataAudio.cxx index ca71806f31..7575ad977b 100644 --- a/panda/src/movies/userDataAudio.cxx +++ b/panda/src/movies/userDataAudio.cxx @@ -58,7 +58,7 @@ open() { * audio will be interleaved. */ void UserDataAudio:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int ready = (_data.size() / _desired_channels); int desired = n * _desired_channels; int avail = ready * _desired_channels; @@ -78,7 +78,7 @@ read_samples(int n, PN_int16 *data) { * Appends audio samples to the buffer. */ void UserDataAudio:: -append(PN_int16 *data, int n) { +append(int16_t *data, int n) { nassertv(!_aborted); int words = n * _desired_channels; for (int i=0; i _data; + pdeque _data; bool _aborted; bool _remove_after_read; friend class UserDataAudioCursor; diff --git a/panda/src/movies/userDataAudioCursor.cxx b/panda/src/movies/userDataAudioCursor.cxx index d882195b2f..e0494cf53e 100644 --- a/panda/src/movies/userDataAudioCursor.cxx +++ b/panda/src/movies/userDataAudioCursor.cxx @@ -48,7 +48,7 @@ UserDataAudioCursor:: * audio will be interleaved. */ void UserDataAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { UserDataAudio *source = (UserDataAudio*)(MovieAudio*)_source; if(source->_remove_after_read) { diff --git a/panda/src/movies/userDataAudioCursor.h b/panda/src/movies/userDataAudioCursor.h index 4c2ad96bb1..5e0d75b85f 100644 --- a/panda/src/movies/userDataAudioCursor.h +++ b/panda/src/movies/userDataAudioCursor.h @@ -33,7 +33,7 @@ PUBLISHED: virtual ~UserDataAudioCursor(); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); virtual int ready() const; virtual void seek(double offset); diff --git a/panda/src/movies/vorbisAudioCursor.cxx b/panda/src/movies/vorbisAudioCursor.cxx index d006c1878d..9d751629c2 100644 --- a/panda/src/movies/vorbisAudioCursor.cxx +++ b/panda/src/movies/vorbisAudioCursor.cxx @@ -109,7 +109,7 @@ seek(double t) { * audio will be interleaved. */ void VorbisAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int desired = n * _audio_channels; char *buffer = (char*) data; diff --git a/panda/src/movies/vorbisAudioCursor.h b/panda/src/movies/vorbisAudioCursor.h index 177b0a0fe4..2d16368dde 100644 --- a/panda/src/movies/vorbisAudioCursor.h +++ b/panda/src/movies/vorbisAudioCursor.h @@ -35,7 +35,7 @@ PUBLISHED: virtual void seek(double offset); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); bool _is_valid; diff --git a/panda/src/movies/wavAudioCursor.cxx b/panda/src/movies/wavAudioCursor.cxx index 2742b41a9d..3b220749c4 100644 --- a/panda/src/movies/wavAudioCursor.cxx +++ b/panda/src/movies/wavAudioCursor.cxx @@ -17,7 +17,7 @@ #include "wavAudio.h" // Tables for decompressing mu-law and A-law wav files. -static PN_int16 mulaw_table[256] = { +static int16_t mulaw_table[256] = { -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956, -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764, -15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412, @@ -52,7 +52,7 @@ static PN_int16 mulaw_table[256] = { 56, 48, 40, 32, 24, 16, 8, 0 }; -static PN_int16 alaw_table[256] = { +static int16_t alaw_table[256] = { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, @@ -143,7 +143,7 @@ WavAudioCursor(WavAudio *src, istream *stream) : _block_align = _reader.get_uint16(); // We can round up to next multiple of 8. - PN_uint16 bps = _reader.get_uint16(); + uint16_t bps = _reader.get_uint16(); bps = (bps + 7) & 0xfff8; // How many bytes in this chunk we've read so far. @@ -324,7 +324,7 @@ seek(double t) { * audio will be interleaved. */ void WavAudioCursor:: -read_samples(int n, PN_int16 *data) { +read_samples(int n, int16_t *data) { int desired = n * _audio_channels; int read_samples = min(desired, ((int) (_data_size - _data_pos)) / _bytes_per_sample); @@ -359,7 +359,7 @@ read_samples(int n, PN_int16 *data) { } case 4: { // Downsample. - const PN_int32 scale_factor = 0x7fffffff / 0x7fff; + const int32_t scale_factor = 0x7fffffff / 0x7fff; for (int i = 0; i < read_samples; ++i) { data[i] = _reader.get_int32() / scale_factor; @@ -368,7 +368,7 @@ read_samples(int n, PN_int16 *data) { } case 8: { // Downsample. - const PN_int64 scale_factor = 0x7fffffffffffffffLL / 0x7fffLL; + const int64_t scale_factor = 0x7fffffffffffffffLL / 0x7fffLL; for (int i = 0; i < read_samples; ++i) { data[i] = _reader.get_int64() / scale_factor; @@ -386,13 +386,13 @@ read_samples(int n, PN_int16 *data) { switch (_bytes_per_sample) { case 4: for (int i = 0; i < read_samples; ++i) { - data[i] = (PN_int16) (_reader.get_float32() * 0x7fff); + data[i] = (int16_t) (_reader.get_float32() * 0x7fff); } break; case 8: for (int i = 0; i < read_samples; ++i) { - data[i] = (PN_int16) (_reader.get_float64() * 0x7fff); + data[i] = (int16_t) (_reader.get_float64() * 0x7fff); } break; diff --git a/panda/src/movies/wavAudioCursor.h b/panda/src/movies/wavAudioCursor.h index 316dffedd9..e03ee5bdde 100644 --- a/panda/src/movies/wavAudioCursor.h +++ b/panda/src/movies/wavAudioCursor.h @@ -31,7 +31,7 @@ PUBLISHED: virtual void seek(double offset); public: - virtual void read_samples(int n, PN_int16 *data); + virtual void read_samples(int n, int16_t *data); bool _is_valid; diff --git a/panda/src/nativenet/socket_address.I b/panda/src/nativenet/socket_address.I index 6a20ced62c..c29b6b646f 100644 --- a/panda/src/nativenet/socket_address.I +++ b/panda/src/nativenet/socket_address.I @@ -158,7 +158,7 @@ set_host(const std::string &hostname, unsigned short port) { } - PN_uint32 addr = (PN_uint32)inet_addr(hostname.c_str()); + uint32_t addr = (uint32_t)inet_addr(hostname.c_str()); if (addr == INADDR_NONE) { hp = gethostbyname(hostname.c_str()); if (hp == NULL) { @@ -195,7 +195,7 @@ set_host(const std::string &hostname) { * */ INLINE bool Socket_Address:: -set_host(PN_uint32 in_hostname, unsigned short port) { +set_host(uint32_t in_hostname, unsigned short port) { memcpy(&_addr.sin_addr, &in_hostname, sizeof(in_hostname)); _addr.sin_port = htons(port); _addr.sin_family = AF_INET; @@ -227,7 +227,7 @@ operator < (const Socket_Address &in) const { */ INLINE bool Socket_Address:: is_mcast_range(void) const { - PN_uint32 address = ntohl(_addr.sin_addr.s_addr); + uint32_t address = ntohl(_addr.sin_addr.s_addr); // 224.0.0.0-239.255.255.255 .. e0,ef return (address >= 0xe0000000 && address < 0xefffffff); } diff --git a/panda/src/nativenet/socket_fdset.h b/panda/src/nativenet/socket_fdset.h index 3f3edc711a..45c990bf27 100644 --- a/panda/src/nativenet/socket_fdset.h +++ b/panda/src/nativenet/socket_fdset.h @@ -18,9 +18,9 @@ PUBLISHED: inline Socket_fdset(); inline void setForSocket(const Socket_IP &incon); inline bool IsSetFor(const Socket_IP &incon) const; - inline int WaitForRead(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); - inline int WaitForWrite(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); - inline int WaitForError(bool zeroFds, PN_uint32 sleep_time = 0xffffffff); + inline int WaitForRead(bool zeroFds, uint32_t sleep_time = 0xffffffff); + inline int WaitForWrite(bool zeroFds, uint32_t sleep_time = 0xffffffff); + inline int WaitForError(bool zeroFds, uint32_t sleep_time = 0xffffffff); inline int WaitForRead(bool zeroFds, const Time_Span & timeout); inline void clear(); @@ -86,7 +86,7 @@ inline bool Socket_fdset::IsSetFor(const Socket_IP & incon) const /** * */ -inline int Socket_fdset::WaitForRead(bool zeroFds, PN_uint32 sleep_time) +inline int Socket_fdset::WaitForRead(bool zeroFds, uint32_t sleep_time) { int retVal = 0; if (sleep_time == 0xffffffff) { @@ -139,7 +139,7 @@ inline void Socket_fdset::setForSocket(const Socket_IP &incon) * This is the function that will wait till one of the sockets is ready for * writing */ -inline int Socket_fdset::WaitForWrite(bool zeroFds, PN_uint32 sleep_time) +inline int Socket_fdset::WaitForWrite(bool zeroFds, uint32_t sleep_time) { int retVal = 0; if (sleep_time == 0xffffffff) @@ -164,7 +164,7 @@ inline int Socket_fdset::WaitForWrite(bool zeroFds, PN_uint32 sleep_time) * This is the function that will wait till one of the sockets is in error * state */ -inline int Socket_fdset::WaitForError(bool zeroFds, PN_uint32 sleep_time) +inline int Socket_fdset::WaitForError(bool zeroFds, uint32_t sleep_time) { int retVal = 0; if (sleep_time == 0xffffffff) diff --git a/panda/src/nativenet/socket_tcp_ssl.h b/panda/src/nativenet/socket_tcp_ssl.h index e80e0d5647..ef89e384c8 100644 --- a/panda/src/nativenet/socket_tcp_ssl.h +++ b/panda/src/nativenet/socket_tcp_ssl.h @@ -285,12 +285,12 @@ inline void Socket_TCP_SSL::DetailErrorFormat(void) { return; // turn on fir debuging - PN_uint32 l; + uint32_t l; char buf[256]; char buf2[4096]; const char *file,*data; int line,flags; - PN_uint32 es; + uint32_t es; es=CRYPTO_thread_id(); while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) diff --git a/panda/src/net/connectionManager.cxx b/panda/src/net/connectionManager.cxx index abfdc2f541..ce2b97ace0 100644 --- a/panda/src/net/connectionManager.cxx +++ b/panda/src/net/connectionManager.cxx @@ -412,7 +412,7 @@ wait_for_readers(double timeout) { wait_timeout = min(wait_timeout, stop - now); } - PN_uint32 wait_timeout_ms = (PN_uint32)(wait_timeout * 1000.0); + uint32_t wait_timeout_ms = (uint32_t)(wait_timeout * 1000.0); if (any_threaded) { // If there are any threaded ConnectionReaders, we can't block at all. wait_timeout_ms = 0; @@ -517,7 +517,7 @@ scan_interfaces() { // Now, we can infer the netmask by the difference between the // network address (the first address) and the broadcast address // (the last address). - PN_uint32 netmask = addresses[0].get_ip() - addresses[2].get_ip() - 1; + uint32_t netmask = addresses[0].get_ip() - addresses[2].get_ip() - 1; Socket_Address sa; sa.set_host(netmask, 0); iface.set_netmask(NetAddress(sa)); diff --git a/panda/src/net/connectionReader.cxx b/panda/src/net/connectionReader.cxx index 7a63d90833..0ca114e476 100644 --- a/panda/src/net/connectionReader.cxx +++ b/panda/src/net/connectionReader.cxx @@ -834,7 +834,7 @@ get_next_available_socket(bool allow_block, int current_thread_index) { _next_index = 0; if (!_shutdown) { - PN_uint32 timeout = (PN_uint32)(get_net_max_block() * 1000.0); + uint32_t timeout = (uint32_t)(get_net_max_block() * 1000.0); if (!allow_block) { timeout = 0; } diff --git a/panda/src/net/datagramTCPHeader.cxx b/panda/src/net/datagramTCPHeader.cxx index 3ad1d53f5b..533e3e671b 100644 --- a/panda/src/net/datagramTCPHeader.cxx +++ b/panda/src/net/datagramTCPHeader.cxx @@ -31,7 +31,7 @@ DatagramTCPHeader(const NetDatagram &datagram, int header_size) { case datagram_tcp16_header_size: { - PN_uint16 size = str.length(); + uint16_t size = str.length(); nassertv(size == str.length()); _header.add_uint16(size); } @@ -39,7 +39,7 @@ DatagramTCPHeader(const NetDatagram &datagram, int header_size) { case datagram_tcp32_header_size: { - PN_uint32 size = str.length(); + uint32_t size = str.length(); nassertv(size == str.length()); _header.add_uint32(size); } diff --git a/panda/src/net/datagramTCPHeader.h b/panda/src/net/datagramTCPHeader.h index ac8119f4fa..51f489e3ed 100644 --- a/panda/src/net/datagramTCPHeader.h +++ b/panda/src/net/datagramTCPHeader.h @@ -21,8 +21,8 @@ #include "datagramIterator.h" #include "numeric_types.h" -static const int datagram_tcp16_header_size = sizeof(PN_uint16); -static const int datagram_tcp32_header_size = sizeof(PN_uint32); +static const int datagram_tcp16_header_size = sizeof(uint16_t); +static const int datagram_tcp32_header_size = sizeof(uint32_t); class NetDatagram; diff --git a/panda/src/net/datagramUDPHeader.cxx b/panda/src/net/datagramUDPHeader.cxx index b9b0938021..b491190187 100644 --- a/panda/src/net/datagramUDPHeader.cxx +++ b/panda/src/net/datagramUDPHeader.cxx @@ -25,9 +25,9 @@ DatagramUDPHeader:: DatagramUDPHeader(const NetDatagram &datagram) { const string &str = datagram.get_message(); - PN_uint16 checksum = 0; + uint16_t checksum = 0; for (size_t p = 0; p < str.size(); p++) { - checksum += (PN_uint16)(PN_uint8)str[p]; + checksum += (uint16_t)(uint8_t)str[p]; } // Now pack the header. @@ -51,9 +51,9 @@ bool DatagramUDPHeader:: verify_datagram(const NetDatagram &datagram) const { const string &str = datagram.get_message(); - PN_uint16 checksum = 0; + uint16_t checksum = 0; for (size_t p = 0; p < str.size(); p++) { - checksum += (PN_uint16)(PN_uint8)str[p]; + checksum += (uint16_t)(uint8_t)str[p]; } if (checksum == get_datagram_checksum()) { diff --git a/panda/src/net/datagramUDPHeader.h b/panda/src/net/datagramUDPHeader.h index fd2abbaa47..e8ee0b8b1a 100644 --- a/panda/src/net/datagramUDPHeader.h +++ b/panda/src/net/datagramUDPHeader.h @@ -21,7 +21,7 @@ #include "datagramIterator.h" #include "numeric_types.h" -static const int datagram_udp_header_size = sizeof(PN_uint16); +static const int datagram_udp_header_size = sizeof(uint16_t); class NetDatagram; diff --git a/panda/src/net/netAddress.cxx b/panda/src/net/netAddress.cxx index 4ae75f3434..ee0ed96ba2 100644 --- a/panda/src/net/netAddress.cxx +++ b/panda/src/net/netAddress.cxx @@ -103,7 +103,7 @@ get_ip_string() const { * Returns the IP address to which this address refers, as a 32-bit integer, * in host byte order. */ -PN_uint32 NetAddress:: +uint32_t NetAddress:: get_ip() const { return _addr.GetIPAddressRaw(); } @@ -113,11 +113,11 @@ get_ip() const { * components; component 0 is the first (leftmost), and component 3 is the * last (rightmost) in the dotted number convention. */ -PN_uint8 NetAddress:: +uint8_t NetAddress:: get_ip_component(int n) const { nassertr(n >= 0 && n < 4, 0); - PN_uint32 ip_long = _addr.GetIPAddressRaw(); - const PN_uint8 *ip = (const PN_uint8 *)&ip_long; + uint32_t ip_long = _addr.GetIPAddressRaw(); + const uint8_t *ip = (const uint8_t *)&ip_long; return ip[n]; } diff --git a/panda/src/net/netAddress.h b/panda/src/net/netAddress.h index e28a7d2443..f10b02041d 100644 --- a/panda/src/net/netAddress.h +++ b/panda/src/net/netAddress.h @@ -37,8 +37,8 @@ PUBLISHED: int get_port() const; void set_port(int port); string get_ip_string() const; - PN_uint32 get_ip() const; - PN_uint8 get_ip_component(int n) const; + uint32_t get_ip() const; + uint8_t get_ip_component(int n) const; const Socket_Address &get_addr() const; diff --git a/panda/src/ode/odeWorld.cxx b/panda/src/ode/odeWorld.cxx index 5e3986b6f5..30b98ddd8b 100644 --- a/panda/src/ode/odeWorld.cxx +++ b/panda/src/ode/odeWorld.cxx @@ -63,7 +63,7 @@ add_body_dampening(OdeBody& body, int surface) { void OdeWorld:: -init_surface_table(PN_uint8 num_surfaces) { +init_surface_table(uint8_t num_surfaces) { _surface_table = new sSurfaceParams[num_surfaces * num_surfaces]; // _dampen_table = new sSurfaceParams[num_surfaces * num_surfaces]; _num_surfaces = num_surfaces; @@ -92,7 +92,7 @@ set_surface(int pos1, int pos2, sSurfaceParams& entry) { sSurfaceParams& OdeWorld:: -get_surface(PN_uint8 surface1, PN_uint8 surface2) { +get_surface(uint8_t surface1, uint8_t surface2) { int true_pos = 0; if(surface1 >= surface2) { true_pos = (surface1 * _num_surfaces) + surface2; @@ -108,7 +108,7 @@ get_surface(PN_uint8 surface1, PN_uint8 surface2) { } void OdeWorld:: -set_surface_entry(PN_uint8 pos1, PN_uint8 pos2, +set_surface_entry(uint8_t pos1, uint8_t pos2, dReal mu, dReal bounce, dReal bounce_vel, diff --git a/panda/src/ode/odeWorld.h b/panda/src/ode/odeWorld.h index 4238700af9..fc17382115 100644 --- a/panda/src/ode/odeWorld.h +++ b/panda/src/ode/odeWorld.h @@ -77,10 +77,10 @@ PUBLISHED: INLINE int compare_to(const OdeWorld &other) const; - void init_surface_table(PN_uint8 num_surfaces); + void init_surface_table(uint8_t num_surfaces); // void assign_surface_body(OdeBody& body, int surface); void add_body_dampening(OdeBody& body, int surface); - void set_surface_entry(PN_uint8 pos1, PN_uint8 pos2, + void set_surface_entry(uint8_t pos1, uint8_t pos2, dReal mu, dReal bounce, dReal bounce_vel, @@ -93,7 +93,7 @@ PUBLISHED: operator bool () const; public: - sSurfaceParams& get_surface(PN_uint8 surface1, PN_uint8 surface2); + sSurfaceParams& get_surface(uint8_t surface1, uint8_t surface2); void set_surface(int pos1, int pos2, sSurfaceParams& entry); sBodyParams get_surface_body(dBodyID id); void set_dampen_on_bodies(dBodyID id1, dBodyID id2,dReal damp); @@ -102,7 +102,7 @@ public: private: dWorldID _id; sSurfaceParams *_surface_table; - PN_uint8 _num_surfaces; + uint8_t _num_surfaces; typedef pmap BodyDampenMap; BodyDampenMap _body_dampen_map; diff --git a/panda/src/pgraph/geomNode.cxx b/panda/src/pgraph/geomNode.cxx index bfbd24f04f..f0000d4ebb 100644 --- a/panda/src/pgraph/geomNode.cxx +++ b/panda/src/pgraph/geomNode.cxx @@ -1099,7 +1099,7 @@ void GeomNode::CData:: write_datagram(BamWriter *manager, Datagram &dg) const { CPT(GeomList) geoms = _geoms.get_read_pointer(); int num_geoms = geoms->size(); - nassertv(num_geoms == (int)(PN_uint16)num_geoms); + nassertv(num_geoms == (int)(uint16_t)num_geoms); dg.add_uint16(num_geoms); GeomList::const_iterator gi; diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 827ae89c31..38a1c5f096 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -4109,7 +4109,7 @@ write_up_list(const PandaNode::Up &up_list, num_parents++; } } - nassertv(num_parents == (int)(PN_uint16)num_parents); + nassertv(num_parents == (int)(uint16_t)num_parents); dg.add_uint16(num_parents); for (ui = up_list.begin(); ui != up_list.end(); ++ui) { PandaNode *parent_node = (*ui).get_parent(); @@ -4126,7 +4126,7 @@ void PandaNode::CData:: write_down_list(const PandaNode::Down &down_list, BamWriter *manager, Datagram &dg) const { int num_children = down_list.size(); - nassertv(num_children == (int)(PN_uint16)num_children); + nassertv(num_children == (int)(uint16_t)num_children); dg.add_uint16(num_children); // Should we smarten up the writing of the sort number? Most of the time diff --git a/panda/src/pgraph/renderEffects.cxx b/panda/src/pgraph/renderEffects.cxx index 077c496e04..18c7565a3f 100644 --- a/panda/src/pgraph/renderEffects.cxx +++ b/panda/src/pgraph/renderEffects.cxx @@ -685,7 +685,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { TypedWritable::write_datagram(manager, dg); int num_effects = _effects.size(); - nassertv(num_effects == (int)(PN_uint16)num_effects); + nassertv(num_effects == (int)(uint16_t)num_effects); dg.add_uint16(num_effects); Effects::const_iterator ai; diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index 0555d300a3..de3a58b2ba 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/panda/src/pgraph/renderState.cxx @@ -1996,7 +1996,7 @@ write_datagram(BamWriter *manager, Datagram &dg) { TypedWritable::write_datagram(manager, dg); int num_attribs = _filled_slots.get_num_on_bits(); - nassertv(num_attribs == (int)(PN_uint16)num_attribs); + nassertv(num_attribs == (int)(uint16_t)num_attribs); dg.add_uint16(num_attribs); // **** We should smarten up the writing of the override number--most of the diff --git a/panda/src/putil/bamWriter.cxx b/panda/src/putil/bamWriter.cxx index 2351a96340..679600b664 100644 --- a/panda/src/putil/bamWriter.cxx +++ b/panda/src/putil/bamWriter.cxx @@ -489,7 +489,7 @@ write_handle(Datagram &packet, TypeHandle type) { // TypeHandle. Why not? int index = type.get_index(); - // Also make sure the index number fits within a PN_uint16. + // Also make sure the index number fits within a uint16_t. nassertv(index <= 0xffff); packet.add_uint16(index); diff --git a/panda/src/putil/bitMask.cxx b/panda/src/putil/bitMask.cxx index 22b7370f95..385d773695 100644 --- a/panda/src/putil/bitMask.cxx +++ b/panda/src/putil/bitMask.cxx @@ -18,6 +18,6 @@ #pragma implementation #endif -template class BitMask; -template class BitMask; -template class BitMask; +template class BitMask; +template class BitMask; +template class BitMask; diff --git a/panda/src/putil/bitMask.h b/panda/src/putil/bitMask.h index a2b2bdab13..17c1c9f69d 100644 --- a/panda/src/putil/bitMask.h +++ b/panda/src/putil/bitMask.h @@ -157,16 +157,16 @@ INLINE ostream &operator << (ostream &out, const BitMask &bitmask) // We need to define this temporary macro so we can pass a parameter // containing a comma through the macro. -#define BITMASK16_DEF BitMask -#define BITMASK32_DEF BitMask -#define BITMASK64_DEF BitMask +#define BITMASK16_DEF BitMask +#define BITMASK32_DEF BitMask +#define BITMASK64_DEF BitMask EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, BITMASK16_DEF); EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, BITMASK32_DEF); EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, BITMASK64_DEF); -typedef BitMask BitMask16; -typedef BitMask BitMask32; -typedef BitMask BitMask64; +typedef BitMask BitMask16; +typedef BitMask BitMask32; +typedef BitMask BitMask64; #if NATIVE_WORDSIZE == 32 typedef BitMask32 BitMaskNative; diff --git a/panda/src/putil/datagramInputFile.cxx b/panda/src/putil/datagramInputFile.cxx index 64fa369231..1ac14b58ed 100644 --- a/panda/src/putil/datagramInputFile.cxx +++ b/panda/src/putil/datagramInputFile.cxx @@ -126,7 +126,7 @@ get_datagram(Datagram &data) { // First, get the size of the upcoming datagram. StreamReader reader(_in, false); - PN_uint32 num_bytes_32 = reader.get_uint32(); + uint32_t num_bytes_32 = reader.get_uint32(); if (_in->fail() || _in->eof()) { return false; } @@ -139,7 +139,7 @@ get_datagram(Datagram &data) { } streamsize num_bytes = (streamsize)num_bytes_32; - if (num_bytes_32 == (PN_uint32)-1) { + if (num_bytes_32 == (uint32_t)-1) { // Another special case for a value larger than 32 bits. num_bytes = reader.get_uint64(); } @@ -205,7 +205,7 @@ save_datagram(SubfileInfo &info) { } streamsize num_bytes = (streamsize)num_bytes_32; - if (num_bytes_32 == (PN_uint32)-1) { + if (num_bytes_32 == (uint32_t)-1) { // Another special case for a value larger than 32 bits. num_bytes = reader.get_uint64(); } diff --git a/panda/src/putil/datagramOutputFile.cxx b/panda/src/putil/datagramOutputFile.cxx index 4ead1274c1..cd9a1af2fc 100644 --- a/panda/src/putil/datagramOutputFile.cxx +++ b/panda/src/putil/datagramOutputFile.cxx @@ -110,13 +110,13 @@ put_datagram(const Datagram &data) { // First, write the size of the upcoming datagram. StreamWriter writer(_out, false); size_t num_bytes = data.get_length(); - if (num_bytes == (PN_uint32)-1 || num_bytes != (PN_uint32)num_bytes) { + if (num_bytes == (uint32_t)-1 || num_bytes != (uint32_t)num_bytes) { // Write a large value as a 64-bit size. - writer.add_uint32((PN_uint32)-1); + writer.add_uint32((uint32_t)-1); writer.add_uint64(num_bytes); } else { // Write a value that fits in 32 bits. - writer.add_uint32((PN_uint32)num_bytes); + writer.add_uint32((uint32_t)num_bytes); } // Now, write the datagram itself. @@ -154,13 +154,13 @@ copy_datagram(SubfileInfo &result, const Filename &filename) { streamsize num_remaining = size; StreamWriter writer(_out, false); - if (num_remaining == (PN_uint32)-1 || num_remaining != (PN_uint32)num_remaining) { + if (num_remaining == (uint32_t)-1 || num_remaining != (uint32_t)num_remaining) { // Write a large value as a 64-bit size. - writer.add_uint32((PN_uint32)-1); + writer.add_uint32((uint32_t)-1); writer.add_uint64(num_remaining); } else { // Write a value that fits in 32 bits. - writer.add_uint32((PN_uint32)num_remaining); + writer.add_uint32((uint32_t)num_remaining); } static const size_t buffer_size = 4096; @@ -217,13 +217,13 @@ copy_datagram(SubfileInfo &result, const SubfileInfo &source) { streamsize num_remaining = source.get_size(); StreamWriter writer(_out, false); - if (num_remaining == (PN_uint32)-1 || num_remaining != (PN_uint32)num_remaining) { + if (num_remaining == (uint32_t)-1 || num_remaining != (uint32_t)num_remaining) { // Write a large value as a 64-bit size. - writer.add_uint32((PN_uint32)-1); + writer.add_uint32((uint32_t)-1); writer.add_uint64(num_remaining); } else { // Write a value that fits in 32 bits. - writer.add_uint32((PN_uint32)num_remaining); + writer.add_uint32((uint32_t)num_remaining); } static const size_t buffer_size = 4096; diff --git a/panda/src/putil/pbitops.I b/panda/src/putil/pbitops.I index f746b8ba77..3d830306f4 100644 --- a/panda/src/putil/pbitops.I +++ b/panda/src/putil/pbitops.I @@ -15,7 +15,7 @@ * Returns the number of 1 bits in the indicated word. */ INLINE int -count_bits_in_word(PN_uint16 x) { +count_bits_in_word(uint16_t x) { return (int)num_bits_on[x]; } @@ -23,7 +23,7 @@ count_bits_in_word(PN_uint16 x) { * Returns the number of 1 bits in the indicated word. */ INLINE int -count_bits_in_word(PN_uint32 x) { +count_bits_in_word(uint32_t x) { #if defined(__GNUC__) && defined(__POPCNT__) return __builtin_popcount((unsigned int) x); #else @@ -35,19 +35,19 @@ count_bits_in_word(PN_uint32 x) { * Returns the number of 1 bits in the indicated word. */ INLINE int -count_bits_in_word(PN_uint64 x) { +count_bits_in_word(uint64_t x) { #if defined(__GNUC__) && defined(__POPCNT__) return __builtin_popcountll((unsigned long long) x); #else - return count_bits_in_word((PN_uint32)x) + count_bits_in_word((PN_uint32)(x >> 32)); + return count_bits_in_word((uint32_t)x) + count_bits_in_word((uint32_t)(x >> 32)); #endif } /** * Returns a value such that every bit at or below the highest bit in x is 1. */ -INLINE PN_uint16 -flood_bits_down(PN_uint16 x) { +INLINE uint16_t +flood_bits_down(uint16_t x) { x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); @@ -58,8 +58,8 @@ flood_bits_down(PN_uint16 x) { /** * Returns a value such that every bit at or below the highest bit in x is 1. */ -INLINE PN_uint32 -flood_bits_down(PN_uint32 x) { +INLINE uint32_t +flood_bits_down(uint32_t x) { x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); @@ -71,8 +71,8 @@ flood_bits_down(PN_uint32 x) { /** * Returns a value such that every bit at or below the highest bit in x is 1. */ -INLINE PN_uint64 -flood_bits_down(PN_uint64 x) { +INLINE uint64_t +flood_bits_down(uint64_t x) { x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); @@ -85,8 +85,8 @@ flood_bits_down(PN_uint64 x) { /** * Returns a value such that every bit at or above the highest bit in x is 1. */ -INLINE PN_uint16 -flood_bits_up(PN_uint16 x) { +INLINE uint16_t +flood_bits_up(uint16_t x) { x |= (x << 1); x |= (x << 2); x |= (x << 4); @@ -97,8 +97,8 @@ flood_bits_up(PN_uint16 x) { /** * Returns a value such that every bit at or above the highest bit in x is 1. */ -INLINE PN_uint32 -flood_bits_up(PN_uint32 x) { +INLINE uint32_t +flood_bits_up(uint32_t x) { x |= (x << 1); x |= (x << 2); x |= (x << 4); @@ -110,8 +110,8 @@ flood_bits_up(PN_uint32 x) { /** * Returns a value such that every bit at or above the highest bit in x is 1. */ -INLINE PN_uint64 -flood_bits_up(PN_uint64 x) { +INLINE uint64_t +flood_bits_up(uint64_t x) { x |= (x << 1); x |= (x << 2); x |= (x << 4); @@ -126,7 +126,7 @@ flood_bits_up(PN_uint64 x) { * no 1 bits. */ INLINE int -get_lowest_on_bit(PN_uint16 x) { +get_lowest_on_bit(uint16_t x) { #if defined(_MSC_VER) unsigned long result; return (_BitScanForward(&result, (unsigned long) x) == 0) ? -1 : result; @@ -137,7 +137,7 @@ get_lowest_on_bit(PN_uint16 x) { return -1; } - PN_uint16 w = (x & (~x + 1)); + uint16_t w = (x & (~x + 1)); return (int)num_bits_on[w - 1]; #endif } @@ -147,7 +147,7 @@ get_lowest_on_bit(PN_uint16 x) { * no 1 bits. */ INLINE int -get_lowest_on_bit(PN_uint32 x) { +get_lowest_on_bit(uint32_t x) { #if defined(_MSC_VER) unsigned long result; return (_BitScanForward(&result, (unsigned long) x) == 0) ? -1 : result; @@ -158,7 +158,7 @@ get_lowest_on_bit(PN_uint32 x) { return -1; } - PN_uint32 w = (x & (~x + 1)); + uint32_t w = (x & (~x + 1)); return count_bits_in_word(w - 1); #endif } @@ -168,7 +168,7 @@ get_lowest_on_bit(PN_uint32 x) { * no 1 bits. */ INLINE int -get_lowest_on_bit(PN_uint64 x) { +get_lowest_on_bit(uint64_t x) { #if defined(_MSC_VER) && defined(_M_X64) unsigned long result; return (_BitScanForward64(&result, (unsigned __int64) x) == 0) ? -1 : result; @@ -179,7 +179,7 @@ get_lowest_on_bit(PN_uint64 x) { return -1; } - PN_uint64 w = (x & (~x + 1)); + uint64_t w = (x & (~x + 1)); return count_bits_in_word(w - 1); #endif } @@ -189,14 +189,14 @@ get_lowest_on_bit(PN_uint64 x) { * are no 1 bits. */ INLINE int -get_highest_on_bit(PN_uint16 x) { +get_highest_on_bit(uint16_t x) { #if defined(_MSC_VER) unsigned long result; return (_BitScanReverse(&result, (unsigned long) x) == 0) ? -1 : result; #elif defined(__GNUC__) return (x == 0) ? -1 : 31 - __builtin_clz((unsigned int) x); #else - PN_uint16 w = flood_bits_down(x); + uint16_t w = flood_bits_down(x); return count_bits_in_word(w) - 1; #endif } @@ -206,14 +206,14 @@ get_highest_on_bit(PN_uint16 x) { * are no 1 bits. */ INLINE int -get_highest_on_bit(PN_uint32 x) { +get_highest_on_bit(uint32_t x) { #if defined(_MSC_VER) unsigned long result; return (_BitScanReverse(&result, (unsigned long) x) == 0) ? -1 : result; #elif defined(__GNUC__) return (x == 0) ? -1 : 31 - __builtin_clz((unsigned int) x); #else - PN_uint32 w = flood_bits_down(x); + uint32_t w = flood_bits_down(x); return count_bits_in_word(w) - 1; #endif } @@ -223,14 +223,14 @@ get_highest_on_bit(PN_uint32 x) { * are no 1 bits. */ INLINE int -get_highest_on_bit(PN_uint64 x) { +get_highest_on_bit(uint64_t x) { #if defined(_MSC_VER) && defined(_M_X64) unsigned long result; return (_BitScanReverse64(&result, (unsigned __int64) x) == 0) ? -1 : result; #elif defined(__GNUC__) return (x == 0) ? -1 : 63 - __builtin_clzll((unsigned long long) x); #else - PN_uint64 w = flood_bits_down(x); + uint64_t w = flood_bits_down(x); return count_bits_in_word(w) - 1; #endif } @@ -241,7 +241,7 @@ get_highest_on_bit(PN_uint64 x) { * Returns the smallest number n such that (1 << n) is larger than x. */ INLINE int -get_next_higher_bit(PN_uint16 x) { +get_next_higher_bit(uint16_t x) { return get_highest_on_bit(x) + 1; } @@ -251,7 +251,7 @@ get_next_higher_bit(PN_uint16 x) { * Returns the smallest number n such that (1 << n) is larger than x. */ INLINE int -get_next_higher_bit(PN_uint32 x) { +get_next_higher_bit(uint32_t x) { return get_highest_on_bit(x) + 1; } @@ -261,6 +261,6 @@ get_next_higher_bit(PN_uint32 x) { * Returns the smallest number n such that (1 << n) is larger than x. */ INLINE int -get_next_higher_bit(PN_uint64 x) { +get_next_higher_bit(uint64_t x) { return get_highest_on_bit(x) + 1; } diff --git a/panda/src/putil/pbitops.h b/panda/src/putil/pbitops.h index 545cce9dba..5b4a10b601 100644 --- a/panda/src/putil/pbitops.h +++ b/panda/src/putil/pbitops.h @@ -24,27 +24,27 @@ // This file defines a few low-level bit-operation routines, optimized all to // heck. -INLINE int count_bits_in_word(PN_uint16 x); -INLINE int count_bits_in_word(PN_uint32 x); -INLINE int count_bits_in_word(PN_uint64 x); +INLINE int count_bits_in_word(uint16_t x); +INLINE int count_bits_in_word(uint32_t x); +INLINE int count_bits_in_word(uint64_t x); -INLINE PN_uint16 flood_bits_down(PN_uint16 x); -INLINE PN_uint32 flood_bits_down(PN_uint32 x); -INLINE PN_uint64 flood_bits_down(PN_uint64 x); -INLINE PN_uint16 flood_bits_up(PN_uint16 x); -INLINE PN_uint32 flood_bits_up(PN_uint32 x); -INLINE PN_uint64 flood_bits_up(PN_uint64 x); +INLINE uint16_t flood_bits_down(uint16_t x); +INLINE uint32_t flood_bits_down(uint32_t x); +INLINE uint64_t flood_bits_down(uint64_t x); +INLINE uint16_t flood_bits_up(uint16_t x); +INLINE uint32_t flood_bits_up(uint32_t x); +INLINE uint64_t flood_bits_up(uint64_t x); -INLINE int get_lowest_on_bit(PN_uint16 x); -INLINE int get_lowest_on_bit(PN_uint32 x); -INLINE int get_lowest_on_bit(PN_uint64 x); -INLINE int get_highest_on_bit(PN_uint16 x); -INLINE int get_highest_on_bit(PN_uint32 x); -INLINE int get_highest_on_bit(PN_uint64 x); +INLINE int get_lowest_on_bit(uint16_t x); +INLINE int get_lowest_on_bit(uint32_t x); +INLINE int get_lowest_on_bit(uint64_t x); +INLINE int get_highest_on_bit(uint16_t x); +INLINE int get_highest_on_bit(uint32_t x); +INLINE int get_highest_on_bit(uint64_t x); -INLINE int get_next_higher_bit(PN_uint16 x); -INLINE int get_next_higher_bit(PN_uint32 x); -INLINE int get_next_higher_bit(PN_uint64 x); +INLINE int get_next_higher_bit(uint16_t x); +INLINE int get_next_higher_bit(uint32_t x); +INLINE int get_next_higher_bit(uint64_t x); // This table precomputes the number of on bits in each 16-bit word. extern EXPCL_PANDA_PUTIL const unsigned char num_bits_on[65536]; diff --git a/panda/src/putil/uniqueIdAllocator.cxx b/panda/src/putil/uniqueIdAllocator.cxx index 3bca1d1ea6..0b3307a2af 100644 --- a/panda/src/putil/uniqueIdAllocator.cxx +++ b/panda/src/putil/uniqueIdAllocator.cxx @@ -20,8 +20,8 @@ NotifyCategoryDecl(uniqueIdAllocator, EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL); NotifyCategoryDef(uniqueIdAllocator, ""); -const PN_uint32 UniqueIdAllocator::IndexEnd = (PN_uint32)-1; -const PN_uint32 UniqueIdAllocator::IndexAllocated = (PN_uint32)-2; +const uint32_t UniqueIdAllocator::IndexEnd = (uint32_t)-1; +const uint32_t UniqueIdAllocator::IndexAllocated = (uint32_t)-2; #ifndef NDEBUG //[ // Non-release build: @@ -50,7 +50,7 @@ const PN_uint32 UniqueIdAllocator::IndexAllocated = (PN_uint32)-2; * Create a free id pool in the range [min:max]. */ UniqueIdAllocator:: -UniqueIdAllocator(PN_uint32 min, PN_uint32 max) +UniqueIdAllocator(uint32_t min, uint32_t max) : _min(min), _max(max) { uniqueIdAllocator_debug("UniqueIdAllocator("< 0. - _table = (PN_uint32 *)PANDA_MALLOC_ARRAY(_size * sizeof(PN_uint32)); + _table = (uint32_t *)PANDA_MALLOC_ARRAY(_size * sizeof(uint32_t)); nassertv(_table); // This should be redundant if new throws an exception. - for (PN_uint32 i = 0; i < _size; ++i) { + for (uint32_t i = 0; i < _size; ++i) { _table[i] = i + 1; } _table[_size - 1] = IndexEnd; @@ -84,14 +84,14 @@ UniqueIdAllocator:: * Returns an id between _min and _max (that were passed to the constructor). * IndexEnd is returned if no ids are available. */ -PN_uint32 UniqueIdAllocator:: +uint32_t UniqueIdAllocator:: allocate() { if (_next_free == IndexEnd) { // ...all ids allocated. uniqueIdAllocator_warning("allocate Error: no more free ids."); return IndexEnd; } - PN_uint32 index = _next_free; + uint32_t index = _next_free; nassertr(_table[index] != IndexAllocated, IndexEnd); _next_free = _table[_next_free]; @@ -99,7 +99,7 @@ allocate() { --_free; - PN_uint32 id = index + _min; + uint32_t id = index + _min; uniqueIdAllocator_debug("allocate() returning " << id); return id; } @@ -116,9 +116,9 @@ allocate() { * reserved at any time. */ void UniqueIdAllocator:: -initial_reserve_id(PN_uint32 id) { +initial_reserve_id(uint32_t id) { nassertv(id >= _min && id <= _max); // Attempt to reserve out-of-range id. - PN_uint32 index = id - _min; // Convert to _table index. + uint32_t index = id - _min; // Convert to _table index. nassertv(_table[index] != IndexAllocated); @@ -143,7 +143,7 @@ initial_reserve_id(PN_uint32 id) { * slot right before it, or if not, it usually won't be far before it. */ - PN_uint32 prev_index = index; + uint32_t prev_index = index; while (prev_index > 0 && _table[prev_index - 1] != index) { --prev_index; } @@ -177,11 +177,11 @@ initial_reserve_id(PN_uint32 id) { * passed to the constructor). */ void UniqueIdAllocator:: -free(PN_uint32 id) { +free(uint32_t id) { uniqueIdAllocator_debug("free("<= _min && id <= _max); // Attempt to free out-of-range id. - PN_uint32 index = id - _min; // Convert to _table index. + uint32_t index = id - _min; // Convert to _table index. nassertv(_table[index] == IndexAllocated); // Attempt to free non-allocated id. if (_next_free != IndexEnd) { nassertv(_table[_last_free] == IndexEnd); @@ -223,8 +223,8 @@ output(ostream &out) const { void UniqueIdAllocator:: write(ostream &out) const { out << "_min: " << _min << "; _max: " << _max - << ";\n_next_free: " << PN_int32(_next_free) - << "; _last_free: " << PN_int32(_last_free) + << ";\n_next_free: " << int32_t(_next_free) + << "; _last_free: " << int32_t(_last_free) << "; _size: " << _size << "; _free: " << _free << "; used: " << _size - _free @@ -232,13 +232,13 @@ write(ostream &out) const { << ";\n"; out << "Table:"; - for (PN_uint32 i = 0; i < _size; ++i) { - out << " " << PN_int32(_table[i]); + for (uint32_t i = 0; i < _size; ++i) { + out << " " << int32_t(_table[i]); } out << "\n"; out << "Free chain:"; - PN_uint32 index = _next_free; + uint32_t index = _next_free; while (index != IndexEnd) { out << " " << index + _min; index = _table[index]; diff --git a/panda/src/putil/uniqueIdAllocator.h b/panda/src/putil/uniqueIdAllocator.h index 7dd42ace04..90efcaee69 100644 --- a/panda/src/putil/uniqueIdAllocator.h +++ b/panda/src/putil/uniqueIdAllocator.h @@ -37,21 +37,21 @@ */ class EXPCL_PANDA_PUTIL UniqueIdAllocator { PUBLISHED: - UniqueIdAllocator(PN_uint32 min=0, PN_uint32 max=20); + UniqueIdAllocator(uint32_t min=0, uint32_t max=20); ~UniqueIdAllocator(); - PN_uint32 allocate(); - void initial_reserve_id(PN_uint32 id); + uint32_t allocate(); + void initial_reserve_id(uint32_t id); - void free(PN_uint32 index); + void free(uint32_t index); PN_stdfloat fraction_used() const; void output(ostream &out) const; void write(ostream &out) const; public: - static const PN_uint32 IndexEnd; - static const PN_uint32 IndexAllocated; + static const uint32_t IndexEnd; + static const uint32_t IndexAllocated; protected: // _table stores an array of _size words, corresponding to each allocatable @@ -63,27 +63,27 @@ protected: // For an allocated id, the table entry at the corresponding index contains // IndexAllocated. - PN_uint32 *_table; + uint32_t *_table; // The minimum and maximum as passed to the constructor. - PN_uint32 _min; - PN_uint32 _max; + uint32_t _min; + uint32_t _max; // This is the head of the free chain: as elements are allocated, they are // taken from _table[_next_free]. If the free chain is empty, _next_free == // IndexEnd. - PN_uint32 _next_free; + uint32_t _next_free; // This is the tail of the free chain: as elements are freed, they are // stored in _table[_last_free]. Normally, _table[_last_free] is the end of // the free chain, unless the free chain is empty. - PN_uint32 _last_free; + uint32_t _last_free; // The total number of elements in _table. - PN_uint32 _size; + uint32_t _size; // The number of free elements in _table. - PN_uint32 _free; + uint32_t _free; }; #endif //] diff --git a/panda/src/text/dynamicTextPage.cxx b/panda/src/text/dynamicTextPage.cxx index 093f6fda2d..fbe1b93486 100644 --- a/panda/src/text/dynamicTextPage.cxx +++ b/panda/src/text/dynamicTextPage.cxx @@ -110,15 +110,15 @@ fill_region(int x, int y, int x_size, int y_size, const LColor &color) { union { unsigned char p[2]; - PN_uint16 v; + uint16_t v; } v; v.p[0] = (unsigned char)(color[0] * 255.0f); v.p[1] = (unsigned char)(color[3] * 255.0f); - PN_uint16 *image = (PN_uint16 *)modify_ram_image().p(); + uint16_t *image = (uint16_t *)modify_ram_image().p(); for (int yi = y; yi < y + y_size; yi++) { - PN_uint16 *row = image + yi * _size[0] ; + uint16_t *row = image + yi * _size[0] ; for (int xi = x; xi < x + x_size; xi++) { row[xi] = v.v; } @@ -145,7 +145,7 @@ fill_region(int x, int y, int x_size, int y_size, const LColor &color) { // RGBA. union { unsigned char p[4]; - PN_uint32 v; + uint32_t v; } v; v.p[0] = (unsigned char)(color[2] * 255.0f); @@ -153,9 +153,9 @@ fill_region(int x, int y, int x_size, int y_size, const LColor &color) { v.p[2] = (unsigned char)(color[0] * 255.0f); v.p[3] = (unsigned char)(color[3] * 255.0f); - PN_uint32 *image = (PN_uint32 *)modify_ram_image().p(); + uint32_t *image = (uint32_t *)modify_ram_image().p(); for (int yi = y; yi < y + y_size; yi++) { - PN_uint32 *row = image + yi * _size[0]; + uint32_t *row = image + yi * _size[0]; for (int xi = x; xi < x + x_size; xi++) { row[xi] = v.v; } diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index c2092fec6b..996713a85a 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -1163,7 +1163,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) { // 32-bit index case. PT(GeomVertexArrayDataHandle) idx_handle = indices->modify_handle(); idx_handle->unclean_set_num_rows(quads.size() * 6); - PN_uint32 *idx_ptr = (PN_uint32 *)idx_handle->get_write_pointer(); + uint32_t *idx_ptr = (uint32_t *)idx_handle->get_write_pointer(); QuadDefs::const_iterator qi; for (qi = quads.begin(); qi != quads.end(); ++qi) { @@ -1219,7 +1219,7 @@ generate_quads(GeomNode *geom_node, const QuadMap &quad_map) { // 16-bit index case. PT(GeomVertexArrayDataHandle) idx_handle = indices->modify_handle(); idx_handle->unclean_set_num_rows(quads.size() * 6); - PN_uint16 *idx_ptr = (PN_uint16 *)idx_handle->get_write_pointer(); + uint16_t *idx_ptr = (uint16_t *)idx_handle->get_write_pointer(); QuadDefs::const_iterator qi; for (qi = quads.begin(); qi != quads.end(); ++qi) { diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index dacb90c88e..9e37c67037 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -960,7 +960,7 @@ draw_triangles(const GeomPrimitivePipelineReader *reader, bool force) { switch (reader->get_index_type()) { case Geom::NT_uint8: { - PN_uint8 *index = (PN_uint8 *)reader->get_read_pointer(force); + uint8_t *index = (uint8_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -975,7 +975,7 @@ draw_triangles(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint16: { - PN_uint16 *index = (PN_uint16 *)reader->get_read_pointer(force); + uint16_t *index = (uint16_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -990,7 +990,7 @@ draw_triangles(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint32: { - PN_uint32 *index = (PN_uint32 *)reader->get_read_pointer(force); + uint32_t *index = (uint32_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1051,7 +1051,7 @@ draw_tristrips(const GeomPrimitivePipelineReader *reader, bool force) { switch (reader->get_index_type()) { case Geom::NT_uint8: { - PN_uint8 *index = (PN_uint8 *)reader->get_read_pointer(force); + uint8_t *index = (uint8_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1076,7 +1076,7 @@ draw_tristrips(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint16: { - PN_uint16 *index = (PN_uint16 *)reader->get_read_pointer(force); + uint16_t *index = (uint16_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1101,7 +1101,7 @@ draw_tristrips(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint32: { - PN_uint32 *index = (PN_uint32 *)reader->get_read_pointer(force); + uint32_t *index = (uint32_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1182,7 +1182,7 @@ draw_lines(const GeomPrimitivePipelineReader *reader, bool force) { switch (reader->get_index_type()) { case Geom::NT_uint8: { - PN_uint8 *index = (PN_uint8 *)reader->get_read_pointer(force); + uint8_t *index = (uint8_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1196,7 +1196,7 @@ draw_lines(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint16: { - PN_uint16 *index = (PN_uint16 *)reader->get_read_pointer(force); + uint16_t *index = (uint16_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1210,7 +1210,7 @@ draw_lines(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint32: { - PN_uint32 *index = (PN_uint32 *)reader->get_read_pointer(force); + uint32_t *index = (uint32_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1259,7 +1259,7 @@ draw_points(const GeomPrimitivePipelineReader *reader, bool force) { switch (reader->get_index_type()) { case Geom::NT_uint8: { - PN_uint8 *index = (PN_uint8 *)reader->get_read_pointer(force); + uint8_t *index = (uint8_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1272,7 +1272,7 @@ draw_points(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint16: { - PN_uint16 *index = (PN_uint16 *)reader->get_read_pointer(force); + uint16_t *index = (uint16_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } @@ -1285,7 +1285,7 @@ draw_points(const GeomPrimitivePipelineReader *reader, bool force) { case Geom::NT_uint32: { - PN_uint32 *index = (PN_uint32 *)reader->get_read_pointer(force); + uint32_t *index = (uint32_t *)reader->get_read_pointer(force); if (index == NULL) { return false; } diff --git a/panda/src/windisplay/winDetectDx.h b/panda/src/windisplay/winDetectDx.h index b57c6575a0..8a3a9c340e 100644 --- a/panda/src/windisplay/winDetectDx.h +++ b/panda/src/windisplay/winDetectDx.h @@ -133,8 +133,8 @@ static int get_display_information (DisplaySearchParameters &display_search_para int total_display_modes; DisplayMode *display_mode_array; - PN_uint64 physical_memory; - PN_uint64 available_physical_memory; + uint64_t physical_memory; + uint64_t available_physical_memory; int vendor_id; int device_id; diff --git a/panda/src/windisplay/winGraphicsPipe.cxx b/panda/src/windisplay/winGraphicsPipe.cxx index 64623d6bfe..01d9ab4068 100644 --- a/panda/src/windisplay/winGraphicsPipe.cxx +++ b/panda/src/windisplay/winGraphicsPipe.cxx @@ -123,11 +123,11 @@ void get_memory_information (DisplayInformation *display_information) { } typedef union { - PN_uint64 long_integer; + uint64_t long_integer; } LONG_INTEGER; -PN_uint64 cpu_time_function (void) { +uint64_t cpu_time_function (void) { #ifdef _WIN64 return __rdtsc(); #else @@ -594,7 +594,7 @@ int update_cpu_frequency_function(int processor_number, DisplayInformation *disp processor_power_information = processor_power_information_array; for (i = 0; i < MAXIMUM_PROCESSORS; i++) { if (processor_power_information->Number == processor_number) { - PN_uint64 value; + uint64_t value; value = processor_power_information->MaxMhz; display_information->_maximum_cpu_frequency = value * 1000000; @@ -662,7 +662,7 @@ count_number_of_cpus(DisplayInformation *display_information) { num_cpu_cores++; // A hyperthreaded core supplies more than one logical processor. - num_logical_cpus += count_bits_in_word((PN_uint64)(ptr->ProcessorMask)); + num_logical_cpus += count_bits_in_word((uint64_t)(ptr->ProcessorMask)); } ++ptr; } @@ -810,8 +810,8 @@ lookup_cpu_data() { _display_information->_cpu_time_function = cpu_time_function; // determine CPU frequency - PN_uint64 time; - PN_uint64 end_time; + uint64_t time; + uint64_t end_time; LARGE_INTEGER counter; LARGE_INTEGER end; LARGE_INTEGER frequency; diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 6ea711b3b5..6940f2d592 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -1068,11 +1068,11 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { // to set certain properties as a "type"; the other one as a "state". We'll // try to honor both. static const int max_type_data = 32; - PN_int32 type_data[max_type_data]; + int32_t type_data[max_type_data]; int next_type_data = 0; static const int max_state_data = 32; - PN_int32 state_data[max_state_data]; + int32_t state_data[max_state_data]; int next_state_data = 0; static const int max_set_data = 32; @@ -1162,7 +1162,7 @@ set_wm_properties(const WindowProperties &properties, bool already_mapped) { nassertv(next_set_data < max_set_data); // Add the process ID as a convenience for other applications. - PN_int32 pid = getpid(); + int32_t pid = getpid(); XChangeProperty(_display, _xwindow, x11_pipe->_net_wm_pid, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid, 1); diff --git a/pandatool/src/lwo/iffId.h b/pandatool/src/lwo/iffId.h index ff48a7e443..2d20b9b99c 100644 --- a/pandatool/src/lwo/iffId.h +++ b/pandatool/src/lwo/iffId.h @@ -40,7 +40,7 @@ public: private: union { - PN_uint32 _n; + uint32_t _n; char _c[4]; } _id; }; diff --git a/pandatool/src/lwo/iffInputFile.cxx b/pandatool/src/lwo/iffInputFile.cxx index 0707d78044..17f4225625 100644 --- a/pandatool/src/lwo/iffInputFile.cxx +++ b/pandatool/src/lwo/iffInputFile.cxx @@ -83,7 +83,7 @@ set_input(istream *input, bool owns_istream) { /** * Extracts a signed 8-bit integer. */ -PN_int8 IffInputFile:: +int8_t IffInputFile:: get_int8() { Datagram dg; if (!read_bytes(dg, 1)) { @@ -96,7 +96,7 @@ get_int8() { /** * Extracts an unsigned 8-bit integer. */ -PN_uint8 IffInputFile:: +uint8_t IffInputFile:: get_uint8() { Datagram dg; if (!read_bytes(dg, 1)) { @@ -109,7 +109,7 @@ get_uint8() { /** * Extracts a signed 16-bit big-endian integer. */ -PN_int16 IffInputFile:: +int16_t IffInputFile:: get_be_int16() { Datagram dg; if (!read_bytes(dg, 2)) { @@ -122,7 +122,7 @@ get_be_int16() { /** * Extracts a signed 32-bit big-endian integer. */ -PN_int32 IffInputFile:: +int32_t IffInputFile:: get_be_int32() { Datagram dg; if (!read_bytes(dg, 4)) { @@ -135,7 +135,7 @@ get_be_int32() { /** * Extracts an unsigned 16-bit big-endian integer. */ -PN_uint16 IffInputFile:: +uint16_t IffInputFile:: get_be_uint16() { Datagram dg; if (!read_bytes(dg, 2)) { @@ -148,7 +148,7 @@ get_be_uint16() { /** * Extracts an unsigned 32-bit big-endian integer. */ -PN_uint32 IffInputFile:: +uint32_t IffInputFile:: get_be_uint32() { Datagram dg; if (!read_bytes(dg, 4)) { @@ -215,7 +215,7 @@ get_chunk() { } IffId id = get_id(); - PN_uint32 length = get_be_uint32(); + uint32_t length = get_be_uint32(); if (!is_eof()) { PT(IffChunk) chunk = make_new_chunk(id); @@ -265,7 +265,7 @@ get_subchunk(IffChunk *context) { } IffId id = get_id(); - PN_uint16 length = get_be_uint16(); + uint16_t length = get_be_uint16(); if (!is_eof()) { PT(IffChunk) chunk = context->make_new_chunk(this, id); diff --git a/pandatool/src/lwo/iffInputFile.h b/pandatool/src/lwo/iffInputFile.h index 3afe12bae8..2b788f07a0 100644 --- a/pandatool/src/lwo/iffInputFile.h +++ b/pandatool/src/lwo/iffInputFile.h @@ -43,13 +43,13 @@ public: INLINE void align(); - PN_int8 get_int8(); - PN_uint8 get_uint8(); + int8_t get_int8(); + uint8_t get_uint8(); - PN_int16 get_be_int16(); - PN_int32 get_be_int32(); - PN_uint16 get_be_uint16(); - PN_uint32 get_be_uint32(); + int16_t get_be_int16(); + int32_t get_be_int32(); + uint16_t get_be_uint16(); + uint32_t get_be_uint32(); PN_stdfloat get_be_float32(); string get_string(); diff --git a/pandatool/src/lwo/lwoInputFile.cxx b/pandatool/src/lwo/lwoInputFile.cxx index 63f3b51731..78e7dfa10c 100644 --- a/pandatool/src/lwo/lwoInputFile.cxx +++ b/pandatool/src/lwo/lwoInputFile.cxx @@ -46,10 +46,10 @@ LwoInputFile:: */ int LwoInputFile:: get_vx() { - PN_uint16 top = get_be_uint16(); + uint16_t top = get_be_uint16(); if ((top & 0xff00) == 0xff00) { // The first byte is 0xff, which indicates we have a 4-byte integer. - PN_uint16 bottom = get_be_uint16(); + uint16_t bottom = get_be_uint16(); return ((int)(top & 0xff) << 16) | bottom; } diff --git a/pandatool/src/mayaegg/mayaNodeDesc.cxx b/pandatool/src/mayaegg/mayaNodeDesc.cxx index 72c8854976..efef4879a8 100644 --- a/pandatool/src/mayaegg/mayaNodeDesc.cxx +++ b/pandatool/src/mayaegg/mayaNodeDesc.cxx @@ -333,9 +333,9 @@ mark_joint_parent() { */ void MayaNodeDesc:: check_pseudo_joints(bool joint_above) { - static PN_uint32 space_count = 0; + static uint32_t space_count = 0; string space; - for (PN_uint32 idx=0; idx= 0) { set_drag_mode(DM_guide_bar); - PN_int16 x = LOWORD(lparam); + int16_t x = LOWORD(lparam); _drag_start_x = x; SetCapture(_graph_window); return 0; @@ -231,8 +231,8 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { case WM_MOUSEMOVE: if (_drag_mode == DM_none && _potential_drag_mode == DM_none) { // When the mouse is over a color bar, highlight it. - PN_int16 x = LOWORD(lparam); - PN_int16 y = HIWORD(lparam); + int16_t x = LOWORD(lparam); + int16_t y = HIWORD(lparam); _label_stack.highlight_label(get_collector_under_pixel(x, y)); // Now we want to get a WM_MOUSELEAVE when the mouse leaves the graph @@ -251,7 +251,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } if (_drag_mode == DM_scale) { - PN_int16 x = LOWORD(lparam); + int16_t x = LOWORD(lparam); double ratio = (double)x / (double)get_xsize(); if (ratio > 0.0f) { set_horizontal_scale(_drag_scale_start / ratio); @@ -261,7 +261,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } else if (_drag_mode == DM_new_guide_bar) { // We haven't created the new guide bar yet; we won't until the mouse // comes within the graph's region. - PN_int16 x = LOWORD(lparam); + int16_t x = LOWORD(lparam); if (x >= 0 && x < get_xsize()) { set_drag_mode(DM_guide_bar); _drag_guide_bar = add_user_guide_bar(pixel_to_height(x)); @@ -269,7 +269,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } } else if (_drag_mode == DM_guide_bar) { - PN_int16 x = LOWORD(lparam); + int16_t x = LOWORD(lparam); move_user_guide_bar(_drag_guide_bar, pixel_to_height(x)); return 0; } @@ -287,7 +287,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { return 0; } else if (_drag_mode == DM_guide_bar) { - PN_int16 x = LOWORD(lparam); + int16_t x = LOWORD(lparam); if (x < 0 || x >= get_xsize()) { remove_user_guide_bar(_drag_guide_bar); } else { @@ -303,8 +303,8 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { { // Double-clicking on a color bar in the graph is the same as double- // clicking on the corresponding label. - PN_int16 x = LOWORD(lparam); - PN_int16 y = HIWORD(lparam); + int16_t x = LOWORD(lparam); + int16_t y = HIWORD(lparam); clicked_label(get_collector_under_pixel(x, y)); return 0; } diff --git a/pandatool/src/win-stats/winStatsStripChart.cxx b/pandatool/src/win-stats/winStatsStripChart.cxx index 2e1d346f3b..066673aecd 100644 --- a/pandatool/src/win-stats/winStatsStripChart.cxx +++ b/pandatool/src/win-stats/winStatsStripChart.cxx @@ -370,14 +370,14 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { case WM_LBUTTONDOWN: if (_potential_drag_mode == DM_none) { set_drag_mode(DM_scale); - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); _drag_scale_start = pixel_to_height(y); SetCapture(_graph_window); return 0; } else if (_potential_drag_mode == DM_guide_bar && _drag_guide_bar >= 0) { set_drag_mode(DM_guide_bar); - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); _drag_start_y = y; SetCapture(_graph_window); return 0; @@ -387,8 +387,8 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { case WM_MOUSEMOVE: if (_drag_mode == DM_none && _potential_drag_mode == DM_none) { // When the mouse is over a color bar, highlight it. - PN_int16 x = LOWORD(lparam); - PN_int16 y = HIWORD(lparam); + int16_t x = LOWORD(lparam); + int16_t y = HIWORD(lparam); _label_stack.highlight_label(get_collector_under_pixel(x, y)); // Now we want to get a WM_MOUSELEAVE when the mouse leaves the graph @@ -407,7 +407,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } if (_drag_mode == DM_scale) { - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); double ratio = 1.0f - ((double)y / (double)get_ysize()); if (ratio > 0.0f) { set_vertical_scale(_drag_scale_start / ratio); @@ -417,7 +417,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } else if (_drag_mode == DM_new_guide_bar) { // We haven't created the new guide bar yet; we won't until the mouse // comes within the graph's region. - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); if (y >= 0 && y < get_ysize()) { set_drag_mode(DM_guide_bar); _drag_guide_bar = add_user_guide_bar(pixel_to_height(y)); @@ -425,7 +425,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { } } else if (_drag_mode == DM_guide_bar) { - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); move_user_guide_bar(_drag_guide_bar, pixel_to_height(y)); return 0; } @@ -443,7 +443,7 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { return 0; } else if (_drag_mode == DM_guide_bar) { - PN_int16 y = HIWORD(lparam); + int16_t y = HIWORD(lparam); if (y < 0 || y >= get_ysize()) { remove_user_guide_bar(_drag_guide_bar); } else { @@ -459,8 +459,8 @@ graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { { // Double-clicking on a color bar in the graph is the same as double- // clicking on the corresponding label. - PN_int16 x = LOWORD(lparam); - PN_int16 y = HIWORD(lparam); + int16_t x = LOWORD(lparam); + int16_t y = HIWORD(lparam); clicked_label(get_collector_under_pixel(x, y)); return 0; }