Ignore:
Timestamp:
May 1, 2010, 9:49:10 PM (15 years ago)
Author:
David Azarewicz
Message:

Cleanup compiler warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/lib32/soundmixer.c

    r457 r479  
    8080};
    8181
    82 static unsigned char LinToLog[OSS32_MAX_VOLUME+1] = { 
     82static unsigned char LinToLog[OSS32_MAX_VOLUME+1] = {
    8383  0,   0,   0,   0,   1,   2,   2,   5,   5,  10,
    84  10,  10,  16,  19,  20,  22,  24,  25,  27,  27, 
    85  28,  28,  29,  30,  30,  35,  35,  35,  39,  39, 
    86  43,  44,  45,  47,  48,  49,  50,  51,  52,  53, 
    87  55,  56,  57,  59,  60,  62,  63,  64,  65,  66, 
     84 10,  10,  16,  19,  20,  22,  24,  25,  27,  27,
     85 28,  28,  29,  30,  30,  35,  35,  35,  39,  39,
     86 43,  44,  45,  47,  48,  49,  50,  51,  52,  53,
     87 55,  56,  57,  59,  60,  62,  63,  64,  65,  66,
    8888 67,  68,  69,  70,  71,  72,  73,  74,  74,  75,
    89  76,  77,  78,  79,  79,  80,  81,  82,  83,  84, 
    90  85,  86,  87,  88,  89,  90,  91,  92,  92,  93, 
    91  93,  94,  94,  95,  95,  96,  96,  97,  97,  98, 
     89 76,  77,  78,  79,  79,  80,  81,  82,  83,  84,
     90 85,  86,  87,  88,  89,  90,  91,  92,  92,  93,
     91 93,  94,  94,  95,  95,  96,  96,  97,  97,  98,
    9292 98,  99,  99,  99,  99, 100, 100, 100, 100, 100,
    9393 100
     
    148148    }
    149149    //retrieve mixer information
    150     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 
    151                                     SNDRV_CTL_IOCTL_CARD_INFO, 
     150    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
     151                                    SNDRV_CTL_IOCTL_CARD_INFO,
    152152                                    (ULONG)&pHandle->info);
    153153    if(ret) {
     
    157157    pHandle->list.offset = 0;
    158158    pHandle->list.space  = 0;
    159     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 
    160                                     SNDRV_CTL_IOCTL_ELEM_LIST, 
     159    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
     160                                    SNDRV_CTL_IOCTL_ELEM_LIST,
    161161                                    (ULONG)&pHandle->list);
    162162    if(ret) {
     
    172172    pHandle->list.space  = pHandle->list.count;
    173173    pHandle->list.pids   = pHandle->pids;
    174     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 
    175                                     SNDRV_CTL_IOCTL_ELEM_LIST, 
     174    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
     175                                    SNDRV_CTL_IOCTL_ELEM_LIST,
    176176                                    (ULONG)&pHandle->list);
    177177    if(ret) {
     
    188188
    189189    //Extract standard mixer controls from array with control names
    190     for(j=0;j<OSS_MIXER_NRDEVICES;j++) 
     190    for(j=0;j<OSS_MIXER_NRDEVICES;j++)
    191191    {
    192192        int namelen = strlen(ossid[j].name);
     
    197197        pHandle->controls[j].idxCaptureSwitch = -1;
    198198
    199         for(i=0;i<pHandle->list.count;i++) 
     199        for(i=0;i<pHandle->list.count;i++)
    200200        {
    201201            if (pHandle->pids[i].index == ossid[j].index &&
     
    209209                    break;
    210210                }
    211                 else 
    212                 {//first part of the control name is correct; now find out what 
     211                else
     212                {//first part of the control name is correct; now find out what
    213213                 //is it exactly
    214214                    char *nextword = &pHandle->pids[i].name[namelen];
     
    216216
    217217                    if(strncmp(nextword, MIXER_PLAYBACKVOLUME, sizeof(MIXER_PLAYBACKVOLUME)-1) == 0 ||
    218                        strncmp(nextword, MIXER_VOLUME, sizeof(MIXER_VOLUME)-1) == 0) 
     218                       strncmp(nextword, MIXER_VOLUME, sizeof(MIXER_VOLUME)-1) == 0)
    219219                    {//volume control
    220220                        pHandle->controls[j].idxVolume = i;
     
    222222                    else
    223223                    if(strncmp(nextword, MIXER_PLAYBACKSWITCH, sizeof(MIXER_PLAYBACKSWITCH)-1) == 0 ||
    224                        strncmp(nextword, MIXER_SWITCH, sizeof(MIXER_SWITCH)-1) == 0) 
     224                       strncmp(nextword, MIXER_SWITCH, sizeof(MIXER_SWITCH)-1) == 0)
    225225                    {//mute control
    226226                        pHandle->controls[j].idxMute = i;
     
    229229                    }
    230230                    else
    231                     if(strncmp(nextword, MIXER_SOURCE, sizeof(MIXER_SOURCE)-1) == 0) 
     231                    if(strncmp(nextword, MIXER_SOURCE, sizeof(MIXER_SOURCE)-1) == 0)
    232232                    {//source control (e.g. recording source)
    233233                        pHandle->controls[j].idxCustom = i;
     
    235235                    else
    236236                    if(strncmp(nextword, MIXER_CAPTUREROUTE, sizeof(MIXER_CAPTUREROUTE)-1) == 0 ||
    237                        strncmp(nextword, MIXER_CAPTURESWITCH, sizeof(MIXER_CAPTURESWITCH)-1) == 0) 
     237                       strncmp(nextword, MIXER_CAPTURESWITCH, sizeof(MIXER_CAPTURESWITCH)-1) == 0)
    238238                    {//source control for recording (per input)
    239239                        pHandle->controls[j].idxCaptureSwitch = i;
     
    241241                    else
    242242                    if(i == OSS_MIXER_MIC) {
    243                         if(strncmp(nextword, MIXER_BOOST, sizeof(MIXER_BOOST)-1) == 0) 
     243                        if(strncmp(nextword, MIXER_BOOST, sizeof(MIXER_BOOST)-1) == 0)
    244244                        {//mic boost switch
    245245                            pHandle->controls[j].idxCustom = i;
     
    257257
    258258    //request information about available capture sources
    259     if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1) 
     259    if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1)
    260260    {
    261         struct snd_ctl_elem_info  *pElemInfo = NULL; 
     261        struct snd_ctl_elem_info  *pElemInfo = NULL;
    262262        int                   idx, j;
    263263
     
    266266        //set operation to non-blocking
    267267        pHandle->file.f_flags = O_NONBLOCK;
    268        
     268
    269269        pHandle->rectype = RECTYPE_SELECTOR;
    270270
     
    277277
    278278        pElemInfo->value.enumerated.items = 1;
    279         for(i=0;i<pElemInfo->value.enumerated.items;i++) 
     279        for(i=0;i<pElemInfo->value.enumerated.items;i++)
    280280        {
    281281            pElemInfo->value.enumerated.item = i;
     
    307307            pHandle->idxRecCaps[j] = -1;
    308308        }
    309         for(j=0;j<OSS_MIXER_NRDEVICES;j++) 
     309        for(j=0;j<OSS_MIXER_NRDEVICES;j++)
    310310        {
    311311            if(pHandle->controls[j].idxCaptureSwitch != -1) {
     
    364364    //set operation to non-blocking
    365365    pHandle->file.f_flags = O_NONBLOCK;
    366  
     366
    367367    return OSSERR_NOT_SUPPORTED;
    368368}
     
    373373    mixerhandle          *pHandle = (mixerhandle *)streamid;
    374374    struct snd_ctl_elem_value *pElem = NULL;
    375     struct snd_ctl_elem_info  *pElemInfo; 
     375    struct snd_ctl_elem_info  *pElemInfo;
    376376    int                   ret, idx, lVol, rVol = 0, idxMute, cnt;
    377377
     378    dprintf(("OSS32_MixSetVolume line=%d\n", line));
    378379    if(pHandle == NULL || pHandle->magic != MAGIC_MIXER_ALSA32) {
    379380        printk("Invalid handle in OSS32_MixSetVolume\n");
     
    450451        idxMute = pHandle->controls[OSS_MIXER_PHONEOUT].idxMute;
    451452        break;
    452     case OSS32_MIX_VOLUME_HEADPHONE: 
     453    case OSS32_MIX_VOLUME_HEADPHONE:
    453454        idx = pHandle->controls[OSS_MIXER_HEADPHONE].idxVolume;
    454455        idxMute = pHandle->controls[OSS_MIXER_HEADPHONE].idxMute;
     
    557558    mixerhandle          *pHandle = (mixerhandle *)streamid;
    558559    struct snd_ctl_elem_value *pElem = NULL;
    559     struct snd_ctl_elem_info  *pElemInfo; 
     560    struct snd_ctl_elem_info  *pElemInfo;
    560561    int                   ret, idx = -1, lVol, rVol = 0, j, i;
    561562
     
    566567    //set operation to non-blocking
    567568    pHandle->file.f_flags = O_NONBLOCK;
    568  
     569
    569570    //too big to put on the stack
    570571    pElem = (struct snd_ctl_elem_value *)kmalloc(sizeof(struct snd_ctl_elem_value) + sizeof(struct snd_ctl_elem_info), GFP_KERNEL);
     
    591592        else {//capture switch for each input source
    592593            //first turn off all capture switches...
    593             for(j=0;j<OSS32_MIX_RECSRC_MAX;j++) 
     594            for(j=0;j<OSS32_MIX_RECSRC_MAX;j++)
    594595            {
    595596                if(pHandle->idxRecCaps[j] != -1) {
     
    641642
    642643        break;
    643    
     644
    644645    case OSS32_MIX_SWITCH_MICBOOST:
    645646        idx = pHandle->controls[OSS_MIXER_MIC].idxCustom;
     
    729730    //set operation to non-blocking
    730731    pHandle->file.f_flags = O_NONBLOCK;
    731  
     732
    732733    return OSSERR_NOT_SUPPORTED;
    733734}
     
    767768    case OSS_MIXER_BASS:
    768769        return OSS32_MIX_LEVEL_BASS;
    769     case OSS_MIXER_HEADPHONE: 
     770    case OSS_MIXER_HEADPHONE:
    770771        return OSS32_MIX_VOLUME_HEADPHONE;
    771772    case OSS_MIXER_SPEAKER:
     
    792793    pCaps->fuRecCaps  = 0;
    793794
    794     for(i=0;i<OSS_MIXER_NRDEVICES;i++) 
     795    for(i=0;i<OSS_MIXER_NRDEVICES;i++)
    795796    {
    796797        if(pHandle->controls[i].idxVolume != -1) {
    797798            ULONG volidx = OSSToALSAVolume(i);
    798             if(volidx != -1) 
     799            if(volidx != -1)
    799800                pCaps->fuCtrlCaps |= OSS32_MIX_FLAG(volidx);
    800801        }
     
    804805    //then we support intput source selection
    805806    if(pHandle->controls[OSS_MIXER_IGAIN].idxCustom != -1 ||
    806        pHandle->rectype == RECTYPE_SWITCH) 
    807     {       
     807       pHandle->rectype == RECTYPE_SWITCH)
     808    {
    808809        pCaps->fuCtrlCaps |= OSS32_MIX_FLAG(OSS32_MIX_INPUTSRC);
    809810        pCaps->fuRecCaps   = pHandle->reccaps;
     
    843844    }
    844845    //retrieve mixer information
    845     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 
    846                                     SNDRV_CTL_IOCTL_CARD_INFO, 
     846    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
     847                                    SNDRV_CTL_IOCTL_CARD_INFO,
    847848                                    (ULONG)&pHandle->info);
    848849    if(ret) {
     
    904905    }
    905906    //retrieve mixer information
    906     ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, 
    907                                     SNDRV_CTL_IOCTL_CARD_INFO, 
     907    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file,
     908                                    SNDRV_CTL_IOCTL_CARD_INFO,
    908909                                    (ULONG)&pHandle->info);
    909910    if(ret) {
Note: See TracChangeset for help on using the changeset viewer.