Skip to content
This repository
Browse code

Merge pull request #2734 from jmarshallnz/dont_byte_off_more_than_you…

…_can_chew

Get rid of #define byte in PlatformDefs.h
  • Loading branch information...
commit 7118b769f8d61ab5c295076c8f08e009b92c3133 2 parents dd0cce0 + f57b713
jmarshallnz authored May 12, 2013
2  lib/UnrarXLib/rartypes.hpp
... ...
@@ -1,9 +1,7 @@
1 1
 #ifndef _RAR_TYPES_
2 2
 #define _RAR_TYPES_
3 3
 
4  
-#ifndef byte
5 4
 typedef unsigned char    byte;   //8 bits
6  
-#endif
7 5
 typedef unsigned short   ushort; //preferably 16 bits, but can be more
8 6
 typedef unsigned int     uint;   //32 bits or more
9 7
 
2  xbmc/cores/dvdplayer/DVDCodecs/Audio/DllLibMad.h
@@ -22,8 +22,6 @@
22 22
 #if (defined HAVE_CONFIG_H) && (!defined WIN32)
23 23
   #include "config.h"
24 24
 #endif
25  
-/* undefine byte from PlatformDefs.h since it's used in mad.h */
26  
-#undef byte
27 25
 #if defined(_LINUX) || defined(TARGET_DARWIN)
28 26
   #include <mad.h>
29 27
 #else
4  xbmc/filesystem/ISOFile.cpp
@@ -87,7 +87,7 @@ unsigned int CISOFile::Read(void *lpBuf, int64_t uiBufSize)
87 87
 
88 88
       if (m_cache.getMaxWriteSize() > 5000)
89 89
       {
90  
-        byte buffer[5000];
  90
+        uint8_t buffer[5000];
91 91
         long lBytesRead = m_isoReader.ReadFile( m_hFile, buffer, sizeof(buffer));
92 92
         if (lBytesRead > 0)
93 93
           m_cache.WriteData((char*)buffer, lBytesRead);
@@ -97,7 +97,7 @@ unsigned int CISOFile::Read(void *lpBuf, int64_t uiBufSize)
97 97
     }
98 98
     return lTotalBytesRead;
99 99
   }
100  
-  int iResult = m_isoReader.ReadFile( m_hFile, (byte*)pData, (long)uiBufSize);
  100
+  int iResult = m_isoReader.ReadFile( m_hFile, (uint8_t*)pData, (long)uiBufSize);
101 101
   if (iResult == -1)
102 102
     return 0;
103 103
   return iResult;
4  xbmc/filesystem/RarFile.cpp
@@ -287,7 +287,7 @@ unsigned int CRarFile::Read(void *lpBuf, int64_t uiBufSize)
287 287
   }
288 288
 
289 289
 
290  
-  byte* pBuf = (byte*)lpBuf;
  290
+  uint8_t* pBuf = (uint8_t*)lpBuf;
291 291
   int64_t uicBufSize = uiBufSize;
292 292
   if (m_iDataInBuffer > 0)
293 293
   {
@@ -718,7 +718,7 @@ bool CRarFile::OpenInArchive()
718 718
       m_pArc->SeekToNext();
719 719
     }
720 720
 
721  
-    m_szBuffer = new byte[MAXWINMEMSIZE];
  721
+    m_szBuffer = new uint8_t[MAXWINMEMSIZE];
722 722
     m_szStartOfBuffer = m_szBuffer;
723 723
     m_pExtract->GetDataIO().SetUnpackToMemory(m_szBuffer,0);
724 724
     m_iDataInBuffer = -1;
4  xbmc/filesystem/RarFile.h
@@ -104,8 +104,8 @@ namespace XFILE
104 104
     CmdExtract* m_pExtract;
105 105
     CRarFileExtractThread* m_pExtractThread;
106 106
 #endif
107  
-    byte* m_szBuffer;
108  
-    byte* m_szStartOfBuffer;
  107
+    uint8_t* m_szBuffer;
  108
+    uint8_t* m_szStartOfBuffer;
109 109
     int64_t m_iDataInBuffer;
110 110
     int64_t m_iBufferStart;
111 111
   };
8  xbmc/filesystem/iso9660.cpp
@@ -752,7 +752,7 @@ HANDLE iso9660::OpenFile(const char *filename)
752 752
 
753 753
   pContext->m_dwCurrentBlock = m_searchpointer->Location;
754 754
   pContext->m_dwFileSize = m_info.curr_filesize = fileinfo.nFileSizeLow;
755  
-  pContext->m_pBuffer = new byte[CIRC_BUFFER_SIZE * BUFFER_SIZE];
  755
+  pContext->m_pBuffer = new uint8_t[CIRC_BUFFER_SIZE * BUFFER_SIZE];
756 756
   pContext->m_dwStartBlock = pContext->m_dwCurrentBlock;
757 757
   pContext->m_dwFilePos = 0;
758 758
   pContext->m_dwCircBuffBegin = 0;
@@ -791,7 +791,7 @@ void iso9660::CloseFile(HANDLE hFile)
791 791
   FreeFileContext(hFile);
792 792
 }
793 793
 //************************************************************************************
794  
-bool iso9660::ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, byte** ppBuffer)
  794
+bool iso9660::ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, uint8_t** ppBuffer)
795 795
 {
796 796
 
797 797
   DWORD StartSectorInCircBuff = pContext->m_dwCircBuffSectorStart;
@@ -891,7 +891,7 @@ void iso9660::ReleaseSectorFromCache(iso9660::isofile* pContext, DWORD sector)
891 891
   }
892 892
 }
893 893
 //************************************************************************************
894  
-long iso9660::ReadFile(HANDLE hFile, byte *pBuffer, long lSize)
  894
+long iso9660::ReadFile(HANDLE hFile, uint8_t *pBuffer, long lSize)
895 895
 {
896 896
   bool bError;
897 897
   long iBytesRead = 0;
@@ -912,7 +912,7 @@ long iso9660::ReadFile(HANDLE hFile, byte *pBuffer, long lSize)
912 912
     //sprintf(szBuf,"pos:%i cblk:%i sblk:%i off:%i",(long)m_dwFilePos, (long)m_dwCurrentBlock,(long)m_dwStartBlock,(long)iOffsetInBuffer);
913 913
     //DBG(szBuf);
914 914
 
915  
-    byte* pSector;
  915
+    uint8_t* pSector;
916 916
     bError = !ReadSectorFromCache(pContext, pContext->m_dwCurrentBlock, &pSector);
917 917
     if (!bError)
918 918
     {
4  xbmc/filesystem/iso9660.h
@@ -185,7 +185,7 @@ class iso9660
185 185
   int64_t GetFilePosition(HANDLE hFile);
186 186
   int64_t Seek(HANDLE hFile, int64_t lOffset, int whence);
187 187
   HANDLE OpenFile( const char* filename );
188  
-  long ReadFile(HANDLE fd, byte *pBuffer, long lSize);
  188
+  long ReadFile(HANDLE fd, uint8_t *pBuffer, long lSize);
189 189
   void CloseFile(HANDLE hFile);
190 190
   void Reset();
191 191
   void Scan();
@@ -196,7 +196,7 @@ class iso9660
196 196
   struct iso_dirtree* ReadRecursiveDirFromSector( DWORD sector, const char * );
197 197
   struct iso_dirtree* FindFolder( char *Folder );
198 198
   std::string GetThinText(BYTE* strTxt, int iLen );
199  
-  bool ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, byte** ppBuffer);
  199
+  bool ReadSectorFromCache(iso9660::isofile* pContext, DWORD sector, uint8_t** ppBuffer);
200 200
   void ReleaseSectorFromCache(iso9660::isofile* pContext, DWORD sector);
201 201
   const std::string ParseName(struct iso9660_Directory& isodir);
202 202
   HANDLE AllocFileContext();
1  xbmc/linux/PlatformDefs.h
@@ -155,7 +155,6 @@
155 155
 #define ZeroMemory(dst,size) memset(dst, 0, size)
156 156
 
157 157
 #define VOID    void
158  
-#define byte    unsigned char
159 158
 #define __int8    char
160 159
 #define __int16   short
161 160
 #define __int32   int
1  xbmc/music/tags/TagLoaderTagLib.cpp
@@ -36,7 +36,6 @@
36 36
 #include <taglib/unsynchronizedlyricsframe.h>
37 37
 #include <taglib/attachedpictureframe.h>
38 38
 
39  
-#undef byte
40 39
 #include <taglib/tstring.h>
41 40
 #include <taglib/tpropertymap.h>
42 41
 
1  xbmc/music/tags/TagLoaderTagLib.h
@@ -20,7 +20,6 @@
20 20
  *
21 21
  */
22 22
 
23  
-#undef byte
24 23
 #include <taglib/aifffile.h>
25 24
 #include <taglib/apefile.h>
26 25
 #include <taglib/asffile.h>
10  xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp
@@ -18,16 +18,16 @@
18 18
  *
19 19
  */
20 20
 
21  
-#include <stdlib.h>
22  
-#include <linux/fb.h>
23  
-#include <sys/ioctl.h>
24  
-#include <EGL/egl.h>
25  
-
26 21
 #include "EGLNativeTypeAmlogic.h"
27 22
 #include "guilib/gui3d.h"
28 23
 #include "utils/AMLUtils.h"
29 24
 #include "utils/StringUtils.h"
30 25
 
  26
+#include <stdlib.h>
  27
+#include <linux/fb.h>
  28
+#include <sys/ioctl.h>
  29
+#include <EGL/egl.h>
  30
+
31 31
 CEGLNativeTypeAmlogic::CEGLNativeTypeAmlogic()
32 32
 {
33 33
   const char *env_framebuffer = getenv("FRAMEBUFFER");

0 notes on commit 7118b76

Please sign in to comment.
Something went wrong with that request. Please try again.