diff --git a/direct/src/distributed/cConnectionRepository.cxx b/direct/src/distributed/cConnectionRepository.cxx index 1781422930..a19491d825 100644 --- a/direct/src/distributed/cConnectionRepository.cxx +++ b/direct/src/distributed/cConnectionRepository.cxx @@ -708,7 +708,7 @@ handle_update_field() { Py_DECREF(dclass_obj); nassertr(dclass_this != NULL, false); - DCClass *dclass = (DCClass *)PyLong_AsLong(dclass_this); + DCClass *dclass = (DCClass *)PyLong_AsVoidPtr(dclass_this); Py_DECREF(dclass_this); // If in quiet zone mode, throw update away unless distobj has @@ -799,7 +799,7 @@ handle_update_field_owner() { Py_DECREF(dclass_obj); nassertr(dclass_this != NULL, false); - DCClass *dclass = (DCClass *)PyLong_AsLong(dclass_this); + DCClass *dclass = (DCClass *)PyLong_AsVoidPtr(dclass_this); Py_DECREF(dclass_this); // check if we should forward this update to the owner view @@ -841,7 +841,7 @@ handle_update_field_owner() { Py_DECREF(dclass_obj); nassertr(dclass_this != NULL, false); - DCClass *dclass = (DCClass *)PyLong_AsLong(dclass_this); + DCClass *dclass = (DCClass *)PyLong_AsVoidPtr(dclass_this); Py_DECREF(dclass_this); // check if we should forward this update to the owner view @@ -974,7 +974,7 @@ describe_message(ostream &out, const string &prefix, Py_DECREF(dclass_obj); nassertv(dclass_this != NULL); - dclass = (DCClass *)PyLong_AsLong(dclass_this); + dclass = (DCClass *)PyLong_AsVoidPtr(dclass_this); Py_DECREF(dclass_this); } } diff --git a/panda/src/display/graphicsWindowProcCallbackData.I b/panda/src/display/graphicsWindowProcCallbackData.I index 55fc325ad9..eb12340a30 100644 --- a/panda/src/display/graphicsWindowProcCallbackData.I +++ b/panda/src/display/graphicsWindowProcCallbackData.I @@ -32,7 +32,7 @@ get_graphics_window() const { /** * Returns the Windows proc hwnd parameter. */ -INLINE int GraphicsWindowProcCallbackData:: +INLINE uintptr_t GraphicsWindowProcCallbackData:: get_hwnd() const { return _hwnd; } @@ -65,7 +65,7 @@ get_lparam() const { * Sets the Windows proc hwnd parameter. */ INLINE void GraphicsWindowProcCallbackData:: -set_hwnd(int hwnd) { +set_hwnd(uintptr_t hwnd) { _hwnd = hwnd; } diff --git a/panda/src/display/graphicsWindowProcCallbackData.h b/panda/src/display/graphicsWindowProcCallbackData.h index 9e3c747d50..d417a3595e 100644 --- a/panda/src/display/graphicsWindowProcCallbackData.h +++ b/panda/src/display/graphicsWindowProcCallbackData.h @@ -32,7 +32,7 @@ public: INLINE GraphicsWindow* get_graphics_window() const; #ifdef WIN32 - INLINE void set_hwnd(int hwnd); + INLINE void set_hwnd(uintptr_t hwnd); INLINE void set_msg(int msg); INLINE void set_wparam(int wparam); INLINE void set_lparam(int lparam); @@ -42,7 +42,7 @@ PUBLISHED: virtual void output(ostream &out) const; #ifdef WIN32 - INLINE int get_hwnd() const; + INLINE uintptr_t get_hwnd() const; INLINE int get_msg() const; INLINE int get_wparam() const; INLINE int get_lparam() const; @@ -55,7 +55,7 @@ PUBLISHED: private: GraphicsWindow* _graphicsWindow; #ifdef WIN32 - int _hwnd; + uintptr_t _hwnd; int _msg; int _wparam; int _lparam; diff --git a/panda/src/display/pythonGraphicsWindowProc.cxx b/panda/src/display/pythonGraphicsWindowProc.cxx index d114d9ba3d..fe2013bed1 100644 --- a/panda/src/display/pythonGraphicsWindowProc.cxx +++ b/panda/src/display/pythonGraphicsWindowProc.cxx @@ -47,7 +47,7 @@ PythonGraphicsWindowProc:: LONG PythonGraphicsWindowProc:: wnd_proc(GraphicsWindow* graphicsWindow, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam){ GraphicsWindowProcCallbackData cdata(graphicsWindow); - cdata.set_hwnd((int)hwnd); + cdata.set_hwnd((uintptr_t)hwnd); cdata.set_msg(msg); cdata.set_wparam(wparam); cdata.set_lparam(lparam); diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.I b/panda/src/dxgsg9/dxGraphicsStateGuardian9.I index 7b5133ccf4..94e50a5f7d 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.I +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.I @@ -127,7 +127,7 @@ get_safe_buffer_start() { // buffer, and then pointing to the first multiple of 0x10000 within that // buffer. _temp_buffer = new unsigned char[0x1ffff]; - _safe_buffer_start = (unsigned char *)(((long)_temp_buffer + 0xffff) & ~0xffff); + _safe_buffer_start = (unsigned char *)(((uintptr_t)_temp_buffer + 0xffff) & ~0xffff); } return _safe_buffer_start; diff --git a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx index b51d67c564..8326068dc1 100644 --- a/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx +++ b/panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx @@ -4936,7 +4936,7 @@ draw_primitive_up(D3DPRIMITIVETYPE primitive_type, _d3d_device->DrawPrimitiveUP(primitive_type, primitive_count, buffer_start, stride); - } else if ((((long)buffer_end ^ (long)buffer_start) & ~0xffff) == 0) { + } else if ((((uintptr_t)buffer_end ^ (uintptr_t)buffer_start) & ~0xffff) == 0) { // No problem; we can draw the buffer directly. _d3d_device->DrawPrimitiveUP(primitive_type, primitive_count, buffer_start, stride); @@ -4978,7 +4978,7 @@ draw_indexed_primitive_up(D3DPRIMITIVETYPE primitive_type, (primitive_type, min_index, max_index - min_index + 1, num_primitives, index_data, index_type, buffer, stride); - } else if ((((long)buffer_end ^ (long)buffer_start) & ~0xffff) == 0) { + } else if ((((uintptr_t)buffer_end ^ (uintptr_t)buffer_start) & ~0xffff) == 0) { // No problem; we can draw the buffer directly. _d3d_device->DrawIndexedPrimitiveUP (primitive_type, min_index, max_index - min_index + 1, num_primitives, diff --git a/panda/src/dxgsg9/dxTextureContext9.cxx b/panda/src/dxgsg9/dxTextureContext9.cxx index 39b92342aa..babfae755e 100644 --- a/panda/src/dxgsg9/dxTextureContext9.cxx +++ b/panda/src/dxgsg9/dxTextureContext9.cxx @@ -680,7 +680,7 @@ create_texture(DXScreenData &scrn) { << "NumColorChannels: " << num_color_channels << "; NumAlphaBits: " << num_alpha_bits << "; targetbpp: " <HighPart) << "." << LOWORD(DrvVer->HighPart) << "." << HIWORD(DrvVer->LowPart) << "." << LOWORD(DrvVer->LowPart) - << ")\nVendorID: 0x" << (void*) adapter_info.VendorId - << " DeviceID: 0x" << (void*) adapter_info.DeviceId - << " SubsysID: 0x" << (void*) adapter_info.SubSysId - << " Revision: 0x" << (void*) adapter_info.Revision << endl; + << ")\nVendorID: 0x" << hex << adapter_info.VendorId + << " DeviceID: 0x" << adapter_info.DeviceId + << " SubsysID: 0x" << adapter_info.SubSysId + << " Revision: 0x" << adapter_info.Revision << dec << endl; HMONITOR _monitor = dxpipe->__d3d9->GetAdapterMonitor(i); if (_monitor == NULL) { diff --git a/panda/src/event/asyncFuture.h b/panda/src/event/asyncFuture.h index e3a835eea3..453384fbb5 100644 --- a/panda/src/event/asyncFuture.h +++ b/panda/src/event/asyncFuture.h @@ -185,10 +185,10 @@ public: register_type(_type_handle, "AsyncGatheringFuture", AsyncFuture::get_class_type()); } - virtual TypeHandle get_type() const { + virtual TypeHandle get_type() const override { return get_class_type(); } - virtual TypeHandle force_init_type() {init_type(); return get_class_type();} + virtual TypeHandle force_init_type() override {init_type(); return get_class_type();} private: static TypeHandle _type_handle; diff --git a/panda/src/movies/flacAudioCursor.cxx b/panda/src/movies/flacAudioCursor.cxx index 839fc8724c..a4c33822cd 100644 --- a/panda/src/movies/flacAudioCursor.cxx +++ b/panda/src/movies/flacAudioCursor.cxx @@ -17,7 +17,6 @@ #include "config_movies.h" #define DR_FLAC_IMPLEMENTATION -#define DR_FLAC_NO_STDIO extern "C" { #include "dr_flac.h" } diff --git a/panda/src/wgldisplay/wglGraphicsWindow.cxx b/panda/src/wgldisplay/wglGraphicsWindow.cxx index d6fe0799b9..06fc3d3ed4 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.cxx +++ b/panda/src/wgldisplay/wglGraphicsWindow.cxx @@ -386,7 +386,7 @@ print_pfd(PIXELFORMATDESCRIPTOR *pfd, char *msg) { wgldisplay_cat.debug() << msg << ", " << OGLDrvStrings[drvtype] << " driver\n" - << "PFD flags: 0x" << (void*)pfd->dwFlags << " (" + << "PFD flags: 0x" << hex << pfd->dwFlags << dec << " (" << PRINT_FLAG(GENERIC_ACCELERATED) << PRINT_FLAG(GENERIC_FORMAT) << PRINT_FLAG(DOUBLEBUFFER)