From 0bebbcb5f45fe1f927b4b600bdc16b825c402c58 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sun, 31 Aug 2008 14:32:35 +0000 Subject: [PATCH] Replaced type "BYTE" by "u8", except where "BYTE" is used to access the Windows API. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@408 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/DolLoader.h | 6 ++++-- Source/Core/Core/Src/Plugins/Plugin_PAD.h | 4 ++-- Source/Core/Core/Src/Plugins/Plugin_Video.h | 4 ++-- Source/Core/VideoCommon/Src/Fifo.cpp | 2 +- Source/PluginSpecs/CommonTypes.h | 1 - Source/PluginSpecs/PluginSpecs.h | 6 +++--- Source/PluginSpecs/pluginspecs_pad.h | 4 ++-- Source/PluginSpecs/pluginspecs_video.h | 4 ++-- Source/Plugins/Plugin_PadDX9/Src/main.cpp | 4 ++-- Source/Plugins/Plugin_PadSimple/Src/main.cpp | 4 ++-- Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.cpp | 2 +- Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.h | 4 +++- Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.cpp | 2 +- Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h | 4 +++- Source/Plugins/Plugin_VideoOGL/Src/main.cpp | 2 +- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp | 4 ++-- 17 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Source/Core/Core/Src/DolLoader.h b/Source/Core/Core/Src/DolLoader.h index 7f891fb40d..92390d2a08 100644 --- a/Source/Core/Core/Src/DolLoader.h +++ b/Source/Core/Core/Src/DolLoader.h @@ -20,6 +20,8 @@ #pragma once +#include "Common.h" + ///////////////////////////////////////////////////////////////////////////////////////////////////// // C L A S S///////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -48,7 +50,7 @@ public: { if(m_dolheader.textOffset[i] != 0) { - BYTE* pTemp = new BYTE[m_dolheader.textSize[i]]; + u8* pTemp = new u8[m_dolheader.textSize[i]]; fseek(pStream, m_dolheader.textOffset[i], SEEK_SET); fread(pTemp, 1, m_dolheader.textSize[i], pStream); @@ -65,7 +67,7 @@ public: { if(m_dolheader.dataOffset[i] != 0) { - BYTE* pTemp = new BYTE[m_dolheader.dataSize[i]]; + u8* pTemp = new u8[m_dolheader.dataSize[i]]; fseek(pStream, m_dolheader.dataOffset[i], SEEK_SET); fread(pTemp, 1, m_dolheader.dataSize[i], pStream); diff --git a/Source/Core/Core/Src/Plugins/Plugin_PAD.h b/Source/Core/Core/Src/Plugins/Plugin_PAD.h index cb55a79b73..a9b36c5a45 100644 --- a/Source/Core/Core/Src/Plugins/Plugin_PAD.h +++ b/Source/Core/Core/Src/Plugins/Plugin_PAD.h @@ -33,8 +33,8 @@ typedef void (__cdecl* TDllAbout)(HWND); typedef void (__cdecl* TDllConfig)(HWND); typedef void (__cdecl* TPAD_Initialize)(SPADInitialize); typedef void (__cdecl* TPAD_Shutdown)(); -typedef void (__cdecl* TPAD_GetStatus)(BYTE, SPADStatus*); -typedef void (__cdecl* TPAD_Rumble)(BYTE, unsigned int, unsigned int); +typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*); +typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int); typedef unsigned int (__cdecl* TPAD_GetAttachedPads)(); // Function Pointers diff --git a/Source/Core/Core/Src/Plugins/Plugin_Video.h b/Source/Core/Core/Src/Plugins/Plugin_Video.h index f9bad51f74..f1a7c45018 100644 --- a/Source/Core/Core/Src/Plugins/Plugin_Video.h +++ b/Source/Core/Core/Src/Plugins/Plugin_Video.h @@ -37,8 +37,8 @@ typedef void (__cdecl* TDllConfig)(HWND); typedef void (__cdecl* TVideo_Initialize)(SVideoInitialize*); typedef void (__cdecl* TVideo_Prepare)(); typedef void (__cdecl* TVideo_Shutdown)(); -typedef void (__cdecl* TVideo_SendFifoData)(BYTE*); -typedef void (__cdecl* TVideo_UpdateXFB)(BYTE*, DWORD, DWORD); +typedef void (__cdecl* TVideo_SendFifoData)(u8*); +typedef void (__cdecl* TVideo_UpdateXFB)(u8*, DWORD, DWORD); typedef BOOL (__cdecl* TVideo_Screenshot)(TCHAR*); typedef void (__cdecl* TVideo_EnterLoop)(); typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds); diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index bcb87aed4d..d90be40572 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -102,7 +102,7 @@ void FAKE_SkipFifo(u32 skip) readptr += skip; } -void Video_SendFifoData(BYTE *_uData) +void Video_SendFifoData(u8* _uData) { memcpy(videoBuffer + size, _uData, 32); size += 32; diff --git a/Source/PluginSpecs/CommonTypes.h b/Source/PluginSpecs/CommonTypes.h index 9c6d9ab163..c20ec05272 100644 --- a/Source/PluginSpecs/CommonTypes.h +++ b/Source/PluginSpecs/CommonTypes.h @@ -41,7 +41,6 @@ typedef signed __int64 s64; #else typedef unsigned char u8; -typedef unsigned char BYTE; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned int BOOL; diff --git a/Source/PluginSpecs/PluginSpecs.h b/Source/PluginSpecs/PluginSpecs.h index 35a72de424..6d86b6ee50 100644 --- a/Source/PluginSpecs/PluginSpecs.h +++ b/Source/PluginSpecs/PluginSpecs.h @@ -5,6 +5,8 @@ #ifndef _PLUGINS_H_INCLUDED__ #define _PLUGINS_H_INCLUDED__ +#include "CommonTypes.h" + #ifdef _WIN32 #define EXPORT __declspec(dllexport) #define CALL __cdecl @@ -29,14 +31,12 @@ // simulate something that looks like win32 // long term, kill these -// glxew defines BOOL and BYTE. evil. +// glxew defines BOOL. evil. #ifdef BOOL #undef BOOL -#undef BYTE #endif #define BOOL unsigned int -#define BYTE unsigned char #define WORD unsigned short #define DWORD unsigned int #define HWND void* diff --git a/Source/PluginSpecs/pluginspecs_pad.h b/Source/PluginSpecs/pluginspecs_pad.h index 2a245d194b..bb8aaca9fe 100644 --- a/Source/PluginSpecs/pluginspecs_pad.h +++ b/Source/PluginSpecs/pluginspecs_pad.h @@ -105,7 +105,7 @@ EXPORT void CALL PAD_Shutdown(); // input: // output: // -EXPORT void CALL PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus); +EXPORT void CALL PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus); // __________________________________________________________________________________________________ // Function: PAD_Rumble @@ -113,7 +113,7 @@ EXPORT void CALL PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus); // input: PAD number, Command type (Stop=0, Rumble=1, Stop Hard=2) and strength of Rumble // output: none // -EXPORT void CALL PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength); +EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength); // __________________________________________________________________________________________________ // Function: PAD_GetAttachedPads diff --git a/Source/PluginSpecs/pluginspecs_video.h b/Source/PluginSpecs/pluginspecs_video.h index bbc205433a..42fea210ff 100644 --- a/Source/PluginSpecs/pluginspecs_video.h +++ b/Source/PluginSpecs/pluginspecs_video.h @@ -132,7 +132,7 @@ EXPORT void CALL Video_Shutdown(void); // input: a data-byte (i know we have to optimize this ;-)) // output: none // -EXPORT void CALL Video_SendFifoData(BYTE *_uData); +EXPORT void CALL Video_SendFifoData(u8* _uData); // __________________________________________________________________________________________________ // Function: Video_UpdateXFB @@ -142,7 +142,7 @@ EXPORT void CALL Video_SendFifoData(BYTE *_uData); // input: pointer to the XFB, width and height of the XFB // output: none // -EXPORT void CALL Video_UpdateXFB(BYTE* _pXFB, DWORD _dwWidth, DWORD _dwHeight); +EXPORT void CALL Video_UpdateXFB(u8* _pXFB, DWORD _dwWidth, DWORD _dwHeight); // __________________________________________________________________________________________________ // Function: Video_Screenshot diff --git a/Source/Plugins/Plugin_PadDX9/Src/main.cpp b/Source/Plugins/Plugin_PadDX9/Src/main.cpp index 16ac6345e0..c047457830 100644 --- a/Source/Plugins/Plugin_PadDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_PadDX9/Src/main.cpp @@ -124,7 +124,7 @@ void PAD_Shutdown(void) // __________________________________________________________________________________________________ // PADGetStatus // -void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) +void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) { // check if all is okay if ((_numPAD != 0) || // we support just pad 0 @@ -187,6 +187,6 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) // __________________________________________________________________________________________________ // PAD_Rumble // -void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength) +void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { } diff --git a/Source/Plugins/Plugin_PadSimple/Src/main.cpp b/Source/Plugins/Plugin_PadSimple/Src/main.cpp index cb8536a0cc..69ff27ea9a 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/main.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/main.cpp @@ -521,7 +521,7 @@ unsigned int PAD_GetAttachedPads() connected |= 1; return connected; } -void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) +void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) { // check if all is okay if ((_pPADStatus == NULL)) @@ -568,7 +568,7 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) // Rough approximation of GC behaviour - needs improvement. -void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength) +void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { #ifdef _WIN32 static int a = 0; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.cpp index 07c39cc515..206742a04d 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.cpp @@ -8,7 +8,7 @@ #include "VertexLoader.h" #include "VertexLoader_Normal.h" -BYTE VertexLoader_Normal::m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; +u8 VertexLoader_Normal::m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; TPipelineFunction VertexLoader_Normal::m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; bool VertexLoader_Normal::index3; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.h b/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.h index e35bdb59ae..43ce7b570c 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexLoader_Normal.h @@ -4,6 +4,8 @@ #pragma once +#include "CommonTypes.h" + class VertexLoader_Normal { public: @@ -46,7 +48,7 @@ private: }; // tables - static BYTE m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; + static u8 m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; static TPipelineFunction m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; // direct diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index d84bc47399..f082b65e11 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -202,7 +202,7 @@ void Video_Shutdown(void) DeInit(); } -void Video_UpdateXFB(BYTE* /*_pXFB*/, DWORD /*_dwWidth*/, DWORD /*_dwHeight*/) +void Video_UpdateXFB(u8* /*_pXFB*/, DWORD /*_dwWidth*/, DWORD /*_dwHeight*/) { /* ConvertXFB(tempBuffer, _pXFB, _dwWidth, _dwHeight); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.cpp index 350758f874..54d1284766 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.cpp @@ -26,7 +26,7 @@ #define LOG_NORM16() PRIM_LOG("norm: %f %f %f, ", ((s16*)VertexManager::s_pCurBufferPointer)[-3]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-2]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-1]/32767.0f); #define LOG_NORMF() PRIM_LOG("norm: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-3], ((float*)VertexManager::s_pCurBufferPointer)[-2], ((float*)VertexManager::s_pCurBufferPointer)[-1]); -BYTE VertexLoader_Normal::m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; +u8 VertexLoader_Normal::m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; TPipelineFunction VertexLoader_Normal::m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; bool VertexLoader_Normal::index3; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h index 7bb442ba41..2ca7e9867c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader_Normal.h @@ -18,6 +18,8 @@ #ifndef _VERTEXLOADER_NORMAL_H #define _VERTEXLOADER_NORMAL_H +#include "CommonTypes.h" + class VertexLoader_Normal { public: @@ -60,7 +62,7 @@ private: }; // tables - static BYTE m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; + static u8 m_sizeTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; static TPipelineFunction m_funcTable[NUM_NRM_TYPE][NUM_NRM_FORMAT][NUM_NRM_ELEMENTS]; // direct diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index b5788088f0..5b2ebd5b0f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -274,7 +274,7 @@ BOOL Video_Screenshot(TCHAR* _szFilename) } -void Video_UpdateXFB(BYTE* _pXFB, DWORD _dwWidth, DWORD _dwHeight) +void Video_UpdateXFB(u8* _pXFB, DWORD _dwWidth, DWORD _dwHeight) { } diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index 23be813778..9f32b5396e 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -304,7 +304,7 @@ void PAD_Shutdown() // Set PAD status // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) +void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) { if(!joysticks[_numPAD].enabled) return; @@ -474,7 +474,7 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) // Set PAD rumble // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ // (Stop=0, Rumble=1) -void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength) +void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) { //if(_numPAD > 0) // return;