Changeset afe75c32b3832a99d89ac7f2d789130d3fde21e9

Show
Ignore:
Timestamp:
02/24/10 15:22:07 (5 months ago)
Author:
Tobias Bieniek <Tobias.Bieniek@…>
Parents:
1524164f078bcf60de07521a278132e7ff06e79f
Children:
4dad3c770c382907aac2d8e8d65238358ac4811b
git-committer:
Tobias Bieniek <Tobias.Bieniek@gmx.de> / 2010-02-24T13:22:07Z+0100
Message:

UtilsSystem?: Corrected Format and Indentation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/UtilsSystem.cpp

    r11517a rafe75c  
    7272 
    7373#ifdef WINDOWSPC 
    74 int SCREENWIDTH=640; 
    75 int SCREENHEIGHT=480; 
     74int SCREENWIDTH = 640; 
     75int SCREENHEIGHT = 480; 
    7676#endif 
    7777 
    7878long CheckFreeRam(void) { 
    7979#ifdef WIN32 
    80   MEMORYSTATUS    memInfo; 
     80  MEMORYSTATUS memInfo; 
    8181  // Program memory 
    8282  memInfo.dwLength = sizeof(memInfo); 
     
    103103#ifdef WINDOWSPC 
    104104#ifdef _DEBUG 
    105   _CrtMemCheckpoint( &memstate_s1 ); 
     105  _CrtMemCheckpoint(&memstate_s1); 
    106106#endif 
    107107#endif 
     
    114114 
    115115   // Store a 2nd memory checkpoint in s2 
    116    _CrtMemCheckpoint( &memstate_s2 ); 
    117  
    118    if ( _CrtMemDifference( &memstate_s3, &memstate_s1, &memstate_s2 ) ) { 
    119      _CrtMemDumpStatistics( &memstate_s3 ); 
     116   _CrtMemCheckpoint(&memstate_s2); 
     117 
     118   if ( _CrtMemDifference(&memstate_s3, &memstate_s1, &memstate_s2)) { 
     119     _CrtMemDumpStatistics(&memstate_s3); 
    120120     _CrtMemDumpAllObjectsSince(&memstate_s1); 
    121121   } 
     
    131131void MyCompactHeaps() { 
    132132#ifdef WIN32 
    133 #if defined(WINDOWSPC)||(defined(GNAV) && !defined(__GNUC__)) 
    134   HeapCompact(GetProcessHeap(),0); 
     133#if defined(WINDOWSPC) || (defined(GNAV) && !defined(__GNUC__)) 
     134  HeapCompact(GetProcessHeap(), 0); 
    135135#else 
    136136  typedef DWORD (_stdcall *CompactAllHeapsFn) (void); 
    137137  static CompactAllHeapsFn CompactAllHeaps = NULL; 
    138   static bool init=false; 
     138  static bool init = false; 
    139139  if (!init) { 
    140140    // get the pointer to the function 
    141     CompactAllHeaps = (CompactAllHeapsFn) 
    142       GetProcAddress(LoadLibrary(_T("coredll.dll")), 
    143                      _T("CompactAllHeaps")); 
    144     init=true; 
    145   } 
    146   if (CompactAllHeaps) { 
     141    CompactAllHeaps = (CompactAllHeapsFn)GetProcAddress( 
     142        LoadLibrary(_T("coredll.dll")), _T("CompactAllHeaps")); 
     143    init = true; 
     144  } 
     145  if (CompactAllHeaps) 
    147146    CompactAllHeaps(); 
    148   } 
    149147#endif 
    150148#endif /* WIN32 */ 
     
    167165  ULARGE_INTEGER TotalNumberOfFreeBytes; 
    168166  if (GetDiskFreeSpaceEx(path, 
    169                         &FreeBytesAvailableToCaller, 
    170                         &TotalNumberOfBytes, 
    171                         &TotalNumberOfFreeBytes)) { 
    172     return FreeBytesAvailableToCaller.LowPart/1024; 
     167                        &FreeBytesAvailableToCaller, 
     168                        &TotalNumberOfBytes, 
     169                        &TotalNumberOfFreeBytes)) { 
     170    return FreeBytesAvailableToCaller.LowPart / 1024; 
    173171  } else 
    174172    return 0; 
     
    199197} 
    200198 
    201 bool RotateScreen() { 
     199bool 
     200RotateScreen() 
     201{ 
    202202#ifdef DM_DISPLAYORIENTATION 
    203203  // 
     
    468468 * max brightness and no timeout if on power is the rule. Otherwise, do it manually.. 
    469469 */ 
    470 bool SetBacklight() 
     470bool 
     471SetBacklight() 
    471472{ 
    472473  HKEY hKey; 
     
    628629bool CheckDataDir() { 
    629630        TCHAR srcdir[MAX_PATH]; 
    630  
    631         _stprintf(srcdir,_T("%s%S"),gmfpathname(), XCSDATADIR ); 
    632         if (  GetFileAttributes(srcdir) != FILE_ATTRIBUTE_DIRECTORY) return false; 
     631  _stprintf(srcdir, _T("%s%S"), gmfpathname(), XCSDATADIR); 
     632 
     633  if (GetFileAttributes(srcdir) != FILE_ATTRIBUTE_DIRECTORY) 
     634          return false; 
    633635        return true; 
    634636} 
     
    644646bool CheckRegistryProfile() { 
    645647        TCHAR srcpath[MAX_PATH]; 
    646         if ( GlobalModelType == MODELTYPE_PNA_HP31X ) return false; 
    647         _stprintf(srcpath,_T("%s%S\\%S"),gmfpathname(), XCSDATADIR , XCSPROFILE); 
    648         if (  GetFileAttributes(srcpath) == 0xffffffff) return false; 
     648        if (GlobalModelType == MODELTYPE_PNA_HP31X) 
     649          return false; 
     650 
     651        _stprintf(srcpath,_T("%s%S\\%S"),gmfpathname(), XCSDATADIR , XCSPROFILE); 
     652 
     653        if (GetFileAttributes(srcpath) == 0xffffffff) 
     654          return false; 
    649655        return true; 
    650656} 
     
    656662 * @param CommandLine not in use 
    657663 */ 
    658 void ParseCommandLine(LPCTSTR CommandLine) { 
     664void 
     665ParseCommandLine(LPCTSTR CommandLine) 
     666{ 
    659667  TCHAR extrnProfileFile[MAX_PATH]; 
    660668  extrnProfileFile[0] = 0; 
     
    682690 
    683691  pC = _tcsstr(CommandLine, _T("-profile=")); 
    684   if (pC != NULL){ 
     692  if (pC != NULL) { 
    685693    pC += strlen("-profile="); 
    686     if (*pC == '"'){ 
     694    if (*pC == '"') { 
    687695      pC++; 
    688696      pCe = pC; 
    689       while (*pCe != '"' && *pCe != '\0') pCe++; 
    690     } else{ 
     697      while (*pCe != '"' && *pCe != '\0') 
     698        pCe++; 
     699    } else { 
    691700      pCe = pC; 
    692       while (*pCe != ' ' && *pCe != '\0') pCe++; 
     701      while (*pCe != ' ' && *pCe != '\0') 
     702        pCe++; 
    693703    } 
    694     if (pCe != NULL && pCe-1 > pC){ 
    695  
    696       _tcsncpy(extrnProfileFile, pC, pCe-pC); 
    697       extrnProfileFile[pCe-pC] = '\0'; 
     704    if (pCe != NULL && pCe - 1 > pC) { 
     705      _tcsncpy(extrnProfileFile, pC, pCe - pC); 
     706      extrnProfileFile[pCe - pC] = '\0'; 
    698707    } 
    699708  } 
     709 
    700710#ifdef WINDOWSPC 
    701711  pC = _tcsstr(CommandLine, _T("-800x480")); 
     
    774784 
    775785  if (GlobalModelType == MODELTYPE_PNA_HP31X) { 
    776       //                if (wParam == 0x7b) wParam=0xc1;  // VK_APP1 
     786      /* 
     787      if (wParam == 0x7b) 
     788        // VK_APP1 
     789        wParam = 0xc1; 
     790      */ 
     791 
    777792      if (wParam == 0x7b) 
    778793        // VK_ESCAPE 
    779794        wParam = 0x1b; 
    780       //                if (wParam == 0x7b) wParam=0x27;  // VK_RIGHT 
    781       //                if (wParam == 0x7b) wParam=0x25;  // VK_LEFT 
     795 
     796      /* 
     797      if (wParam == 0x7b) 
     798        // VK_RIGHT 
     799        wParam = 0x27; 
     800      if (wParam == 0x7b) 
     801        // VK_LEFT 
     802        wParam=0x25; 
     803      */ 
    782804  } else if (GlobalModelType == MODELTYPE_PNA_PN6000) { 
    783805    switch(wParam) {