[MPlayer-cvslog] r26789 - in trunk: 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

diego subversion at mplayerhq.hu
Fri May 16 11:31:56 CEST 2008


Author: diego
Date: Fri May 16 11:31:55 2008
New Revision: 26789

Log:
Remove pointless parentheses from return statements.


Modified:
   trunk/libao2/ao_alsa.c
   trunk/libao2/ao_alsa5.c
   trunk/libao2/ao_arts.c
   trunk/libao2/ao_sdl.c
   trunk/loader/driver.c
   trunk/loader/dshow/mediatype.c
   trunk/loader/qtx/qtxload.c
   trunk/loader/win32.c
   trunk/loader/wine/heap.h

Modified: trunk/libao2/ao_alsa.c
==============================================================================
--- trunk/libao2/ao_alsa.c	(original)
+++ trunk/libao2/ao_alsa.c	Fri May 16 11:31:55 2008
@@ -232,7 +232,7 @@ static int control(int cmd, void *arg)
     }
     
   } //end switch
-  return(CONTROL_UNKNOWN);
+  return CONTROL_UNKNOWN;
 }
 
 static void parse_device (char *dest, const char *src, int len)
@@ -498,11 +498,11 @@ static int init(int rate_hz, int channel
 	    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 @@ static int init(int rate_hz, int channel
 	{
 	  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 @@ static int init(int rate_hz, int channel
       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 @@ static int init(int rate_hz, int channel
 	{
 	  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 @@ static int init(int rate_hz, int channel
 	{
 	  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 @@ static int init(int rate_hz, int channel
 	{
 	  mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_UnableToDisableResampling,
 		 snd_strerror(err));
-	  return(0);
+	  return 0;
 	}
 #endif
 
@@ -575,7 +575,7 @@ static int init(int rate_hz, int channel
         {
 	  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 @@ static int init(int rate_hz, int channel
 	  {
 	    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 @@ static int init(int rate_hz, int channel
 
     } // 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 @@ static int play(void* data, int len, int
 	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 @@ static int get_space(void)
     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 @@ static float get_delay(void)
     }
     return (float)delay / (float)ao_data.samplerate;
   } else {
-    return(0);
+    return 0;
   }
 }

Modified: trunk/libao2/ao_alsa5.c
==============================================================================
--- trunk/libao2/ao_alsa5.c	(original)
+++ trunk/libao2/ao_alsa5.c	Fri May 16 11:31:55 2008
@@ -35,7 +35,7 @@ static int alsa_rate = SND_PCM_RATE_CONT
 /* to set/get/query special features/parameters */
 static int control(int cmd, void *arg)
 {
-    return(CONTROL_UNKNOWN);
+    return CONTROL_UNKNOWN;
 }
 
 /*
@@ -62,7 +62,7 @@ static int init(int rate_hz, int channel
     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 @@ static int init(int rate_hz, int channel
 	    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 @@ static int init(int rate_hz, int channel
     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 @@ static int init(int rate_hz, int channel
 	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 @@ static int init(int rate_hz, int channel
     if ((err = snd_pcm_channel_params(alsa_handler, &params)) < 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 @@ static int init(int rate_hz, int channel
     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 @@ static int play(void* data, int len, int
     int got_len;
     
     if (!len)
-	return(0);
+	return 0;
     
     if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0)
     {
@@ -331,20 +331,20 @@ static int play(void* data, int len, int
 	    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 @@ static int get_space(void)
     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 @@ static float get_delay(void)
     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;
 }

Modified: trunk/libao2/ao_arts.c
==============================================================================
--- trunk/libao2/ao_arts.c	(original)
+++ trunk/libao2/ao_arts.c	Fri May 16 11:31:55 2008
@@ -37,7 +37,7 @@ LIBAO_EXTERN(arts)
 
 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)

Modified: trunk/libao2/ao_sdl.c
==============================================================================
--- trunk/libao2/ao_sdl.c	(original)
+++ trunk/libao2/ao_sdl.c	Fri May 16 11:31:55 2008
@@ -231,7 +231,7 @@ void callback(void *userdata, Uint8 *str
 	/* 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 ? */

Modified: trunk/loader/driver.c
==============================================================================
--- trunk/loader/driver.c	(original)
+++ trunk/loader/driver.c	Fri May 16 11:31:55 2008
@@ -158,7 +158,7 @@ HDRVR DrvOpen(LPARAM lParam2)
 
     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 @@ HDRVR DrvOpen(LPARAM lParam2)
     {
 	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 @@ HDRVR DrvOpen(LPARAM lParam2)
     {
 	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);

Modified: trunk/loader/dshow/mediatype.c
==============================================================================
--- trunk/loader/dshow/mediatype.c	(original)
+++ trunk/loader/dshow/mediatype.c	Fri May 16 11:31:55 2008
@@ -156,6 +156,6 @@ void DeleteMediaType(AM_MEDIA_TYPE * pMe
 #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));
 }

Modified: trunk/loader/qtx/qtxload.c
==============================================================================
--- trunk/loader/qtx/qtxload.c	(original)
+++ trunk/loader/qtx/qtxload.c	Fri May 16 11:31:55 2008
@@ -17,7 +17,7 @@ ComponentResult ComponentDummy(
 	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);}

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	(original)
+++ trunk/loader/win32.c	Fri May 16 11:31:55 2008
@@ -1273,8 +1273,8 @@ static int critsecs_get_pos(CRITICAL_SEC
 
     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 @@ static int critsecs_get_unused(void)
 
     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 @@ struct CRITSECT *critsecs_get_unix(CRITI
 
     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
 

Modified: trunk/loader/wine/heap.h
==============================================================================
--- trunk/loader/wine/heap.h	(original)
+++ trunk/loader/wine/heap.h	Fri May 16 11:31:55 2008
@@ -33,7 +33,7 @@ extern LPSTR HEAP_strdupWtoA( HANDLE hea
          (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) \



More information about the MPlayer-cvslog mailing list