diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 11:55:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-03 12:35:44 +0400 |
commit | d900f5be55d0812eb5c7dfd3ea47020c3edafd41 (patch) | |
tree | 7d5035e3dbafdcd4988e7ed57068e48c951a989a /source/blender/blenkernel/intern/text.c | |
parent | a948ae2c5167c49819241572d3aacb4e4bf5b6d7 (diff) |
Code cleanup: use bools where possible
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 145f832063a..7fea20a14e2 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1230,7 +1230,7 @@ void txt_order_cursors(Text *text, const bool reverse) } } -int txt_has_sel(Text *text) +bool txt_has_sel(Text *text) { return ((text->curl != text->sell) || (text->curc != text->selc)); } @@ -3010,7 +3010,7 @@ int text_check_bracket(const char ch) } /* TODO, have a function for operators - http://docs.python.org/py3k/reference/lexical_analysis.html#operators */ -int text_check_delim(const char ch) +bool text_check_delim(const char ch) { int a; char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,@"; @@ -3022,14 +3022,14 @@ int text_check_delim(const char ch) return 0; } -int text_check_digit(const char ch) +bool text_check_digit(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; return 0; } -int text_check_identifier(const char ch) +bool text_check_identifier(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; @@ -3040,7 +3040,7 @@ int text_check_identifier(const char ch) return 0; } -int text_check_identifier_nodigit(const char ch) +bool text_check_identifier_nodigit(const char ch) { if (ch <= '9') return 0; if (ch < 'A') return 0; @@ -3051,18 +3051,18 @@ int text_check_identifier_nodigit(const char ch) } #ifndef WITH_PYTHON -int text_check_identifier_unicode(const unsigned int ch) +bool text_check_identifier_unicode(const unsigned int ch) { return (ch < 255 && text_check_identifier((char)ch)); } -int text_check_identifier_nodigit_unicode(const unsigned int ch) +bool text_check_identifier_nodigit_unicode(const unsigned int ch) { return (ch < 255 && text_check_identifier_nodigit((char)ch)); } #endif /* WITH_PYTHON */ -int text_check_whitespace(const char ch) +bool text_check_whitespace(const char ch) { if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') return 1; |