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>2014-01-04 10:16:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-04 11:10:01 +0400
commitb9114cb609698bdd40175b79c017b8ec8d10b518 (patch)
tree98dc331711dcd06fb69f905ebdaf7937a4d23379 /source/blender/blenkernel
parent091740f858c1b6d3016e38fc3186cce737d9ff2c (diff)
UI: Use bool rather then int/short's where possible
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_colortools.h2
-rw-r--r--source/blender/blenkernel/BKE_context.h2
-rw-r--r--source/blender/blenkernel/BKE_text.h24
-rw-r--r--source/blender/blenkernel/BKE_unit.h2
-rw-r--r--source/blender/blenkernel/intern/colortools.c2
-rw-r--r--source/blender/blenkernel/intern/text.c24
-rw-r--r--source/blender/blenkernel/intern/unit.c6
7 files changed, 32 insertions, 30 deletions
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index e0b7e68bafc..a69a9601c9a 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -59,7 +59,7 @@ int curvemap_remove_point(struct CurveMap *cuma, struct Curv
struct CurveMapPoint *curvemap_insert(struct CurveMap *cuma, float x, float y);
void curvemap_sethandle(struct CurveMap *cuma, int type);
-void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles);
+void curvemapping_changed(struct CurveMapping *cumap, const bool rem_doubles);
void curvemapping_changed_all(struct CurveMapping *cumap);
/* call before _all_ evaluation functions */
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index c6a6b0672d1..2834a37ca7a 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -85,7 +85,7 @@ typedef struct bContextStore {
struct bContextStore *next, *prev;
ListBase entries;
- int used;
+ bool used;
} bContextStore;
/* for the context's rna mode enum
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index bba209334d4..67c1b6834dd 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -66,18 +66,18 @@ int txt_utf8_offset_to_index(const char *str, int offset);
int txt_utf8_index_to_offset(const char *str, int index);
int txt_utf8_offset_to_column(const char *str, int offset);
int txt_utf8_column_to_offset(const char *str, int column);
-void txt_move_up (struct Text *text, short sel);
-void txt_move_down (struct Text *text, short sel);
-void txt_move_left (struct Text *text, short sel);
-void txt_move_right (struct Text *text, short sel);
-void txt_jump_left (struct Text *text, bool sel, bool use_init_step);
-void txt_jump_right (struct Text *text, bool sel, bool use_init_step);
-void txt_move_bof (struct Text *text, short sel);
-void txt_move_eof (struct Text *text, short sel);
-void txt_move_bol (struct Text *text, short sel);
-void txt_move_eol (struct Text *text, short sel);
-void txt_move_toline (struct Text *text, unsigned int line, short sel);
-void txt_move_to (struct Text *text, unsigned int line, unsigned int ch, short sel);
+void txt_move_up (struct Text *text, const bool sel);
+void txt_move_down (struct Text *text, const bool sel);
+void txt_move_left (struct Text *text, const bool sel);
+void txt_move_right (struct Text *text, const bool sel);
+void txt_jump_left (struct Text *text, const bool sel, const bool use_init_step);
+void txt_jump_right (struct Text *text, const bool sel, const bool use_init_step);
+void txt_move_bof (struct Text *text, const bool sel);
+void txt_move_eof (struct Text *text, const bool sel);
+void txt_move_bol (struct Text *text, const bool sel);
+void txt_move_eol (struct Text *text, const bool sel);
+void txt_move_toline (struct Text *text, unsigned int line, const bool sel);
+void txt_move_to (struct Text *text, unsigned int line, unsigned int ch, const bool sel);
void txt_pop_sel (struct Text *text);
void txt_delete_char (struct Text *text);
void txt_delete_word (struct Text *text);
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
index 133f3d0dfbc..8bccf3511d8 100644
--- a/source/blender/blenkernel/BKE_unit.h
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -34,7 +34,7 @@ extern "C" {
/* in all cases the value is assumed to be scaled by the user preference */
/* humanly readable representation of a value in units (used for button drawing) */
-size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad);
+size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad);
/* replace units with values, used before python button evaluation */
int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type);
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index 578fa5d348d..c2ce779f03f 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -681,7 +681,7 @@ static int sort_curvepoints(const void *a1, const void *a2)
/* ************************ more CurveMapping calls *************** */
/* note; only does current curvemap! */
-void curvemapping_changed(CurveMapping *cumap, int rem_doubles)
+void curvemapping_changed(CurveMapping *cumap, const bool rem_doubles)
{
CurveMap *cuma = cumap->cm + cumap->cur;
CurveMapPoint *cmp = cuma->curve;
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 96601985f67..b2c10ca78ae 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -847,7 +847,7 @@ int txt_utf8_column_to_offset(const char *str, int column)
return offset;
}
-void txt_move_up(Text *text, short sel)
+void txt_move_up(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -870,7 +870,7 @@ void txt_move_up(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_down(Text *text, short sel)
+void txt_move_down(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -892,7 +892,7 @@ void txt_move_down(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_left(Text *text, short sel)
+void txt_move_left(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -937,7 +937,7 @@ void txt_move_left(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_right(Text *text, short sel)
+void txt_move_right(Text *text, const bool sel)
{
TextLine **linep;
int *charp, do_tab = FALSE, i;
@@ -979,7 +979,7 @@ void txt_move_right(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_jump_left(Text *text, bool sel, bool use_init_step)
+void txt_jump_left(Text *text, const bool sel, const bool use_init_step)
{
TextLine **linep;
int *charp;
@@ -996,7 +996,7 @@ void txt_jump_left(Text *text, bool sel, bool use_init_step)
if (!sel) txt_pop_sel(text);
}
-void txt_jump_right(Text *text, bool sel, bool use_init_step)
+void txt_jump_right(Text *text, const bool sel, const bool use_init_step)
{
TextLine **linep;
int *charp;
@@ -1013,7 +1013,7 @@ void txt_jump_right(Text *text, bool sel, bool use_init_step)
if (!sel) txt_pop_sel(text);
}
-void txt_move_bol(Text *text, short sel)
+void txt_move_bol(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -1028,7 +1028,7 @@ void txt_move_bol(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_eol(Text *text, short sel)
+void txt_move_eol(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -1043,7 +1043,7 @@ void txt_move_eol(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_bof(Text *text, short sel)
+void txt_move_bof(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -1059,7 +1059,7 @@ void txt_move_bof(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_eof(Text *text, short sel)
+void txt_move_eof(Text *text, const bool sel)
{
TextLine **linep;
int *charp;
@@ -1075,13 +1075,13 @@ void txt_move_eof(Text *text, short sel)
if (!sel) txt_pop_sel(text);
}
-void txt_move_toline(Text *text, unsigned int line, short sel)
+void txt_move_toline(Text *text, unsigned int line, const bool sel)
{
txt_move_to(text, line, 0, sel);
}
/* Moves to a certain byte in a line, not a certain utf8-character! */
-void txt_move_to(Text *text, unsigned int line, unsigned int ch, short sel)
+void txt_move_to(Text *text, unsigned int line, unsigned int ch, const bool sel)
{
TextLine **linep;
int *charp;
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 11a39752391..a26b579f5e5 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -29,12 +29,14 @@
#include <ctype.h>
#include <string.h>
#include <assert.h>
-#include "BKE_unit.h"
+#include "BLI_sys_types.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
+#include "BKE_unit.h" /* own include */
+
#ifdef WIN32
# include "BLI_winstuff.h"
#endif
@@ -421,7 +423,7 @@ static size_t unit_as_string(char *str, int len_max, double value, int prec, bUn
/* Used for drawing number buttons, try keep fast.
* Return the length of the generated string.
*/
-size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad)
+size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad)
{
bUnitCollection *usys = unit_get_system(system, type);