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
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-03-12 13:22:16 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-03-12 13:22:16 +0400
commit30907594b6bcbc8c401d425a57bf7eadefdcaf61 (patch)
treee62faabb8e03d090d8c304cc6b4e9fdfda8e2a8b /source/blender/blenfont/intern/blf_dir.c
parent51c553befba6799b47df14902b93c652275cebee (diff)
Style cleanup in blenfont (spaces, C++ comments, etc.).
Diffstat (limited to 'source/blender/blenfont/intern/blf_dir.c')
-rw-r--r--source/blender/blenfont/intern/blf_dir.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index b82393fad92..824f1715f3c 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -51,17 +51,17 @@
#include "blf_internal_types.h"
#include "blf_internal.h"
-static ListBase global_font_dir= { NULL, NULL };
+static ListBase global_font_dir = { NULL, NULL };
static DirBLF *blf_dir_find(const char *path)
{
DirBLF *p;
- p= global_font_dir.first;
+ p = global_font_dir.first;
while (p) {
if (BLI_path_cmp(p->path, path) == 0)
return p;
- p= p->next;
+ p = p->next;
}
return NULL;
}
@@ -70,12 +70,12 @@ void BLF_dir_add(const char *path)
{
DirBLF *dir;
- dir= blf_dir_find(path);
+ dir = blf_dir_find(path);
if (dir) /* already in the list ? just return. */
return;
- dir= (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add");
- dir->path= BLI_strdup(path);
+ dir = (DirBLF *)MEM_callocN(sizeof(DirBLF), "BLF_dir_add");
+ dir->path = BLI_strdup(path);
BLI_addhead(&global_font_dir, dir);
}
@@ -83,7 +83,7 @@ void BLF_dir_rem(const char *path)
{
DirBLF *dir;
- dir= blf_dir_find(path);
+ dir = blf_dir_find(path);
if (dir) {
BLI_remlink(&global_font_dir, dir);
MEM_freeN(dir->path);
@@ -98,19 +98,19 @@ char **BLF_dir_get(int *ndir)
char *path;
int i, count;
- count= BLI_countlist(&global_font_dir);
+ count = BLI_countlist(&global_font_dir);
if (!count)
return NULL;
- dirs= (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get");
- p= global_font_dir.first;
- i= 0;
+ dirs = (char **)MEM_callocN(sizeof(char *) * count, "BLF_dir_get");
+ p = global_font_dir.first;
+ i = 0;
while (p) {
- path= BLI_strdup(p->path);
- dirs[i]= path;
- p= p->next;
+ path = BLI_strdup(p->path);
+ dirs[i] = path;
+ p = p->next;
}
- *ndir= i;
+ *ndir = i;
return dirs;
}
@@ -119,8 +119,8 @@ void BLF_dir_free(char **dirs, int count)
char *path;
int i;
- for (i= 0; i < count; i++) {
- path= dirs[i];
+ for (i = 0; i < count; i++) {
+ path = dirs[i];
MEM_freeN(path);
}
MEM_freeN(dirs);
@@ -130,12 +130,12 @@ char *blf_dir_search(const char *file)
{
DirBLF *dir;
char full_path[FILE_MAX];
- char *s= NULL;
+ char *s = NULL;
- for(dir=global_font_dir.first; dir; dir= dir->next) {
+ for (dir = global_font_dir.first; dir; dir = dir->next) {
BLI_join_dirfile(full_path, sizeof(full_path), dir->path, file);
if (BLI_exists(full_path)) {
- s= BLI_strdup(full_path);
+ s = BLI_strdup(full_path);
break;
}
}
@@ -143,32 +143,32 @@ char *blf_dir_search(const char *file)
if (!s) {
/* check the current directory, why not ? */
if (BLI_exists(file))
- s= BLI_strdup(file);
+ s = BLI_strdup(file);
}
return s;
}
-#if 0 // UNUSED
+#if 0 /* UNUSED */
int blf_dir_split(const char *str, char *file, int *size)
{
int i, len;
char *s;
/* Window, Linux or Mac, this is always / */
- s= strrchr(str, '/');
+ s = strrchr(str, '/');
if (s) {
- len= s - str;
- for (i= 0; i < len; i++)
- file[i]= str[i];
-
- file[i]= '.';
- file[i+1]= 't';
- file[i+2]= 't';
- file[i+3]= 'f';
- file[i+4]= '\0';
+ len = s - str;
+ for (i = 0; i < len; i++)
+ file[i] = str[i];
+
+ file[i] = '.';
+ file[i+1] = 't';
+ file[i+2] = 't';
+ file[i+3] = 'f';
+ file[i+4] = '\0';
s++;
- *size= atoi(s);
+ *size = atoi(s);
return 1;
}
return 0;
@@ -183,24 +183,24 @@ char *blf_dir_metrics_search(const char *filename)
char *mfile;
char *s;
- mfile= BLI_strdup(filename);
- s= strrchr(mfile, '.');
+ mfile = BLI_strdup(filename);
+ s = strrchr(mfile, '.');
if (s) {
if (BLI_strnlen(s, 4) < 4) {
MEM_freeN(mfile);
return NULL;
}
s++;
- s[0]= 'a';
- s[1]= 'f';
- s[2]= 'm';
+ s[0] = 'a';
+ s[1] = 'f';
+ s[2] = 'm';
/* first check .afm */
if (BLI_exists(s))
return s;
/* and now check .pfm */
- s[0]= 'p';
+ s[0] = 'p';
if (BLI_exists(s))
return s;