diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-12 06:15:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-12 06:15:33 +0400 |
commit | cc1259178b95d084a7ca9e83c90ef0ab97b7fa86 (patch) | |
tree | fb6b69a28ea45fb30373bdc4e387b0eebde4b3ce /source/blender | |
parent | 5aaf3ede76c91a062d09360301083b6f75a6a89f (diff) |
code cleanup: utfconv library had some quite confusing formatting, also cleared som warnings.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 40 | ||||
-rw-r--r-- | source/blender/blenlib/intern/storage.c | 22 |
2 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 576af23ed1b..1b734c674e2 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -184,14 +184,14 @@ int BLI_file_is_writable(const char *filename) int BLI_file_touch(const char *file) { - FILE *f = BLI_fopen(file,"r+b"); + FILE *f = BLI_fopen(file, "r+b"); if (f != NULL) { char c = getc(f); rewind(f); - putc(c,f); + putc(c, f); } else { - f = BLI_fopen(file,"wb"); + f = BLI_fopen(file, "wb"); } if (f) { fclose(f); @@ -250,7 +250,7 @@ int BLI_delete(const char *file, int dir, int recursive) { int err; - UTF16_ENCODE(file) + UTF16_ENCODE(file); if (recursive) { callLocalErrorCallBack("Recursive delete is unsupported on Windows"); @@ -265,7 +265,7 @@ int BLI_delete(const char *file, int dir, int recursive) if (err) callLocalErrorCallBack("Unable to delete file"); } - UTF16_UN_ENCODE(file) + UTF16_UN_ENCODE(file); return err; } @@ -286,11 +286,11 @@ int BLI_move(const char *file, const char *to) } } - UTF16_ENCODE(file) - UTF16_ENCODE(str) + UTF16_ENCODE(file); + UTF16_ENCODE(str); err= !MoveFileW(file_16, str_16); - UTF16_UN_ENCODE(str) - UTF16_UN_ENCODE(file) + UTF16_UN_ENCODE(str); + UTF16_UN_ENCODE(file); if (err) { callLocalErrorCallBack("Unable to move file"); @@ -317,11 +317,11 @@ int BLI_copy(const char *file, const char *to) } } - UTF16_ENCODE(file) - UTF16_ENCODE(str) - err= !CopyFileW(file_16,str_16,FALSE); - UTF16_UN_ENCODE(str) - UTF16_UN_ENCODE(file) + UTF16_ENCODE(file); + UTF16_ENCODE(str); + err = !CopyFileW(file_16, str_16, FALSE); + UTF16_UN_ENCODE(str); + UTF16_UN_ENCODE(file); if (err) { callLocalErrorCallBack("Unable to copy file!"); @@ -344,10 +344,10 @@ void BLI_dir_create_recursive(const char *dirname) char *lslash; char tmp[MAXPATHLEN]; - // First remove possible slash at the end of the dirname. - // This routine otherwise tries to create - // blah1/blah2/ (with slash) after creating - // blah1/blah2 (without slash) + /* First remove possible slash at the end of the dirname. + * This routine otherwise tries to create + * blah1/blah2/ (with slash) after creating + * blah1/blah2 (without slash) */ BLI_strncpy(tmp, dirname, sizeof(tmp)); lslash= BLI_last_slash(tmp); @@ -357,10 +357,10 @@ void BLI_dir_create_recursive(const char *dirname) } if (BLI_exists(tmp)) return; - + lslash= BLI_last_slash(tmp); if (lslash) { - /* Split about the last slash and recurse */ + /* Split about the last slash and recurse */ *lslash = 0; BLI_dir_create_recursive(tmp); } diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 01ebd1dce57..b0c0f106f06 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -224,16 +224,16 @@ static void bli_builddir(const char *dirname, const char *relname) return; } #else - UTF16_ENCODE(dirname) + UTF16_ENCODE(dirname); if (!SetCurrentDirectoryW(dirname_16)) { perror(dirname); free(dirname_16); return; } - UTF16_UN_ENCODE(dirname) + UTF16_UN_ENCODE(dirname); #endif - if ( (dir = (DIR *)opendir(".")) ) { + if ((dir = (DIR *)opendir("."))) { while ((fname = (struct dirent*) readdir(dir)) != NULL) { dlink = (struct dirlink *)malloc(sizeof(struct dirlink)); if (dlink) { @@ -247,13 +247,13 @@ static void bli_builddir(const char *dirname, const char *relname) if (newnum) { if (files) { - void *tmp= realloc(files, (totnum+newnum) * sizeof(struct direntry)); + void *tmp = realloc(files, (totnum+newnum) * sizeof(struct direntry)); if (tmp) { - files= (struct direntry *)tmp; + files = (struct direntry *)tmp; } else { /* realloc fail */ free(files); - files= NULL; + files = NULL; } } @@ -556,17 +556,17 @@ void BLI_file_free_lines(LinkNode *lines) int BLI_file_older(const char *file1, const char *file2) { -#if WIN32 +#ifdef WIN32 struct _stat st1, st2; - UTF16_ENCODE(file1) - UTF16_ENCODE(file2) + UTF16_ENCODE(file1); + UTF16_ENCODE(file2); if (_wstat(file1_16, &st1)) return 0; if (_wstat(file2_16, &st2)) return 0; - UTF16_UN_ENCODE(file2) - UTF16_UN_ENCODE(file1) + UTF16_UN_ENCODE(file2); + UTF16_UN_ENCODE(file1); #else struct stat st1, st2; |