Changeset 21916 for trunk/src/winmm


Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
14 deleted
26 edited
8 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/winmm/IRTMidi.cpp

    r5269 r21916  
    9393  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDICreateInstance", &modAddr );
    9494  if ( rc ) return rc;
    95   pfnMidiCreateInstance =  (ULONG(*APIENTRY )( ULONG, MINSTANCE*, PSZ, ULONG)) modAddr;
     95  pfnMidiCreateInstance =  (ULONG(APIENTRY *)( ULONG, MINSTANCE*, PCSZ, ULONG)) modAddr;
    9696
    9797  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIDeleteInstance", &modAddr );
    9898  if ( rc ) return rc;
    99   pfnMidiDeleteInstance =  (ULONG(*APIENTRY )(MINSTANCE, ULONG)) modAddr;
     99  pfnMidiDeleteInstance =  (ULONG(APIENTRY *)(MINSTANCE, ULONG)) modAddr;
    100100
    101101  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIEnableInstance", &modAddr );
    102102  if ( rc ) return rc;
    103   pfnMidiEnableInstance =  (ULONG(*APIENTRY )(MINSTANCE, ULONG)) modAddr;
     103  pfnMidiEnableInstance =  (ULONG(APIENTRY *)(MINSTANCE, ULONG)) modAddr;
    104104
    105105  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIDisableInstance", &modAddr );
    106106  if ( rc ) return rc;
    107   pfnMidiDisableInstance = (ULONG(*APIENTRY )(MINSTANCE, ULONG)) modAddr;
     107  pfnMidiDisableInstance = (ULONG(APIENTRY *)(MINSTANCE, ULONG)) modAddr;
    108108
    109109  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIAddLink", &modAddr );
    110110  if ( rc ) return rc;
    111   pfnMidiAddLink =         (ULONG(*APIENTRY )(MINSTANCE, MINSTANCE, ULONG, ULONG)) modAddr;
     111  pfnMidiAddLink =         (ULONG(APIENTRY *)(MINSTANCE, MINSTANCE, ULONG, ULONG)) modAddr;
    112112
    113113  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIRemoveLink", &modAddr );
    114114  if ( rc ) return rc;
    115   pfnMidiRemoveLink =      (ULONG(*APIENTRY )(MINSTANCE, MINSTANCE, ULONG, ULONG)) modAddr;
     115  pfnMidiRemoveLink =      (ULONG(APIENTRY *)(MINSTANCE, MINSTANCE, ULONG, ULONG)) modAddr;
    116116
    117117  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIQueryClassList", &modAddr );
    118118  if ( rc ) return rc;
    119   pfnMidiQueryClassList    = (ULONG(*APIENTRY )(ULONG, PMIDICLASSINFO, ULONG)) modAddr;
     119  pfnMidiQueryClassList    = (ULONG(APIENTRY *)(ULONG, PMIDICLASSINFO, ULONG)) modAddr;
    120120
    121121  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIQueryInstanceList", &modAddr );
    122122  if ( rc ) return rc;
    123   pfnMidiQueryInstanceList = (ULONG(*APIENTRY )(ULONG, PMIDIINSTANCEINFO, ULONG)) modAddr;
     123  pfnMidiQueryInstanceList = (ULONG(APIENTRY *)(ULONG, PMIDIINSTANCEINFO, ULONG)) modAddr;
    124124
    125125  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIQueryNumClasses", &modAddr );
    126126  if ( rc ) return rc;
    127   pfnMidiQueryNumClasses   = (ULONG(*APIENTRY )(PULONG, ULONG)) modAddr;
     127  pfnMidiQueryNumClasses   = (ULONG(APIENTRY *)(PULONG, ULONG)) modAddr;
    128128
    129129  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIQueryNumInstances", &modAddr );
    130130  if ( rc ) return rc;
    131   pfnMidiQueryNumInstances = (ULONG(*APIENTRY )(PULONG, ULONG)) modAddr;
     131  pfnMidiQueryNumInstances = (ULONG(APIENTRY *)(PULONG, ULONG)) modAddr;
    132132
    133133  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDISendMessages", &modAddr );
    134134  if ( rc ) return rc;
    135   pfnMidiSendMessages      = (ULONG(*APIENTRY )(PMESSAGE, ULONG, ULONG)) modAddr;
     135  pfnMidiSendMessages      = (ULONG(APIENTRY *)(PMESSAGE, ULONG, ULONG)) modAddr;
    136136
    137137  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDISendSysexMessage", &modAddr );
    138138  if ( rc ) return rc;
    139   pfnMidiSendSysexMessage  = (ULONG(*APIENTRY )(PMESSAGE, ULONG, ULONG)) modAddr;
     139  pfnMidiSendSysexMessage  = (ULONG(APIENTRY *)(PMESSAGE, ULONG, ULONG)) modAddr;
    140140
    141141  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDIRetrieveMessages", &modAddr );
    142142  if ( rc ) return rc;
    143   pfnMidiRetrieveMessages  = (ULONG(*APIENTRY )(MINSTANCE, PVOID, PULONG, ULONG)) modAddr;
     143  pfnMidiRetrieveMessages  = (ULONG(APIENTRY *)(MINSTANCE, PVOID, PULONG, ULONG)) modAddr;
    144144
    145145  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDISetup", &modAddr );
    146146  if ( rc ) return rc;
    147   pfnMidiSetup             = (ULONG(*APIENTRY)(PMIDISETUP, ULONG)) modAddr;
     147  pfnMidiSetup             = (ULONG(APIENTRY *)(PMIDISETUP, ULONG)) modAddr;
    148148
    149149  rc = DosQueryProcAddr( iRTMidiModule, 0L, "MIDITimer", &modAddr );
    150150  if ( rc ) return rc;
    151   pfnMidiTimer             = (ULONG(*APIENTRY )(ULONG, ULONG)) modAddr;
     151  pfnMidiTimer             = (ULONG(APIENTRY *)(ULONG, ULONG)) modAddr;
    152152
    153153  return 0;
     
    177177// IRTMidi :: RCExplanation
    178178//------------------------------------------------------------------------------
    179 char * IRTMidi::RCExplanation() const
    180 {
    181    char * DebugString;
     179const char * IRTMidi::RCExplanation() const
     180{
     181   const char * DebugString;
    182182   switch( iLastRC )
    183183   {
     
    460460}
    461461
    462 ULONG IRTMidi::MidiCreateInstance( ULONG a, MINSTANCE* b, PSZ c, ULONG d)
     462ULONG IRTMidi::MidiCreateInstance( ULONG a, MINSTANCE* b, PCSZ c, ULONG d)
    463463{
    464464  ULONG ret;
  • trunk/src/winmm/auxos2.cpp

    r7196 r21916  
    2828
    2929#include "auxiliary.h"
    30 #include "initwinmm.h"
     30#include "initterm.h"
    3131
    3232#define DBG_LOCALLOG    DBG_auxos2
  • trunk/src/winmm/dbglocal.cpp

    r21358 r21916  
    1919USHORT DbgEnabledLvl2WINMM[DBG_MAXFILES] = {0};
    2020
    21 static char  *DbgFileNames[DBG_MAXFILES] =
     21static const char  *DbgFileNames[DBG_MAXFILES] =
    2222{
    2323"os2timer",
  • trunk/src/winmm/irtmidi.hpp

    r5269 r21916  
    8787  unsigned long   hardwareClass() const
    8888                  { return iHardwareClass; };
    89   char *          RCExplanation() const;
     89  const char *    RCExplanation() const;
    9090  static IRTMidi* instance();
    9191  static void     shutdown();
     
    103103
    104104  // Methods for calls to RTMIDI functions
    105   ULONG (*APIENTRY pfnMidiCreateInstance)    ( ULONG, MINSTANCE*, PSZ, ULONG );
     105  ULONG (*APIENTRY pfnMidiCreateInstance)    ( ULONG, MINSTANCE*, PCSZ, ULONG );
    106106  ULONG (*APIENTRY pfnMidiDeleteInstance)    ( MINSTANCE, ULONG );
    107107  ULONG (*APIENTRY pfnMidiEnableInstance)    ( MINSTANCE, ULONG );
     
    119119  ULONG (*APIENTRY pfnMidiTimer)             ( ULONG, ULONG );
    120120
    121   ULONG MidiCreateInstance    ( ULONG, MINSTANCE*, PSZ, ULONG );
     121  ULONG MidiCreateInstance    ( ULONG, MINSTANCE*, PCSZ, ULONG );
    122122  ULONG MidiDeleteInstance    ( MINSTANCE, ULONG );
    123123  ULONG MidiEnableInstance    ( MINSTANCE, ULONG );
  • trunk/src/winmm/mci.cpp

    r10410 r21916  
    157157{
    158158  dprintf(("WINMM:mciGetErrorStringA(%d)\n", mcierr ));
    159   char * theMsg = getWinmmMsg( mcierr );
     159  const char * theMsg = getWinmmMsg( mcierr );
    160160  if ( theMsg )
    161161    strncpy( pszText, theMsg, cchText );
     
    184184{
    185185  dprintf(("WINMM:mciGetErrorStringW(%d)\n", mcierr ));
    186   char * theMsg = getWinmmMsg( mcierr );
     186  const char * theMsg = getWinmmMsg( mcierr );
    187187  if ( theMsg )
    188188    AsciiToUnicodeN( theMsg, pszText, cchText );
  • trunk/src/winmm/mcicda/cdrom.cpp

    r5005 r21916  
    1515#include <string.h>
    1616
    17 /* 
     17/*
    1818 * FIXME: Should use the right errorcodes for SetLastError if a function fails.
    1919*/
     
    3232  if(strlen(wcda->chrDrive)==2) {
    3333      if((wcda->hfOS2Handle=os2CDOpen(wcda->chrDrive))==NULL) {
    34           SetLastError(ERROR_WRONG_DISK); 
     34          SetLastError(ERROR_WRONG_DISK);
    3535          /* We always return TRUE because we want to open the driver not the disk */
    3636      }
     
    3838  }
    3939
    40   if(!strcmpi(wcda->chrDeviceType,"cdaudio")) {
     40  if(!stricmp(wcda->chrDeviceType,"cdaudio")) {
    4141      /* We try any CDROM in the system until one can be opened */
    4242      if(!os2CDQueryCDDrives(&iNumCD,  chrFirstCD)) {
    43           SetLastError(ERROR_WRONG_DISK); 
     43          SetLastError(ERROR_WRONG_DISK);
    4444          return FALSE;/* Can't get drives in system */
    4545      }
    46      
     46
    4747      chrFirstCD[1]=':';
    4848      for(i=0;i<iNumCD;i++) {
    4949          chrFirstCD[0]++;
    50           if((wcda->hfOS2Handle=os2CDOpen(chrFirstCD))!=NULL) {     
     50          if((wcda->hfOS2Handle=os2CDOpen(chrFirstCD))!=NULL) {
    5151              return TRUE;
    5252          }
    5353      }
    5454      SetLastError(ERROR_WRONG_DISK);
    55       /* We always return TRUE because we want to open the driver not the disk */ 
    56       /* Can't open CD */     
     55      /* We always return TRUE because we want to open the driver not the disk */
     56      /* Can't open CD */
    5757  }
    5858  /* We always return TRUE because we want to open the driver not the disk */
     
    6363{
    6464    ULONG rc;
    65    
     65
    6666    dprintf(("MCICDA-CDROM: CDAUDIO_Close: Closing drive: %s...\n",wcda->chrDrive));
    67    
     67
    6868    if(wcda->hfOS2Handle==NULL) {
    6969        SetLastError(ERROR_INVALID_PARAMETER);
    7070        return FALSE;
    7171    }
    72    
     72
    7373  if((rc=os2CDClose(wcda->hfOS2Handle))!=0) {
    7474      dprintf(("MCICDA-CDROM: CDAUDIO_Close:rc=%d \n",rc));
     
    160160        }
    161161    }
    162    
     162
    163163    os2CDSeek(wcda->hfOS2Handle, at);
    164164    return 0;
     
    177177        }
    178178    }
    179      
     179
    180180    CDAUDIO_Stop(wcda);
    181181    if(open) {
     
    190190
    191191/******************************************/
    192 /* Result: 
     192/* Result:
    193193         0:   Error
    194194         -1: CD is Data Disk
     
    215215            return -1;
    216216        case 0:
    217             SetLastError(ERROR_WRONG_DISK); 
     217            SetLastError(ERROR_WRONG_DISK);
    218218            return 1;
    219219        default:
     
    243243        }
    244244    }
    245    
     245
    246246    if (wcda->nTracks == 0) {
    247247        if (CDAUDIO_GetNumberOfTracks(wcda) <= 0)
    248248            return FALSE;
    249249    }
    250    
     250
    251251    TRACE("nTracks=%u\n", wcda->nTracks);
    252    
     252
    253253    SetLastError(ERROR_INVALID_PARAMETER);
    254    
    255     if (wcda->lpdwTrackLen != NULL) 
     254
     255    if (wcda->lpdwTrackLen != NULL)
    256256        free(wcda->lpdwTrackLen);
    257257    wcda->lpdwTrackLen = (LPDWORD)malloc((wcda->nTracks + 1) * sizeof(DWORD));
    258     if (wcda->lpdwTrackPos != NULL) 
     258    if (wcda->lpdwTrackPos != NULL)
    259259        free(wcda->lpdwTrackPos);
    260260    wcda->lpdwTrackPos = (LPDWORD)malloc((wcda->nTracks + 1) * sizeof(DWORD));
     
    262262        free(wcda->lpbTrackFlags);
    263263    wcda->lpbTrackFlags = (LPBYTE)malloc((wcda->nTracks + 1) * sizeof(BYTE));
    264    
     264
    265265    if (wcda->lpdwTrackLen == NULL || wcda->lpdwTrackPos == NULL ||
    266266        wcda->lpbTrackFlags == NULL) {
    267267        WARN("error allocating track table !\n");
    268268        /* Freeing the already allocated mem */
    269         if (wcda->lpdwTrackLen != NULL) 
     269        if (wcda->lpdwTrackLen != NULL)
    270270            free(wcda->lpdwTrackLen);
    271         if (wcda->lpdwTrackPos != NULL) 
     271        if (wcda->lpdwTrackPos != NULL)
    272272            free(wcda->lpdwTrackPos);
    273273        if (wcda->lpbTrackFlags != NULL)
     
    281281    memset(wcda->lpdwTrackPos, 0, (wcda->nTracks + 1) * sizeof(DWORD));
    282282    memset(wcda->lpbTrackFlags, 0, (wcda->nTracks + 1) * sizeof(BYTE));
    283    
     283
    284284    for (i = 0; i <= wcda->nTracks; i++) {
    285285        if((start=os2CDQueryTrackStartSector(wcda->hfOS2Handle,i,&flAudioTrack))==0)
     
    287287                WARN("error reading start sector for track %d\n", i+1);
    288288                /* Freeing the already allocated mem */
    289                 if (wcda->lpdwTrackLen != NULL) 
     289                if (wcda->lpdwTrackLen != NULL)
    290290                    free(wcda->lpdwTrackLen);
    291                 if (wcda->lpdwTrackPos != NULL) 
     291                if (wcda->lpdwTrackPos != NULL)
    292292                    free(wcda->lpdwTrackPos);
    293293                if (wcda->lpbTrackFlags != NULL)
     
    299299            }
    300300        start-=150;
    301        
     301
    302302        if (i == 0) {
    303303            last_start = start;
     
    315315        //if(wcda->ulCDROMStatus & )
    316316        if (!flAudioTrack)
    317           wcda->lpbTrackFlags[i] = CDROM_DATA_TRACK; 
     317          wcda->lpbTrackFlags[i] = CDROM_DATA_TRACK;
    318318        else
    319319          wcda->lpbTrackFlags[i] = 0;
    320320        //TRACE("track #%u flags=%02x\n", i + 1, wcda->lpbTrackFlags[i]);
    321321    }/* for */
    322    
     322
    323323    wcda->dwLastFrame = last_start;
    324324    TRACE("total_len=%u Leaving CDAUDIO_GetTracksInfo...\n", total_length);
    325    
     325
    326326    return TRUE;
    327327}
     
    346346        return FALSE;
    347347    }
    348     /* Current mode */   
     348    /* Current mode */
    349349    //wcda->cdaMode=WINE_CDA_STOP;
    350350    if(wcda->ulCDROMStatus & 0x1L)
     
    385385    if (wcda->cdaMode != WINE_CDA_OPEN)
    386386        return TRUE;
    387     else 
     387    else
    388388        return FALSE;
    389389}
  • trunk/src/winmm/mcicda/mcicda.cpp

    r4982 r21916  
    407407static DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMSA lpParms)
    408408{
    409     LPSTR               str = NULL;
     409    LPCSTR              str = NULL;
    410410    WINE_MCICDAUDIO*    wmcda = CDAUDIO_mciGetOpenDrv(wDevID);
    411411    DWORD               ret = 0;
     
    758758        break;
    759759    default:
    760         TRACE("Seeking to ??=%lu\n", dwFlags);
     760        TRACE("Seeking to #%lu\n", dwFlags);
    761761        return MCIERR_UNSUPPORTED_FUNCTION;
    762762    }
  • trunk/src/winmm/mcicda/mcicda.def

    r4809 r21916  
    55
    66EXPORTS
    7     DriverProc      = _MCICDAUDIO_DriverProc@20     @1
     7    DriverProc      = "_MCICDAUDIO_DriverProc@20"   @1
  • trunk/src/winmm/mcicda/os2cdrom.cpp

    r9976 r21916  
    148148       
    149149    rc = DosDevIOCtl(hfOS2Handle, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIODISK,
    150                      "CD01", 4, &ulParamLen, &cdInfo,
     150                     (void*)"CD01", 4, &ulParamLen, &cdInfo,
    151151                     sizeof(cdInfo), &ulDataLen);
    152152
     
    194194    ulParamLen=4;
    195195    rc = DosDevIOCtl(hfOS2Handle, IOCTL_CDROMDISK, CDROMDISK_DEVICESTATUS,
    196                      "CD01", 4, &ulParamLen, &ulDeviceStatus,
     196                     (void*)"CD01", 4, &ulParamLen, &ulDeviceStatus,
    197197                     sizeof(ulDeviceStatus), &ulDataLen);               
    198198    if(rc) {
     
    218218    /* Get information */
    219219    rc = DosDevIOCtl(hfOS2Handle, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIOSTATUS,
    220                      "CD01", 4, &ulParamLen, &asStatus,
     220                     (void*)"CD01", 4, &ulParamLen, &asStatus,
    221221                     sizeof(asStatus), &ulDataLen);
    222222    if(rc) {
     
    247247        ulParamLen=4;
    248248        rc = DosDevIOCtl(hfDrive, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIODISK,
    249                          "CD01", 4, &ulParamLen, &cdInfo,
     249                         (void*)"CD01", 4, &ulParamLen, &cdInfo,
    250250                         sizeof(cdInfo), &ulDataLen);           
    251251        if(rc)
     
    292292    ulParamLen=4;
    293293    rc = DosDevIOCtl(hfDrive, IOCTL_CDROMDISK, CDROMDISK_EJECTDISK,
    294                      "CD01", 4, &ulParamLen,0,
     294                     (void*)"CD01", 4, &ulParamLen,0,
    295295                     0, 0);             
    296296    if(rc)
     
    314314    ulParamLen=4;
    315315    rc = DosDevIOCtl(hfDrive, IOCTL_CDROMDISK, CDROMDISK_CLOSETRAY,
    316                      "CD01", 4, &ulParamLen,0,
     316                     (void*)"CD01", 4, &ulParamLen,0,
    317317                     0, 0);             
    318318    if(rc)
     
    335335    ulParamLen=4;
    336336    rc = DosDevIOCtl(hfDrive, IOCTL_CDROMAUDIO, CDROMAUDIO_STOPAUDIO,
    337                      "CD01", 4, &ulParamLen,0,
     337                     (void*)"CD01", 4, &ulParamLen,0,
    338338                     0, 0);             
    339339    if(rc)
     
    396396    ulParamLen=4;
    397397    rc = DosDevIOCtl(hfDrive, IOCTL_CDROMAUDIO, CDROMAUDIO_RESUMEAUDIO,
    398                      "CD01", 4, &ulParamLen,0,
     398                     (void*)"CD01", 4, &ulParamLen,0,
    399399                     0, 0);             
    400400    if(rc)
     
    484484    ulParamLen=4;
    485485    rc = DosDevIOCtl(hfOS2Handle, IOCTL_CDROMAUDIO, CDROMAUDIO_GETSUBCHANNELQ,
    486                      "CD01", 4, &ulParamLen, &scq,
     486                     (void*)"CD01", 4, &ulParamLen, &scq,
    487487                     sizeof(scq), &ulDataLen);         
    488488    if(rc) {
  • trunk/src/winmm/mciwave/mciwave.c

    r10410 r21916  
    2323
    2424#include <stdarg.h>
     25#include <string.h>
     26#include <memory.h>
    2527
    2628#include "winerror.h"
  • trunk/src/winmm/mciwave/mciwave.def

    r4809 r21916  
    66
    77EXPORTS
    8     DriverProc      = _MCIWAVE_DriverProc@20        @1
     8    DriverProc      = "_MCIWAVE_DriverProc@20"      @1
  • trunk/src/winmm/midi.cpp

    r10173 r21916  
    3838*/
    3939
    40 char * getWinmmMsg( MMRESULT result )
    41 {
    42   char * ret;
     40const char * getWinmmMsg( MMRESULT result )
     41{
     42  const char * ret;
    4343  switch ( result )
    4444  {
     
    243243{
    244244  dprintf(("WINMM:midiInGetErrorTextA(%d)\n", wError ));
    245   char * theMsg = getWinmmMsg( wError );
     245  const char * theMsg = getWinmmMsg( wError );
    246246  if ( theMsg )
    247247    strncpy( lpText, theMsg, cchText );
     
    260260{
    261261  dprintf(("WINMM:midiInGetErrorTextW(%d)\n", wError ));
    262   char * theMsg = getWinmmMsg( wError );
     262  const char * theMsg = getWinmmMsg( wError );
    263263  if ( theMsg )
    264264    AsciiToUnicodeN( theMsg, lpText, cchText );
     
    563563{
    564564  dprintf(("WINMM:midiOutGetErrorTextA(%d)\n", wError ));
    565   char * theMsg = getWinmmMsg( wError );
     565  const char * theMsg = getWinmmMsg( wError );
    566566  if ( theMsg )
    567567    strncpy( lpText, theMsg, cchText );
     
    579579{
    580580  dprintf(("WINMM:midiOutGetErrorTextW(%d) - need to translate\n", wError ));
    581   char * theMsg = getWinmmMsg( wError );
     581  const char * theMsg = getWinmmMsg( wError );
    582582  if ( theMsg )
    583583    AsciiToUnicodeN( theMsg, lpText, cchText );
  • trunk/src/winmm/mixer.cpp

    r21570 r21916  
    3434#include "waveoutdart.h"
    3535#include "winmm.h"
    36 #include "initwinmm.h"
     36#include "initterm.h"
    3737#include "mixer.h"
    3838#include "mixeros2.h"
     
    749749        //find line associated with this control
    750750        lpMlc->dwLineID = -1;
    751         for(int i=0;i<nrLines;i++) {
     751        int i;
     752        for(i=0;i<nrLines;i++) {
    752753            for(int j=0;j<pmixerLines[i]->cControls;j++) {
    753754                if(pmixerLines[i]->Controls[j] == lpMlc->u.dwControlID) {
     
    10861087#endif
    10871088        //search all lines (src & dest) for one with specified type
    1088         for(int i=0;i<nrLines;i++) {
     1089        int i;
     1090        for(i=0;i<nrLines;i++) {
    10891091            if(pmixerLines[i]->line.dwComponentType == lpMl->dwComponentType) {
    10901092                break;
     
    11301132        //TODO: Should we compare mid, pid & pddname too? (must be initialized according to MSDN)
    11311133        //      (see below; unicode version doesn't copy pddname; change if these checks are required)
     1134        int i;
    11321135        for(int i=0;i<nrLines;i++) {
    11331136            if(pmixerLines[i]->line.Target.dwType == lpMl->Target.dwType) {
     
    13711374
    13721375    memset(mixerDest, 0, sizeof(mixerDest));
    1373     for(int i=0;i<MIXER_DEST_MAX;i++) {
     1376    int i;
     1377    for(i=0;i<MIXER_DEST_MAX;i++) {
    13741378        memset(mixerDest[i].Connections, -1, sizeof(mixerDest[i].Connections));
    13751379        memset(mixerDest[i].Controls, -1, sizeof(mixerDest[i].Controls));
  • trunk/src/winmm/mixer.h

    r8495 r21916  
    5656void mixerExit();
    5757
    58 extern char *szCtrlName[MIX_CTRL_MAX][2];
    59 extern char *szSourceName[MIXER_SRC_MAX][2];
    60 extern char *szDestName[MIXER_DEST_MAX][2];
     58extern const char *szCtrlName[MIX_CTRL_MAX][2];
     59extern const char *szSourceName[MIXER_SRC_MAX][2];
     60extern const char *szDestName[MIXER_DEST_MAX][2];
    6161
    6262#ifdef __cplusplus
  • trunk/src/winmm/mixerdata.cpp

    r8493 r21916  
    1717/******************************************************************************/
    1818/******************************************************************************/
    19 char *szCtrlName[MIX_CTRL_MAX][2] = {
     19const char *szCtrlName[MIX_CTRL_MAX][2] = {
    2020    {
    2121        "MasterVol",
     
    201201/******************************************************************************/
    202202/******************************************************************************/
    203 char *szDestName[MIXER_DEST_MAX][2] = {
     203const char *szDestName[MIXER_DEST_MAX][2] = {
    204204  {
    205205      "Volume Control",
     
    217217/******************************************************************************/
    218218/******************************************************************************/
    219 char *szSourceName[MIXER_SRC_MAX][2] = {
     219const char *szSourceName[MIXER_SRC_MAX][2] = {
    220220  {
    221221      "MonoIn",
  • trunk/src/winmm/mixeros2.cpp

    r8858 r21916  
    2323#include <ioctl90.h>
    2424
    25 #include "initwinmm.h"
     25#include "initterm.h"
    2626#include "mixeros2.h"
    2727
  • trunk/src/winmm/playsound.cpp

    r8470 r21916  
    1717 * Includes                                                                 *
    1818 ****************************************************************************/
     19
     20#include <string.h>
    1921
    2022#include <os2win.h>
     
    2325#include <heapstring.h>
    2426#include <misc.h>
    25 #include <string.h>
    26 #include <win\debugtools.h>
     27#include <win/debugtools.h>
    2728
    2829#define DBG_LOCALLOG    DBG_playsound
     
    5152}
    5253
    53 static HMMIO    get_mmioFromProfile(UINT uFlags, LPCSTR lpszName) 
     54static HMMIO    get_mmioFromProfile(UINT uFlags, LPCSTR lpszName)
    5455{
    5556    char        str[128];
    5657    LPSTR       ptr;
    5758    HMMIO       hmmio;
    58    
     59
    5960    TRACE("searching in SystemSound List !\n");
    6061    GetProfileStringA("Sounds", (LPSTR)lpszName, "", str, sizeof(str));
     
    7879};
    7980
    80 static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg, 
    81                                         DWORD dwInstance, 
     81static void CALLBACK PlaySound_Callback(HWAVEOUT hwo, UINT uMsg,
     82                                        DWORD dwInstance,
    8283                                        DWORD dwParam1, DWORD dwParam2)
    8384{
     
    9899}
    99100
    100 static void PlaySound_WaitDone(struct playsound_data* s) 
     101static void PlaySound_WaitDone(struct playsound_data* s)
    101102{
    102103    for (;;) {
     
    106107        }
    107108        InterlockedIncrement((LPLONG)&s->dwEventCount);
    108        
     109
    109110        WaitForSingleObject(s->hEvent, INFINITE);
    110111    }
     
    141142        hmmio = 0;
    142143        if (uFlags & SND_ALIAS)
    143             if ((hmmio = get_mmioFromProfile(uFlags, lpszSoundName)) == 0) 
     144            if ((hmmio = get_mmioFromProfile(uFlags, lpszSoundName)) == 0)
    144145                return FALSE;
    145        
     146
    146147        if (uFlags & SND_FILENAME)
    147148            if ((hmmio=get_mmioFromFile(lpszSoundName)) == 0) return FALSE;
    148        
     149
    149150        if (PlaySound_SearchMode == 1) {
    150151            PlaySound_SearchMode = 0;
    151             if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0) 
     152            if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)
    152153                hmmio = get_mmioFromProfile(uFlags, lpszSoundName);
    153154        }
    154        
     155
    155156        if (PlaySound_SearchMode == 2) {
    156157            PlaySound_SearchMode = 0;
    157             if ((hmmio = get_mmioFromProfile(uFlags | SND_NODEFAULT, lpszSoundName)) == 0) 
    158                 if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)     
     158            if ((hmmio = get_mmioFromProfile(uFlags | SND_NODEFAULT, lpszSoundName)) == 0)
     159                if ((hmmio = get_mmioFromFile(lpszSoundName)) == 0)
    159160                    hmmio = get_mmioFromProfile(uFlags, lpszSoundName);
    160161        }
     
    197198        goto errCleanUp;
    198199
    199     TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n", 
     200    TRACE("Chunk Found ckid=%.4s fccType=%.4s cksize=%08lX\n",
    200201          (LPSTR)&mmckInfo.ckid, (LPSTR)&mmckInfo.fccType, mmckInfo.cksize);
    201202
     
    216217    waveHdr[0].dwFlags = waveHdr[1].dwFlags = 0L;
    217218    waveHdr[0].dwBufferLength = waveHdr[1].dwBufferLength = bufsize;
    218     if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) || 
     219    if (waveOutPrepareHeader(hWave, &waveHdr[0], sizeof(WAVEHDR)) ||
    219220        waveOutPrepareHeader(hWave, &waveHdr[1], sizeof(WAVEHDR))) {
    220221        goto errCleanUp;
     
    260261}
    261262
    262 static DWORD WINAPI PlaySound_Thread(LPVOID arg) 
     263static DWORD WINAPI PlaySound_Thread(LPVOID arg)
    263264{
    264265    DWORD     res;
    265    
     266
    266267    for (;;) {
    267268        PlaySound_Playing = FALSE;
     
    273274        if (res != WAIT_OBJECT_0) continue;
    274275        PlaySound_Playing = TRUE;
    275        
     276
    276277        if ((PlaySound_fdwSound & SND_RESOURCE) == SND_RESOURCE) {
    277278            HRSRC       hRES;
     
    292293                continue;
    293294            }
    294             PlaySound_Result = proc_PlaySound((LPCSTR)ptr, 
     295            PlaySound_Result = proc_PlaySound((LPCSTR)ptr,
    295296                                              ((UINT16)PlaySound_fdwSound ^ SND_RESOURCE) | SND_MEMORY);
    296297            FreeResource(hGLOB);
     
    319320{
    320321    static LPSTR StrDup = NULL;
    321    
     322
    322323    TRACE("pszSound='%p' hmod=%04X fdwSound=%08lX\n",
    323324          pszSound, hmod, fdwSound);
    324    
     325
    325326    if (PlaySound_hThread == 0) { /* This is the first time they called us */
    326327        DWORD   id;
     
    331332        if ((PlaySound_hPlayEvent = CreateEventA(NULL, FALSE, FALSE, NULL)) == 0)
    332333            return FALSE;
    333         if ((PlaySound_hThread = CreateThread(NULL, 0, PlaySound_Thread, 0, 0, &id)) == 0) 
    334             return FALSE;
    335     }
    336    
    337     /* FIXME? I see no difference between SND_WAIT and SND_NOSTOP ! */ 
    338     if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && PlaySound_Playing) 
     334        if ((PlaySound_hThread = CreateThread(NULL, 0, PlaySound_Thread, 0, 0, &id)) == 0)
     335            return FALSE;
     336    }
     337
     338    /* FIXME? I see no difference between SND_WAIT and SND_NOSTOP ! */
     339    if ((fdwSound & (SND_NOWAIT | SND_NOSTOP)) && PlaySound_Playing)
    339340        return FALSE;
    340    
     341
    341342    /* Trying to stop if playing */
    342343    if (PlaySound_Playing) PlaySound_Stop = TRUE;
    343    
     344
    344345    /* Waiting playing thread to get ready. I think 10 secs is ok & if not then leave*/
    345346    if (WaitForSingleObject(PlaySound_hReadyEvent, 1000*10) != WAIT_OBJECT_0)
    346347        return FALSE;
    347    
    348     if (!pszSound || (fdwSound & SND_PURGE)) 
     348
     349    if (!pszSound || (fdwSound & SND_PURGE))
    349350        return FALSE; /* We stoped playing so leaving */
    350    
     351
    351352    if (PlaySound_SearchMode != 1) PlaySound_SearchMode = 2;
    352353    if (!(fdwSound & SND_ASYNC)) {
    353         if (fdwSound & SND_LOOP) 
     354        if (fdwSound & SND_LOOP)
    354355            return FALSE;
    355356        PlaySound_pszSound = pszSound;
     
    358359        PlaySound_Result = FALSE;
    359360        SetEvent(PlaySound_hPlayEvent);
    360         if (WaitForSingleObject(PlaySound_hMiddleEvent, INFINITE) != WAIT_OBJECT_0) 
    361             return FALSE;
    362         if (WaitForSingleObject(PlaySound_hReadyEvent, INFINITE) != WAIT_OBJECT_0) 
     361        if (WaitForSingleObject(PlaySound_hMiddleEvent, INFINITE) != WAIT_OBJECT_0)
     362            return FALSE;
     363        if (WaitForSingleObject(PlaySound_hReadyEvent, INFINITE) != WAIT_OBJECT_0)
    363364            return FALSE;
    364365        return PlaySound_Result;
     
    371372            StrDup = NULL;
    372373        }
    373         if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) && 
     374        if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) &&
    374375                                          !((DWORD)pszSound >> 16)) || !pszSound)) {
    375376            StrDup = HEAP_strdupA(GetProcessHeap(), 0,pszSound);
     
    403404    LPSTR       pszSoundA;
    404405    BOOL        bSound;
    405    
    406     if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) && 
     406
     407    if (!((fdwSound & SND_MEMORY) || ((fdwSound & SND_RESOURCE) &&
    407408                                      !((DWORD)pszSound >> 16)) || !pszSound)) {
    408409        pszSoundA = HEAP_strdupWtoA(GetProcessHeap(), 0,pszSound);
    409410        bSound = PlaySoundA(pszSoundA, hmod, fdwSound);
    410411        HeapFree(GetProcessHeap(), 0, pszSoundA);
    411     } else 
     412    } else
    412413        bSound = PlaySoundA((LPCSTR)pszSound, hmod, fdwSound);
    413    
     414
    414415    return bSound;
    415416}
  • trunk/src/winmm/wavein.cpp

    r21358 r21916  
    2828#include "winmm.h"
    2929#include "waveindart.h"
    30 #include "initwinmm.h"
     30#include "initterm.h"
    3131
    3232#define DBG_LOCALLOG    DBG_wavein
     
    281281{
    282282    dprintf(("WINMM:waveInGetErrorTextA(%d)\n", wError ));
    283     char * theMsg = getWinmmMsg( wError );
     283    const char * theMsg = getWinmmMsg( wError );
    284284    if ( theMsg )
    285285        strncpy( lpText, theMsg, cchText );
     
    297297{
    298298    dprintf(("WINMM:waveInGetErrorTextW(%d) - stub\n", wError ));
    299     char * theMsg = getWinmmMsg( wError );
     299    const char * theMsg = getWinmmMsg( wError );
    300300    if ( theMsg )
    301301        AsciiToUnicodeN( theMsg, lpText, cchText );
  • trunk/src/winmm/waveindart.cpp

    r21358 r21916  
    2828#include "misc.h"
    2929#include "waveindart.h"
    30 #include "initwinmm.h"
     30#include "initterm.h"
    3131
    3232#define DBG_LOCALLOG    DBG_waveindart
  • trunk/src/winmm/waveout.cpp

    r21358 r21916  
    3131#include "misc.h"
    3232#include "winmm.h"
    33 #include "initwinmm.h"
     33#include "initterm.h"
    3434
    3535#define DBG_LOCALLOG    DBG_waveout
     
    315315MMRESULT WINAPI waveOutGetErrorTextA(MMRESULT wError, LPSTR lpText, UINT cchText)
    316316{
    317     char * theMsg = getWinmmMsg( wError );
     317    const char * theMsg = getWinmmMsg( wError );
    318318    if(theMsg) {
    319319        strncpy( lpText, theMsg, cchText );
     
    331331MMRESULT WINAPI waveOutGetErrorTextW(MMRESULT wError, LPWSTR lpText, UINT cchText)
    332332{
    333     char * theMsg = getWinmmMsg( wError );
     333    const char * theMsg = getWinmmMsg( wError );
    334334    if(theMsg) {
    335335        AsciiToUnicodeN( theMsg, lpText, cchText );
  • trunk/src/winmm/waveoutbase.cpp

    r21358 r21916  
    3030#include "misc.h"
    3131#include "waveoutbase.h"
    32 #include "initwinmm.h"
     32#include "initterm.h"
    3333
    3434#define DBG_LOCALLOG    DBG_waveoutbase
  • trunk/src/winmm/waveoutdart.cpp

    r21358 r21916  
    3333#include "misc.h"
    3434#include "waveoutdart.h"
    35 #include "initwinmm.h"
     35#include "initterm.h"
    3636
    3737#define DBG_LOCALLOG    DBG_waveoutdart
     
    759759    dprintf2(("WaveOutHandler %x %x %x", ulStatus, pBuffer, ulFlags));
    760760
     761#ifdef __IBMC__
    761762    ptib2 = (PTIB2)_getTIBvalue(offsetof(TIB, tib_ptib2));
     763#else
     764    PTIB ptib;
     765    DosGetInfoBlocks(&ptib, NULL);
     766    ptib2 = ptib->tib_ptib2;
     767#endif
     768
    762769    if (ptib2 && HIBYTE(ptib2->tib2_ulpri) != PRTYC_TIMECRITICAL &&
    763770       LOBYTE(ptib2->tib2_ulpri) != PRTYD_MAXIMUM)
  • trunk/src/winmm/waveoutflash.cpp

    r21358 r21916  
    3131#include "misc.h"
    3232#include "waveoutflash.h"
    33 #include "initwinmm.h"
     33#include "initterm.h"
    3434
    3535#define DBG_LOCALLOG    DBG_waveoutflash
     
    338338    MCI_BUFFER_PARMS  BufferParms;
    339339
    340     dprintf((__FUNCTION__" - bufsize= %d", dartBufSize));
     340    dprintf(("$ - bufsize= %d", __FUNCTION__, dartBufSize));
    341341
    342342    // Set up the BufferParms data structure and
     
    763763// Displays the text associated with an MCI error code.
    764764
    765 void FlashWaveOut::mciError(char * msg, ULONG rc)
     765void FlashWaveOut::mciError(const char * msg, ULONG rc)
    766766{
    767767#ifdef DEBUG
  • trunk/src/winmm/waveoutflash.h

    r21358 r21916  
    4848          void      writeBuffer();
    4949          void      handler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags);
    50           void      mciError(char * msg, ULONG rc);
     50          void      mciError(const char * msg, ULONG rc);
    5151
    5252private:
     
    7070};
    7171
     72LONG APIENTRY FlashWaveOutHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
     73                                  ULONG ulFlags);
     74
    7275#endif
    7376
  • trunk/src/winmm/winmm.h

    r3303 r21916  
    99#define __WINMM_H__
    1010
    11 char * getWinmmMsg( MMRESULT result );
     11const char * getWinmmMsg( MMRESULT result );
    1212
    1313typedef struct {
Note: See TracChangeset for help on using the changeset viewer.