[Spice-commits] server/red-channel-client.cpp server/red-worker.cpp server/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun May 9 05:40:53 UTC 2021


 server/red-channel-client.cpp |   12 ++++++------
 server/red-worker.cpp         |    2 +-
 server/tests/test-channel.cpp |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 9fb945c31bf8f5001857b6e33ec87ee00fa3ac6c
Author: Rosen Penev <rosenp at gmail.com>
Date:   Wed Apr 14 00:15:26 2021 -0700

    clang-tidy: replace typedef with using
    
    Found with modernize-use-using
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Acked-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/server/red-channel-client.cpp b/server/red-channel-client.cpp
index 3ba0b4f0..b97f38b1 100644
--- a/server/red-channel-client.cpp
+++ b/server/red-channel-client.cpp
@@ -46,12 +46,12 @@
 
 struct SpiceDataHeaderOpaque;
 
-typedef uint16_t (*get_msg_type_proc)(SpiceDataHeaderOpaque *header);
-typedef uint32_t (*get_msg_size_proc)(SpiceDataHeaderOpaque *header);
-typedef void (*set_msg_type_proc)(SpiceDataHeaderOpaque *header, uint16_t type);
-typedef void (*set_msg_size_proc)(SpiceDataHeaderOpaque *header, uint32_t size);
-typedef void (*set_msg_serial_proc)(SpiceDataHeaderOpaque *header, uint64_t serial);
-typedef void (*set_msg_sub_list_proc)(SpiceDataHeaderOpaque *header, uint32_t sub_list);
+using get_msg_type_proc = uint16_t (*)(SpiceDataHeaderOpaque *header);
+using get_msg_size_proc = uint32_t (*)(SpiceDataHeaderOpaque *header);
+using set_msg_type_proc = void (*)(SpiceDataHeaderOpaque *header, uint16_t type);
+using set_msg_size_proc = void (*)(SpiceDataHeaderOpaque *header, uint32_t size);
+using set_msg_serial_proc = void (*)(SpiceDataHeaderOpaque *header, uint64_t serial);
+using set_msg_sub_list_proc = void (*)(SpiceDataHeaderOpaque *header, uint32_t sub_list);
 
 struct SpiceDataHeaderOpaque {
     uint8_t *data;
diff --git a/server/red-worker.cpp b/server/red-worker.cpp
index 4d0a2361..69a16e9d 100644
--- a/server/red-worker.cpp
+++ b/server/red-worker.cpp
@@ -265,7 +265,7 @@ static bool red_process_is_blocked(RedWorker *worker)
            worker->display_channel->max_pipe_size() > MAX_PIPE_SIZE;
 }
 
-typedef int (*red_process_t)(RedWorker *worker, int *ring_is_empty);
+using red_process_t = int (*)(RedWorker *worker, int *ring_is_empty);
 static void flush_commands(RedWorker *worker, RedChannel *red_channel,
                            red_process_t process)
 {
diff --git a/server/tests/test-channel.cpp b/server/tests/test-channel.cpp
index ffd0ec0f..af0e1d6d 100644
--- a/server/tests/test-channel.cpp
+++ b/server/tests/test-channel.cpp
@@ -87,8 +87,8 @@ RedTestChannelClient::release_recv_buf(uint16_t type, uint32_t size, uint8_t *ms
 /*
  * Main test part
  */
-typedef SpiceWatch *watch_add_t(const SpiceCoreInterfaceInternal *iface,
-                                int fd, int event_mask, SpiceWatchFunc func, void *opaque);
+using watch_add_t = SpiceWatch *(const SpiceCoreInterfaceInternal *iface,
+                                 int fd, int event_mask, SpiceWatchFunc func, void *opaque);
 static watch_add_t *old_watch_add = nullptr;
 static SpiceWatchFunc old_watch_func = nullptr;
 


More information about the Spice-commits mailing list