From 056e47e752be3f4555d4af9057f1ad25809524c9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 23 Jun 2019 20:49:38 +0200 Subject: [PATCH] Replace "cannot" by "could not" --- app/src/controller.c | 2 +- app/src/file_handler.c | 4 +-- app/src/input_manager.c | 34 +++++++++---------- app/src/main.c | 2 +- app/src/recorder.c | 4 +-- app/src/scrcpy.c | 4 +-- app/src/screen.c | 2 +- app/src/server.c | 8 ++--- app/src/stream.c | 2 +- app/src/sys/unix/command.c | 2 +- app/src/sys/win/command.c | 4 +-- .../java/com/genymobile/scrcpy/Server.java | 2 +- .../scrcpy/wrappers/StatusBarManager.java | 4 +-- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/src/controller.c b/app/src/controller.c index 4b1f4c8b..7f90d787 100644 --- a/app/src/controller.c +++ b/app/src/controller.c @@ -91,7 +91,7 @@ run_controller(void *data) { bool ok = process_msg(controller, &msg); control_msg_destroy(&msg); if (!ok) { - LOGD("Cannot write msg to socket"); + LOGD("Could not write msg to socket"); break; } } diff --git a/app/src/file_handler.c b/app/src/file_handler.c index 051db897..ec53faae 100644 --- a/app/src/file_handler.c +++ b/app/src/file_handler.c @@ -31,7 +31,7 @@ file_handler_init(struct file_handler *file_handler, const char *serial) { if (serial) { file_handler->serial = SDL_strdup(serial); if (!file_handler->serial) { - LOGW("Cannot strdup serial"); + LOGW("Could not strdup serial"); SDL_DestroyCond(file_handler->event_cond); SDL_DestroyMutex(file_handler->mutex); return false; @@ -169,7 +169,7 @@ file_handler_stop(struct file_handler *file_handler) { cond_signal(file_handler->event_cond); if (file_handler->current_process != PROCESS_NONE) { if (!cmd_terminate(file_handler->current_process)) { - LOGW("Cannot terminate install process"); + LOGW("Could not terminate install process"); } cmd_simple_wait(file_handler->current_process, NULL); file_handler->current_process = PROCESS_NONE; diff --git a/app/src/input_manager.c b/app/src/input_manager.c index fb8ef8f0..37e41ca9 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -47,7 +47,7 @@ send_keycode(struct controller *controller, enum android_keycode keycode, if (actions & ACTION_DOWN) { msg.inject_keycode.action = AKEY_EVENT_ACTION_DOWN; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'inject %s (DOWN)'", name); + LOGW("Could not request 'inject %s (DOWN)'", name); return; } } @@ -55,7 +55,7 @@ send_keycode(struct controller *controller, enum android_keycode keycode, if (actions & ACTION_UP) { msg.inject_keycode.action = AKEY_EVENT_ACTION_UP; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'inject %s (UP)'", name); + LOGW("Could not request 'inject %s (UP)'", name); } } } @@ -102,7 +102,7 @@ press_back_or_turn_screen_on(struct controller *controller) { msg.type = CONTROL_MSG_TYPE_BACK_OR_SCREEN_ON; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'turn screen on'"); + LOGW("Could not request 'turn screen on'"); } } @@ -112,7 +112,7 @@ expand_notification_panel(struct controller *controller) { msg.type = CONTROL_MSG_TYPE_EXPAND_NOTIFICATION_PANEL; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'expand notification panel'"); + LOGW("Could not request 'expand notification panel'"); } } @@ -122,7 +122,7 @@ collapse_notification_panel(struct controller *controller) { msg.type = CONTROL_MSG_TYPE_COLLAPSE_NOTIFICATION_PANEL; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'collapse notification panel'"); + LOGW("Could not request 'collapse notification panel'"); } } @@ -132,7 +132,7 @@ request_device_clipboard(struct controller *controller) { msg.type = CONTROL_MSG_TYPE_GET_CLIPBOARD; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request device clipboard"); + LOGW("Could not request device clipboard"); } } @@ -140,7 +140,7 @@ static void set_device_clipboard(struct controller *controller) { char *text = SDL_GetClipboardText(); if (!text) { - LOGW("Cannot get clipboard text: %s", SDL_GetError()); + LOGW("Could not get clipboard text: %s", SDL_GetError()); return; } if (!*text) { @@ -155,7 +155,7 @@ set_device_clipboard(struct controller *controller) { if (!controller_push_msg(controller, &msg)) { SDL_free(text); - LOGW("Cannot request 'set device clipboard'"); + LOGW("Could not request 'set device clipboard'"); } } @@ -167,7 +167,7 @@ set_screen_power_mode(struct controller *controller, msg.set_screen_power_mode.mode = mode; if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'set screen power mode'"); + LOGW("Could not request 'set screen power mode'"); } } @@ -191,7 +191,7 @@ static void clipboard_paste(struct controller *controller) { char *text = SDL_GetClipboardText(); if (!text) { - LOGW("Cannot get clipboard text: %s", SDL_GetError()); + LOGW("Could not get clipboard text: %s", SDL_GetError()); return; } if (!*text) { @@ -205,7 +205,7 @@ clipboard_paste(struct controller *controller) { msg.inject_text.text = text; if (!controller_push_msg(controller, &msg)) { SDL_free(text); - LOGW("Cannot request 'paste clipboard'"); + LOGW("Could not request 'paste clipboard'"); } } @@ -222,12 +222,12 @@ input_manager_process_text_input(struct input_manager *input_manager, msg.type = CONTROL_MSG_TYPE_INJECT_TEXT; msg.inject_text.text = SDL_strdup(event->text); if (!msg.inject_text.text) { - LOGW("Cannot strdup input text"); + LOGW("Could not strdup input text"); return; } if (!controller_push_msg(input_manager->controller, &msg)) { SDL_free(msg.inject_text.text); - LOGW("Cannot request 'inject text'"); + LOGW("Could not request 'inject text'"); } } @@ -368,7 +368,7 @@ input_manager_process_key(struct input_manager *input_manager, struct control_msg msg; if (input_key_from_sdl_to_android(event, &msg)) { if (!controller_push_msg(controller, &msg)) { - LOGW("Cannot request 'inject keycode'"); + LOGW("Could not request 'inject keycode'"); } } } @@ -385,7 +385,7 @@ input_manager_process_mouse_motion(struct input_manager *input_manager, input_manager->screen->frame_size, &msg)) { if (!controller_push_msg(input_manager->controller, &msg)) { - LOGW("Cannot request 'inject mouse motion event'"); + LOGW("Could not request 'inject mouse motion event'"); } } } @@ -431,7 +431,7 @@ input_manager_process_mouse_button(struct input_manager *input_manager, input_manager->screen->frame_size, &msg)) { if (!controller_push_msg(input_manager->controller, &msg)) { - LOGW("Cannot request 'inject mouse button event'"); + LOGW("Could not request 'inject mouse button event'"); } } } @@ -446,7 +446,7 @@ input_manager_process_mouse_wheel(struct input_manager *input_manager, struct control_msg msg; if (mouse_wheel_from_sdl_to_android(event, position, &msg)) { if (!controller_push_msg(input_manager->controller, &msg)) { - LOGW("Cannot request 'inject mouse wheel event'"); + LOGW("Could not request 'inject mouse wheel event'"); } } } diff --git a/app/src/main.c b/app/src/main.c index ffa2f02d..b4f8953d 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -415,7 +415,7 @@ parse_args(struct args *args, int argc, char *argv[]) { } if (args->no_control && args->turn_screen_off) { - LOGE("Cannot request to turn screen off if control is disabled"); + LOGE("Could not request to turn screen off if control is disabled"); return false; } diff --git a/app/src/recorder.c b/app/src/recorder.c index 321a17ee..f0f64a5f 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -33,7 +33,7 @@ recorder_init(struct recorder *recorder, struct size declared_frame_size) { recorder->filename = SDL_strdup(filename); if (!recorder->filename) { - LOGE("Cannot strdup filename"); + LOGE("Could not strdup filename"); return false; } @@ -133,7 +133,7 @@ recorder_write_header(struct recorder *recorder, const AVPacket *packet) { uint8_t *extradata = av_malloc(packet->size * sizeof(uint8_t)); if (!extradata) { - LOGC("Cannot allocate extradata"); + LOGC("Could not allocate extradata"); return false; } diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 761edb69..ede34dd7 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -259,7 +259,7 @@ av_log_callback(void *avcl, int level, const char *fmt, va_list vl) { } char *local_fmt = SDL_malloc(strlen(fmt) + 10); if (!local_fmt) { - LOGC("Cannot allocate string"); + LOGC("Could not allocate string"); return; } // strcpy is safe here, the destination is large enough @@ -391,7 +391,7 @@ scrcpy(const struct scrcpy_options *options) { msg.set_screen_power_mode.mode = SCREEN_POWER_MODE_OFF; if (!controller_push_msg(&controller, &msg)) { - LOGW("Cannot request 'set screen power mode'"); + LOGW("Could not request 'set screen power mode'"); } } diff --git a/app/src/screen.c b/app/src/screen.c index 67b268c5..159d6a47 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -85,7 +85,7 @@ get_optimal_size(struct size current_size, struct size frame_size) { uint32_t h; if (!get_preferred_display_bounds(&display_size)) { - // cannot get display bounds, do not constraint the size + // could not get display bounds, do not constraint the size w = current_size.width; h = current_size.height; } else { diff --git a/app/src/server.c b/app/src/server.c index 14b8d41d..5b593c47 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -35,7 +35,7 @@ get_server_path(void) { // use scrcpy-server.jar in the same directory as the executable char *executable_path = get_executable_path(); if (!executable_path) { - LOGE("Cannot get executable path, " + LOGE("Could not get executable path, " "using " SERVER_FILENAME " from current directory"); // not found, use current directory return SERVER_FILENAME; @@ -47,7 +47,7 @@ get_server_path(void) { size_t len = dirlen + 1 + sizeof(SERVER_FILENAME); char *server_path = SDL_malloc(len); if (!server_path) { - LOGE("Cannot alloc server path string, " + LOGE("Could not alloc server path string, " "using " SERVER_FILENAME " from current directory"); SDL_free(executable_path); return SERVER_FILENAME; @@ -182,7 +182,7 @@ close_socket(socket_t *socket) { SDL_assert(*socket != INVALID_SOCKET); net_shutdown(*socket, SHUT_RDWR); if (!net_close(*socket)) { - LOGW("Cannot close socket"); + LOGW("Could not close socket"); return; } *socket = INVALID_SOCKET; @@ -306,7 +306,7 @@ server_stop(struct server *server) { SDL_assert(server->process != PROCESS_NONE); if (!cmd_terminate(server->process)) { - LOGW("Cannot terminate server"); + LOGW("Could not terminate server"); } cmd_simple_wait(server->process, NULL); // ignore exit code diff --git a/app/src/stream.c b/app/src/stream.c index 4f38cecf..30151859 100644 --- a/app/src/stream.c +++ b/app/src/stream.c @@ -100,7 +100,7 @@ read_packet_with_meta(void *opaque, uint8_t *buf, int buf_size) { if (pts != NO_PTS && !receiver_state_push_meta(state, pts)) { LOGE("Could not store PTS for recording"); - // we cannot save the PTS, the recording would be broken + // we could not save the PTS, the recording would be broken return AVERROR(ENOMEM); } } diff --git a/app/src/sys/unix/command.c b/app/src/sys/unix/command.c index 55aea5e8..9e00ccf8 100644 --- a/app/src/sys/unix/command.c +++ b/app/src/sys/unix/command.c @@ -94,7 +94,7 @@ cmd_simple_wait(pid_t pid, int *exit_code) { int status; int code; if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status)) { - // cannot wait, or exited unexpectedly, probably by a signal + // could not wait, or exited unexpectedly, probably by a signal code = -1; } else { code = WEXITSTATUS(status); diff --git a/app/src/sys/win/command.c b/app/src/sys/win/command.c index 484ce9f0..f23730a0 100644 --- a/app/src/sys/win/command.c +++ b/app/src/sys/win/command.c @@ -33,7 +33,7 @@ cmd_execute(const char *path, const char *const argv[], HANDLE *handle) { wchar_t *wide = utf8_to_wide_char(cmd); if (!wide) { - LOGC("Cannot allocate wide char string"); + LOGC("Could not allocate wide char string"); return PROCESS_ERROR_GENERIC; } @@ -67,7 +67,7 @@ cmd_simple_wait(HANDLE handle, DWORD *exit_code) { DWORD code; if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0 || !GetExitCodeProcess(handle, &code)) { - // cannot wait or retrieve the exit code + // could not wait or retrieve the exit code code = -1; // max value, it's unsigned } if (exit_code) { diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index 25da0f4e..3bd2fcdc 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -116,7 +116,7 @@ public final class Server { try { new File(SERVER_PATH).delete(); } catch (Exception e) { - Ln.e("Cannot unlink server", e); + Ln.e("Could not unlink server", e); } } diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java index 74003b64..7cd28da6 100644 --- a/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java +++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/StatusBarManager.java @@ -29,7 +29,7 @@ public class StatusBarManager { try { expandNotificationsPanelMethod.invoke(manager); } catch (InvocationTargetException | IllegalAccessException e) { - Ln.e("Cannot invoke ServiceBarManager.expandNotificationsPanel()", e); + Ln.e("Could not invoke ServiceBarManager.expandNotificationsPanel()", e); } } @@ -45,7 +45,7 @@ public class StatusBarManager { try { collapsePanelsMethod.invoke(manager); } catch (InvocationTargetException | IllegalAccessException e) { - Ln.e("Cannot invoke ServiceBarManager.collapsePanels()", e); + Ln.e("Could not invoke ServiceBarManager.collapsePanels()", e); } } }