[Spice-commits] common/snd_codec.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 6 19:25:36 UTC 2020


 common/snd_codec.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit da6a405f258a79fac37eaa104cfb638212a4f317
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Nov 21 09:02:15 2019 +0000

    snd_codec: Avoid some useless casts declaring struct type
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/common/snd_codec.c b/common/snd_codec.c
index ce8a389..e54ef3f 100644
--- a/common/snd_codec.c
+++ b/common/snd_codec.c
@@ -39,7 +39,7 @@
 #include "mem.h"
 #include "log.h"
 
-typedef struct
+typedef struct SndCodecInternal
 {
     int mode;
     int frequency;
@@ -262,7 +262,7 @@ int snd_codec_is_capable(int mode, int frequency)
 int snd_codec_create(SndCodec *codec, int mode, int frequency, int purpose)
 {
     int rc = SND_CODEC_UNAVAILABLE;
-    SndCodecInternal **c = (SndCodecInternal **) codec;
+    SndCodecInternal **c = codec;
 
     *c = spice_new0(SndCodecInternal, 1);
     (*c)->frequency = frequency;
@@ -286,7 +286,7 @@ int snd_codec_create(SndCodec *codec, int mode, int frequency, int purpose)
 */
 void snd_codec_destroy(SndCodec *codec)
 {
-    SndCodecInternal **c = (SndCodecInternal **) codec;
+    SndCodecInternal **c = codec;
     if (! c || ! *c)
         return;
 
@@ -311,7 +311,7 @@ void snd_codec_destroy(SndCodec *codec)
 int snd_codec_frame_size(SndCodec codec)
 {
 #if defined(HAVE_CELT051) || defined(HAVE_OPUS)
-    SndCodecInternal *c = (SndCodecInternal *) codec;
+    SndCodecInternal *c = codec;
 #endif
 #if HAVE_CELT051
     if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1)
@@ -345,7 +345,7 @@ int snd_codec_frame_size(SndCodec codec)
 int snd_codec_encode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_ptr, int *out_size)
 {
 #if defined(HAVE_CELT051) || defined(HAVE_OPUS)
-    SndCodecInternal *c = (SndCodecInternal *) codec;
+    SndCodecInternal *c = codec;
 #endif
 #if HAVE_CELT051
     if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1) {
@@ -384,7 +384,7 @@ int snd_codec_encode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_
 int snd_codec_decode(SndCodec codec, uint8_t *in_ptr, int in_size, uint8_t *out_ptr, int *out_size)
 {
 #if defined(HAVE_CELT051) || defined(HAVE_OPUS)
-    SndCodecInternal *c = (SndCodecInternal *) codec;
+    SndCodecInternal *c = codec;
 #endif
 #if HAVE_CELT051
     if (c && c->mode == SPICE_AUDIO_DATA_MODE_CELT_0_5_1)


More information about the Spice-commits mailing list