Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-12 06:15:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-12 06:15:33 +0400
commitcc1259178b95d084a7ca9e83c90ef0ab97b7fa86 (patch)
treefb6b69a28ea45fb30373bdc4e387b0eebde4b3ce /source
parent5aaf3ede76c91a062d09360301083b6f75a6a89f (diff)
code cleanup: utfconv library had some quite confusing formatting, also cleared som warnings.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/intern/fileops.c40
-rw-r--r--source/blender/blenlib/intern/storage.c22
-rw-r--r--source/creator/creator.c5
3 files changed, 33 insertions, 34 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;
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 516c50a01f9..308cdab9726 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1169,7 +1169,7 @@ char **environ = NULL;
#ifdef WIN32
-int main(int argc, const char **argv_c) /*Do not mess with const*/
+int main(int argc, const char **UNUSED(argv_c)) /* Do not mess with const */
#else
int main(int argc, const char **argv)
#endif
@@ -1182,8 +1182,7 @@ int main(int argc, const char **argv)
wchar_t **argv_16 = CommandLineToArgvW(GetCommandLineW(), &argc);
int argci = 0;
char **argv = MEM_mallocN(argc * sizeof(char *), "argv array");
- for (argci = 0; argci < argc; argci++)
- {
+ for (argci = 0; argci < argc; argci++) {
argv[argci] = alloc_utf_8_from_16(argv_16[argci], 0);
}
LocalFree(argv_16);