From 4d69b2bf7f127670b2a87efba103b77ba571aa4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 24 May 2019 22:37:42 -0300 Subject: [PATCH] Removed typedefs for structs. --HG-- branch : dev --- include/eepp/audio/soundmanager.hpp | 4 +-- include/eepp/graphics/console.hpp | 4 +-- include/eepp/graphics/packerhelper.hpp | 12 +++---- include/eepp/graphics/textureatlasloader.hpp | 4 +-- include/eepp/maps/maphelper.hpp | 36 ++++++++++---------- include/eepp/system/md5.hpp | 8 ++--- include/eepp/system/pak.hpp | 12 +++---- include/eepp/system/rc4.hpp | 4 +-- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/include/eepp/audio/soundmanager.hpp b/include/eepp/audio/soundmanager.hpp index 75d3523a3..6c65624ec 100755 --- a/include/eepp/audio/soundmanager.hpp +++ b/include/eepp/audio/soundmanager.hpp @@ -56,10 +56,10 @@ class tSoundManager { ~tSoundManager(); private: - typedef struct sSound { + struct sSound { SoundBuffer Buf; std::vector Snd; - } sSound; + }; std::map tSounds; }; diff --git a/include/eepp/graphics/console.hpp b/include/eepp/graphics/console.hpp index 788b3f7f4..463008475 100755 --- a/include/eepp/graphics/console.hpp +++ b/include/eepp/graphics/console.hpp @@ -161,11 +161,11 @@ class EE_API Console : protected LogReaderInterface { Primitives mPri; Uint32 mTexId; - typedef struct { + struct sCon { int ConMin; int ConMax; int ConModif; - } sCon; + }; sCon mCon; Float mCurAlpha; diff --git a/include/eepp/graphics/packerhelper.hpp b/include/eepp/graphics/packerhelper.hpp index 92bc63e70..3ddd5e807 100644 --- a/include/eepp/graphics/packerhelper.hpp +++ b/include/eepp/graphics/packerhelper.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { namespace Private { #define HDR_NAME_SIZE 64 -typedef struct sTextureRegionHdrSN { +struct sTextureRegionHdr { char Name[ HDR_NAME_SIZE ]; Uint64 Date; Int32 X; @@ -24,18 +24,18 @@ typedef struct sTextureRegionHdrSN { Int32 DestHeight; Uint32 Flags; Uint32 PixelDensity; -} sTextureRegionHdr; +}; #define HDR_TEXTUREREGION_FLAG_FLIPED ( 1 << 0 ) -typedef struct sTextureHdrS { +struct sTextureHdr { char Name[ HDR_NAME_SIZE ]; Uint32 ResourceID; Uint32 Size; Int32 TextureRegionCount; -} sTextureHdr; +}; -typedef struct sTextureAtlasHdrSN { +struct sTextureAtlasHdr { Uint32 Magic; Uint32 Version; Uint64 Date; @@ -47,7 +47,7 @@ typedef struct sTextureAtlasHdrSN { Uint32 Flags; char TextureFilter; char Reserved[15]; -} sTextureAtlasHdr; +}; #define HDR_TEXTURE_ATLAS_ALLOW_FLIPPING ( 1 << 0 ) #define HDR_TEXTURE_ATLAS_REMOVE_EXTENSION ( 1 << 1 ) diff --git a/include/eepp/graphics/textureatlasloader.hpp b/include/eepp/graphics/textureatlasloader.hpp index 3ad40823d..4cead8a1a 100644 --- a/include/eepp/graphics/textureatlasloader.hpp +++ b/include/eepp/graphics/textureatlasloader.hpp @@ -148,10 +148,10 @@ class EE_API TextureAtlasLoader { GLLoadCallback mLoadCallback; std::vector mTexturesLoaded; - typedef struct sTempTexAtlasS { + struct sTempTexAtlas { sTextureHdr Texture; std::vector TextureRegions; - } sTempTexAtlas; + }; sTextureAtlasHdr mTexGrHdr; std::vector mTempAtlass; diff --git a/include/eepp/maps/maphelper.hpp b/include/eepp/maps/maphelper.hpp index f6d881e5e..95de09c6a 100644 --- a/include/eepp/maps/maphelper.hpp +++ b/include/eepp/maps/maphelper.hpp @@ -9,20 +9,20 @@ namespace EE { namespace Maps { #define LAYER_NAME_SIZE (64) #define MAP_TEXTUREATLAS_PATH_SIZE (128) -typedef struct sPropertyHdrS { +struct sPropertyHdr { char Name[ MAP_PROPERTY_SIZE ]; char Value[ MAP_PROPERTY_SIZE ]; -} sPropertyHdr; +}; -typedef struct sMapTextureAtlasS { +struct sMapTextureAtlas { char Path[ MAP_TEXTUREATLAS_PATH_SIZE ]; -} sMapTextureAtlas; +}; -typedef struct sVirtualObjS { +struct sVirtualObj { char Name[ MAP_PROPERTY_SIZE ]; -} sVirtualObj; +}; -typedef struct sMapHdrS { +struct sMapHdr { Uint32 Magic; Uint32 SizeX; Uint32 SizeY; @@ -36,9 +36,9 @@ typedef struct sMapHdrS { Uint32 VirtualObjectTypesCount; Uint32 BaseColor; Uint32 LightsCount; -} sMapHdr; +}; -typedef struct sLayerHdrS { +struct sLayerHdr { char Name[ LAYER_NAME_SIZE ]; Uint32 Type; Uint32 Flags; @@ -46,36 +46,36 @@ typedef struct sLayerHdrS { Int32 OffsetY; Uint32 PropertyCount; Uint32 ObjectCount; //! Only used by the Object Layer -} sLayerHdr; +}; -typedef struct sMapTileGOHdrS { +struct sMapTileGOHdr { Uint32 Type; Uint32 Id; Uint32 Flags; -} sMapTileGOHdr; +}; -typedef struct sMapObjGOHdrS { +struct sMapObjGOHdr { Uint32 Type; Uint32 Id; Uint32 Flags; Int32 PosX; Int32 PosY; -} sMapObjGOHdr; +}; -typedef struct sMapLightHdrS { +struct sMapLightHdr { Uint32 Radius; Int32 PosX; Int32 PosY; Uint32 Color; Uint32 Type; -} sMapLightHdr; +}; -typedef struct sMapObjObjHdrS { +struct sMapObjObjHdr { char Name[ MAP_PROPERTY_SIZE ]; char Type[ MAP_PROPERTY_SIZE ]; Uint32 PointCount; Uint32 PropertyCount; -} sMapObjObjHdr; +}; class GObjFlags { public: diff --git a/include/eepp/system/md5.hpp b/include/eepp/system/md5.hpp index 691fdacbf..285acd578 100644 --- a/include/eepp/system/md5.hpp +++ b/include/eepp/system/md5.hpp @@ -9,13 +9,13 @@ namespace EE { namespace System { class MD5 { public: - typedef struct { + struct Result { std::vector digest; std::string toHexString() { return MD5::hexDigest( digest ); } - } Result; + }; /** @return Calculates the md5 hash from a stream */ static Result fromStream( IOStream& stream ); @@ -34,12 +34,12 @@ class MD5 { protected: typedef unsigned int MD5_u32plus; - typedef struct { + struct Context { MD5_u32plus lo, hi; MD5_u32plus a, b, c, d; unsigned char buffer[64]; MD5_u32plus block[16]; - } Context; + }; static const void * body( Context *ctx, const void *data, unsigned long size ); diff --git a/include/eepp/system/pak.hpp b/include/eepp/system/pak.hpp index 75668f444..cce26a317 100755 --- a/include/eepp/system/pak.hpp +++ b/include/eepp/system/pak.hpp @@ -74,24 +74,24 @@ class EE_API Pak : public Pack { protected: friend class IOStreamPak; - typedef struct pakheader_t { + struct pakHeader { char head[4]; //! Header of the file ( default: 'PACK' ) Uint32 dir_offset; //! Offset to the first pakEntry on the pakFile Uint32 dir_length; //! Space ocuped by all the pakEntrys ( num of pakEntrys = dir_length / sizeof(pakEntry) ) - } pakHeader; //! The header of the file + }; //! The header of the file - typedef struct dirsection_t { + struct pakEntry { char filename[56]; //! File name Uint32 file_position; //! The file position on the file ( in bytes ) Uint32 file_length; //! THe file length ( in bytes ) - } pakEntry; //! The stored file info + }; //! The stored file info - typedef struct pakfile_t { + struct pakFile { IOStreamFile * fs; pakHeader header; Uint32 pakFilesNum; std::string pakPath; - } pakFile; + }; pakFile mPak; std::vector mPakFiles; diff --git a/include/eepp/system/rc4.hpp b/include/eepp/system/rc4.hpp index 6c0faa6c3..05341d7c0 100755 --- a/include/eepp/system/rc4.hpp +++ b/include/eepp/system/rc4.hpp @@ -50,9 +50,9 @@ class EE_API RC4 { /** @brief Decrypt a file ( you must set the key first ). */ bool decryptFile( const std::string& SourceFile, const std::string& DestFile ); private: - typedef struct _RC4Key { + struct RC4Key { Uint8 state[256]; - } RC4Key; + }; RC4Key mKey; void swap( Uint8& a, Uint8& b );