Skip to content

Commit

Permalink
Specify fileChanged argument type
Browse files Browse the repository at this point in the history
  • Loading branch information
jackun committed Mar 29, 2022
1 parent 73da29d commit 45113bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )

static void fileChanged(void *params_void) {
notify_thread *nt = reinterpret_cast<notify_thread *>(params_void);
static void fileChanged(notify_thread *nt) {
int length, i = 0;
char buffer[EVENT_BUF_LEN];
overlay_params local_params = *nt->params;
Expand All @@ -23,7 +22,7 @@ static void fileChanged(void *params_void) {
(struct inotify_event *) &buffer[i];
i += EVENT_SIZE + event->len;
if (event->mask & IN_MODIFY || event->mask & IN_DELETE_SELF) {
// In the case of IN_DELETE_SELF, some editors may to a save-to-temp-file/delete-original/move-temp-file
// In the case of IN_DELETE_SELF, some editors may do a save-to-temp-file/delete-original/move-temp-file
// so sleep a little to let file to be replaced
std::this_thread::sleep_for(std::chrono::milliseconds(100));
parse_overlay_config(&local_params, getenv("MANGOHUD_CONFIG"));
Expand Down

0 comments on commit 45113bb

Please sign in to comment.