diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:16:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:17:30 +0300 |
commit | 9ba948a4859da3308033fa6dc54f74433d7e6a21 (patch) | |
tree | 0bd6e95eb59d9af03aa32d925c68e1cbebecc246 /source/blender/blenlib/intern/winstuff_dir.c | |
parent | 337eb8c1de4c57c34520b467d79779153335eecb (diff) |
Cleanup: style, use braces for blenlib
Diffstat (limited to 'source/blender/blenlib/intern/winstuff_dir.c')
-rw-r--r-- | source/blender/blenlib/intern/winstuff_dir.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/winstuff_dir.c b/source/blender/blenlib/intern/winstuff_dir.c index 0b3cf07883d..b302eaea9de 100644 --- a/source/blender/blenlib/intern/winstuff_dir.c +++ b/source/blender/blenlib/intern/winstuff_dir.c @@ -89,7 +89,9 @@ static char *BLI_alloc_utf_8_from_16(wchar_t *in16, size_t add) { size_t bsize = count_utf_8_from_16(in16); char *out8 = NULL; - if (!bsize) return NULL; + if (!bsize) { + return NULL; + } out8 = (char *)MEM_mallocN(sizeof(char) * (bsize + add), "UTF-8 String"); conv_utf_16_to_8(in16, out8, bsize); return out8; @@ -99,7 +101,9 @@ static wchar_t *UNUSED_FUNCTION(BLI_alloc_utf16_from_8) (char *in8, size_t add) { size_t bsize = count_utf_16_from_8(in8); wchar_t *out16 = NULL; - if (!bsize) return NULL; + if (!bsize) { + return NULL; + } out16 = (wchar_t *) MEM_mallocN(sizeof(wchar_t) * (bsize + add), "UTF-16 String"); conv_utf_8_to_16(in8, out16, bsize); return out16; @@ -118,8 +122,9 @@ struct dirent *readdir(DIR *dp) wchar_t *path_16 = alloc_utf16_from_8(dp->path, 0); dp->handle = FindFirstFileW(path_16, &(dp->data)); free(path_16); - if (dp->handle == INVALID_HANDLE_VALUE) + if (dp->handle == INVALID_HANDLE_VALUE) { return NULL; + } dp->direntry.d_name = BLI_alloc_utf_8_from_16(dp->data.cFileName, 0); @@ -137,8 +142,12 @@ struct dirent *readdir(DIR *dp) int closedir(DIR *dp) { - if (dp->direntry.d_name) MEM_freeN(dp->direntry.d_name); - if (dp->handle != INVALID_HANDLE_VALUE) FindClose(dp->handle); + if (dp->direntry.d_name) { + MEM_freeN(dp->direntry.d_name); + } + if (dp->handle != INVALID_HANDLE_VALUE) { + FindClose(dp->handle); + } MEM_freeN(dp); |