Skip to content

Commit

Permalink
Merge pull request #2734 from jmarshallnz/dont_byte_off_more_than_you…
Browse files Browse the repository at this point in the history
…_can_chew

Get rid of #define byte in PlatformDefs.h
  • Loading branch information
jmarshallnz committed May 12, 2013
2 parents dd0cce0 + f57b713 commit 7118b76
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 24 deletions.
2 changes: 0 additions & 2 deletions lib/UnrarXLib/rartypes.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef _RAR_TYPES_
#define _RAR_TYPES_

#ifndef byte
typedef unsigned char byte; //8 bits
#endif
typedef unsigned short ushort; //preferably 16 bits, but can be more
typedef unsigned int uint; //32 bits or more

Expand Down
2 changes: 0 additions & 2 deletions xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#if (defined HAVE_CONFIG_H) && (!defined WIN32)
#include "config.h"
#endif
/* undefine byte from PlatformDefs.h since it's used in mad.h */
#undef byte
#if defined(_LINUX) || defined(TARGET_DARWIN)
#include <mad.h>
#else
Expand Down
4 changes: 2 additions & 2 deletions xbmc/filesystem/ISOFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ unsigned int CISOFile::Read(void *lpBuf, int64_t uiBufSize)

if (m_cache.getMaxWriteSize() > 5000)
{
byte buffer[5000];
uint8_t buffer[5000];
long lBytesRead = m_isoReader.ReadFile( m_hFile, buffer, sizeof(buffer));
if (lBytesRead > 0)
m_cache.WriteData((char*)buffer, lBytesRead);
Expand All @@ -97,7 +97,7 @@ unsigned int CISOFile::Read(void *lpBuf, int64_t uiBufSize)
}
return lTotalBytesRead;
}
int iResult = m_isoReader.ReadFile( m_hFile, (byte*)pData, (long)uiBufSize);
int iResult = m_isoReader.ReadFile( m_hFile, (uint8_t*)pData, (long)uiBufSize);
if (iResult == -1)
return 0;
return iResult;
Expand Down
4 changes: 2 additions & 2 deletions xbmc/filesystem/RarFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ unsigned int CRarFile::Read(void *lpBuf, int64_t uiBufSize)
}


byte* pBuf = (byte*)lpBuf;
uint8_t* pBuf = (uint8_t*)lpBuf;
int64_t uicBufSize = uiBufSize;
if (m_iDataInBuffer > 0)
{
Expand Down Expand Up @@ -718,7 +718,7 @@ bool CRarFile::OpenInArchive()
m_pArc->SeekToNext();
}

m_szBuffer = new byte[MAXWINMEMSIZE];
m_szBuffer = new uint8_t[MAXWINMEMSIZE];
m_szStartOfBuffer = m_szBuffer;
m_pExtract->GetDataIO().SetUnpackToMemory(m_szBuffer,0);
m_iDataInBuffer = -1;
Expand Down
4 changes: 2 additions & 2 deletions xbmc/filesystem/RarFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ namespace XFILE
CmdExtract* m_pExtract;
CRarFileExtractThread* m_pExtractThread;
#endif
byte* m_szBuffer;
byte* m_szStartOfBuffer;
uint8_t* m_szBuffer;
uint8_t* m_szStartOfBuffer;
int64_t m_iDataInBuffer;
int64_t m_iBufferStart;
};
Expand Down
8 changes: 4 additions & 4 deletions xbmc/filesystem/iso9660.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ HANDLE iso9660::OpenFile(const char *filename)

pContext->m_dwCurrentBlock = m_searchpointer->Location;
pContext->m_dwFileSize = m_info.curr_filesize = fileinfo.nFileSizeLow;
pContext->m_pBuffer = new byte[CIRC_BUFFER_SIZE * BUFFER_SIZE];
pContext->m_pBuffer = new uint8_t[CIRC_BUFFER_SIZE * BUFFER_SIZE];
pContext->m_dwStartBlock = pContext->m_dwCurrentBlock;
pContext->m_dwFilePos = 0;
pContext->m_dwCircBuffBegin = 0;
Expand Down Expand Up @@ -791,7 +791,7 @@ void iso9660::CloseFile(HANDLE hFile)
FreeFileContext(hFile);
}
//************************************************************************************
bool iso9660::ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, byte** ppBuffer)
bool iso9660::ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, uint8_t** ppBuffer)
{

DWORD StartSectorInCircBuff = pContext->m_dwCircBuffSectorStart;
Expand Down Expand Up @@ -891,7 +891,7 @@ void iso9660::ReleaseSectorFromCache(iso9660::isofile* pContext, DWORD sector)
}
}
//************************************************************************************
long iso9660::ReadFile(HANDLE hFile, byte *pBuffer, long lSize)
long iso9660::ReadFile(HANDLE hFile, uint8_t *pBuffer, long lSize)
{
bool bError;
long iBytesRead = 0;
Expand All @@ -912,7 +912,7 @@ long iso9660::ReadFile(HANDLE hFile, byte *pBuffer, long lSize)
//sprintf(szBuf,"pos:%i cblk:%i sblk:%i off:%i",(long)m_dwFilePos, (long)m_dwCurrentBlock,(long)m_dwStartBlock,(long)iOffsetInBuffer);
//DBG(szBuf);

byte* pSector;
uint8_t* pSector;
bError = !ReadSectorFromCache(pContext, pContext->m_dwCurrentBlock, &pSector);
if (!bError)
{
Expand Down
4 changes: 2 additions & 2 deletions xbmc/filesystem/iso9660.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class iso9660
int64_t GetFilePosition(HANDLE hFile);
int64_t Seek(HANDLE hFile, int64_t lOffset, int whence);
HANDLE OpenFile( const char* filename );
long ReadFile(HANDLE fd, byte *pBuffer, long lSize);
long ReadFile(HANDLE fd, uint8_t *pBuffer, long lSize);
void CloseFile(HANDLE hFile);
void Reset();
void Scan();
Expand All @@ -196,7 +196,7 @@ class iso9660
struct iso_dirtree* ReadRecursiveDirFromSector( DWORD sector, const char * );
struct iso_dirtree* FindFolder( char *Folder );
std::string GetThinText(BYTE* strTxt, int iLen );
bool ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, byte** ppBuffer);
bool ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, uint8_t** ppBuffer);
void ReleaseSectorFromCache(iso9660::isofile* pContext, DWORD sector);
const std::string ParseName(struct iso9660_Directory& isodir);
HANDLE AllocFileContext();
Expand Down
1 change: 0 additions & 1 deletion xbmc/linux/PlatformDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
#define ZeroMemory(dst,size) memset(dst, 0, size)

#define VOID void
#define byte unsigned char
#define __int8 char
#define __int16 short
#define __int32 int
Expand Down
1 change: 0 additions & 1 deletion xbmc/music/tags/TagLoaderTagLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <taglib/unsynchronizedlyricsframe.h>
#include <taglib/attachedpictureframe.h>

#undef byte
#include <taglib/tstring.h>
#include <taglib/tpropertymap.h>

Expand Down
1 change: 0 additions & 1 deletion xbmc/music/tags/TagLoaderTagLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*
*/

#undef byte
#include <taglib/aifffile.h>
#include <taglib/apefile.h>
#include <taglib/asffile.h>
Expand Down
10 changes: 5 additions & 5 deletions xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
*
*/

#include <stdlib.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <EGL/egl.h>

#include "EGLNativeTypeAmlogic.h"
#include "guilib/gui3d.h"
#include "utils/AMLUtils.h"
#include "utils/StringUtils.h"

#include <stdlib.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <EGL/egl.h>

CEGLNativeTypeAmlogic::CEGLNativeTypeAmlogic()
{
const char *env_framebuffer = getenv("FRAMEBUFFER");
Expand Down

0 comments on commit 7118b76

Please sign in to comment.