Merge 1.6.1 changes to patch branch.
diff --git a/src/common-ssh/common-ssh/key.h b/src/common-ssh/common-ssh/key.h index ce8fec9..f2c5caf 100644 --- a/src/common-ssh/common-ssh/key.h +++ b/src/common-ssh/common-ssh/key.h
@@ -89,7 +89,7 @@ * @return * A statically-allocated string describing the most recent SSH key error. */ -const char* guac_common_ssh_key_error(); +const char* guac_common_ssh_key_error(void); /** * Frees all memory associated with the given key.
diff --git a/src/common-ssh/common-ssh/ssh.h b/src/common-ssh/common-ssh/ssh.h index d5805b4..cec09a9 100644 --- a/src/common-ssh/common-ssh/ssh.h +++ b/src/common-ssh/common-ssh/ssh.h
@@ -93,7 +93,7 @@ * This function must be called once no other guac_common_ssh_*() functions * will be used. */ -void guac_common_ssh_uninit(); +void guac_common_ssh_uninit(void); /** * Connects to the SSH server running at the given hostname and port, and
diff --git a/src/common-ssh/key.c b/src/common-ssh/key.c index 4ac979c..71c130d 100644 --- a/src/common-ssh/key.c +++ b/src/common-ssh/key.c
@@ -155,7 +155,7 @@ } -const char* guac_common_ssh_key_error() { +const char* guac_common_ssh_key_error(void) { /* Return static error string */ return ERR_reason_error_string(ERR_get_error());
diff --git a/src/common-ssh/ssh.c b/src/common-ssh/ssh.c index 582c3eb..7378946 100644 --- a/src/common-ssh/ssh.c +++ b/src/common-ssh/ssh.c
@@ -111,7 +111,7 @@ * @return * An ID which uniquely identifies the current thread. */ -static unsigned long guac_common_ssh_openssl_id_callback() { +static unsigned long guac_common_ssh_openssl_id_callback(void) { return (unsigned long) pthread_self(); } @@ -202,7 +202,7 @@ } -void guac_common_ssh_uninit() { +void guac_common_ssh_uninit(void) { #ifdef OPENSSL_REQUIRES_THREADING_CALLBACKS guac_common_ssh_openssl_free_locks(CRYPTO_num_locks()); #endif
diff --git a/src/common-ssh/tests/sftp/normalize_path.c b/src/common-ssh/tests/sftp/normalize_path.c index df586c1..588a160 100644 --- a/src/common-ssh/tests/sftp/normalize_path.c +++ b/src/common-ssh/tests/sftp/normalize_path.c
@@ -28,7 +28,7 @@ * Test which verifies absolute Windows-style paths are correctly normalized to * absolute paths with UNIX separators and no relative components. */ -void test_sftp__normalize_absolute_windows() { +void test_sftp__normalize_absolute_windows(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -56,7 +56,7 @@ * Test which verifies absolute UNIX-style paths are correctly normalized to * absolute paths with UNIX separators and no relative components. */ -void test_sftp__normalize_absolute_unix() { +void test_sftp__normalize_absolute_unix(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -85,7 +85,7 @@ * separators are correctly normalized to absolute paths with UNIX separators * and no relative components. */ -void test_sftp__normalize_absolute_mixed() { +void test_sftp__normalize_absolute_mixed(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -109,7 +109,7 @@ /** * Test which verifies relative Windows-style paths are always rejected. */ -void test_sftp__normalize_relative_windows() { +void test_sftp__normalize_relative_windows(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -128,7 +128,7 @@ /** * Test which verifies relative UNIX-style paths are always rejected. */ -void test_sftp__normalize_relative_unix() { +void test_sftp__normalize_relative_unix(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -148,7 +148,7 @@ * Test which verifies relative paths consisting of mixed Windows and UNIX path * separators are always rejected. */ -void test_sftp__normalize_relative_mixed() { +void test_sftp__normalize_relative_mixed(void) { char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -208,7 +208,7 @@ * Test which verifies that paths exceeding the maximum path length are * rejected. */ -void test_sftp__normalize_long() { +void test_sftp__normalize_long(void) { char* input; char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH]; @@ -234,7 +234,7 @@ * Test which verifies that paths exceeding the maximum path depth are * rejected. */ -void test_sftp__normalize_deep() { +void test_sftp__normalize_deep(void) { char* input; char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
diff --git a/src/common/common/list.h b/src/common/common/list.h index 6c8e0a4..52532c0 100644 --- a/src/common/common/list.h +++ b/src/common/common/list.h
@@ -71,7 +71,7 @@ * * @return A newly-allocated list. */ -guac_common_list* guac_common_list_alloc(); +guac_common_list* guac_common_list_alloc(void); /** * A handler that will be invoked with the data pointer of each element of
diff --git a/src/common/list.c b/src/common/list.c index 9e4c568..d417c4e 100644 --- a/src/common/list.c +++ b/src/common/list.c
@@ -24,7 +24,7 @@ #include <stdlib.h> #include <pthread.h> -guac_common_list* guac_common_list_alloc() { +guac_common_list* guac_common_list_alloc(void) { guac_common_list* list = guac_mem_alloc(sizeof(guac_common_list));
diff --git a/src/common/surface.c b/src/common/surface.c index 8d26b12..622c8d2 100644 --- a/src/common/surface.c +++ b/src/common/surface.c
@@ -1894,7 +1894,6 @@ guac_common_surface_bitmap_rect* current = surface->bitmap_queue; int i, j; int original_queue_length; - int flushed = 0; original_queue_length = surface->bitmap_queue_length; @@ -1942,8 +1941,6 @@ /* Flush as bitmap otherwise */ else if (surface->dirty) { - flushed++; - int opaque = __guac_common_surface_is_opaque(surface, &surface->dirty_rect);
diff --git a/src/common/tests/iconv/convert.c b/src/common/tests/iconv/convert.c index 7a94007..8c320a7 100644 --- a/src/common/tests/iconv/convert.c +++ b/src/common/tests/iconv/convert.c
@@ -79,7 +79,7 @@ * to every other supported encoding, with all line endings preserved verbatim * (not normalized). */ -void test_iconv__preserve() { +void test_iconv__preserve(void) { for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) { for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) { @@ -99,7 +99,7 @@ * to every other supported encoding, normalizing all line endings to * Unix-style line endings. */ -void test_iconv__normalize_unix() { +void test_iconv__normalize_unix(void) { for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) { for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) { @@ -119,7 +119,7 @@ * to every other supported encoding, normalizing all line endings to * Windows-style line endings. */ -void test_iconv__normalize_crlf() { +void test_iconv__normalize_crlf(void) { for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) { for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) {
diff --git a/src/common/tests/rect/clip_and_split.c b/src/common/tests/rect/clip_and_split.c index e286bce..7b7f4da 100644 --- a/src/common/tests/rect/clip_and_split.c +++ b/src/common/tests/rect/clip_and_split.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_common_rect_clip_and_split() divides a * rectangle into subrectangles after removing a "hole" rectangle. */ -void test_rect__clip_and_split() { +void test_rect__clip_and_split(void) { int res;
diff --git a/src/common/tests/rect/constrain.c b/src/common/tests/rect/constrain.c index 793aac2..6bddc14 100644 --- a/src/common/tests/rect/constrain.c +++ b/src/common/tests/rect/constrain.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_common_rect_constrain() restricts a given * rectangle to arbitrary bounds. */ -void test_rect__constrain() { +void test_rect__constrain(void) { guac_common_rect max; guac_common_rect rect;
diff --git a/src/common/tests/rect/expand_to_grid.c b/src/common/tests/rect/expand_to_grid.c index beef87d..46b7efa 100644 --- a/src/common/tests/rect/expand_to_grid.c +++ b/src/common/tests/rect/expand_to_grid.c
@@ -25,7 +25,7 @@ * Test which verifies guac_common_rect_expand_to_grid() properly shifts and * resizes rectangles to fit an NxN grid. */ -void test_rect__expand_to_grid() { +void test_rect__expand_to_grid(void) { int cell_size = 16;
diff --git a/src/common/tests/rect/extend.c b/src/common/tests/rect/extend.c index dc2a0e3..8fb92f7 100644 --- a/src/common/tests/rect/extend.c +++ b/src/common/tests/rect/extend.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_common_rect_extend() expands the given * rectangle as necessary to contain at least the given bounds. */ -void test_rect__extend() { +void test_rect__extend(void) { guac_common_rect max; guac_common_rect rect;
diff --git a/src/common/tests/rect/init.c b/src/common/tests/rect/init.c index 288cd75..345a245 100644 --- a/src/common/tests/rect/init.c +++ b/src/common/tests/rect/init.c
@@ -24,7 +24,7 @@ /** * Test which verifies rectangle initialization via guac_common_rect_init(). */ -void test_rect__init() { +void test_rect__init(void) { guac_common_rect max;
diff --git a/src/common/tests/rect/intersects.c b/src/common/tests/rect/intersects.c index c480268..31b6d61 100644 --- a/src/common/tests/rect/intersects.c +++ b/src/common/tests/rect/intersects.c
@@ -24,7 +24,7 @@ /** * Test which verifies intersection testing via guac_common_rect_intersects(). */ -void test_rect__intersects() { +void test_rect__intersects(void) { int res;
diff --git a/src/common/tests/string/count_occurrences.c b/src/common/tests/string/count_occurrences.c index 0c7d01d..3cdef7e 100644 --- a/src/common/tests/string/count_occurrences.c +++ b/src/common/tests/string/count_occurrences.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_count_occurrences() counts the number of * occurrences of an arbitrary character within a given string. */ -void test_string__guac_count_occurrences() { +void test_string__guac_count_occurrences(void) { CU_ASSERT_EQUAL(4, guac_count_occurrences("this is a test string", 's')); CU_ASSERT_EQUAL(3, guac_count_occurrences("this is a test string", 'i')); CU_ASSERT_EQUAL(0, guac_count_occurrences("", 's'));
diff --git a/src/common/tests/string/split.c b/src/common/tests/string/split.c index d774018..15027fc 100644 --- a/src/common/tests/string/split.c +++ b/src/common/tests/string/split.c
@@ -28,7 +28,7 @@ * Test which verifies that guac_split() splits a string on occurrences of a * given character. */ -void test_string__split() { +void test_string__split(void) { /* Split test string */ char** tokens = guac_split("this is a test string", ' ');
diff --git a/src/guacd/conf-file.c b/src/guacd/conf-file.c index 2f162cc..6cc805a 100644 --- a/src/guacd/conf-file.c +++ b/src/guacd/conf-file.c
@@ -174,7 +174,7 @@ } -guacd_config* guacd_conf_load() { +guacd_config* guacd_conf_load(void) { guacd_config* conf = guac_mem_alloc(sizeof(guacd_config)); if (conf == NULL)
diff --git a/src/guacd/conf-file.h b/src/guacd/conf-file.h index 3548698..b30f6c8 100644 --- a/src/guacd/conf-file.h +++ b/src/guacd/conf-file.h
@@ -33,7 +33,7 @@ * Loads the configuration from any of several default locations, if found. If * parsing fails, NULL is returned, and an error message is printed to stderr. */ -guacd_config* guacd_conf_load(); +guacd_config* guacd_conf_load(void); #endif
diff --git a/src/guacd/daemon.c b/src/guacd/daemon.c index ec5f531..94a1e7e 100644 --- a/src/guacd/daemon.c +++ b/src/guacd/daemon.c
@@ -100,7 +100,7 @@ * still the original caller. This function does not return for the original * caller if daemonization succeeds. */ -static int daemonize() { +static int daemonize(void) { pid_t pid; @@ -201,7 +201,7 @@ * @return * An ID which uniquely identifies the current thread. */ -static unsigned long guacd_openssl_id_callback() { +static unsigned long guacd_openssl_id_callback(void) { return (unsigned long) pthread_self(); }
diff --git a/src/guacd/log.c b/src/guacd/log.c index 93fe498..21ee9b1 100644 --- a/src/guacd/log.c +++ b/src/guacd/log.c
@@ -129,7 +129,7 @@ } -void guacd_log_handshake_failure() { +void guacd_log_handshake_failure(void) { if (guac_error == GUAC_STATUS_CLOSED) guacd_log(GUAC_LOG_DEBUG,
diff --git a/src/guacd/log.h b/src/guacd/log.h index 209822a..adc1bb0 100644 --- a/src/guacd/log.h +++ b/src/guacd/log.h
@@ -63,7 +63,7 @@ * Logs a reasonable explanatory message regarding handshake failure based on * the current value of guac_error. */ -void guacd_log_handshake_failure(); +void guacd_log_handshake_failure(void); #endif
diff --git a/src/guacd/proc-map.c b/src/guacd/proc-map.c index b177333..9055679 100644 --- a/src/guacd/proc-map.c +++ b/src/guacd/proc-map.c
@@ -127,7 +127,7 @@ } -guacd_proc_map* guacd_proc_map_alloc() { +guacd_proc_map* guacd_proc_map_alloc(void) { guacd_proc_map* map = guac_mem_alloc(sizeof(guacd_proc_map)); map->processes = guac_common_list_alloc();
diff --git a/src/guacd/proc-map.h b/src/guacd/proc-map.h index 518b9ef..5d521cf 100644 --- a/src/guacd/proc-map.h +++ b/src/guacd/proc-map.h
@@ -62,7 +62,7 @@ * @return * A newly-allocated client process map. */ -guacd_proc_map* guacd_proc_map_alloc(); +guacd_proc_map* guacd_proc_map_alloc(void); /** * Free all resources allocated for the provided map. Note that this function
diff --git a/src/guacd/proc.c b/src/guacd/proc.c index 39534cd..6098276 100644 --- a/src/guacd/proc.c +++ b/src/guacd/proc.c
@@ -153,7 +153,7 @@ * a process which does not have a PGID separate from the main guacd process * can result in guacd itself being terminated. */ -static void guacd_kill_current_proc_group() { +static void guacd_kill_current_proc_group(void) { /* Forcibly kill all children within process group */ if (kill(0, SIGKILL))
diff --git a/src/guacenc/buffer.c b/src/guacenc/buffer.c index 9f484de..a337413 100644 --- a/src/guacenc/buffer.c +++ b/src/guacenc/buffer.c
@@ -25,7 +25,7 @@ #include <assert.h> #include <stdlib.h> -guacenc_buffer* guacenc_buffer_alloc() { +guacenc_buffer* guacenc_buffer_alloc(void) { return guac_mem_zalloc(sizeof(guacenc_buffer)); }
diff --git a/src/guacenc/buffer.h b/src/guacenc/buffer.h index ad063f2..25074af 100644 --- a/src/guacenc/buffer.h +++ b/src/guacenc/buffer.h
@@ -80,7 +80,7 @@ * A newly-allocated and initialized guacenc_buffer, or NULL if allocation * fails. */ -guacenc_buffer* guacenc_buffer_alloc(); +guacenc_buffer* guacenc_buffer_alloc(void); /** * Frees all memory associated with the given buffer object. If the buffer
diff --git a/src/guacenc/cursor.c b/src/guacenc/cursor.c index 7afd79c..9bb517f 100644 --- a/src/guacenc/cursor.c +++ b/src/guacenc/cursor.c
@@ -24,7 +24,7 @@ #include <stdlib.h> -guacenc_cursor* guacenc_cursor_alloc() { +guacenc_cursor* guacenc_cursor_alloc(void) { /* Allocate new cursor */ guacenc_cursor* cursor = (guacenc_cursor*) guac_mem_alloc(sizeof(guacenc_cursor));
diff --git a/src/guacenc/cursor.h b/src/guacenc/cursor.h index dbea3b9..f4538bb 100644 --- a/src/guacenc/cursor.h +++ b/src/guacenc/cursor.h
@@ -71,7 +71,7 @@ * A newly-allocated and initialized guacenc_cursor, or NULL if allocation * fails. */ -guacenc_cursor* guacenc_cursor_alloc(); +guacenc_cursor* guacenc_cursor_alloc(void); /** * Frees all memory associated with the given cursor object. If the cursor
diff --git a/src/guacenc/layer.c b/src/guacenc/layer.c index 0a3e03f..6b416ec 100644 --- a/src/guacenc/layer.c +++ b/src/guacenc/layer.c
@@ -24,7 +24,7 @@ #include <stdlib.h> -guacenc_layer* guacenc_layer_alloc() { +guacenc_layer* guacenc_layer_alloc(void) { /* Allocate new layer */ guacenc_layer* layer = (guacenc_layer*) guac_mem_zalloc(sizeof(guacenc_layer));
diff --git a/src/guacenc/layer.h b/src/guacenc/layer.h index 1424774..9eff27f 100644 --- a/src/guacenc/layer.h +++ b/src/guacenc/layer.h
@@ -87,7 +87,7 @@ * A newly-allocated and initialized guacenc_layer, or NULL if allocation * fails. */ -guacenc_layer* guacenc_layer_alloc(); +guacenc_layer* guacenc_layer_alloc(void); /** * Frees all memory associated with the given layer object. If the layer
diff --git a/src/guaclog/keydef.c b/src/guaclog/keydef.c index 635f88f..015e913 100644 --- a/src/guaclog/keydef.c +++ b/src/guaclog/keydef.c
@@ -143,7 +143,7 @@ const void* member) { int keysym = (int) ((intptr_t) key); - guaclog_keydef* current = (guaclog_keydef*) member; + const guaclog_keydef* current = (const guaclog_keydef*) member; /* Compare given keysym to keysym of current member */ return keysym - current->keysym; @@ -162,7 +162,7 @@ * A pointer to the static guaclog_keydef associated with the given keysym, * or NULL if the key could not be found. */ -static guaclog_keydef* guaclog_get_known_key(int keysym) { +static const guaclog_keydef* guaclog_get_known_key(int keysym) { /* Search through known keys for given keysym */ return bsearch((void*) ((intptr_t) keysym), @@ -279,7 +279,7 @@ * A newly-allocated guaclog_keydef structure copied from the given * guaclog_keydef. */ -static guaclog_keydef* guaclog_copy_key(guaclog_keydef* keydef) { +static guaclog_keydef* guaclog_copy_key(const guaclog_keydef* keydef) { guaclog_keydef* copy = guac_mem_alloc(sizeof(guaclog_keydef)); @@ -300,7 +300,7 @@ guaclog_keydef* guaclog_keydef_alloc(int keysym) { - guaclog_keydef* keydef; + const guaclog_keydef* keydef; /* Check list of known keys first */ keydef = guaclog_get_known_key(keysym);
diff --git a/src/libguac/argv.c b/src/libguac/argv.c index 82777a7..7ff0250 100644 --- a/src/libguac/argv.c +++ b/src/libguac/argv.c
@@ -314,7 +314,7 @@ } -void guac_argv_stop() { +void guac_argv_stop(void) { pthread_mutex_lock(&await_state.lock); /* Signal any waiting threads that no further argument values will be
diff --git a/src/libguac/client.c b/src/libguac/client.c index b2919c4..bb50875 100644 --- a/src/libguac/client.c +++ b/src/libguac/client.c
@@ -254,7 +254,7 @@ } -guac_client* guac_client_alloc() { +guac_client* guac_client_alloc(void) { int i;
diff --git a/src/libguac/display.c b/src/libguac/display.c index 8d259b9..87452c5 100644 --- a/src/libguac/display.c +++ b/src/libguac/display.c
@@ -55,7 +55,7 @@ * The number of available processors, or zero if this value cannot be * determined for any reason. */ -static unsigned long guac_display_nproc() { +static unsigned long guac_display_nproc(void) { #if defined(HAVE_SCHED_GETAFFINITY)
diff --git a/src/libguac/error.c b/src/libguac/error.c index bbc06f7..3bd3153 100644 --- a/src/libguac/error.c +++ b/src/libguac/error.c
@@ -182,21 +182,21 @@ } -static void __guac_alloc_error_key() { +static void __guac_alloc_error_key(void) { /* Create key, destroy any allocated variable on thread exit */ pthread_key_create(&__guac_error_key, __guac_mem_free_pointer); } -static void __guac_alloc_error_message_key() { +static void __guac_alloc_error_message_key(void) { /* Create key, destroy any allocated variable on thread exit */ pthread_key_create(&__guac_error_message_key, __guac_mem_free_pointer); } -guac_status* __guac_error() { +guac_status* __guac_error(void) { /* Pointer for thread-local data */ guac_status* status; @@ -217,7 +217,7 @@ } -const char** __guac_error_message() { +const char** __guac_error_message(void) { /* Pointer for thread-local data */ const char** message; @@ -247,11 +247,11 @@ static guac_status __guac_error_unsafe_storage; static const char** __guac_error_message_unsafe_storage; -guac_status* __guac_error() { +guac_status* __guac_error(void) { return &__guac_error_unsafe_storage; } -const char** __guac_error_message() { +const char** __guac_error_message(void) { return &__guac_error_message_unsafe_storage; }
diff --git a/src/libguac/fips.c b/src/libguac/fips.c index f1dbc9e..65934df 100644 --- a/src/libguac/fips.c +++ b/src/libguac/fips.c
@@ -43,7 +43,7 @@ #define GUAC_FIPS_ENABLED 0 #endif -int guac_fips_enabled() { +int guac_fips_enabled(void) { return GUAC_FIPS_ENABLED;
diff --git a/src/libguac/guacamole/argv.h b/src/libguac/guacamole/argv.h index 3cc4806..aa5c586 100644 --- a/src/libguac/guacamole/argv.h +++ b/src/libguac/guacamole/argv.h
@@ -114,7 +114,7 @@ * guac_argv_await() that is currently blocking will return, and any future * calls to guac_argv_await() will return immediately without blocking. */ -void guac_argv_stop(); +void guac_argv_stop(void); /** * Convenience implementation of the "argv" instruction handler which
diff --git a/src/libguac/guacamole/client.h b/src/libguac/guacamole/client.h index 01ecbc8..4b311f1 100644 --- a/src/libguac/guacamole/client.h +++ b/src/libguac/guacamole/client.h
@@ -319,7 +319,7 @@ * * @return A pointer to the new client. */ -guac_client* guac_client_alloc(); +guac_client* guac_client_alloc(void); /** * Free all resources associated with the given client.
diff --git a/src/libguac/guacamole/error.h b/src/libguac/guacamole/error.h index 0384569..5b69499 100644 --- a/src/libguac/guacamole/error.h +++ b/src/libguac/guacamole/error.h
@@ -92,7 +92,7 @@ */ #define guac_error (*__guac_error()) -guac_status* __guac_error(); +guac_status* __guac_error(void); /** * Returns a message describing the error which occurred during the last @@ -105,7 +105,7 @@ */ #define guac_error_message (*__guac_error_message()) -const char** __guac_error_message(); +const char** __guac_error_message(void); #endif
diff --git a/src/libguac/guacamole/fips.h b/src/libguac/guacamole/fips.h index 014f7dc..780fc02 100644 --- a/src/libguac/guacamole/fips.h +++ b/src/libguac/guacamole/fips.h
@@ -28,6 +28,6 @@ * A non-zero value if FIPS mode is enabled, or zero if FIPS mode is * not enabled. */ -int guac_fips_enabled(); +int guac_fips_enabled(void); -#endif \ No newline at end of file +#endif
diff --git a/src/libguac/guacamole/parser.h b/src/libguac/guacamole/parser.h index a5a1a08..b6fb0bd 100644 --- a/src/libguac/guacamole/parser.h +++ b/src/libguac/guacamole/parser.h
@@ -93,7 +93,7 @@ * @return The newly allocated parser, or NULL if an error occurs during * allocation, in which case guac_error will be set appropriately. */ -guac_parser* guac_parser_alloc(); +guac_parser* guac_parser_alloc(void); /** * Appends data from the given buffer to the given parser. The data will be
diff --git a/src/libguac/guacamole/socket.h b/src/libguac/guacamole/socket.h index 6075f39..75d5432 100644 --- a/src/libguac/guacamole/socket.h +++ b/src/libguac/guacamole/socket.h
@@ -127,7 +127,7 @@ * @returns A newly-allocated guac_socket, or NULL if the guac_socket could * not be allocated. */ -guac_socket* guac_socket_alloc(); +guac_socket* guac_socket_alloc(void); /** * Frees the given guac_socket and all associated resources.
diff --git a/src/libguac/guacamole/timestamp.h b/src/libguac/guacamole/timestamp.h index 6789415..d3fe90d 100644 --- a/src/libguac/guacamole/timestamp.h +++ b/src/libguac/guacamole/timestamp.h
@@ -37,7 +37,7 @@ * @return * An arbitrary millisecond timestamp. */ -guac_timestamp guac_timestamp_current(); +guac_timestamp guac_timestamp_current(void); /** * Sleeps for the given number of milliseconds.
diff --git a/src/libguac/guacamole/user.h b/src/libguac/guacamole/user.h index 93e68ea..0ea5895 100644 --- a/src/libguac/guacamole/user.h +++ b/src/libguac/guacamole/user.h
@@ -546,7 +546,7 @@ * * @return The newly allocated guac_user, or NULL if allocation failed. */ -guac_user* guac_user_alloc(); +guac_user* guac_user_alloc(void); /** * Frees the given user and all associated resources.
diff --git a/src/libguac/parser.c b/src/libguac/parser.c index 762da9d..e9047ee 100644 --- a/src/libguac/parser.c +++ b/src/libguac/parser.c
@@ -35,7 +35,7 @@ parser->__element_length = 0; } -guac_parser* guac_parser_alloc() { +guac_parser* guac_parser_alloc(void) { /* Allocate space for parser */ guac_parser* parser = guac_mem_alloc(sizeof(guac_parser));
diff --git a/src/libguac/socket.c b/src/libguac/socket.c index 1d51168..a078f8f 100644 --- a/src/libguac/socket.c +++ b/src/libguac/socket.c
@@ -146,7 +146,7 @@ } -guac_socket* guac_socket_alloc() { +guac_socket* guac_socket_alloc(void) { guac_socket* socket = guac_mem_alloc(sizeof(guac_socket));
diff --git a/src/libguac/string.c b/src/libguac/string.c index c4b57ed..61238a1 100644 --- a/src/libguac/string.c +++ b/src/libguac/string.c
@@ -116,25 +116,28 @@ #ifdef HAVE_STRNSTR return strnstr(haystack, needle, len); #else - char* chr; - size_t nlen = strlen(needle), off = 0; + const char* chr; + size_t nlen = strlen(needle); /* Follow documented API: return haystack if needle is the empty string. */ if (nlen == 0) - return (char *)haystack; + return (char*) haystack; /* Use memchr to find candidates. It might be optimized in asm. */ - while (off < len && NULL != (chr = memchr(haystack + off, needle[0], len - off))) { + for (size_t off = 0; off < len + && NULL != (chr = memchr(haystack + off, needle[0], len - off)); off++) { + /* chr is guaranteed to be in bounds of and >= haystack. */ off = chr - haystack; + /* If needle would go beyond provided len, it doesn't exist in haystack. */ if (off + nlen > len) return NULL; + /* Now that we know we have at least nlen bytes, compare them. */ if (!memcmp(chr, needle, nlen)) - return chr; - /* Make sure we make progress. */ - off += 1; + return (char*) chr; + } /* memchr ran out of candidates, needle wasn't found. */
diff --git a/src/libguac/tests/client/buffer_pool.c b/src/libguac/tests/client/buffer_pool.c index 4f3b3c1..967e62a 100644 --- a/src/libguac/tests/client/buffer_pool.c +++ b/src/libguac/tests/client/buffer_pool.c
@@ -28,7 +28,7 @@ * of buffers available to each guac_client, and that doing so does not disturb * the similar pool of layers. */ -void test_client__buffer_pool() { +void test_client__buffer_pool(void) { guac_client* client;
diff --git a/src/libguac/tests/client/layer_pool.c b/src/libguac/tests/client/layer_pool.c index f82e84f..c3a4bd9 100644 --- a/src/libguac/tests/client/layer_pool.c +++ b/src/libguac/tests/client/layer_pool.c
@@ -28,7 +28,7 @@ * of layers available to each guac_client, and that doing so does not disturb * the similar pool of buffers. */ -void test_client__layer_pool() { +void test_client__layer_pool(void) { guac_client* client;
diff --git a/src/libguac/tests/fifo/fifo.c b/src/libguac/tests/fifo/fifo.c index 67617e2..c5e4545 100644 --- a/src/libguac/tests/fifo/fifo.c +++ b/src/libguac/tests/fifo/fifo.c
@@ -258,7 +258,7 @@ * Verify that the base fifo implementation functions correctly when events * are sent slower than they are read. */ -void test_fifo__slow_add() { +void test_fifo__slow_add(void) { /* Add context for subsequent logging of sent/received values to STDOUT */ printf("-------- %s() --------\n", __func__); @@ -272,7 +272,7 @@ * Verify that the base fifo implementation functions correctly when events * are sent faster than they are read. */ -void test_fifo__fast_add() { +void test_fifo__fast_add(void) { /* Add context for subsequent logging of sent/received values to STDOUT */ printf("-------- %s() --------\n", __func__); @@ -286,7 +286,7 @@ * Verify that the base fifo implementation functions correctly when events * are sent at roughly the same speed as the reading thread. */ -void test_fifo__interleaved() { +void test_fifo__interleaved(void) { /* Add context for subsequent logging of sent/received values to STDOUT */ printf("-------- %s() --------\n", __func__);
diff --git a/src/libguac/tests/file/openat.c b/src/libguac/tests/file/openat.c index 146f7f0..5e5a807 100644 --- a/src/libguac/tests/file/openat.c +++ b/src/libguac/tests/file/openat.c
@@ -196,7 +196,7 @@ * Verify general guac_openat() behavior when creating files within * directories, optionally first creating that directory. */ -void test_file__openat() { +void test_file__openat(void) { int fd; char filename[1024]; @@ -309,7 +309,7 @@ * Verify guac_openat() behavior when the filename provided contains path * components. */ -void test_file__openat_not_filename() { +void test_file__openat_not_filename(void) { int fd; @@ -350,7 +350,7 @@ /** * Verify guac_openat() behavior when locking is requested vs. not requested. */ -void test_file__openat_locked() { +void test_file__openat_locked(void) { #ifdef __MINGW32__ /* Skipped under Windows platforms (see documentation for GUAC_O_LOCKED) */ #else
diff --git a/src/libguac/tests/flag/flag.c b/src/libguac/tests/flag/flag.c index c822a6a..1ff23a8 100644 --- a/src/libguac/tests/flag/flag.c +++ b/src/libguac/tests/flag/flag.c
@@ -111,7 +111,7 @@ * Verifies that a thread waiting on a particular event will NOT be notified if * absolutely zero events ever occur. */ -void test_flag__ignore_total_silence() { +void test_flag__ignore_total_silence(void) { guac_flag test_flag; guac_flag_init(&test_flag); @@ -127,7 +127,7 @@ * Verifies that a thread waiting on a particular event will NOT be notified if * that event never occurs, even if other events are occurring. */ -void test_flag__ignore_uninteresting_events() { +void test_flag__ignore_uninteresting_events(void) { guac_flag test_flag; guac_flag_init(&test_flag); @@ -146,7 +146,7 @@ * Verifies that a thread waiting on a particular event will be notified when * that event occurs. */ -void test_flag__wake_for_interesting_events() { +void test_flag__wake_for_interesting_events(void) { guac_flag test_flag; guac_flag_init(&test_flag);
diff --git a/src/libguac/tests/id/generate.c b/src/libguac/tests/id/generate.c index 4f369fd..dfe07b6 100644 --- a/src/libguac/tests/id/generate.c +++ b/src/libguac/tests/id/generate.c
@@ -29,7 +29,7 @@ * Test which verifies that each call to guac_generate_id() produces a * different string. */ -void test_id__unique() { +void test_id__unique(void) { char* id1 = guac_generate_id('x'); char* id2 = guac_generate_id('x'); @@ -50,7 +50,7 @@ * Test which verifies that guac_generate_id() produces strings are in the * correct UUID-based format. */ -void test_id__format() { +void test_id__format(void) { unsigned int ignore; @@ -71,7 +71,7 @@ * Test which verifies that guac_generate_id() takes the specified prefix * character into account when generating the ID string. */ -void test_id__prefix() { +void test_id__prefix(void) { char* id;
diff --git a/src/libguac/tests/mem/alloc.c b/src/libguac/tests/mem/alloc.c index bec3145..0332560 100644 --- a/src/libguac/tests/mem/alloc.c +++ b/src/libguac/tests/mem/alloc.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_alloc() returns NULL for all inputs involving * at least one zero value. */ -void test_mem__alloc_fail_zero() { +void test_mem__alloc_fail_zero(void) { CU_ASSERT_PTR_NULL(guac_mem_alloc(0)); CU_ASSERT_PTR_NULL(guac_mem_alloc(0, 0)); @@ -44,7 +44,7 @@ * Test which verifies that guac_mem_alloc() successfully allocates blocks of * memory for inputs that can reasonably be expected to succeed. */ -void test_mem__alloc_success() { +void test_mem__alloc_success(void) { void* ptr; @@ -66,7 +66,7 @@ * Test which verifies that guac_mem_alloc() fails to allocate blocks of memory * that exceed the capacity of a size_t. */ -void test_mem__alloc_fail_large() { +void test_mem__alloc_fail_large(void) { CU_ASSERT_PTR_NULL(guac_mem_alloc(123, 456, SIZE_MAX)); CU_ASSERT_PTR_NULL(guac_mem_alloc(SIZE_MAX / 2, SIZE_MAX / 2)); }
diff --git a/src/libguac/tests/mem/ckd_add.c b/src/libguac/tests/mem/ckd_add.c index f24e624..1acf29f 100644 --- a/src/libguac/tests/mem/ckd_add.c +++ b/src/libguac/tests/mem/ckd_add.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_ckd_add() calculates results correctly for * all inputs involving at least one zero value. */ -void test_mem__ckd_add_zero() { +void test_mem__ckd_add_zero(void) { size_t result = SIZE_MAX; @@ -65,7 +65,7 @@ * Test which verifies that guac_mem_ckd_add() successfully calculates expected * values for relatively small integer inputs. */ -void test_mem__ckd_add_small() { +void test_mem__ckd_add_small(void) { size_t result = SIZE_MAX; @@ -85,7 +85,7 @@ * relatively large integer inputs, including inputs that cause overflow beyond * the capacity of a size_t. */ -void test_mem__ckd_add_large() { +void test_mem__ckd_add_large(void) { size_t result = 0;
diff --git a/src/libguac/tests/mem/ckd_add_or_die.c b/src/libguac/tests/mem/ckd_add_or_die.c index 497bfe3..e64ee43 100644 --- a/src/libguac/tests/mem/ckd_add_or_die.c +++ b/src/libguac/tests/mem/ckd_add_or_die.c
@@ -27,7 +27,7 @@ * Test which verifies that guac_mem_ckd_add_or_die() calculates results * correctly for all inputs involving at least one zero value. */ -void test_mem__ckd_add_or_die_zero() { +void test_mem__ckd_add_or_die_zero(void) { CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(0), 0); CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(0, 0), 0); @@ -46,7 +46,7 @@ * Test which verifies that guac_mem_ckd_add_or_die() successfully calculates * expected values for relatively small integer inputs. */ -void test_mem__ckd_add_or_die_small() { +void test_mem__ckd_add_or_die_small(void) { CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(123), 123); CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(123, 456), 123 + 456); @@ -59,7 +59,7 @@ * relatively large integer inputs, including inputs that cause overflow beyond * the capacity of a size_t. */ -void test_mem__ckd_add_or_die_large() { +void test_mem__ckd_add_or_die_large(void) { CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(SIZE_MAX), SIZE_MAX); CU_ASSERT_EQUAL(guac_mem_ckd_add_or_die(SIZE_MAX / 2, SIZE_MAX / 2), (SIZE_MAX / 2) * 2);
diff --git a/src/libguac/tests/mem/ckd_mul.c b/src/libguac/tests/mem/ckd_mul.c index 847c6f1..9dc1a23 100644 --- a/src/libguac/tests/mem/ckd_mul.c +++ b/src/libguac/tests/mem/ckd_mul.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_ckd_mul() calculates zero values for all * inputs involving at least one zero value. */ -void test_mem__ckd_mul_zero() { +void test_mem__ckd_mul_zero(void) { size_t result = SIZE_MAX; @@ -65,7 +65,7 @@ * Test which verifies that guac_mem_ckd_mul() successfully calculates expected * values for relatively small integer inputs. */ -void test_mem__ckd_mul_small() { +void test_mem__ckd_mul_small(void) { size_t result = SIZE_MAX; @@ -85,7 +85,7 @@ * relatively large integer inputs, including inputs that cause overflow beyond * the capacity of a size_t. */ -void test_mem__ckd_mul_large() { +void test_mem__ckd_mul_large(void) { size_t result = 0;
diff --git a/src/libguac/tests/mem/ckd_mul_or_die.c b/src/libguac/tests/mem/ckd_mul_or_die.c index c4ba759..0e98647 100644 --- a/src/libguac/tests/mem/ckd_mul_or_die.c +++ b/src/libguac/tests/mem/ckd_mul_or_die.c
@@ -27,7 +27,7 @@ * Test which verifies that guac_mem_ckd_mul_or_die() calculates zero values * for all inputs involving at least one zero value. */ -void test_mem__ckd_mul_or_die_zero() { +void test_mem__ckd_mul_or_die_zero(void) { CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(0), 0); CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(0, 0), 0); @@ -47,7 +47,7 @@ * Test which verifies that guac_mem_ckd_mul_or_die() successfully calculates * expected values for relatively small integer inputs. */ -void test_mem__ckd_mul_or_die_small() { +void test_mem__ckd_mul_or_die_small(void) { CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(123), 123); CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(123, 456), 123 * 456); CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(123, 456, 789), 123 * 456 * 789); @@ -57,7 +57,7 @@ * Test which verifies that guac_mem_ckd_mul_or_die() behaves as expected for * relatively large integer inputs. */ -void test_mem__ckd_mul_or_die_large() { +void test_mem__ckd_mul_or_die_large(void) { CU_ASSERT_EQUAL(guac_mem_ckd_mul_or_die(SIZE_MAX), SIZE_MAX);
diff --git a/src/libguac/tests/mem/ckd_sub.c b/src/libguac/tests/mem/ckd_sub.c index 4dfa01b..5fb8bb4 100644 --- a/src/libguac/tests/mem/ckd_sub.c +++ b/src/libguac/tests/mem/ckd_sub.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_ckd_sub() calculates results correctly for * all inputs involving at least one zero value. */ -void test_mem__ckd_sub_zero() { +void test_mem__ckd_sub_zero(void) { size_t result = SIZE_MAX; @@ -63,7 +63,7 @@ * values for relatively small integer inputs, including inputs that cause * overflow beyond zero. */ -void test_mem__ckd_sub_small() { +void test_mem__ckd_sub_small(void) { size_t result = SIZE_MAX; @@ -88,7 +88,7 @@ * relatively large integer inputs, including inputs that cause overflow beyond * zero. */ -void test_mem__ckd_sub_large() { +void test_mem__ckd_sub_large(void) { size_t result = 0;
diff --git a/src/libguac/tests/mem/ckd_sub_or_die.c b/src/libguac/tests/mem/ckd_sub_or_die.c index e29d6c1..26508ab 100644 --- a/src/libguac/tests/mem/ckd_sub_or_die.c +++ b/src/libguac/tests/mem/ckd_sub_or_die.c
@@ -27,7 +27,7 @@ * Test which verifies that guac_mem_ckd_sub_or_die() calculates results * correctly for all inputs involving at least one zero value. */ -void test_mem__ckd_sub_or_die_zero() { +void test_mem__ckd_sub_or_die_zero(void) { CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(0), 0); CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(0, 0), 0); @@ -46,7 +46,7 @@ * expected values for relatively small integer inputs, including inputs that * cause overflow beyond zero. */ -void test_mem__ckd_sub_or_die_small() { +void test_mem__ckd_sub_or_die_small(void) { CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(123), 123); CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(456, 123), 456 - 123); @@ -62,7 +62,7 @@ * relatively large integer inputs, including inputs that cause overflow beyond * zero. */ -void test_mem__ckd_sub_or_die_large() { +void test_mem__ckd_sub_or_die_large(void) { CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(SIZE_MAX), SIZE_MAX); CU_ASSERT_EQUAL(guac_mem_ckd_sub_or_die(SIZE_MAX, SIZE_MAX / 2), SIZE_MAX - (SIZE_MAX / 2));
diff --git a/src/libguac/tests/mem/free.c b/src/libguac/tests/mem/free.c index 62470fb..de6c7b6 100644 --- a/src/libguac/tests/mem/free.c +++ b/src/libguac/tests/mem/free.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_free() sets the provided pointer to NULL after * freeing. */ -void test_mem__free_assigns_null() { +void test_mem__free_assigns_null(void) { void* ptr = guac_mem_alloc(123); CU_ASSERT_PTR_NOT_NULL(ptr); guac_mem_free(ptr); @@ -36,7 +36,7 @@ * Test which verifies that guac_mem_free_const() can be used to free constant * pointers, but that those pointers are not set to NULL after freeing. */ -void test_mem__free_const() { +void test_mem__free_const(void) { const void* ptr = guac_mem_alloc(123); CU_ASSERT_PTR_NOT_NULL(ptr); guac_mem_free_const(ptr); @@ -47,7 +47,7 @@ * Test which verifies that guac_mem_free() does nothing if provided a NULL * pointer. */ -void test_mem__free_null() { +void test_mem__free_null(void) { void* ptr = NULL; guac_mem_free(ptr); CU_PASS("Nothing freed (segfault did not occur)"); @@ -57,7 +57,7 @@ * Test which verifies that guac_mem_free_const() does nothing if provided a NULL * pointer. */ -void test_mem__free_null_const() { +void test_mem__free_null_const(void) { const void* ptr = NULL; guac_mem_free_const(ptr); CU_PASS("Nothing freed (segfault did not occur)");
diff --git a/src/libguac/tests/mem/realloc.c b/src/libguac/tests/mem/realloc.c index 91dbef5..a4aa539 100644 --- a/src/libguac/tests/mem/realloc.c +++ b/src/libguac/tests/mem/realloc.c
@@ -26,7 +26,7 @@ * involving at least one zero value (reallocation to zero bytes is not an * error but equivalent freeing the memory). */ -void test_mem__realloc_success_zero() { +void test_mem__realloc_success_zero(void) { void* ptr; @@ -72,7 +72,7 @@ * Test which verifies that guac_mem_realloc() successfully allocates blocks of * memory for inputs that can reasonably be expected to succeed. */ -void test_mem__realloc_success() { +void test_mem__realloc_success(void) { void* ptr; @@ -100,7 +100,7 @@ * Test which verifies that guac_mem_realloc() fails to allocate blocks of * memory that exceed the capacity of a size_t. */ -void test_mem__realloc_fail_large() { +void test_mem__realloc_fail_large(void) { void* ptr;
diff --git a/src/libguac/tests/mem/realloc_or_die.c b/src/libguac/tests/mem/realloc_or_die.c index 4a244af..7931329 100644 --- a/src/libguac/tests/mem/realloc_or_die.c +++ b/src/libguac/tests/mem/realloc_or_die.c
@@ -28,7 +28,7 @@ * inputs involving at least one zero value (reallocation to zero bytes is not * an error but equivalent freeing the memory). */ -void test_mem__realloc_or_die_success_zero() { +void test_mem__realloc_or_die_success_zero(void) { void* ptr; @@ -74,7 +74,7 @@ * Test which verifies that guac_mem_realloc_or_die() successfully allocates * blocks of memory for inputs that can reasonably be expected to succeed. */ -void test_mem__realloc_or_die_success() { +void test_mem__realloc_or_die_success(void) { void* ptr; @@ -102,7 +102,7 @@ * Test which verifies that guac_mem_realloc_or_die() fails to allocate blocks of * memory that exceed the capacity of a size_t. */ -void test_mem__realloc_or_die_fail_large() { +void test_mem__realloc_or_die_fail_large(void) { void* ptr;
diff --git a/src/libguac/tests/mem/zalloc.c b/src/libguac/tests/mem/zalloc.c index 933dca0..faf4ce5 100644 --- a/src/libguac/tests/mem/zalloc.c +++ b/src/libguac/tests/mem/zalloc.c
@@ -25,7 +25,7 @@ * Test which verifies that guac_mem_zalloc() returns NULL for all inputs involving * at least one zero value. */ -void test_mem__zalloc_fail_zero() { +void test_mem__zalloc_fail_zero(void) { CU_ASSERT_PTR_NULL(guac_mem_zalloc(0)); CU_ASSERT_PTR_NULL(guac_mem_zalloc(0, 0)); @@ -70,7 +70,7 @@ * memory for inputs that can reasonably be expected to succeed, and that each * block is zeroed out. */ -void test_mem__zalloc_success() { +void test_mem__zalloc_success(void) { void* ptr; @@ -95,7 +95,7 @@ * Test which verifies that guac_mem_zalloc() fails to allocate blocks of memory * that exceed the capacity of a size_t. */ -void test_mem__zalloc_fail_large() { +void test_mem__zalloc_fail_large(void) { CU_ASSERT_PTR_NULL(guac_mem_zalloc(123, 456, SIZE_MAX)); CU_ASSERT_PTR_NULL(guac_mem_zalloc(SIZE_MAX / 2, SIZE_MAX / 2)); }
diff --git a/src/libguac/tests/parser/append.c b/src/libguac/tests/parser/append.c index 88515c1..baed9d6 100644 --- a/src/libguac/tests/parser/append.c +++ b/src/libguac/tests/parser/append.c
@@ -28,7 +28,7 @@ * Test which verifies that guac_parser correctly parses Guacamole instructions * from arbitrary blocks of data passed to guac_parser_append(). */ -void test_parser__append() { +void test_parser__append(void) { /* Allocate parser */ guac_parser* parser = guac_parser_alloc();
diff --git a/src/libguac/tests/parser/read.c b/src/libguac/tests/parser/read.c index 062a2f7..5db3b5b 100644 --- a/src/libguac/tests/parser/read.c +++ b/src/libguac/tests/parser/read.c
@@ -116,7 +116,7 @@ * received over a guac_socket. A child process is forked to write a series of * instructions which are read and verified by the parent process. */ -void test_parser__read() { +void test_parser__read(void) { int fd[2];
diff --git a/src/libguac/tests/pool/next_free.c b/src/libguac/tests/pool/next_free.c index e8bd945..a2245b7 100644 --- a/src/libguac/tests/pool/next_free.c +++ b/src/libguac/tests/pool/next_free.c
@@ -31,7 +31,7 @@ * unique integers, never repeating a retrieved integer until that integer * is returned to the pool. */ -void test_pool__next_free() { +void test_pool__next_free(void) { guac_pool* pool;
diff --git a/src/libguac/tests/protocol/base64_decode.c b/src/libguac/tests/protocol/base64_decode.c index 60c8a03..6939a0a 100644 --- a/src/libguac/tests/protocol/base64_decode.c +++ b/src/libguac/tests/protocol/base64_decode.c
@@ -24,7 +24,7 @@ * Tests that libguac's in-place base64 decoding function properly decodes * valid base64 and fails for invalid base64. */ -void test_protocol__decode_base64() { +void test_protocol__decode_base64(void) { /* Test strings */ char test_HELLO[] = "SEVMTE8=";
diff --git a/src/libguac/tests/protocol/guac_protocol_version.c b/src/libguac/tests/protocol/guac_protocol_version.c index f9b2fdf..bff4bd1 100644 --- a/src/libguac/tests/protocol/guac_protocol_version.c +++ b/src/libguac/tests/protocol/guac_protocol_version.c
@@ -25,7 +25,7 @@ * Test which verifies that conversion of the guac_protocol_version enum to * string values succeeds and produces the expected results. */ -void test_guac_protocol__version_to_string() { +void test_guac_protocol__version_to_string(void) { guac_protocol_version version_a = GUAC_PROTOCOL_VERSION_1_5_0; guac_protocol_version version_b = GUAC_PROTOCOL_VERSION_1_0_0; @@ -43,7 +43,7 @@ * guac_protocol_version enum values, and that versions that do not match * any version get the correct unknown value. */ -void test_guac_protocol__string_to_version() { +void test_guac_protocol__string_to_version(void) { char* str_version_a = "VERSION_1_3_0"; char* str_version_b = "VERSION_1_1_0"; @@ -61,7 +61,7 @@ * Test which verifies that the comparisons between guac_protocol_version enum * values produces the expected results. */ -void test_gauc_protocol__version_comparison() { +void test_gauc_protocol__version_comparison(void) { CU_ASSERT_TRUE(GUAC_PROTOCOL_VERSION_1_3_0 > GUAC_PROTOCOL_VERSION_1_0_0); CU_ASSERT_TRUE(GUAC_PROTOCOL_VERSION_UNKNOWN < GUAC_PROTOCOL_VERSION_1_1_0);
diff --git a/src/libguac/tests/rect/align.c b/src/libguac/tests/rect/align.c index bed1972..1c440aa 100644 --- a/src/libguac/tests/rect/align.c +++ b/src/libguac/tests/rect/align.c
@@ -24,7 +24,7 @@ * Test which verifies guac_rect_align() properly shifts and resizes rectangles * to fit an NxN grid. */ -void test_rect__align() { +void test_rect__align(void) { /* A cell size of 4 is 2^4 (16) */ const int cell_size = 4;
diff --git a/src/libguac/tests/rect/constrain.c b/src/libguac/tests/rect/constrain.c index 18ddc7a..021f765 100644 --- a/src/libguac/tests/rect/constrain.c +++ b/src/libguac/tests/rect/constrain.c
@@ -24,7 +24,7 @@ * Test which verifies that guac_rect_constrain() restricts a given rectangle * to arbitrary bounds. */ -void test_rect__constrain() { +void test_rect__constrain(void) { guac_rect max; guac_rect rect;
diff --git a/src/libguac/tests/rect/extend.c b/src/libguac/tests/rect/extend.c index 264ab3b..44b881b 100644 --- a/src/libguac/tests/rect/extend.c +++ b/src/libguac/tests/rect/extend.c
@@ -24,7 +24,7 @@ * Test which verifies that guac_rect_extend() expands the given rectangle as * necessary to contain at least the given bounds. */ -void test_rect__extend() { +void test_rect__extend(void) { guac_rect max; guac_rect rect;
diff --git a/src/libguac/tests/rect/init.c b/src/libguac/tests/rect/init.c index c91efec..8950f4a 100644 --- a/src/libguac/tests/rect/init.c +++ b/src/libguac/tests/rect/init.c
@@ -23,7 +23,7 @@ /** * Test which verifies rectangle initialization via guac_rect_init(). */ -void test_rect__init() { +void test_rect__init(void) { guac_rect max;
diff --git a/src/libguac/tests/rect/intersects.c b/src/libguac/tests/rect/intersects.c index e6b005e..7599193 100644 --- a/src/libguac/tests/rect/intersects.c +++ b/src/libguac/tests/rect/intersects.c
@@ -23,7 +23,7 @@ /** * Test which verifies intersection testing via guac_rect_intersects(). */ -void test_rect__intersects() { +void test_rect__intersects(void) { int res;
diff --git a/src/libguac/tests/socket/fd_send_instruction.c b/src/libguac/tests/socket/fd_send_instruction.c index abbf5cc..b5890f4 100644 --- a/src/libguac/tests/socket/fd_send_instruction.c +++ b/src/libguac/tests/socket/fd_send_instruction.c
@@ -107,7 +107,7 @@ * implements writing of instructions. A child process is forked to write a * series of instructions which are read and verified by the parent process. */ -void test_socket__fd_send_instruction() { +void test_socket__fd_send_instruction(void) { int fd[2];
diff --git a/src/libguac/tests/socket/nested_send_instruction.c b/src/libguac/tests/socket/nested_send_instruction.c index 14e876b..e8fb84c 100644 --- a/src/libguac/tests/socket/nested_send_instruction.c +++ b/src/libguac/tests/socket/nested_send_instruction.c
@@ -120,7 +120,7 @@ * implements writing of instructions. A child process is forked to write a * series of instructions which are read and verified by the parent process. */ -void test_socket__nested_send_instruction() { +void test_socket__nested_send_instruction(void) { int fd[2];
diff --git a/src/libguac/tests/string/strdup.c b/src/libguac/tests/string/strdup.c index 9641e09..7b4750c 100644 --- a/src/libguac/tests/string/strdup.c +++ b/src/libguac/tests/string/strdup.c
@@ -37,7 +37,7 @@ /** * Verify guac_strdup() behavior when the string is both NULL and not NULL. */ -void test_string__strdup() { +void test_string__strdup(void) { /* Copy the strings. */ char* dest_string = guac_strdup(source_string);
diff --git a/src/libguac/tests/string/strlcat.c b/src/libguac/tests/string/strlcat.c index cf3dc33..3144e8b 100644 --- a/src/libguac/tests/string/strlcat.c +++ b/src/libguac/tests/string/strlcat.c
@@ -29,7 +29,7 @@ * resulting string. Each resulting string should contain the full result of * the concatenation, including null terminator. */ -void test_string__strlcat() { +void test_string__strlcat(void) { char buffer[1024]; @@ -72,7 +72,7 @@ * many characters as can fit should be appended to the string within the * buffer, and the buffer should be null-terminated. */ -void test_string__strlcat_truncate() { +void test_string__strlcat_truncate(void) { char buffer[1024]; @@ -101,7 +101,7 @@ * each call should be the size of the input string, while the buffer remains * untouched. */ -void test_string__strlcat_nospace() { +void test_string__strlcat_nospace(void) { /* 0-byte buffer plus 1 guard byte (to test overrun) */ char buffer[1] = { '\xFF' }; @@ -126,7 +126,7 @@ * considered equal to the size of the buffer, however the resulting buffer * should not be null-terminated. */ -void test_string__strlcat_nonull() { +void test_string__strlcat_nonull(void) { char expected[1024]; memset(expected, 0xFF, sizeof(expected));
diff --git a/src/libguac/tests/string/strlcpy.c b/src/libguac/tests/string/strlcpy.c index 1e8e01e..1c49f84 100644 --- a/src/libguac/tests/string/strlcpy.c +++ b/src/libguac/tests/string/strlcpy.c
@@ -27,7 +27,7 @@ * Verify guac_strlcpy() behavior when the string fits the buffer without * truncation. */ -void test_string__strlcpy() { +void test_string__strlcpy(void) { char buffer[1024]; @@ -57,7 +57,7 @@ * Verify guac_strlcpy() behavior when the string must be truncated to fit the * buffer. */ -void test_string__strlcpy_truncate() { +void test_string__strlcpy_truncate(void) { char buffer[1024]; @@ -81,7 +81,7 @@ /** * Verify guac_strlcpy() behavior with zero buffer sizes. */ -void test_string__strlcpy_nospace() { +void test_string__strlcpy_nospace(void) { /* 0-byte buffer plus 1 guard byte (to test overrun) */ char buffer[1] = { '\xFF' };
diff --git a/src/libguac/tests/string/strljoin.c b/src/libguac/tests/string/strljoin.c index 3993288..c3e7ba5 100644 --- a/src/libguac/tests/string/strljoin.c +++ b/src/libguac/tests/string/strljoin.c
@@ -50,7 +50,7 @@ * resulting string. Each resulting string should contain the full result of * the join operation, including null terminator. */ -void test_string__strljoin() { +void test_string__strljoin(void) { char buffer[1024]; @@ -88,7 +88,7 @@ * characters as can fit should be appended to the string within the buffer, * and the buffer should be null-terminated. */ -void test_string__strljoin_truncate() { +void test_string__strljoin_truncate(void) { char buffer[1024]; @@ -124,7 +124,7 @@ * each call should be the size of the input string, while the buffer remains * untouched. */ -void test_string__strljoin_nospace() { +void test_string__strljoin_nospace(void) { /* 0-byte buffer plus 1 guard byte (to test overrun) */ char buffer[1] = { '\xFF' };
diff --git a/src/libguac/tests/string/strnstr.c b/src/libguac/tests/string/strnstr.c index ffd02db..d2f2e47 100644 --- a/src/libguac/tests/string/strnstr.c +++ b/src/libguac/tests/string/strnstr.c
@@ -26,7 +26,7 @@ /** * Verify guac_strnstr() behaviors: */ -void test_string__strnstr() { +void test_string__strnstr(void) { char haystack[8] = {'a', 'h', 'i', ' ', 't', 'u', 'n', 'a'}; char* result;
diff --git a/src/libguac/tests/unicode/charsize.c b/src/libguac/tests/unicode/charsize.c index e636155..b9dd892 100644 --- a/src/libguac/tests/unicode/charsize.c +++ b/src/libguac/tests/unicode/charsize.c
@@ -24,7 +24,7 @@ * Test which verifies that guac_utf8_charsize() correctly determines the * length of UTF-8 characters from the leading byte of that character. */ -void test_unicode__utf8_charsize() { +void test_unicode__utf8_charsize(void) { CU_ASSERT_EQUAL(1, guac_utf8_charsize('g')); CU_ASSERT_EQUAL(2, guac_utf8_charsize('\xC4')); CU_ASSERT_EQUAL(3, guac_utf8_charsize('\xE7'));
diff --git a/src/libguac/tests/unicode/read.c b/src/libguac/tests/unicode/read.c index 230a721..c021d79 100644 --- a/src/libguac/tests/unicode/read.c +++ b/src/libguac/tests/unicode/read.c
@@ -23,7 +23,7 @@ /** * Test which verifies that guac_utf8_read() properly parses UTF-8. */ -void test_unicode__utf8_read() { +void test_unicode__utf8_read(void) { int codepoint;
diff --git a/src/libguac/tests/unicode/strlen.c b/src/libguac/tests/unicode/strlen.c index 995a503..3ff129a 100644 --- a/src/libguac/tests/unicode/strlen.c +++ b/src/libguac/tests/unicode/strlen.c
@@ -44,7 +44,7 @@ * Test which verifies that guac_utf8_strlen() properly calculates the length * of UTF-8 strings. */ -void test_unicode__utf8_strlen() { +void test_unicode__utf8_strlen(void) { CU_ASSERT_EQUAL(0, guac_utf8_strlen("")); CU_ASSERT_EQUAL(1, guac_utf8_strlen(UTF8_4b)); CU_ASSERT_EQUAL(2, guac_utf8_strlen(UTF8_4b UTF8_1b));
diff --git a/src/libguac/tests/unicode/write.c b/src/libguac/tests/unicode/write.c index 8480086..9bb88e6 100644 --- a/src/libguac/tests/unicode/write.c +++ b/src/libguac/tests/unicode/write.c
@@ -24,7 +24,7 @@ * Test which verifies that guac_utf8_write() properly encodes Unicode * codepoints as UTF-8. */ -void test_unicode__utf8_write() { +void test_unicode__utf8_write(void) { char buffer[16];
diff --git a/src/libguac/timestamp.c b/src/libguac/timestamp.c index 044ebd9..92b58ed 100644 --- a/src/libguac/timestamp.c +++ b/src/libguac/timestamp.c
@@ -27,7 +27,7 @@ #include <time.h> #endif -guac_timestamp guac_timestamp_current() { +guac_timestamp guac_timestamp_current(void) { #ifdef HAVE_CLOCK_GETTIME
diff --git a/src/libguac/user.c b/src/libguac/user.c index ff1d3ec..78de07e 100644 --- a/src/libguac/user.c +++ b/src/libguac/user.c
@@ -38,7 +38,7 @@ #include <stdlib.h> #include <string.h> -guac_user* guac_user_alloc() { +guac_user* guac_user_alloc(void) { guac_user* user = guac_mem_zalloc(sizeof(guac_user)); int i;
diff --git a/src/protocols/kubernetes/tests/url/append.c b/src/protocols/kubernetes/tests/url/append.c index 48e3601..a7fe598 100644 --- a/src/protocols/kubernetes/tests/url/append.c +++ b/src/protocols/kubernetes/tests/url/append.c
@@ -27,7 +27,7 @@ * Verifies that guac_kubernetes_append_endpoint_param() correctly appends * parameters to URLs that do not already have a query string. */ -void test_url__append_no_query() { +void test_url__append_no_query(void) { char url[256] = "http://example.net"; @@ -40,7 +40,7 @@ * Verifies that guac_kubernetes_append_endpoint_param() correctly appends * parameters to URLs that already have a query string. */ -void test_url__append_existing_query() { +void test_url__append_existing_query(void) { char url[256] = "http://example.net?foo=test%20value"; @@ -53,7 +53,7 @@ * Verifies that guac_kubernetes_append_endpoint_param() refuses to overflow * the bounds of the provided buffer. */ -void test_url__append_bounds() { +void test_url__append_bounds(void) { char url[256];
diff --git a/src/protocols/kubernetes/tests/url/escape.c b/src/protocols/kubernetes/tests/url/escape.c index d0e1f53..8bc6492 100644 --- a/src/protocols/kubernetes/tests/url/escape.c +++ b/src/protocols/kubernetes/tests/url/escape.c
@@ -26,7 +26,7 @@ * Verifies that guac_kubernetes_escape_url_component() correctly escapes * characters that would otherwise have special meaning within URLs. */ -void test_url__escape_special() { +void test_url__escape_special(void) { char value[256]; @@ -39,7 +39,7 @@ * Verifies that guac_kubernetes_escape_url_component() leaves strings * untouched if they contain no characters requiring escaping. */ -void test_url__escape_nospecial() { +void test_url__escape_nospecial(void) { char value[256]; @@ -52,7 +52,7 @@ * Verifies that guac_kubernetes_escape_url_component() refuses to overflow the * bounds of the provided buffer. */ -void test_url__escape_bounds() { +void test_url__escape_bounds(void) { char value[256];
diff --git a/src/protocols/rdp/doc/svc-example/svc-example.c b/src/protocols/rdp/doc/svc-example/svc-example.c index 681b3f9..4b8e248 100644 --- a/src/protocols/rdp/doc/svc-example/svc-example.c +++ b/src/protocols/rdp/doc/svc-example/svc-example.c
@@ -28,7 +28,7 @@ */ #define SVC_NAME "EXAMPLE" -int main() { +int main(void) { ULONG bytes_read; ULONG bytes_written;
diff --git a/src/protocols/rdp/tests/fs/basename.c b/src/protocols/rdp/tests/fs/basename.c index 9ac6097..5ab1898 100644 --- a/src/protocols/rdp/tests/fs/basename.c +++ b/src/protocols/rdp/tests/fs/basename.c
@@ -26,7 +26,7 @@ * Test which verifies basenames are correctly extracted from Windows-style * paths. */ -void test_fs__basename_windows() { +void test_fs__basename_windows(void) { CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("\\foo\\bar\\baz"), "baz") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("\\foo\\bar\\..\\baz\\"), "") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("bar\\..\\..\\baz\\a\\..\\b"), "b") @@ -37,7 +37,7 @@ /** * Test which verifies basenames are correctly extracted from UNIX-style paths. */ -void test_fs__basename_unix() { +void test_fs__basename_unix(void) { CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("/foo/bar/baz"), "baz") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("/foo/bar/../baz/"), "") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("bar/../../baz/a/../b"), "b") @@ -49,7 +49,7 @@ * Test which verifies basenames are correctly extracted from paths consisting * of mixed Windows and UNIX path separators. */ -void test_fs__basename_mixed() { +void test_fs__basename_mixed(void) { CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("\\foo/bar\\baz"), "baz") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("/foo\\bar/..\\baz/"), "") CU_ASSERT_STRING_EQUAL(guac_rdp_fs_basename("bar\\../../baz\\a\\..\\b"), "b")
diff --git a/src/protocols/rdp/tests/fs/normalize_path.c b/src/protocols/rdp/tests/fs/normalize_path.c index 8640dab..0c29081 100644 --- a/src/protocols/rdp/tests/fs/normalize_path.c +++ b/src/protocols/rdp/tests/fs/normalize_path.c
@@ -28,7 +28,7 @@ * Test which verifies absolute Windows-style paths are correctly normalized to * absolute paths with Windows separators and no relative components. */ -void test_fs__normalize_absolute_windows() { +void test_fs__normalize_absolute_windows(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -56,7 +56,7 @@ * Test which verifies absolute UNIX-style paths are correctly normalized to * absolute paths with Windows separators and no relative components. */ -void test_fs__normalize_absolute_unix() { +void test_fs__normalize_absolute_unix(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -85,7 +85,7 @@ * separators are correctly normalized to absolute paths with Windows * separators and no relative components. */ -void test_fs__normalize_absolute_mixed() { +void test_fs__normalize_absolute_mixed(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -109,7 +109,7 @@ /** * Test which verifies relative Windows-style paths are always rejected. */ -void test_fs__normalize_relative_windows() { +void test_fs__normalize_relative_windows(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -128,7 +128,7 @@ /** * Test which verifies relative UNIX-style paths are always rejected. */ -void test_fs__normalize_relative_unix() { +void test_fs__normalize_relative_unix(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -148,7 +148,7 @@ * Test which verifies relative paths consisting of mixed Windows and UNIX path * separators are always rejected. */ -void test_fs__normalize_relative_mixed() { +void test_fs__normalize_relative_mixed(void) { char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -208,7 +208,7 @@ * Test which verifies that paths exceeding the maximum path length are * rejected. */ -void test_fs__normalize_long() { +void test_fs__normalize_long(void) { char* input; char normalized[GUAC_RDP_FS_MAX_PATH]; @@ -234,7 +234,7 @@ * Test which verifies that paths exceeding the maximum path depth are * rejected. */ -void test_fs__normalize_deep() { +void test_fs__normalize_deep(void) { char* input; char normalized[GUAC_RDP_FS_MAX_PATH];
diff --git a/src/terminal/named-colors.c b/src/terminal/named-colors.c index 948982a..71713d3 100644 --- a/src/terminal/named-colors.c +++ b/src/terminal/named-colors.c
@@ -784,7 +784,7 @@ int guac_terminal_find_color(const char* name, guac_terminal_color* color) { /* Search for the color having the given name */ - guac_terminal_named_color* found = bsearch(name, + const guac_terminal_named_color* found = bsearch(name, GUAC_TERMINAL_NAMED_COLORS, GUAC_TERMINAL_NAMED_COLORS_LENGTH, sizeof(guac_terminal_named_color), guac_terminal_named_color_search);
diff --git a/src/terminal/tests/selection-point/enclose-text.c b/src/terminal/tests/selection-point/enclose-text.c index 637f704..ed6007b 100644 --- a/src/terminal/tests/selection-point/enclose-text.c +++ b/src/terminal/tests/selection-point/enclose-text.c
@@ -26,7 +26,7 @@ * Verifies that guac_terminal_selection_points_enclose_text() correctly * calculates if the range contains a full character. */ -void test_selection_point__enclose_text() { +void test_selection_point__enclose_text(void) { guac_terminal_selection_point a = { .column = 1, @@ -70,7 +70,7 @@ * Verifies that guac_terminal_selection_points_enclose_text() correctly * calculates if the range contains a full character with wide characters. */ -void test_selection_point__enclose_wide_text() { +void test_selection_point__enclose_wide_text(void) { guac_terminal_selection_point a = { .column = 1,
diff --git a/src/terminal/tests/selection-point/point-after.c b/src/terminal/tests/selection-point/point-after.c index 470730e..3661732 100644 --- a/src/terminal/tests/selection-point/point-after.c +++ b/src/terminal/tests/selection-point/point-after.c
@@ -26,7 +26,7 @@ * Verifies that guac_terminal_selection_point_is_after() correctly * determins the order of two points. */ -void test_selection_point__is_point_after() { +void test_selection_point__is_point_after(void) { guac_terminal_selection_point a = { .column = 1,
diff --git a/src/terminal/tests/selection-point/rounding.c b/src/terminal/tests/selection-point/rounding.c index c4389e7..f67eaa8 100644 --- a/src/terminal/tests/selection-point/rounding.c +++ b/src/terminal/tests/selection-point/rounding.c
@@ -27,7 +27,7 @@ * guac_terminal_selection_point_round_up() both correctly * calculate normalized column values for a point. */ -void test_selection_point__rounding() { +void test_selection_point__rounding(void) { guac_terminal_selection_point a = { .column = 1, @@ -51,7 +51,7 @@ * guac_terminal_selection_point_round_up() both correctly * calculate normalized column values for points with wide characters. */ -void test_selection_point__rounding_wide() { +void test_selection_point__rounding_wide(void) { guac_terminal_selection_point a = { .column = 1,