[Spice-commits] server/image-cache.h server/pixmap-cache.h server/red-parse-qxl.h server/red-record-qxl.cpp server/reds-private.h server/tree.h server/video-stream.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 05:16:22 UTC 2021


 server/image-cache.h      |   14 +++++++-------
 server/pixmap-cache.h     |    7 ++-----
 server/red-parse-qxl.h    |    4 ++--
 server/red-record-qxl.cpp |    4 ++--
 server/reds-private.h     |   30 +++++++++++++++---------------
 server/tree.h             |    9 +++------
 server/video-stream.h     |   18 +++++++++---------
 7 files changed, 40 insertions(+), 46 deletions(-)

New commits:
commit d17e7878cb9724e2d4e476dab4b0bf30a825d13c
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Thu Aug 26 20:59:41 2021 +0100

    Remove useless typedefs
    
    Just use forward declaration if needed.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/server/image-cache.h b/server/image-cache.h
index 9c3d3463..ba45a637 100644
--- a/server/image-cache.h
+++ b/server/image-cache.h
@@ -24,12 +24,12 @@
 #include <common/canvas_base.h>
 #include <common/ring.h>
 
-SPICE_BEGIN_DECLS
+#include "push-visibility.h"
 
 /* FIXME: move back to display-channel.h (once structs are private) */
-typedef struct Drawable Drawable;
+struct Drawable;
 
-typedef struct ImageCacheItem {
+struct ImageCacheItem {
     RingItem lru_link;
     uint64_t id;
 #ifdef IMAGE_CACHE_AGE
@@ -37,11 +37,11 @@ typedef struct ImageCacheItem {
 #endif
     struct ImageCacheItem *next;
     pixman_image_t *image;
-} ImageCacheItem;
+};
 
 #define IMAGE_CACHE_HASH_SIZE 1024
 
-typedef struct ImageCache {
+struct ImageCache {
     SpiceImageCache base;
     ImageCacheItem *hash_table[IMAGE_CACHE_HASH_SIZE];
     Ring lru;
@@ -50,7 +50,7 @@ typedef struct ImageCache {
 #else
     uint32_t num_items;
 #endif
-} ImageCache;
+};
 
 void         image_cache_init              (ImageCache *cache);
 void         image_cache_reset             (ImageCache *cache);
@@ -62,6 +62,6 @@ void         image_cache_localize_brush    (ImageCache *cache, SpiceBrush *brush
 void         image_cache_localize_mask     (ImageCache *cache, SpiceQMask *mask,
                                             SpiceImage *image_store);
 
-SPICE_END_DECLS
+#include "pop-visibility.h"
 
 #endif /* IMAGE_CACHE_H_ */
diff --git a/server/pixmap-cache.h b/server/pixmap-cache.h
index ad308175..577ca948 100644
--- a/server/pixmap-cache.h
+++ b/server/pixmap-cache.h
@@ -23,7 +23,7 @@
 
 #include "red-channel.h"
 
-SPICE_BEGIN_DECLS
+#include "push-visibility.h"
 
 #define MAX_CACHE_CLIENTS 4
 
@@ -32,9 +32,6 @@ SPICE_BEGIN_DECLS
 #define BITS_CACHE_HASH_MASK (BITS_CACHE_HASH_SIZE - 1)
 #define BITS_CACHE_HASH_KEY(id) ((id) & BITS_CACHE_HASH_MASK)
 
-typedef struct PixmapCache PixmapCache;
-typedef struct NewCacheItem NewCacheItem;
-
 struct NewCacheItem {
     RingItem lru_link;
     NewCacheItem *next;
@@ -74,6 +71,6 @@ void         pixmap_cache_clear(PixmapCache *cache);
 int          pixmap_cache_unlocked_set_lossy(PixmapCache *cache, uint64_t id, int lossy);
 bool         pixmap_cache_freeze(PixmapCache *cache);
 
-SPICE_END_DECLS
+#include "pop-visibility.h"
 
 #endif /* PIXMAP_CACHE_H_ */
diff --git a/server/red-parse-qxl.h b/server/red-parse-qxl.h
index cbea4504..8bf0e2e3 100644
--- a/server/red-parse-qxl.h
+++ b/server/red-parse-qxl.h
@@ -82,13 +82,13 @@ struct RedMessage final: public RedQXLResource<RedMessage> {
     uint8_t *data;
 };
 
-typedef struct RedSurfaceCreate {
+struct RedSurfaceCreate {
     uint32_t format;
     uint32_t width;
     uint32_t height;
     int32_t stride;
     uint8_t *data;
-} RedSurfaceCreate;
+};
 
 struct RedSurfaceCmd final: public RedQXLResource<RedSurfaceCmd> {
     ~RedSurfaceCmd();
diff --git a/server/red-record-qxl.cpp b/server/red-record-qxl.cpp
index 2ff25d5b..032b15e6 100644
--- a/server/red-record-qxl.cpp
+++ b/server/red-record-qxl.cpp
@@ -62,11 +62,11 @@ static void hexdump_qxl(RedMemSlotInfo *slots, int group_id,
 /* TODO: make this thread safe (required for two qxl devices) */
 
 #if WITH_ZLIB
-typedef struct RecordEncoderData {
+struct RecordEncoderData {
     ZlibEncoderUsrContext base;
     uint8_t *buf;
     int size;
-} RecordEncoderData;
+};
 
 static int record_zlib_more_space(ZlibEncoderUsrContext *usr, uint8_t **io_ptr)
 {
diff --git a/server/reds-private.h b/server/reds-private.h
index 51534d94..fc867fa3 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -32,46 +32,46 @@
 #define MIGRATE_TIMEOUT (MSEC_PER_SEC * 10)
 #define MM_TIME_DELTA 400 /*ms*/
 
-typedef struct TicketAuthentication {
+struct TicketAuthentication {
     char password[SPICE_MAX_PASSWORD_LENGTH];
     time_t expiration_time;
-} TicketAuthentication;
+};
 
-typedef struct TicketInfo {
+struct TicketInfo {
     RSA *rsa;
     int rsa_size;
     BIGNUM *bn;
     SpiceLinkEncryptedTicket encrypted_ticket;
-} TicketInfo;
+};
 
-typedef struct MonitorMode {
+struct MonitorMode {
     uint32_t x_res;
     uint32_t y_res;
-} MonitorMode;
+};
 
-typedef struct RedsMigPendingLink {
+struct RedsMigPendingLink {
     SpiceLinkMess *link_msg;
     RedStream *stream;
-} RedsMigPendingLink;
+};
 
-typedef struct RedsMigTargetClient {
+struct RedsMigTargetClient {
     RedClient *client;
     GList *pending_links;
-} RedsMigTargetClient;
+};
 
-typedef struct ChannelSecurityOptions ChannelSecurityOptions;
+struct ChannelSecurityOptions;
 
-typedef struct RedSSLParameters {
+struct RedSSLParameters {
     char keyfile_password[256];
     char certs_file[256];
     char private_key_file[256];
     char ca_certificate_file[256];
     char dh_key_file[256];
     char ciphersuite[256];
-} RedSSLParameters;
+};
 
-typedef struct RedCharDeviceVDIPort RedCharDeviceVDIPort;
-typedef struct RedServerConfig RedServerConfig;
+struct RedCharDeviceVDIPort;
+struct RedServerConfig;
 
 struct RedsState {
     SPICE_CXX_GLIB_ALLOCATOR
diff --git a/server/tree.h b/server/tree.h
index 7e7c61f3..5827f364 100644
--- a/server/tree.h
+++ b/server/tree.h
@@ -25,7 +25,7 @@
 
 #include "spice-bitmap-utils.h"
 
-SPICE_BEGIN_DECLS
+#include "push-visibility.h"
 
 enum {
     TREE_ITEM_TYPE_NONE,
@@ -36,10 +36,7 @@ enum {
     TREE_ITEM_TYPE_LAST,
 };
 
-typedef struct TreeItem TreeItem;
-typedef struct Shadow Shadow;
-typedef struct Container Container;
-typedef struct DrawItem DrawItem;
+struct Container;
 
 /* TODO consider GNode instead */
 struct TreeItem {
@@ -99,6 +96,6 @@ Container* container_new                            (DrawItem *item);
 void       container_free                           (Container *container);
 void       container_cleanup                        (Container *container);
 
-SPICE_END_DECLS
+#include "pop-visibility.h"
 
 #endif /* TREE_H_ */
diff --git a/server/video-stream.h b/server/video-stream.h
index f6855ae6..23b44ff5 100644
--- a/server/video-stream.h
+++ b/server/video-stream.h
@@ -27,7 +27,7 @@
 #include "red-channel.h"
 #include "dcc.h"
 
-SPICE_BEGIN_DECLS
+#include "push-visibility.h"
 
 #define RED_STREAM_DETECTION_MAX_DELTA (NSEC_PER_SEC / 5)
 #define RED_STREAM_CONTINUOUS_MAX_DELTA NSEC_PER_SEC
@@ -45,10 +45,10 @@ SPICE_BEGIN_DECLS
 #define RED_STREAM_DEFAULT_LOW_START_BIT_RATE (2.5 * 1024 * 1024) // 2.5Mbps
 #define MAX_FPS 30
 
-typedef struct VideoStream VideoStream;
+struct VideoStream;
 
 #ifdef STREAM_STATS
-typedef struct StreamStats {
+struct StreamStats {
     uint64_t num_drops_pipe;
     uint64_t num_drops_fps;
     uint64_t num_frames_sent;
@@ -57,10 +57,10 @@ typedef struct StreamStats {
 
     uint64_t start;
     uint64_t end;
-} StreamStats;
+};
 #endif
 
-typedef struct VideoStreamAgent {
+struct VideoStreamAgent {
     QRegion vis_region; /* the part of the surface area that is currently occupied by video
                            fragments */
     QRegion clip;       /* the current video clipping. It can be different from vis_region:
@@ -79,7 +79,7 @@ typedef struct VideoStreamAgent {
 #ifdef STREAM_STATS
     StreamStats stats;
 #endif
-} VideoStreamAgent;
+};
 
 struct VideoStreamClipItem: public RedPipeItem {
     VideoStreamClipItem(VideoStreamAgent *agent);
@@ -96,7 +96,7 @@ struct StreamCreateDestroyItem: public RedPipeItem {
     VideoStreamAgent *agent;
 };
 
-typedef struct ItemTrace {
+struct ItemTrace {
     red_time_t time;
     red_time_t first_frame_time;
     int frames_count;
@@ -105,7 +105,7 @@ typedef struct ItemTrace {
     int width;
     int height;
     SpiceRect dest_area;
-} ItemTrace;
+};
 
 struct VideoStream {
     uint8_t refs;
@@ -139,6 +139,6 @@ void video_stream_agent_stop(VideoStreamAgent *agent);
 
 void video_stream_detach_drawable(VideoStream *stream);
 
-SPICE_END_DECLS
+#include "pop-visibility.h"
 
 #endif /* VIDEO_STREAM_H_ */


More information about the Spice-commits mailing list