Mercurial > mplayer.hg
changeset 26757:0fdf04b07ecb
cosmetics: Remove pointless parentheses from return statements.
author | diego |
---|---|
date | Fri, 16 May 2008 09:31:55 +0000 |
parents | c43ce7268677 |
children | 9fb1d2c3dbd4 |
files | libao2/ao_alsa.c libao2/ao_alsa5.c libao2/ao_arts.c libao2/ao_sdl.c loader/driver.c loader/dshow/mediatype.c loader/qtx/qtxload.c loader/win32.c loader/wine/heap.h |
diffstat | 9 files changed, 50 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/libao2/ao_alsa.c Fri May 16 08:43:15 2008 +0000 +++ b/libao2/ao_alsa.c Fri May 16 09:31:55 2008 +0000 @@ -232,7 +232,7 @@ } } //end switch - return(CONTROL_UNKNOWN); + return CONTROL_UNKNOWN; } static void parse_device (char *dest, const char *src, int len) @@ -498,11 +498,11 @@ mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_OpenInNonblockModeFailed); if ((err = try_open_device(alsa_device, 0, format == AF_FORMAT_AC3)) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); - return(0); + return 0; } } else { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PlaybackOpenError, snd_strerror(err)); - return(0); + return 0; } } @@ -520,7 +520,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToGetInitialParameters, snd_strerror(err)); - return(0); + return 0; } err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams, @@ -528,7 +528,7 @@ if (err < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetAccessType, snd_strerror(err)); - return (0); + return 0; } /* workaround for nonsupported formats @@ -547,7 +547,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetFormat, snd_strerror(err)); - return(0); + return 0; } if ((err = snd_pcm_hw_params_set_channels_near(alsa_handler, alsa_hwparams, @@ -555,7 +555,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetChannels, snd_strerror(err)); - return(0); + return 0; } /* workaround for buggy rate plugin (should be fixed in ALSA 1.0.11) @@ -566,7 +566,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToDisableResampling, snd_strerror(err)); - return(0); + return 0; } #endif @@ -575,7 +575,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetSamplerate2, snd_strerror(err)); - return(0); + return 0; } bytes_per_sample = snd_pcm_format_physical_width(alsa_format) / 8; @@ -592,7 +592,7 @@ { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToSetBufferTimeNear, snd_strerror(err)); - return(0); + return 0; } else alsa_buffer_time = err; @@ -711,7 +711,7 @@ } // end switch alsa_handler (spdif) alsa_can_pause = snd_pcm_hw_params_can_pause(alsa_hwparams); - return(1); + return 1; } // end init @@ -837,7 +837,7 @@ mp_msg(MSGT_AO,MSGL_INFO,MSGTR_AO_ALSA_TryingToResetSoundcard); if ((res = snd_pcm_prepare(alsa_handler)) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(res)); - return(0); + return 0; break; } } @@ -857,13 +857,13 @@ if ((ret = snd_pcm_status(alsa_handler, status)) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_CannotGetPcmStatus, snd_strerror(ret)); - return(0); + return 0; } ret = snd_pcm_status_get_avail(status) * bytes_per_sample; if (ret > ao_data.buffersize) // Buffer underrun? ret = ao_data.buffersize; - return(ret); + return ret; } /* delay in seconds between first and last sample in buffer */ @@ -884,6 +884,6 @@ } return (float)delay / (float)ao_data.samplerate; } else { - return(0); + return 0; } }
--- a/libao2/ao_alsa5.c Fri May 16 08:43:15 2008 +0000 +++ b/libao2/ao_alsa5.c Fri May 16 09:31:55 2008 +0000 @@ -35,7 +35,7 @@ /* to set/get/query special features/parameters */ static int control(int cmd, void *arg) { - return(CONTROL_UNKNOWN); + return CONTROL_UNKNOWN; } /* @@ -62,7 +62,7 @@ if ((cards = snd_cards()) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_SoundCardNotFound); - return(0); + return 0; } ao_data.format = format; @@ -112,7 +112,7 @@ break; case -1: mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_InvalidFormatReq,af_fmt2str_short(format)); - return(0); + return 0; default: break; } @@ -164,13 +164,13 @@ if ((err = snd_pcm_open(&alsa_handler, 0, 0, SND_PCM_OPEN_PLAYBACK)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlayBackError, snd_strerror(err)); - return(0); + return 0; } if ((err = snd_pcm_info(alsa_handler, &info)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmInfoError, snd_strerror(err)); - return(0); + return 0; } mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_ALSA5_SoundcardsFound, @@ -183,7 +183,7 @@ if ((err = snd_pcm_channel_info(alsa_handler, &chninfo)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PcmChanInfoError, snd_strerror(err)); - return(0); + return 0; } #ifndef __QNX__ @@ -207,7 +207,7 @@ if ((err = snd_pcm_channel_params(alsa_handler, ¶ms)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetParms, snd_strerror(err)); - return(0); + return 0; } memset(&setup, 0, sizeof(setup)); @@ -220,19 +220,19 @@ if ((err = snd_pcm_channel_setup(alsa_handler, &setup)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_CantSetChan, snd_strerror(err)); - return(0); + return 0; } if ((err = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_ChanPrepareError, snd_strerror(err)); - return(0); + return 0; } mp_msg(MSGT_AO, MSGL_INFO, "AUDIO: %d Hz/%d channels/%d bps/%d bytes buffer/%s\n", ao_data.samplerate, ao_data.channels, ao_data.bps, ao_data.buffersize, snd_pcm_get_format_name(alsa_format.format)); - return(1); + return 1; } /* close audio device */ @@ -321,7 +321,7 @@ int got_len; if (!len) - return(0); + return 0; if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0) { @@ -331,20 +331,20 @@ if ((got_len = snd_pcm_channel_prepare(alsa_handler, SND_PCM_CHANNEL_PLAYBACK)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_PlaybackPrepareError, snd_strerror(got_len)); - return(0); + return 0; } if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0) { mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_WriteErrorAfterReset, snd_strerror(got_len)); - return(0); + return 0; } - return(got_len); /* 2nd write was ok */ + return got_len; /* 2nd write was ok */ } mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_ALSA5_OutPutError, snd_strerror(got_len)); - return(0); + return 0; } - return(got_len); + return got_len; } /* how many byes are free in the buffer */ @@ -355,9 +355,9 @@ ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK; if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0) - return(0); /* error occurred */ + return 0; /* error occurred */ else - return(ch_stat.free); + return ch_stat.free; } /* delay in seconds between first and last sample in buffer */ @@ -368,7 +368,7 @@ ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK; if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0) - return((float)ao_data.buffersize/(float)ao_data.bps); /* error occurred */ + return (float)ao_data.buffersize/(float)ao_data.bps; /* error occurred */ else - return((float)ch_stat.count/(float)ao_data.bps); + return (float)ch_stat.count/(float)ao_data.bps; }
--- a/libao2/ao_arts.c Fri May 16 08:43:15 2008 +0000 +++ b/libao2/ao_arts.c Fri May 16 09:31:55 2008 +0000 @@ -37,7 +37,7 @@ static int control(int cmd, void *arg) { - return(CONTROL_UNKNOWN); + return CONTROL_UNKNOWN; } static int init(int rate_hz, int channels, int format, int flags)
--- a/libao2/ao_sdl.c Fri May 16 08:43:15 2008 +0000 +++ b/libao2/ao_sdl.c Fri May 16 09:31:55 2008 +0000 @@ -231,7 +231,7 @@ /* Open the audio device and start playing sound! */ if(SDL_OpenAudio(&aspec, &obtained) < 0) { mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_SDL_CantOpenAudio, SDL_GetError()); - return(0); + return 0; } /* did we got what we wanted ? */
--- a/loader/driver.c Fri May 16 08:43:15 2008 +0000 +++ b/loader/driver.c Fri May 16 09:31:55 2008 +0000 @@ -158,7 +158,7 @@ hDriver = (NPDRVR) malloc(sizeof(DRVR)); if (!hDriver) - return ((HDRVR) 0); + return (HDRVR) 0; memset((void*)hDriver, 0, sizeof(DRVR)); #ifdef WIN32_LOADER @@ -171,7 +171,7 @@ { printf("Can't open library %s\n", filename); DrvClose((HDRVR)hDriver); - return ((HDRVR) 0); + return (HDRVR) 0; } hDriver->DriverProc = (DRIVERPROC) GetProcAddress(hDriver->hDriverModule, @@ -180,7 +180,7 @@ { printf("Library %s is not a valid VfW/ACM codec\n", filename); DrvClose((HDRVR)hDriver); - return ((HDRVR) 0); + return (HDRVR) 0; } TRACE("DriverProc == %X\n", hDriver->DriverProc);
--- a/loader/dshow/mediatype.c Fri May 16 08:43:15 2008 +0000 +++ b/loader/dshow/mediatype.c Fri May 16 09:31:55 2008 +0000 @@ -156,6 +156,6 @@ #define IsEqualGUID(a,b) (memcmp(a,b,16)==0) int CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * pmt2, int bWildcards) { - return (((bWildcards && (IsEqualGUID(&pmt1->majortype, &GUID_NULL) || IsEqualGUID(&pmt2->majortype, &GUID_NULL))) || IsEqualGUID(&pmt1->majortype, &pmt2->majortype)) && - ((bWildcards && (IsEqualGUID(&pmt1->subtype, &GUID_NULL) || IsEqualGUID(&pmt2->subtype, &GUID_NULL))) || IsEqualGUID(&pmt1->subtype, &pmt2->subtype))); + return ((bWildcards && (IsEqualGUID(&pmt1->majortype, &GUID_NULL) || IsEqualGUID(&pmt2->majortype, &GUID_NULL))) || IsEqualGUID(&pmt1->majortype, &pmt2->majortype)) && + ((bWildcards && (IsEqualGUID(&pmt1->subtype, &GUID_NULL) || IsEqualGUID(&pmt2->subtype, &GUID_NULL))) || IsEqualGUID(&pmt1->subtype, &pmt2->subtype)); }
--- a/loader/qtx/qtxload.c Fri May 16 08:43:15 2008 +0000 +++ b/loader/qtx/qtxload.c Fri May 16 09:31:55 2008 +0000 @@ -17,7 +17,7 @@ params, globals, ComponentDispatch); printf(" Dummy: global datas: %p\n", *globals); printf(" Dummy: returning 0\n"); - return(0); + return 0; } char *get_path(const char* x){ return strdup(x);}
--- a/loader/win32.c Fri May 16 08:43:15 2008 +0000 +++ b/loader/win32.c Fri May 16 09:31:55 2008 +0000 @@ -1273,8 +1273,8 @@ for (i=0; i < CRITSECS_LIST_MAX; i++) if (critsecs_list[i].cs_win == cs_win) - return(i); - return(-1); + return i; + return -1; } static int critsecs_get_unused(void) @@ -1283,8 +1283,8 @@ for (i=0; i < CRITSECS_LIST_MAX; i++) if (critsecs_list[i].cs_win == NULL) - return(i); - return(-1); + return i; + return -1; } struct CRITSECT *critsecs_get_unix(CRITICAL_SECTION *cs_win) @@ -1293,8 +1293,8 @@ for (i=0; i < CRITSECS_LIST_MAX; i++) if (critsecs_list[i].cs_win == cs_win && critsecs_list[i].cs_unix) - return(critsecs_list[i].cs_unix); - return(NULL); + return critsecs_list[i].cs_unix; + return NULL; } #endif
--- a/loader/wine/heap.h Fri May 16 08:43:15 2008 +0000 +++ b/loader/wine/heap.h Fri May 16 09:31:55 2008 +0000 @@ -33,7 +33,7 @@ (HIWORD(str) ? HEAP_strdupWtoA( SegptrHeap, 0, (str) ) : (LPSTR)(str)) /* define an inline function, a macro won't do */ static inline SEGPTR WINE_UNUSED SEGPTR_Get(LPCVOID ptr) { - return (HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr); + return HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr; } #define SEGPTR_GET(ptr) SEGPTR_Get(ptr) #define SEGPTR_FREE(ptr) \