You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libdispatch/asprintf.patch

105 lines
4.9 KiB

diff -Naur ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/bsdtests.c ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/bsdtests.c
--- ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/bsdtests.c 2020-09-02 02:28:48.000000000 -0500
+++ ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/bsdtests.c 2021-01-19 11:17:43.952112327 -0600
@@ -347,8 +347,8 @@
{
char* actual_str;
char* expected_str;
- asprintf(&actual_str, "%d\t%s", actual, actual ? strerror(actual) : "");
- asprintf(&expected_str, "%d\t%s", expected, expected ? strerror(expected) : "");
+ (void)asprintf(&actual_str, "%d\t%s", actual, actual ? strerror(actual) : "");
+ (void)asprintf(&expected_str, "%d\t%s", expected, expected ? strerror(expected) : "");
_test_print(file, line, desc,
(actual == expected), "%s", actual_str, "%s", expected_str);
free(actual_str);
@@ -369,8 +369,8 @@
{
char* actual_str;
char* expected_str;
- asprintf(&actual_str, "%d %s", actual, actual ? mach_error_string(actual) : "");
- asprintf(&expected_str, "%d %s", expected, expected ? mach_error_string(expected) : "");
+ (void)asprintf(&actual_str, "%d %s", actual, actual ? mach_error_string(actual) : "");
+ (void)asprintf(&expected_str, "%d %s", expected, expected ? mach_error_string(expected) : "");
_test_print(file, line, desc,
(actual == expected), "%s", actual_str, "%s", expected_str);
free(actual_str);
@@ -416,12 +416,12 @@
if (code != expectedCode) {
char buffer[BUFSIZ];
CFStringGetCString(errDesc, buffer, sizeof(buffer), kCFStringEncodingUTF8);
- asprintf(&actual_str, "%ld\t%s", code, buffer);
+ (void)asprintf(&actual_str, "%ld\t%s", code, buffer);
} else {
- asprintf(&actual_str, "%ld", code);
+ (void)asprintf(&actual_str, "%ld", code);
}
- asprintf(&expected_str, "%ld", expectedCode);
+ (void)asprintf(&expected_str, "%ld", expectedCode);
_test_print("", (long) 0, desc,
(code == expectedCode), "%s", actual_str, "%s", expected_str);
diff -Naur ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_io.c ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_io.c
--- ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_io.c 2020-09-02 02:28:48.000000000 -0500
+++ ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_io.c 2021-01-19 11:19:09.286850562 -0600
@@ -255,7 +255,7 @@
test_stop();
}
char *path_out = NULL;
- asprintf(&path_out, "%s\\dispatchtest_io.XXXXXX", temp_dir);
+ (void)asprintf(&path_out, "%s\\dispatchtest_io.XXXXXX", temp_dir);
#else
char path_out[] = "/tmp/dispatchtest_io.XXXXXX";
#endif
@@ -486,7 +486,7 @@
#if defined(_WIN32)
for (size_t i = 0; paths[i]; i++) {
char *search_path = NULL;
- asprintf(&search_path, "%s\\*", paths[i]);
+ (void)asprintf(&search_path, "%s\\*", paths[i]);
WIN32_FIND_DATAA node;
HANDLE find = FindFirstFileA(search_path, &node);
free(search_path);
@@ -503,7 +503,7 @@
continue;
}
char *node_path = NULL;
- asprintf(&node_path, "%s\\%s", paths[i], node.cFileName);
+ (void)asprintf(&node_path, "%s\\%s", paths[i], node.cFileName);
if (node.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
char *subdir_paths[] = {node_path, NULL};
test_enumerate_dir_trees(subdir_paths, process_file);
@@ -590,7 +590,7 @@
test_ptr_notnull("SystemRoot", system_root);
test_stop();
}
- asprintf(&paths[0], "%s\\System32", system_root);
+ (void)asprintf(&paths[0], "%s\\System32", system_root);
#else
char *paths[] = {"/usr/lib", NULL};
#endif
diff -Naur ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_io_muxed.c ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_io_muxed.c
--- ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_io_muxed.c 2020-09-02 02:28:48.000000000 -0500
+++ ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_io_muxed.c 2021-01-19 11:18:19.122416587 -0600
@@ -64,7 +64,7 @@
const char *path_separator = "/";
#endif
char *path = NULL;
- asprintf(&path, "%s%sdispatchtest_io.XXXXXX", temp_dir, path_separator);
+ (void)asprintf(&path, "%s%sdispatchtest_io.XXXXXX", temp_dir, path_separator);
dispatch_fd_t fd = mkstemp(path);
if (fd == -1) {
test_errno("mkstemp", errno, 0);
diff -Naur ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_overcommit.c ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_overcommit.c
--- ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE-orig/tests/dispatch_overcommit.c 2020-09-02 02:28:48.000000000 -0500
+++ ./swift-corelibs-libdispatch-swift-5.3.2-RELEASE/tests/dispatch_overcommit.c 2021-01-19 11:16:37.385536454 -0600
@@ -48,7 +48,7 @@
int i;
for (i = 0; i < final; ++i) {
char* name;
- asprintf(&name, "test.overcommit.%d", i);
+ (void)asprintf(&name, "test.overcommit.%d", i);
dispatch_queue_t queue = dispatch_queue_create(name, NULL);
test_ptr_notnull("dispatch_queue_create", queue);