Skip to content

Commit

Permalink
Tidy: More replace "typedef" with "using" in header files.
Browse files Browse the repository at this point in the history
The clang-tidy modernize "use using" checker pointed out a number of
places where the older style of "typedef a b;" should be replaced with
the modern construct of "using b = a;", but it didn't point out many
instances in header files, only in cpp files.  Make these replacements
by hand in header files.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
  • Loading branch information
linuxdude42 committed Nov 29, 2019
1 parent 3e31063 commit ee37113
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/audio/audiooutputdx.cpp
Expand Up @@ -125,8 +125,8 @@ AudioOutputDX::~AudioOutputDX()
timeEndPeriod(1);
}

typedef HRESULT (WINAPI *LPFNDSC) (LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
typedef HRESULT (WINAPI *LPFNDSE) (LPDSENUMCALLBACK, LPVOID);
using LPFNDSC = HRESULT (WINAPI *) (LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
using LPFNDSE = HRESULT (WINAPI *) (LPDSENUMCALLBACK, LPVOID);

#ifdef UNICODE
int CALLBACK AudioOutputDXPrivate::DSEnumCallback(LPGUID lpGuid,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/dxva2decoder.cpp
Expand Up @@ -160,7 +160,7 @@ bool DXVA2Decoder::Init(MythRenderD3D9* render)
return ok;
}

typedef HRESULT (__stdcall *DXVA2CreateVideoServicePtr)(IDirect3DDevice9* pDD,
using DXVA2CreateVideoServicePtr = HRESULT (__stdcall *)(IDirect3DDevice9* pDD,
REFIID riid,
void** ppService);

Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/opengl/mythvdpauinterop.h
Expand Up @@ -15,11 +15,11 @@ extern "C" {
class MythVDPAUHelper;

using MythVDPAUSurfaceNV = GLintptr;
typedef void (APIENTRY * MYTH_VDPAUINITNV)(const void*, const void*);
typedef void (APIENTRY * MYTH_VDPAUFININV)(void);
typedef MythVDPAUSurfaceNV (APIENTRY * MYTH_VDPAUREGOUTSURFNV)(const void*, GLenum, GLsizei, const GLuint*);
typedef void (APIENTRY * MYTH_VDPAUSURFACCESSNV)(MythVDPAUSurfaceNV, GLenum);
typedef void (APIENTRY * MYTH_VDPAUMAPSURFNV)(GLsizei, MythVDPAUSurfaceNV*);
using MYTH_VDPAUINITNV = void (APIENTRY *)(const void*, const void*);
using MYTH_VDPAUFININV = void (APIENTRY *)(void);
using MYTH_VDPAUREGOUTSURFNV = MythVDPAUSurfaceNV (APIENTRY *)(const void*, GLenum, GLsizei, const GLuint*);
using MYTH_VDPAUSURFACCESSNV = void (APIENTRY *)(MythVDPAUSurfaceNV, GLenum);
using MYTH_VDPAUMAPSURFNV = void (APIENTRY *)(GLsizei, MythVDPAUSurfaceNV*);

class MythVDPAUInterop : public MythOpenGLInterop
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/mythrender_d3d9.cpp
Expand Up @@ -249,7 +249,7 @@ bool MythRenderD3D9::Create(QSize size, HWND window)
{
QMutexLocker locker(&m_lock);

typedef LPDIRECT3D9 (WINAPI *LPFND3DC)(UINT SDKVersion);
using LPFND3DC = LPDIRECT3D9 (WINAPI *)(UINT SDKVersion);
static LPFND3DC OurDirect3DCreate9 = nullptr;

OurDirect3DCreate9 = (LPFND3DC)ResolveAddress("D3D9","Direct3DCreate9");
Expand Down Expand Up @@ -1186,7 +1186,7 @@ void MythRenderD3D9::ReleaseDevice(void)
}

#ifdef USING_DXVA2
typedef HRESULT (WINAPI *CreateDeviceManager9Ptr)(UINT *pResetToken,
using CreateDeviceManager9Ptr = HRESULT (WINAPI *)(UINT *pResetToken,
IDirect3DDeviceManager9 **);
#endif

Expand Down
6 changes: 2 additions & 4 deletions mythtv/libs/libmythui/opengl/mythrenderopengldefs.h
Expand Up @@ -22,8 +22,6 @@
#endif

using MYTH_GLsizeiptr = ptrdiff_t;
typedef GLvoid* (APIENTRY * MYTH_GLMAPBUFFERPROC)
(GLenum target, GLenum access);
typedef GLboolean (APIENTRY * MYTH_GLUNMAPBUFFERPROC)
(GLenum target);
using MYTH_GLMAPBUFFERPROC = GLvoid* (APIENTRY *) (GLenum target, GLenum access);
using MYTH_GLUNMAPBUFFERPROC = GLboolean (APIENTRY *) (GLenum target);
#endif

0 comments on commit ee37113

Please sign in to comment.