general: Remove use of proprietary unsigned integer typedefs

This commit is contained in:
rdb 2021-12-08 14:51:52 +01:00
parent eb753be249
commit 429acd6e0d
15 changed files with 50 additions and 50 deletions

View File

@ -245,7 +245,7 @@ apply_texture(int i, TextureContext *tc, const SamplerState &sampler) {
set_sampler_state(i, D3DSAMP_BORDERCOLOR, border_color); set_sampler_state(i, D3DSAMP_BORDERCOLOR, border_color);
uint aniso_degree = sampler.get_effective_anisotropic_degree(); unsigned int aniso_degree = sampler.get_effective_anisotropic_degree();
SamplerState::FilterType ft = sampler.get_effective_magfilter(); SamplerState::FilterType ft = sampler.get_effective_magfilter();
if (aniso_degree >= 1) { if (aniso_degree >= 1) {

View File

@ -831,7 +831,7 @@ create_texture(DXScreenData &scrn) {
tex->set_minfilter(ft); tex->set_minfilter(ft);
uint aniso_degree; unsigned int aniso_degree;
aniso_degree = 1; aniso_degree = 1;
if (scrn._d3dcaps.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) { if (scrn._d3dcaps.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) {

View File

@ -192,8 +192,8 @@ struct DXScreenData {
HWND _window; HWND _window;
HMONITOR _monitor; HMONITOR _monitor;
DWORD _max_available_video_memory; DWORD _max_available_video_memory;
ushort _card_id; // adapter ID unsigned short _card_id; // adapter ID
ushort _depth_buffer_bitdepth; //GetSurfaceDesc is not reliable so must store this explicitly unsigned short _depth_buffer_bitdepth; //GetSurfaceDesc is not reliable so must store this explicitly
bool _can_direct_disable_color_writes; // if true, don't need blending for this bool _can_direct_disable_color_writes; // if true, don't need blending for this
bool _is_low_memory_card; bool _is_low_memory_card;
bool _is_tnl_device; bool _is_tnl_device;

View File

@ -13,7 +13,7 @@
#include "pta_uchar.h" #include "pta_uchar.h"
template class PointerToBase<ReferenceCountedVector<uchar> >; template class PointerToBase<ReferenceCountedVector<unsigned char> >;
template class PointerToArrayBase<uchar>; template class PointerToArrayBase<unsigned char>;
template class PointerToArray<unsigned char>; template class PointerToArray<unsigned char>;
template class ConstPointerToArray<unsigned char>; template class ConstPointerToArray<unsigned char>;

View File

@ -29,8 +29,8 @@
#if !defined(__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 #if !defined(__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
// GCC 4.6 has a weird bug related to this type. // GCC 4.6 has a weird bug related to this type.
#else #else
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToBase<ReferenceCountedVector<uchar> >) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToBase<ReferenceCountedVector<unsigned char> >)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToArrayBase<uchar>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToArrayBase<unsigned char>)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToArray<unsigned char>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, PointerToArray<unsigned char>)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, ConstPointerToArray<unsigned char>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_EXPRESS, EXPTP_PANDA_EXPRESS, ConstPointerToArray<unsigned char>)
#endif #endif

View File

@ -2251,7 +2251,7 @@ do_get_auto_texture_scale(const CData *cdata) const {
*/ */
INLINE void Texture:: INLINE void Texture::
store_unscaled_byte(unsigned char *&p, int value) { store_unscaled_byte(unsigned char *&p, int value) {
(*p++) = (uchar)value; (*p++) = (unsigned char)value;
} }
/** /**
@ -2262,10 +2262,10 @@ store_unscaled_byte(unsigned char *&p, int value) {
INLINE void Texture:: INLINE void Texture::
store_unscaled_short(unsigned char *&p, int value) { store_unscaled_short(unsigned char *&p, int value) {
union { union {
ushort us; unsigned short us;
uchar uc[2]; unsigned char uc[2];
} v; } v;
v.us = (ushort)value; v.us = (unsigned short)value;
(*p++) = v.uc[0]; (*p++) = v.uc[0];
(*p++) = v.uc[1]; (*p++) = v.uc[1];
} }
@ -2310,8 +2310,8 @@ get_unsigned_byte(const unsigned char *&p) {
INLINE double Texture:: INLINE double Texture::
get_unsigned_short(const unsigned char *&p) { get_unsigned_short(const unsigned char *&p) {
union { union {
ushort us; unsigned short us;
uchar uc[2]; unsigned char uc[2];
} v; } v;
v.uc[0] = (*p++); v.uc[0] = (*p++);
v.uc[1] = (*p++); v.uc[1] = (*p++);
@ -2327,7 +2327,7 @@ INLINE double Texture::
get_unsigned_int(const unsigned char *&p) { get_unsigned_int(const unsigned char *&p) {
union { union {
unsigned int ui; unsigned int ui;
uchar uc[4]; unsigned char uc[4];
} v; } v;
v.uc[0] = (*p++); v.uc[0] = (*p++);
v.uc[1] = (*p++); v.uc[1] = (*p++);

View File

@ -1146,7 +1146,7 @@ set_ram_image_as(CPTA_uchar image, const string &supplied_format) {
return; return;
} }
for (int p = 0; p < imgsize; ++p) { for (int p = 0; p < imgsize; ++p) {
for (uchar s = 0; s < format.size(); ++s) { for (unsigned char s = 0; s < format.size(); ++s) {
signed char component = -1; signed char component = -1;
if (format.at(s) == 'B' || (cdata->_num_components <= 2 && format.at(s) != 'A')) { if (format.at(s) == 'B' || (cdata->_num_components <= 2 && format.at(s) != 'A')) {
component = 0; component = 0;
@ -1178,7 +1178,7 @@ set_ram_image_as(CPTA_uchar image, const string &supplied_format) {
return; return;
} }
for (int p = 0; p < imgsize; ++p) { for (int p = 0; p < imgsize; ++p) {
for (uchar s = 0; s < format.size(); ++s) { for (unsigned char s = 0; s < format.size(); ++s) {
signed char component = -1; signed char component = -1;
if (format.at(s) == 'B' || (cdata->_num_components <= 2 && format.at(s) != 'A')) { if (format.at(s) == 'B' || (cdata->_num_components <= 2 && format.at(s) != 'A')) {
component = 0; component = 0;
@ -8023,7 +8023,7 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
for (int j = y_size-1; j >= 0; j--) { for (int j = y_size-1; j >= 0; j--) {
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
} }
p += row_skip; p += row_skip;
} }
@ -8036,8 +8036,8 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
const xelval *alpha_row = alpha + j * x_size; const xelval *alpha_row = alpha + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
*p++ = (uchar)alpha_row[i]; *p++ = (unsigned char)alpha_row[i];
} }
p += row_skip; p += row_skip;
} }
@ -8045,8 +8045,8 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
for (int j = y_size-1; j >= 0; j--) { for (int j = y_size-1; j >= 0; j--) {
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
*p++ = (uchar)255; *p++ = (unsigned char)255;
} }
p += row_skip; p += row_skip;
} }
@ -8057,9 +8057,9 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
for (int j = y_size-1; j >= 0; j--) { for (int j = y_size-1; j >= 0; j--) {
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
*p++ = (uchar)PPM_GETG(row[i]); *p++ = (unsigned char)PPM_GETG(row[i]);
*p++ = (uchar)PPM_GETR(row[i]); *p++ = (unsigned char)PPM_GETR(row[i]);
} }
p += row_skip; p += row_skip;
} }
@ -8072,10 +8072,10 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
const xelval *alpha_row = alpha + j * x_size; const xelval *alpha_row = alpha + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
*p++ = (uchar)PPM_GETG(row[i]); *p++ = (unsigned char)PPM_GETG(row[i]);
*p++ = (uchar)PPM_GETR(row[i]); *p++ = (unsigned char)PPM_GETR(row[i]);
*p++ = (uchar)alpha_row[i]; *p++ = (unsigned char)alpha_row[i];
} }
p += row_skip; p += row_skip;
} }
@ -8083,10 +8083,10 @@ convert_from_pnmimage(PTA_uchar &image, size_t page_size,
for (int j = y_size-1; j >= 0; j--) { for (int j = y_size-1; j >= 0; j--) {
const xel *row = array + j * x_size; const xel *row = array + j * x_size;
for (int i = 0; i < x_size; i++) { for (int i = 0; i < x_size; i++) {
*p++ = (uchar)PPM_GETB(row[i]); *p++ = (unsigned char)PPM_GETB(row[i]);
*p++ = (uchar)PPM_GETG(row[i]); *p++ = (unsigned char)PPM_GETG(row[i]);
*p++ = (uchar)PPM_GETR(row[i]); *p++ = (unsigned char)PPM_GETR(row[i]);
*p++ = (uchar)255; *p++ = (unsigned char)255;
} }
p += row_skip; p += row_skip;
} }

View File

@ -242,7 +242,7 @@ TimeVal() {
/** /**
* *
*/ */
INLINE ulong TimeVal:: INLINE unsigned long TimeVal::
get_sec() const { get_sec() const {
return tv[0]; return tv[0];
} }
@ -250,7 +250,7 @@ get_sec() const {
/** /**
* *
*/ */
INLINE ulong TimeVal:: INLINE unsigned long TimeVal::
get_usec() const { get_usec() const {
return tv[1]; return tv[1];
} }

View File

@ -31,9 +31,9 @@
class EXPCL_PANDA_PUTIL TimeVal { class EXPCL_PANDA_PUTIL TimeVal {
PUBLISHED: PUBLISHED:
INLINE TimeVal(); INLINE TimeVal();
INLINE ulong get_sec() const; INLINE unsigned long get_sec() const;
INLINE ulong get_usec() const; INLINE unsigned long get_usec() const;
ulong tv[2]; unsigned long tv[2];
}; };
/** /**

View File

@ -10,10 +10,10 @@ ignoretype Factory<TypedWriteable>
# builds (to support multi-arch builds), so we don't export this. # builds (to support multi-arch builds), so we don't export this.
ignoretype BitMaskNative ignoretype BitMaskNative
forcetype PointerToBase<ReferenceCountedVector<ushort> > forcetype PointerToBase<ReferenceCountedVector<unsigned short> >
forcetype PointerToArrayBase<ushort> forcetype PointerToArrayBase<unsigned short>
forcetype PointerToArray<ushort> forcetype PointerToArray<unsigned short>
forcetype ConstPointerToArray<ushort> forcetype ConstPointerToArray<unsigned short>
# This is so the extensions for PTA_ushort are made available. # This is so the extensions for PTA_ushort are made available.
forceinclude "pointerToArray_ext.h" forceinclude "pointerToArray_ext.h"

View File

@ -13,7 +13,7 @@
#include "pta_ushort.h" #include "pta_ushort.h"
template class PointerToBase<ReferenceCountedVector<ushort> >; template class PointerToBase<ReferenceCountedVector<unsigned short> >;
template class PointerToArrayBase<ushort>; template class PointerToArrayBase<unsigned short>;
template class PointerToArray<unsigned short>; template class PointerToArray<unsigned short>;
template class ConstPointerToArray<unsigned short>; template class ConstPointerToArray<unsigned short>;

View File

@ -26,8 +26,8 @@
* defining the pta again. * defining the pta again.
*/ */
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToBase<ReferenceCountedVector<ushort> >) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToBase<ReferenceCountedVector<unsigned short> >)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToArrayBase<ushort>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToArrayBase<unsigned short>)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToArray<unsigned short>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, PointerToArray<unsigned short>)
EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ConstPointerToArray<unsigned short>) EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_PUTIL, EXPTP_PANDA_PUTIL, ConstPointerToArray<unsigned short>)

View File

@ -2109,7 +2109,7 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
if (lptstr != nullptr) { if (lptstr != nullptr) {
char *pChar; char *pChar;
for (pChar = lptstr; *pChar; pChar++) { for (pChar = lptstr; *pChar; pChar++) {
_input->keystroke((uchar)*pChar); _input->keystroke((unsigned char)*pChar);
} }
GlobalUnlock(hglb); GlobalUnlock(hglb);
} }

View File

@ -1466,8 +1466,8 @@ void MayaEggLoader::TraverseEggNode(EggNode *node, EggGroup *context, string del
surface->_vNumCvs = eggNurbsSurface->get_num_v_cvs(); surface->_vNumCvs = eggNurbsSurface->get_num_v_cvs();
// [gjeon] building cvArray // [gjeon] building cvArray
for (uint ui = 0; ui < surface->_uNumCvs; ui++) { for (unsigned int ui = 0; ui < surface->_uNumCvs; ui++) {
for (uint vi = 0; vi < surface->_vNumCvs; vi++) { for (unsigned int vi = 0; vi < surface->_vNumCvs; vi++) {
EggVertex *vtx = eggNurbsSurface->get_vertex(eggNurbsSurface->get_vertex_index(ui, vi)); EggVertex *vtx = eggNurbsSurface->get_vertex(eggNurbsSurface->get_vertex_index(ui, vi));
surface->_cvArray.append(MakeMPoint(vtx->get_pos3())); surface->_cvArray.append(MakeMPoint(vtx->get_pos3()));
} }

View File

@ -371,7 +371,7 @@ get_egg_group(MayaNodeDesc *node_desc) {
pvector<string> tag_attribute_names; pvector<string> tag_attribute_names;
get_tag_attribute_names(dag_object, tag_attribute_names); get_tag_attribute_names(dag_object, tag_attribute_names);
for (uint ti=0; ti < tag_attribute_names.size(); ti++) { for (unsigned int ti=0; ti < tag_attribute_names.size(); ti++) {
if (get_enum_attribute(dag_object, tag_attribute_names[ti], object_type)) { if (get_enum_attribute(dag_object, tag_attribute_names[ti], object_type)) {
egg_group->set_tag(tag_attribute_names[ti].substr(3), object_type); egg_group->set_tag(tag_attribute_names[ti].substr(3), object_type);
} }