diff options
author | koekeishiya <aasvi93@hotmail.com> | 2017-09-23 23:24:46 +0200 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2017-09-23 23:24:46 +0200 |
commit | df3d13c9e655c5a566d471256b5e54cca796f576 (patch) | |
tree | 03c13f16ac65b9bc102ac138448c33e869b02271 /src/hotload.c | |
parent | eb2315cefc6c4f6375b31e93ca99f1422c78792a (diff) | |
download | skhd-df3d13c9e655c5a566d471256b5e54cca796f576.tar.gz skhd-df3d13c9e655c5a566d471256b5e54cca796f576.zip |
code style
Diffstat (limited to 'src/hotload.c')
-rw-r--r-- | src/hotload.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/hotload.c b/src/hotload.c index 81fc589..8677cc2 100644 --- a/src/hotload.c +++ b/src/hotload.c @@ -44,14 +44,14 @@ internal struct watched_file * hotloader_watched_file(struct hotloader *hotloader, char *absolutepath) { struct watched_file *result = NULL; - for(unsigned index = 0; result == NULL && index < hotloader->watch_count; ++index) { + for (unsigned index = 0; result == NULL && index < hotloader->watch_count; ++index) { struct watched_file *watch_info = hotloader->watch_list + index; char *directory = file_directory(absolutepath); char *filename = file_name(absolutepath); - if(strcmp(watch_info->directory, directory) == 0) { - if(strcmp(watch_info->filename, filename) == 0) { + if (strcmp(watch_info->directory, directory) == 0) { + if (strcmp(watch_info->filename, filename) == 0) { result = watch_info; } } @@ -70,9 +70,9 @@ internal FSEVENT_CALLBACK(hotloader_handler) char **files = (char **) paths; struct watched_file *watch_info; - for(unsigned index = 0; index < count; ++index) { + for (unsigned index = 0; index < count; ++index) { char *absolutepath = files[index]; - if((watch_info = hotloader_watched_file(hotloader, absolutepath))) { + if ((watch_info = hotloader_watched_file(hotloader, absolutepath))) { hotloader->callback(absolutepath, watch_info->directory, watch_info->filename); } } @@ -80,7 +80,7 @@ internal FSEVENT_CALLBACK(hotloader_handler) void hotloader_add_file(struct hotloader *hotloader, const char *file) { - if(!hotloader->enabled) { + if (!hotloader->enabled) { struct watched_file watch_info; watch_info.directory = file_directory(file); watch_info.filename = file_name(file); @@ -91,13 +91,13 @@ void hotloader_add_file(struct hotloader *hotloader, const char *file) bool hotloader_begin(struct hotloader *hotloader, hotloader_callback *callback) { - if((hotloader->enabled) || - (!hotloader->watch_count)) { + if ((hotloader->enabled) || + (!hotloader->watch_count)) { return false; } CFStringRef string_refs[hotloader->watch_count]; - for(unsigned index = 0; index < hotloader->watch_count; ++index) { + for (unsigned index = 0; index < hotloader->watch_count; ++index) { string_refs[index] = CFStringCreateWithCString(kCFAllocatorDefault, hotloader->watch_list[index].directory, kCFStringEncodingUTF8); @@ -124,13 +124,13 @@ bool hotloader_begin(struct hotloader *hotloader, hotloader_callback *callback) void hotloader_end(struct hotloader *hotloader) { - if(hotloader->enabled) { + if (hotloader->enabled) { FSEventStreamStop(hotloader->stream); FSEventStreamInvalidate(hotloader->stream); FSEventStreamRelease(hotloader->stream); CFIndex count = CFArrayGetCount(hotloader->path); - for(unsigned index = 0; index < count; ++index) { + for (unsigned index = 0; index < count; ++index) { CFStringRef string_ref = (CFStringRef) CFArrayGetValueAtIndex(hotloader->path, index); free(hotloader->watch_list[index].directory); free(hotloader->watch_list[index].filename); |