Changeset 21737 for branches/gcc-kmk/src


Ignore:
Timestamp:
Oct 24, 2011, 9:23:36 PM (14 years ago)
Author:
dmik
Message:

Common compiler warnings and errors.

Location:
branches/gcc-kmk/src/kernel32
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/kernel32/atom.cpp

    r10251 r21737  
    2121#include <misc.h>
    2222
     23#ifdef __GNUC__
     24#include <alloca.h>
     25#endif
     26
    2327#define DBG_LOCALLOG    DBG_atom
    2428#include "dbglocal.h"
  • branches/gcc-kmk/src/kernel32/conprop2.cpp

    r5308 r21737  
    268268                               szKey,
    269269                               0,
    270                                "",
     270                               NULL,
    271271                               0,
    272272                               KEY_ALL_ACCESS,
  • branches/gcc-kmk/src/kernel32/cpu.cpp

    r21343 r21737  
    2828
    2929static BYTE PF[64]          = {0,};
    30 static nrCPUs               = 1;
     30static int nrCPUs           = 1;
    3131static SYSTEM_INFO cachedsi = {0};
    3232
     
    5353 * Note that there is a hierarchy for every processor installed, so this
    5454 * supports multiprocessor systems. This is done like Win95 does it, I think.
    55  *                                                     
     55 *
    5656 * It also creates a cached flag array for IsProcessorFeaturePresent().
    5757 *
     
    104104        }
    105105
    106         if(SupportsCPUID()) 
     106        if(SupportsCPUID())
    107107        {
    108             for(int i=0;i<cachedsi.dwNumberOfProcessors;i++) 
     108            for(int i=0;i<cachedsi.dwNumberOfProcessors;i++)
    109109            {
    110110                // Create a new processor subkey
     
    153153
    154154                                        Sleep(32);      //sleep for about 32 ms
    155                                        
     155
    156156                                        GetTSC((LONG *)&tsc2.LowPart, &tsc2.HighPart);
    157157                                        QueryPerformanceCounter(&time2);
     
    167167                                        tmp1 = (double)tsc1.LowPart + (double)tsc1.HighPart*4.0*1024.0*1024.0;
    168168                                        clockticks = tmp - tmp1;
    169                                         if(millisec > 0) 
     169                                        if(millisec > 0)
    170170                                        {//make sure we have something valid here
    171171                                                tmp = 1000 / millisec;
     
    199199                if (features & CPUID_FPU_PRESENT) {
    200200                        if (i == 0) {
    201                                 if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS) 
     201                                if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"HARDWARE\\DESCRIPTION\\System\\FloatingPointProcessor",&fpukey)!=ERROR_SUCCESS)
    202202                                        dprintf(("Unable to register FPU information\n"));
    203203                        }
     
    208208                        }
    209209                }
    210        
     210
    211211           } //for each cpu
    212212        }
  • branches/gcc-kmk/src/kernel32/directory.cpp

    r21720 r21737  
    3030#include <os2win.h>
    3131#include <stdlib.h>
     32#include <string.h>
     33#ifdef __GNUC__
     34#include <alloca.h>
     35#endif
    3236#include <unicode.h>
    3337#include <heapstring.h>
     
    3539#include "initterm.h"
    3640#include <win/file.h>
    37 #include <string.h>
    3841#include "oslibdos.h"
    3942#include "profile.h"
     
    204207       (len != 1) )
    205208  {
    206     LPSTR lpTemp = (LPSTR)_alloca(len);
     209    LPSTR lpTemp = (LPSTR)alloca(len);
    207210    lstrcpynA(lpTemp,
    208211              lpstrDirectory,
     
    269272       (lpstrDirectory[len - 1] == '/') )
    270273  {
    271     LPSTR lpTemp = (LPSTR)_alloca(len);
     274    LPSTR lpTemp = (LPSTR)alloca(len);
    272275    lstrcpynA(lpTemp,
    273276              lpstrDirectory,
     
    533536       (lpstrDirectory[len - 1] == '/') )
    534537  {
    535     LPSTR lpTemp = (LPSTR)_alloca(len);
     538    LPSTR lpTemp = (LPSTR)alloca(len);
    536539    lstrcpynA(lpTemp,
    537540              lpstrDirectory,
  • branches/gcc-kmk/src/kernel32/dosdevice.cpp

    r21355 r21737  
    99 * Copyright 1993 Erik Bos
    1010 * Copyright 1996 Alexandre Julliard
    11  * 
     11 *
    1212 * Project Odin Software License can be found in LICENSE.TXT
    1313 *
     
    2424#include <os2win.h>
    2525#include <stdio.h>
     26#include <string.h>
    2627#include <winnls.h>
    2728#include "unicode.h"
    2829#include "handlemanager.h"
    2930#include "handlenames.h"
    30 #include <string.h>
    3131
    3232
     
    150150        }
    151151        *ptr = 0;
    152        
     152
    153153        SetLastError(ERROR_SUCCESS);
    154154        return sizeof(devices)+len;
     
    176176        if(devname[1] == ':' && devname[2] == 0) {
    177177            int ret = GetDriveTypeA(devname);
    178             if(ret != DRIVE_UNKNOWN) 
     178            if(ret != DRIVE_UNKNOWN)
    179179            {
    180180                if(bufsize < 16) {
  • branches/gcc-kmk/src/kernel32/ordinals.cpp

    r6646 r21737  
    1313 *****************************************************************************/
    1414#include <os2win.h>
     15#include <string.h>
    1516#include <winnls.h>
    1617#include "unicode.h"
    1718#include "handlemanager.h"
    18 #include <string.h>
    1919
    2020#include "stubs.h"
  • branches/gcc-kmk/src/kernel32/osliblvm.cpp

    r21720 r21737  
    356356        return volinfo;
    357357    }
    358     for(int i=0;i<volctrl->Count;i++) {
     358    int i;
     359    for(i=0;i<volctrl->Count;i++) {
    359360        volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror);
    360361        if(*lasterror != LVM_ENGINE_NO_ERROR) {
     
    394395        return volinfo;
    395396    }
    396     for(int i=0;i<volctrl->Count;i++) {
     397    int i;
     398    for(i=0;i<volctrl->Count;i++) {
    397399        volinfo = Get_Volume_Information(volctrl->Volume_Control_Data[i].Volume_Handle, lasterror);
    398400        if(*lasterror != LVM_ENGINE_NO_ERROR) {
     
    499501        return FALSE;
    500502    }
    501     for(int i=0;i<diskinfo.Count;i++) {
     503    int i;
     504    for(i=0;i<diskinfo.Count;i++) {
    502505        if(diskinfo.Drive_Control_Data[i].Drive_Handle == partctrl.Partition_Array[0].Drive_Handle) {
    503506            //win32 base = 0, os2 base = 1
  • branches/gcc-kmk/src/kernel32/stubs.cpp

    r21324 r21737  
    1515 *****************************************************************************/
    1616#include <os2win.h>
     17#include <string.h>
    1718#include <winnls.h>
    1819#include "unicode.h"
    1920#include "handlemanager.h"
    20 #include <string.h>
    2121
    2222#include "stubs.h"
  • branches/gcc-kmk/src/kernel32/windlllx.cpp

    r21716 r21737  
    2424#include <string.h>
    2525#include <stdlib.h>
     26#ifndef __GNUC__
    2627#include <iostream.h>
    2728#include <fstream.h>
     29#endif
    2830#include <misc.h>
    2931#include <win32type.h>
  • branches/gcc-kmk/src/kernel32/windllpeldr.cpp

    r21716 r21737  
    2121#include <string.h>
    2222#include <stdlib.h>
     23#ifndef __GNUC__
    2324#include <iostream.h>
    2425#include <fstream.h>
     26#endif
    2527#include <misc.h>
    2628#include <win32type.h>
  • branches/gcc-kmk/src/kernel32/winexelx.cpp

    r21716 r21737  
    1919#include <string.h>
    2020#include <stdlib.h>
     21#ifndef __GNUC__
    2122#include <iostream.h>
    2223#include <fstream.h>
     24#endif
    2325#include <misc.h>
    2426#include <win32type.h>
  • branches/gcc-kmk/src/kernel32/winexepeldr.cpp

    r21716 r21737  
    1919#include <string.h>
    2020#include <stdlib.h>
     21#ifndef __GNUC__
    2122#include <iostream.h>
    2223#include <fstream.h>
     24#endif
    2325#include <misc.h>
    2426#include <win32type.h>
     
    5355//Called by ring 3 pe loader to create win32 executable
    5456//PE.EXE command line options:
    55 //   /OPT:[x1=y,x2=z,..]         
     57//   /OPT:[x1=y,x2=z,..]
    5658//   x = CURDIR    -> set current directory to y
    5759//   (not other options available at this time)
    5860//******************************************************************************
    5961DWORD WIN32API CreateWin32PeLdrExe(char *szFileName, char *szCmdLine,
    60                                    char *peoptions, 
     62                                   char *peoptions,
    6163                                   ULONG reservedMem, ULONG ulPEOffset,
    6264                                   BOOL fConsoleApp, BOOL fVioConsole,
     
    118120  free(szFullCmdLine);
    119121
    120   //Init console before loading executable as dlls might want to print 
     122  //Init console before loading executable as dlls might want to print
    121123  //something on the console while being loaded
    122   if(WinExe->isConsoleApp()) 
     124  if(WinExe->isConsoleApp())
    123125  {
    124126      dprintf(("Console application!\n"));
     
    142144  }
    143145  OS2UnsetExceptionHandler(&exceptFrame);
    144  
     146
    145147#ifdef PROFILE
    146148  // Note: after this point, we might start collecting performance
     
    150152  ProfilerEnable(TRUE);
    151153#endif /* PROFILE */
    152  
    153  
     154
     155
    154156  WinExe->start();
    155157
  • branches/gcc-kmk/src/kernel32/winimgres.cpp

    r21716 r21737  
    3737#define MAX_RES 17
    3838typedef struct {
    39   char *typename;
    40   int   namelen;
     39  const char *typenam;
     40  int namelen;
    4141} STD_RESTYPE;
    4242
     
    131131    typelen = strlen(lpszType);
    132132
    133         for(int i=0;i<MAX_RES;i++) {
     133        int i;
     134        for(i=0;i<MAX_RES;i++) {
    134135            if(ResType[i].namelen &&
    135136               ResType[i].namelen == typelen &&
    136                stricmp(lpszType, ResType[i].typename) == 0)
     137               stricmp(lpszType, ResType[i].typenam) == 0)
    137138                    break;
    138139        }
     
    186187    typelen = strlen(astring1);
    187188
    188         for(int i=0;i<MAX_RES;i++) {
     189        int i;
     190        for(i=0;i<MAX_RES;i++) {
    189191            if(ResType[i].namelen &&
    190192               ResType[i].namelen == typelen &&
    191                stricmp(astring1, ResType[i].typename) == 0)
     193               stricmp(astring1, ResType[i].typenam) == 0)
    192194                    break;
    193195        }
     
    603605            pstring = (PIMAGE_RESOURCE_DIR_STRING_U)((ULONG)pResRootDir + nameOffset);
    604606            int len = lstrlenWtoA( pstring->NameString, pstring->Length );
    605             char *typename = (char *)malloc( len + 1 );
    606             lstrcpynWtoA(typename, pstring->NameString, len + 1 );
    607             typename[len] = 0;
    608 
    609         fRet = lpEnumFunc(hmod, typename, lParam);
    610             free(typename);
     607            char *typenam = (char *)malloc( len + 1 );
     608            lstrcpynWtoA(typenam, pstring->NameString, len + 1 );
     609            typenam[len] = 0;
     610
     611        fRet = lpEnumFunc(hmod, typenam, lParam);
     612            free(typenam);
    611613        }
    612614        else {
Note: See TracChangeset for help on using the changeset viewer.