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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-17 04:52:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-17 04:52:36 +0400
commitad96dacbc5a7cc61ccf74405927847f243a955b5 (patch)
treea2b78d3b502b99a1c7e59e8400dfd0807a896125 /source/blender/blenkernel/intern/suggestions.c
parent9276fb479ed1c5b472c5d831f52913157efe9288 (diff)
style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
Diffstat (limited to 'source/blender/blenkernel/intern/suggestions.c')
-rw-r--r--source/blender/blenkernel/intern/suggestions.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c
index 48bc4926a85..e1e872c42b6 100644
--- a/source/blender/blenkernel/intern/suggestions.c
+++ b/source/blender/blenkernel/intern/suggestions.c
@@ -47,7 +47,8 @@ static SuggList suggestions = {NULL, NULL, NULL, NULL, NULL};
static char *documentation = NULL;
//static int doc_lines = 0;
-static int txttl_cmp(const char *first, const char *second, int len) {
+static int txttl_cmp(const char *first, const char *second, int len)
+{
int cmp, i;
for (cmp=0, i=0; i<len; i++) {
if ( (cmp= toupper(first[i])-toupper(second[i])) ) {
@@ -57,7 +58,8 @@ static int txttl_cmp(const char *first, const char *second, int len) {
return cmp;
}
-static void txttl_free_suggest(void) {
+static void txttl_free_suggest(void)
+{
SuggItem *item, *prev;
for (item = suggestions.last; item; item=prev) {
prev = item->prev;
@@ -69,7 +71,8 @@ static void txttl_free_suggest(void) {
suggestions.top = 0;
}
-static void txttl_free_docs(void) {
+static void txttl_free_docs(void)
+{
if (documentation) {
MEM_freeN(documentation);
documentation = NULL;
@@ -80,23 +83,27 @@ static void txttl_free_docs(void) {
/* General tool functions */
/**************************/
-void free_texttools(void) {
+void free_texttools(void)
+{
txttl_free_suggest();
txttl_free_docs();
}
-void texttool_text_set_active(Text *text) {
+void texttool_text_set_active(Text *text)
+{
if (activeToolText == text) return;
texttool_text_clear();
activeToolText = text;
}
-void texttool_text_clear(void) {
+void texttool_text_clear(void)
+{
free_texttools();
activeToolText = NULL;
}
-short texttool_text_is_active(Text *text) {
+short texttool_text_is_active(Text *text)
+{
return activeToolText==text ? 1 : 0;
}
@@ -104,7 +111,8 @@ short texttool_text_is_active(Text *text) {
/* Suggestion list methods */
/***************************/
-void texttool_suggest_add(const char *name, char type) {
+void texttool_suggest_add(const char *name, char type)
+{
SuggItem *newitem, *item;
int len, cmp;
@@ -154,7 +162,8 @@ void texttool_suggest_add(const char *name, char type) {
suggestions.top= 0;
}
-void texttool_suggest_prefix(const char *prefix) {
+void texttool_suggest_prefix(const char *prefix)
+{
SuggItem *match, *first, *last;
int cmp, len = strlen(prefix), top = 0;
@@ -194,27 +203,33 @@ void texttool_suggest_prefix(const char *prefix) {
}
}
-void texttool_suggest_clear(void) {
+void texttool_suggest_clear(void)
+{
txttl_free_suggest();
}
-SuggItem *texttool_suggest_first(void) {
+SuggItem *texttool_suggest_first(void)
+{
return suggestions.firstmatch;
}
-SuggItem *texttool_suggest_last(void) {
+SuggItem *texttool_suggest_last(void)
+{
return suggestions.lastmatch;
}
-void texttool_suggest_select(SuggItem *sel) {
+void texttool_suggest_select(SuggItem *sel)
+{
suggestions.selected = sel;
}
-SuggItem *texttool_suggest_selected(void) {
+SuggItem *texttool_suggest_selected(void)
+{
return suggestions.selected;
}
-int *texttool_suggest_top(void) {
+int *texttool_suggest_top(void)
+{
return &suggestions.top;
}
@@ -222,7 +237,8 @@ int *texttool_suggest_top(void) {
/* Documentation methods */
/*************************/
-void texttool_docs_show(const char *docs) {
+void texttool_docs_show(const char *docs)
+{
int len;
if (!docs) return;
@@ -246,10 +262,12 @@ void texttool_docs_show(const char *docs) {
documentation[len] = '\0';
}
-char *texttool_docs_get(void) {
+char *texttool_docs_get(void)
+{
return documentation;
}
-void texttool_docs_clear(void) {
+void texttool_docs_clear(void)
+{
txttl_free_docs();
}