diff options
author | amet <amet.nospam@gmail.com> | 2011-03-15 12:49:58 +0400 |
---|---|---|
committer | amet <amet.nospam@gmail.com> | 2011-03-15 12:49:58 +0400 |
commit | 5dd7ae1b91c2fe9a29dd1ed4e2948827b42f1751 (patch) | |
tree | f893ce8d668bc18b7d4c6e5987b0b758af03590a /lib/UnrarXLib | |
parent | 0897223461edd0badb6c454f4b5af39eac523eab (diff) |
cleanup of #ifdef _XBOX
Diffstat (limited to 'lib/UnrarXLib')
-rw-r--r-- | lib/UnrarXLib/cmddata.cpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/consio.cpp | 6 | ||||
-rw-r--r-- | lib/UnrarXLib/crypt.cpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/errhnd.cpp | 8 | ||||
-rw-r--r-- | lib/UnrarXLib/filcreat.cpp | 4 | ||||
-rw-r--r-- | lib/UnrarXLib/file.cpp | 8 | ||||
-rw-r--r-- | lib/UnrarXLib/filefn.cpp | 14 | ||||
-rw-r--r-- | lib/UnrarXLib/filestr.cpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/find.cpp | 4 | ||||
-rw-r--r-- | lib/UnrarXLib/isnt.cpp | 4 | ||||
-rw-r--r-- | lib/UnrarXLib/os.hpp | 11 | ||||
-rw-r--r-- | lib/UnrarXLib/pathfn.cpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/rar.cpp | 44 | ||||
-rw-r--r-- | lib/UnrarXLib/rar.hpp | 1 | ||||
-rw-r--r-- | lib/UnrarXLib/raros.hpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/strfn.cpp | 4 | ||||
-rw-r--r-- | lib/UnrarXLib/system.cpp | 27 | ||||
-rw-r--r-- | lib/UnrarXLib/unicode.cpp | 2 |
18 files changed, 36 insertions, 111 deletions
diff --git a/lib/UnrarXLib/cmddata.cpp b/lib/UnrarXLib/cmddata.cpp index ab8565b501..da618d2c1e 100644 --- a/lib/UnrarXLib/cmddata.cpp +++ b/lib/UnrarXLib/cmddata.cpp @@ -126,7 +126,7 @@ void CommandData::ParseDone() } -#if !defined(SFX_MODULE) && !defined(_WIN_CE) && !defined(_XBOX) && !defined(_LINUX) +#if !defined(SFX_MODULE) && !defined(_WIN_CE) && !defined(_LINUX) void CommandData::ParseEnvVar() { char *EnvStr=getenv("RAR"); diff --git a/lib/UnrarXLib/consio.cpp b/lib/UnrarXLib/consio.cpp index 32dc975663..0ac32150d6 100644 --- a/lib/UnrarXLib/consio.cpp +++ b/lib/UnrarXLib/consio.cpp @@ -1,4 +1,4 @@ -#if !defined(_XBOX) && !defined(_LINUX) && !defined(_XBMC) +#if !defined(_LINUX) && !defined(_XBMC) #include "rar.hpp" #ifndef GUI @@ -291,10 +291,10 @@ void OutComment(char *Comment,int Size) #endif } -#else // _XBOX +#else void OutComment(char *Comment,int Size) { } -#endif // !_XBOX +#endif diff --git a/lib/UnrarXLib/crypt.cpp b/lib/UnrarXLib/crypt.cpp index 9020bc3ecf..192a82a6ab 100644 --- a/lib/UnrarXLib/crypt.cpp +++ b/lib/UnrarXLib/crypt.cpp @@ -201,7 +201,7 @@ void CryptData::SetCryptKeys(char *Password,byte *Salt,bool Encrypt,bool OldOnly Key[2]=0x7515A235L; Key[3]=0xA4E7F123L; memset(Psw,0,sizeof(Psw)); -#if defined(_WIN_32) && !defined(GUI) && !defined(_XBOX) && !defined(_LINUX) +#if defined(_WIN_32) && !defined(GUI) && !defined(_LINUX) CharToOemBuff(Password,(char*)Psw,strlen(Password)); #else strncpy((char *)Psw,Password,MAXPASSWORD-1); diff --git a/lib/UnrarXLib/errhnd.cpp b/lib/UnrarXLib/errhnd.cpp index 4415c0a60f..8f245886ac 100644 --- a/lib/UnrarXLib/errhnd.cpp +++ b/lib/UnrarXLib/errhnd.cpp @@ -265,8 +265,7 @@ extern "C" void _stdfunction ProcessSignal(int SigType) #endif { -//#ifdef _WIN_32 && !defined(_XBOX) -#if defined(_WIN_32) && !defined(_XBOX) && !defined(_LINUX) +#if defined(_WIN_32) && !defined(_LINUX) if (SigType==CTRL_LOGOFF_EVENT) return(TRUE); #endif @@ -281,7 +280,7 @@ void _stdfunction ProcessSignal(int SigType) #if defined(USE_RC) && !defined(SFX_MODULE) && !defined(_WIN_CE) ExtRes.UnloadDLL(); #endif -#if !defined(_XBOX) || !defined(_LINUX) +#if !defined(_LINUX) exit(USER_BREAK); #endif #ifdef _WIN_32 @@ -296,10 +295,7 @@ void ErrorHandler::SetSignalHandlers(bool Enable) EnableBreak=Enable; #if !defined(GUI) && !defined(_SFX_RTL_) #ifdef _WIN_32 -#ifndef _XBOX SetConsoleCtrlHandler(Enable ? ProcessSignal:NULL,TRUE); -#endif -// signal(SIGBREAK,Enable ? ProcessSignal:SIG_IGN); #else signal(SIGINT,Enable ? ProcessSignal:SIG_IGN); signal(SIGTERM,Enable ? ProcessSignal:SIG_IGN); diff --git a/lib/UnrarXLib/filcreat.cpp b/lib/UnrarXLib/filcreat.cpp index 27c1fda25e..35c9b1718d 100644 --- a/lib/UnrarXLib/filcreat.cpp +++ b/lib/UnrarXLib/filcreat.cpp @@ -53,11 +53,7 @@ bool FileCreate(RAROptions *Cmd,File *NewFile,char *Name,wchar *NameW, SrcFile.SetHandleType(FILE_HANDLESTD); int Size=SrcFile.Read(NewName,NM); NewName[Size]=0; -#ifdef _XBOX - lstrcpy(NewName, NewName); -#else OemToChar(NewName,NewName); -#endif #else if (!fgets(NewName,sizeof(NewName),stdin)) continue; diff --git a/lib/UnrarXLib/file.cpp b/lib/UnrarXLib/file.cpp index 7ce56aefde..ecc9047888 100644 --- a/lib/UnrarXLib/file.cpp +++ b/lib/UnrarXLib/file.cpp @@ -52,6 +52,8 @@ void File::operator = (File &SrcFile) bool File::Open(const char *Name,const wchar *NameW,bool OpenShared,bool Update) { + // Below commented code was left behind on spiffs request for possible later usage + /*ErrorType=FILE_SUCCESS; FileHandle hNewFile; if (File::OpenShared) @@ -146,6 +148,7 @@ bool File::WOpen(const char *Name,const wchar *NameW) bool File::Create(const char *Name,const wchar *NameW) { +// Below commented code was left behind on spiffs request for possible later usage /*#ifdef _WIN_32 #ifndef _XBOX if (WinNT() && NameW!=NULL && *NameW!=0) @@ -286,6 +289,7 @@ bool File::Rename(const char *NewName) void File::Write(const void *Data,int Size) { +// Below commented code was left behind on spiffs request for possible later usage /*if (Size==0) return; //#ifndef _WIN_CE @@ -417,6 +421,8 @@ int File::DirectRead(void *Data,int Size) #ifdef _WIN_32 const int MaxDeviceRead=20000; #endif +// Below commented code was left behind on spiffs request for possible later usage + //#ifndef _WIN_CE /*#if !defined(_WIN_CE) && !defined(_XBOX) if (HandleType==FILE_HANDLESTD) @@ -561,6 +567,8 @@ bool File::Truncate() void File::SetOpenFileTime(RarTime *ftm,RarTime *ftc,RarTime *fta) { #ifdef _WIN_32 +// Below commented code was left behind on spiffs request for possible later usage + /*bool sm=ftm!=NULL && ftm->IsSet(); bool sc=ftc!=NULL && ftc->IsSet(); bool sa=fta!=NULL && fta->IsSet(); diff --git a/lib/UnrarXLib/filefn.cpp b/lib/UnrarXLib/filefn.cpp index a794fc2150..116525986f 100644 --- a/lib/UnrarXLib/filefn.cpp +++ b/lib/UnrarXLib/filefn.cpp @@ -34,7 +34,7 @@ void SetDirTime(const char *Name,RarTime *ftm,RarTime *ftc,RarTime *fta) bool IsRemovable(const char *Name) { -#if defined(_XBOX) || defined(_LINUX) +#if defined(_LINUX) return false; //#ifdef _WIN_32 #elif defined(_WIN_32) @@ -54,7 +54,7 @@ bool IsRemovable(const char *Name) #ifndef SFX_MODULE Int64 GetFreeDisk(const char *Name) { -#if defined(_XBOX) || defined(_LINUX) +#if defined(_LINUX) char Root[NM]; GetPathRoot(Name,Root); @@ -146,7 +146,7 @@ Int64 GetFreeDisk(const char *Name) bool FileExist(const char *Name,const wchar *NameW) { #ifdef _WIN_32 -#if !defined(_XBOX) && !defined(_LINUX) +#if !defined(_LINUX) if (WinNT() && NameW!=NULL && *NameW!=0) return(GetFileAttributesW(NameW)!=0xffffffff); else @@ -242,7 +242,7 @@ void PrepareToDelete(const char *Name,const wchar *NameW) uint GetFileAttr(const char *Name,const wchar *NameW) { #ifdef _WIN_32 -#if !defined(_XBOX) && !defined(_LINUX) +#if !defined(_LINUX) if (WinNT() && NameW!=NULL && *NameW!=0) return(GetFileAttributesW(NameW)); else @@ -267,7 +267,7 @@ bool SetFileAttr(const char *Name,const wchar *NameW,uint Attr) { bool success; #ifdef _WIN_32 -#if !defined(_XBOX) && !defined(_LINUX) +#if !defined(_LINUX) if (WinNT() && NameW!=NULL && *NameW!=0) success=SetFileAttributesW(NameW,Attr)!=0; else @@ -290,7 +290,7 @@ void ConvertNameToFull(const char *Src,char *Dest) { #ifdef _WIN_32 //#ifndef _WIN_CE -#if !defined(_WIN_CE) && !defined(_XBOX) && !defined(_LINUX) +#if !defined(_WIN_CE) && !defined(_LINUX) char FullName[NM],*NamePtr; if (GetFullPathName(Src,sizeof(FullName),FullName,&NamePtr)) strcpy(Dest,FullName); @@ -329,7 +329,7 @@ void ConvertNameToFull(const wchar *Src,wchar *Dest) #endif { //#ifndef _WIN_CE -#if !defined(_WIN_CE) && !defined(_XBOX) && !defined(_LINUX) +#if !defined(_WIN_CE) && !defined(_LINUX) wchar FullName[NM],*NamePtr; if (GetFullPathNameW(Src,sizeof(FullName)/sizeof(FullName[0]),FullName,&NamePtr)) strcpyw(Dest,FullName); diff --git a/lib/UnrarXLib/filestr.cpp b/lib/UnrarXLib/filestr.cpp index 5bb8b3792e..571a71b419 100644 --- a/lib/UnrarXLib/filestr.cpp +++ b/lib/UnrarXLib/filestr.cpp @@ -113,7 +113,7 @@ bool ReadTextFile(char *Name,StringList *List,bool Config,bool AbortOnError, CurStr++; } } -#if defined(_WIN_32) && !defined(_XBOX) && !defined(_LINUX) +#if defined(_WIN_32) && !defined(_LINUX) if (ConvertToAnsi) OemToChar(CurStr,CurStr); #endif diff --git a/lib/UnrarXLib/find.cpp b/lib/UnrarXLib/find.cpp index 340c27b866..8f28bd4c5c 100644 --- a/lib/UnrarXLib/find.cpp +++ b/lib/UnrarXLib/find.cpp @@ -183,7 +183,7 @@ bool FindFile::FastFind(const char *FindMask,const wchar *FindMaskW,struct FindD #ifdef _WIN_32 HANDLE FindFile::Win32Find(HANDLE hFind,const char *Mask,const wchar *MaskW,struct FindData *fd) { -#if !defined(_XBOX) && !defined(_LINUX) +#if !defined(_LINUX) #ifndef _WIN_CE if (WinNT()) #endif @@ -237,7 +237,7 @@ HANDLE FindFile::Win32Find(HANDLE hFind,const char *Mask,const wchar *MaskW,stru } #ifndef _WIN_CE else -#endif //_XBOX +#endif { char CharMask[NM]; if (Mask!=NULL && *Mask!=0) diff --git a/lib/UnrarXLib/isnt.cpp b/lib/UnrarXLib/isnt.cpp index 4ea311ed77..493a9eb918 100644 --- a/lib/UnrarXLib/isnt.cpp +++ b/lib/UnrarXLib/isnt.cpp @@ -3,9 +3,6 @@ #ifdef _WIN_32 int WinNT() { -#ifdef _XBOX - return 0; -#else static int dwPlatformId=-1,dwMajorVersion; if (dwPlatformId==-1) { @@ -16,6 +13,5 @@ int WinNT() dwMajorVersion=WinVer.dwMajorVersion; } return(dwPlatformId==VER_PLATFORM_WIN32_NT ? dwMajorVersion:0); -#endif } #endif diff --git a/lib/UnrarXLib/os.hpp b/lib/UnrarXLib/os.hpp index ed32833020..a6889094b3 100644 --- a/lib/UnrarXLib/os.hpp +++ b/lib/UnrarXLib/os.hpp @@ -22,11 +22,6 @@ #define LITTLE_ENDIAN #define NM 1024 -#if defined(_XBOX) -#ifndef _WIN_32 -#define _WIN_32 -#endif //_WIN_32 -#endif //_XBOX #ifdef _WIN_32 //#define STRICT @@ -40,13 +35,11 @@ #define WIN32_LEAN_AND_MEAN #endif -#if !defined(_XBOX) + #include "system.h" #include <prsht.h> -#elif defined(_LINUX) +#if defined(_LINUX) #include "PlatformDefs.h" -#else -#include <xtl.h> #endif #endif diff --git a/lib/UnrarXLib/pathfn.cpp b/lib/UnrarXLib/pathfn.cpp index e49093ab50..e47d85d4c5 100644 --- a/lib/UnrarXLib/pathfn.cpp +++ b/lib/UnrarXLib/pathfn.cpp @@ -345,7 +345,7 @@ bool EnumConfigPaths(char *Path,int Number) #elif defined(_WIN_32) if (Number!=0) return(false); -#if !defined(_XBOX) && !defined(_LINUX) +#if !defined(_LINUX) GetModuleFileName(NULL,Path,NM); RemoveNameFromPath(Path); #endif diff --git a/lib/UnrarXLib/rar.cpp b/lib/UnrarXLib/rar.cpp index 288cc2c4b7..501a6095a4 100644 --- a/lib/UnrarXLib/rar.cpp +++ b/lib/UnrarXLib/rar.cpp @@ -12,44 +12,7 @@ extern "C" char **__crt0_glob_function (char *arg) { return 0; } extern "C" void __crt0_load_environment_file (char *progname) { } #endif -#if defined(_XBOX) && defined(__XBOX__TEST__) -void main(int argc, char *argv[]) -{ - ArchiveList_struct *list, *p; - urarlib_list(argv[1], &list, NULL); - - printf(" Name Size Packed OS FileTime "); - printf("CRC-32 Attr Ver Meth\n"); - printf(" ------------------------------------------------------"); - printf("--------------------\n"); - - p = list; - while (list) - { - if (list->item.NameSize < 23) - printf("%23s", list->item.Name); - else - printf("%23s", list->item.Name + (list->item.NameSize - 23)); - - printf("%9ld", list->item.UnpSize); - printf("%8ld", list->item.PackSize); - printf("%5d", list->item.HostOS); - printf("%10lx", list->item.FileTime); - printf("%10lx", list->item.FileCRC); - printf("%5ld", list->item.FileAttr); - printf("%4d", list->item.UnpVer); - printf("%5d", list->item.Method); - printf("\n"); - - list = list->next; - } - urarlib_freelist(p); - - int res = urarlib_get(argv[1], argv[2], argv[3], NULL); -} -#else - -#if !defined(GUI) && !defined(RARDLL) && !defined(_XBOX) && !defined(_LINUX) && !defined(_XBMC) +#if !defined(GUI) && !defined(RARDLL) && !defined(_LINUX) && !defined(_XBMC) int main(int argc, char *argv[]) { #ifdef _UNIX @@ -164,9 +127,8 @@ int main(int argc, char *argv[]) } #endif -#endif /* __XBOX__TEST__ */ -#if defined(_XBOX) || defined(_LINUX) || defined(_XBMC) +#if defined(_LINUX) || defined(_XBMC) /*-------------------------------------------------------------------------*\ XBOX interface \*-------------------------------------------------------------------------*/ @@ -471,4 +433,4 @@ void urarlib_freelist(ArchiveList_struct *list) } -#endif /* _XBOX */ +#endif diff --git a/lib/UnrarXLib/rar.hpp b/lib/UnrarXLib/rar.hpp index e972dc5fa9..bee2e46890 100644 --- a/lib/UnrarXLib/rar.hpp +++ b/lib/UnrarXLib/rar.hpp @@ -5,7 +5,6 @@ #include "os.hpp" -//#if defined(RARDLL) || defined(_XBOX) #ifdef RARDLL #include "dll.hpp" #endif diff --git a/lib/UnrarXLib/raros.hpp b/lib/UnrarXLib/raros.hpp index df4eb2303a..3483da3548 100644 --- a/lib/UnrarXLib/raros.hpp +++ b/lib/UnrarXLib/raros.hpp @@ -1,7 +1,7 @@ #ifndef _RAR_RAROS_ #define _RAR_RAROS_ -#if defined(_XBOX) || defined(_XBMC) +#if defined(_XBMC) #ifndef _WIN_32 #define _WIN_32 #endif diff --git a/lib/UnrarXLib/strfn.cpp b/lib/UnrarXLib/strfn.cpp index b3d31918ec..53749d44cf 100644 --- a/lib/UnrarXLib/strfn.cpp +++ b/lib/UnrarXLib/strfn.cpp @@ -22,7 +22,7 @@ char *IntNameToExt(const char *Name) void ExtToInt(const char *Src,char *Dest) { -#if defined(_WIN_32) && !defined(_XBOX) +#if defined(_WIN_32) CharToOem(Src,Dest); #else if (Dest!=Src) @@ -33,7 +33,7 @@ void ExtToInt(const char *Src,char *Dest) void IntToExt(const char *Src,char *Dest) { -#if defined(_WIN_32) && !defined(_XBOX) +#if defined(_WIN_32) OemToChar(Src,Dest); #else if (Dest!=Src) diff --git a/lib/UnrarXLib/system.cpp b/lib/UnrarXLib/system.cpp index e53199b51e..ab2eb73a48 100644 --- a/lib/UnrarXLib/system.cpp +++ b/lib/UnrarXLib/system.cpp @@ -19,32 +19,7 @@ void InitSystemOptions(int SleepTime) void SetPriority(int Priority) { -#ifdef _XBOX - int PriorityLevel; - if (Priority<1 || Priority>15) - return; - if (Priority==1) - { - PriorityLevel=THREAD_PRIORITY_IDLE; - } - else - if (Priority<7) - { - PriorityLevel=Priority-4; - } - else - if (Priority<11) - { - PriorityLevel=Priority-9; - } - else - { - PriorityLevel=Priority-13; - } - SetThreadPriority(GetCurrentThread(),PriorityLevel); - -//#ifdef _WIN_32 -#elif defined(_WIN_32) +#if defined(_WIN_32) uint PriorityClass; int PriorityLevel; if (Priority<1 || Priority>15) diff --git a/lib/UnrarXLib/unicode.cpp b/lib/UnrarXLib/unicode.cpp index 3125d526f2..89e63fd452 100644 --- a/lib/UnrarXLib/unicode.cpp +++ b/lib/UnrarXLib/unicode.cpp @@ -367,7 +367,7 @@ SupportDBCS::SupportDBCS() void SupportDBCS::Init() { -#if defined(_XBOX) || defined(_LINUX) +#if defined(_LINUX) DBCSMode = true; for (int I=0;I<sizeof(IsLeadByte)/sizeof(IsLeadByte[0]);I++) IsLeadByte[I]=true; |