[Spice-devel] [PATCH v2 03/10] Generate GTypes for spice-server enums

Frediano Ziglio fziglio at redhat.com
Thu Sep 8 12:25:58 UTC 2016


> 
> Looked at this a bit closer, any reason why this is limited to
> spice-server.h and not including the other public headers? I don't
> really understand why we need these enums at this point.
> Also, some of the enums in spice-server.h are not taken into account
> because they are not of the form typedef enum { } spice_foo_t;
> 

I actually merged all but this... yes, there is no current reason for this
patch (as far as I know).

Is it used for debugging somewhere in the future?
GObject require it?

> diff --git a/server/Makefile.am b/server/Makefile.am
> index 9c5b3b6..93082c1 100644
> --- a/server/Makefile.am
> +++ b/server/Makefile.am
> @@ -190,11 +190,11 @@ endif
>  libspice_server_la_LIBADD = libserver.la
>  libspice_server_la_SOURCES =
>  
> -spice-server-enums.c: spice-server.h
> +spice-server-enums.c: spice-server.h spice-audio.h spice-char.h
>  	$(AM_V_GEN)glib-mkenums --fhead "#include \"config.h\"\n\n" \
>  			--fhead "#include <glib-object.h>\n" \
>  			--fhead "#include \"spice-server-enums.h\"\n\n" \
> -			--fprod "\n#include \"spice-server.h\"\n" \
> +			--fprod "\n#include \"spice.h\"\n" \
>  			--vhead "static const G at Type@Value _ at enum_name@_values[] = {" \
>  			--vprod "  { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
>  			--vtail "  { 0, NULL, NULL }\n};\n\n" \
> @@ -208,7 +208,7 @@ spice-server-enums.c: spice-server.h
>  			--vtail "  return type;\n}\n\n" \
>  		$^ > $@
>  
> -spice-server-enums.h: spice-server.h
> +spice-server-enums.h: spice-server.h spice-audio.h spice-char.h
>  	$(AM_V_GEN)glib-mkenums --fhead "#ifndef SPICE_SERVER_ENUMS_H\n" \
>  			--fhead "#define SPICE_SERVER_ENUMS_H\n\n" \
>  			--fhead "G_BEGIN_DECLS\n\n" \
> diff --git a/server/spice-audio.h b/server/spice-audio.h
> index 3de4a8d..f62999d 100644
> --- a/server/spice-audio.h
> +++ b/server/spice-audio.h
> @@ -33,9 +33,9 @@ typedef struct SpicePlaybackInterface
> SpicePlaybackInterface;
>  typedef struct SpicePlaybackInstance SpicePlaybackInstance;
>  typedef struct SpicePlaybackState SpicePlaybackState;
>  
> -enum {
> +typedef enum {
>      SPICE_INTERFACE_AUDIO_FMT_S16 = 1,
> -};
> +} spice_audio_format_t;
>  
>  #define SPICE_INTERFACE_PLAYBACK_FREQ  44100
>  #define SPICE_INTERFACE_PLAYBACK_CHAN  2
> diff --git a/server/spice-server.h b/server/spice-server.h
> index a5c7a95..3c112bc 100644
> --- a/server/spice-server.h
> +++ b/server/spice-server.h
> @@ -104,20 +104,20 @@ int spice_server_set_channel_security(SpiceServer *s,
> const char *channel, int s
>  
>  int spice_server_add_renderer(SpiceServer *s, const char *name)
>  SPICE_GNUC_DEPRECATED;
>  
> -enum {
> +typedef enum {
>      SPICE_STREAM_VIDEO_INVALID,
>      SPICE_STREAM_VIDEO_OFF,
>      SPICE_STREAM_VIDEO_ALL,
>      SPICE_STREAM_VIDEO_FILTER
> -};
> +} spice_stream_video_t;
>  
>  int spice_server_set_streaming_video(SpiceServer *s, int value);
>  
> -enum {
> +typedef enum {
>      SPICE_STREAMING_INVALID,
>      SPICE_STREAMING_SPICE,
>      SPICE_STREAMING_GSTREAMER
> -};
> +} spice_streaming_type_t;
>  
>  int spice_server_set_video_codecs(SpiceServer *s, const char* video_codecs);
>  int spice_server_set_playback_compression(SpiceServer *s, int enable);
> 
> Christophe
> 

Why you are adding some other data if you are not sure they are used?

Frediano


More information about the Spice-devel mailing list