diff --git a/libguac/include/client.h b/libguac/include/client.h index 059bb27e..3483ce01 100644 --- a/libguac/include/client.h +++ b/libguac/include/client.h @@ -169,13 +169,13 @@ struct guac_client { * The time (in milliseconds) of receipt of the last sync message from * the client. */ - guac_timestamp_t last_received_timestamp; + guac_timestamp last_received_timestamp; /** * The time (in milliseconds) that the last sync message was sent to the * client. */ - guac_timestamp_t last_sent_timestamp; + guac_timestamp last_sent_timestamp; /** * Reference to dlopen'd client plugin. diff --git a/libguac/include/protocol.h b/libguac/include/protocol.h index ba4c04c6..5f73191f 100644 --- a/libguac/include/protocol.h +++ b/libguac/include/protocol.h @@ -64,13 +64,13 @@ */ #define GUAC_USEC_TIMEOUT (GUAC_TIMEOUT*1000) -typedef int64_t guac_timestamp_t; +typedef int64_t guac_timestamp; /** * Composite modes used by Guacamole draw instructions. Each * composite mode maps to a unique channel mask integer. */ -typedef enum guac_composite_mode_t { +typedef enum guac_composite_mode { /* * A: Source where destination transparent = S n D' @@ -102,7 +102,7 @@ typedef enum guac_composite_mode_t { GUAC_COMP_RATOP = 0x9, /* 1001 */ GUAC_COMP_SRC = 0xC /* 1100 */ -} guac_composite_mode_t; +} guac_composite_mode; typedef struct guac_layer guac_layer; @@ -197,7 +197,7 @@ int guac_send_name(GUACIO* io, const char* name); * @param timestamp The current timestamp (in milliseconds). * @return Zero on success, non-zero on error. */ -int guac_send_sync(GUACIO* io, guac_timestamp_t timestamp); +int guac_send_sync(GUACIO* io, guac_timestamp timestamp); /** * Sends an error instruction over the given GUACIO connection. @@ -246,7 +246,7 @@ int guac_send_size(GUACIO* io, int w, int h); */ int guac_send_copy(GUACIO* io, const guac_layer* srcl, int srcx, int srcy, int w, int h, - guac_composite_mode_t mode, const guac_layer* dstl, int dstx, int dsty); + guac_composite_mode mode, const guac_layer* dstl, int dstx, int dsty); /** * Sends a rect instruction over the given GUACIO connection. @@ -265,7 +265,7 @@ int guac_send_copy(GUACIO* io, * @return Zero on success, non-zero on error. */ int guac_send_rect(GUACIO* io, - guac_composite_mode_t mode, const guac_layer* layer, + guac_composite_mode mode, const guac_layer* layer, int x, int y, int width, int height, int r, int g, int b, int a); @@ -295,7 +295,7 @@ int guac_send_clip(GUACIO* io, const guac_layer* layer, * @param surface A cairo surface containing the image data to send. * @return Zero on success, non-zero on error. */ -int guac_send_png(GUACIO* io, guac_composite_mode_t mode, +int guac_send_png(GUACIO* io, guac_composite_mode mode, const guac_layer* layer, int x, int y, cairo_surface_t* surface); /** @@ -335,7 +335,7 @@ int guac_instructions_waiting(GUACIO* io); */ int guac_read_instruction(GUACIO* io, guac_instruction* parsed_instruction); -guac_timestamp_t guac_current_timestamp(); +guac_timestamp guac_current_timestamp(); void guac_sleep(int millis); #endif diff --git a/libguac/include/thread.h b/libguac/include/thread.h index 33bd5d5d..f39c5682 100644 --- a/libguac/include/thread.h +++ b/libguac/include/thread.h @@ -47,17 +47,17 @@ #ifdef HAVE_LIBPTHREAD #include -typedef pthread_t guac_thread_t; +typedef pthread_t guac_thread; #elif defined(__MINGW32__) #include #include -typedef HANDLE guac_thread_t; +typedef HANDLE guac_thread; #endif -int guac_thread_create(guac_thread_t* thread, void*(*function)(void*), void* data); -void guac_thread_join(guac_thread_t thread); +int guac_thread_create(guac_thread* thread, void*(*function)(void*), void* data); +void guac_thread_join(guac_thread thread); #endif diff --git a/libguac/src/client-handlers.c b/libguac/src/client-handlers.c index 66e9d792..91e533a2 100644 --- a/libguac/src/client-handlers.c +++ b/libguac/src/client-handlers.c @@ -56,7 +56,7 @@ __guac_instruction_handler_mapping __guac_instruction_handler_map[] = { /* Guacamole instruction handlers */ int __guac_handle_sync(guac_client* client, guac_instruction* instruction) { - guac_timestamp_t timestamp = guac_parse_int(instruction->argv[0]); + guac_timestamp timestamp = guac_parse_int(instruction->argv[0]); /* Error if timestamp is in future */ if (timestamp > client->last_sent_timestamp) diff --git a/libguac/src/client.c b/libguac/src/client.c index e8d2cc83..a1cafa18 100644 --- a/libguac/src/client.c +++ b/libguac/src/client.c @@ -342,13 +342,13 @@ void* __guac_client_output_thread(void* data) { guac_client* client = (guac_client*) data; GUACIO* io = client->io; - guac_timestamp_t last_ping_timestamp = guac_current_timestamp(); + guac_timestamp last_ping_timestamp = guac_current_timestamp(); /* Guacamole client output loop */ while (client->state == RUNNING) { /* Occasionally ping client with repeat of last sync */ - guac_timestamp_t timestamp = guac_current_timestamp(); + guac_timestamp timestamp = guac_current_timestamp(); if (timestamp - last_ping_timestamp > GUAC_SYNC_FREQUENCY) { last_ping_timestamp = timestamp; if ( @@ -444,7 +444,7 @@ void* __guac_client_input_thread(void* data) { int guac_start_client(guac_client* client) { - guac_thread_t input_thread, output_thread; + guac_thread input_thread, output_thread; if (guac_thread_create(&output_thread, __guac_client_output_thread, (void*) client)) { return -1; diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index 9dfe74f7..89ead2f4 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -137,7 +137,7 @@ int guac_send_error(GUACIO* io, const char* error) { || guac_write_string(io, ";"); } -int guac_send_sync(GUACIO* io, guac_timestamp_t timestamp) { +int guac_send_sync(GUACIO* io, guac_timestamp timestamp) { return guac_write_string(io, "4.sync,") @@ -148,7 +148,7 @@ int guac_send_sync(GUACIO* io, guac_timestamp_t timestamp) { int guac_send_copy(GUACIO* io, const guac_layer* srcl, int srcx, int srcy, int w, int h, - guac_composite_mode_t mode, const guac_layer* dstl, int dstx, int dsty) { + guac_composite_mode mode, const guac_layer* dstl, int dstx, int dsty) { return guac_write_string(io, "4.copy,") @@ -174,7 +174,7 @@ int guac_send_copy(GUACIO* io, } int guac_send_rect(GUACIO* io, - guac_composite_mode_t mode, const guac_layer* layer, + guac_composite_mode mode, const guac_layer* layer, int x, int y, int width, int height, int r, int g, int b, int a) { @@ -295,7 +295,7 @@ int __guac_write_length_png(GUACIO* io, cairo_surface_t* surface) { } -int guac_send_png(GUACIO* io, guac_composite_mode_t mode, +int guac_send_png(GUACIO* io, guac_composite_mode mode, const guac_layer* layer, int x, int y, cairo_surface_t* surface) { return @@ -475,7 +475,7 @@ int guac_instructions_waiting(GUACIO* io) { return guac_select(io, GUAC_USEC_TIMEOUT); } -guac_timestamp_t guac_current_timestamp() { +guac_timestamp guac_current_timestamp() { #ifdef HAVE_CLOCK_GETTIME @@ -485,7 +485,7 @@ guac_timestamp_t guac_current_timestamp() { clock_gettime(CLOCK_REALTIME, ¤t); /* Calculate milliseconds */ - return (guac_timestamp_t) current.tv_sec * 1000 + current.tv_nsec / 1000000; + return (guac_timestamp) current.tv_sec * 1000 + current.tv_nsec / 1000000; #else @@ -495,7 +495,7 @@ guac_timestamp_t guac_current_timestamp() { gettimeofday(¤t, NULL); /* Calculate milliseconds */ - return (guac_timestamp_t) current.tv_sec * 1000 + current.tv_usec / 1000; + return (guac_timestamp) current.tv_sec * 1000 + current.tv_usec / 1000; #endif diff --git a/libguac/src/thread.c b/libguac/src/thread.c index cacc7b08..ffa8a647 100644 --- a/libguac/src/thread.c +++ b/libguac/src/thread.c @@ -44,11 +44,11 @@ #include #endif -int guac_thread_create(guac_thread_t* thread, void*(*function)(void*), void* data) { +int guac_thread_create(guac_thread* thread, void*(*function)(void*), void* data) { #ifdef HAVE_LIBPTHREAD return pthread_create(thread, NULL, function, data); #elif defined(__MINGW32__) - *thread = (guac_thread_t) _beginthreadex(NULL, 0, + *thread = (guac_thread) _beginthreadex(NULL, 0, (unsigned(__stdcall*)(void*)) function, data, 0 /* Create running */, NULL); if (thread == 0) @@ -57,7 +57,7 @@ int guac_thread_create(guac_thread_t* thread, void*(*function)(void*), void* dat #endif } -void guac_thread_join(guac_thread_t thread) { +void guac_thread_join(guac_thread thread) { #ifdef HAVE_LIBPTHREAD pthread_join(thread, NULL); #elif defined(__MINGW32__)