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>2019-01-04 03:05:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-04 03:06:44 +0300
commit53d655a0b317edf4d05fd163e3ad6f09ec0c2b3b (patch)
treef800a68113b86bd085046deeb09aaca3163a183e /source/blender/editors/interface
parent54a4c1cf359c369c8fc16ecf0ecaa92e6f650e2f (diff)
Cleanup: use typed unsigned ints
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c8
-rw-r--r--source/blender/editors/interface/interface_draw.c44
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/interface/interface_icons.c26
-rw-r--r--source/blender/editors/interface/interface_intern.h10
-rw-r--r--source/blender/editors/interface/interface_layout.c12
-rw-r--r--source/blender/editors/interface/interface_panel.c36
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c4
-rw-r--r--source/blender/editors/interface/interface_region_tooltip.c6
-rw-r--r--source/blender/editors/interface/interface_regions_intern.h2
-rw-r--r--source/blender/editors/interface/interface_style.c16
-rw-r--r--source/blender/editors/interface/interface_widgets.c88
-rw-r--r--source/blender/editors/interface/resources.c72
-rw-r--r--source/blender/editors/interface/view2d.c8
14 files changed, 168 insertions, 168 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d90135001c4..7d82e8d2377 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -843,8 +843,8 @@ static void ui_menu_block_set_keyaccels(uiBlock *block)
{
uiBut *but;
- unsigned int menu_key_mask = 0;
- unsigned char menu_key;
+ uint menu_key_mask = 0;
+ uchar menu_key;
const char *str_pt;
int pass;
int tot_missing = 0;
@@ -3837,7 +3837,7 @@ uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, in
* ((1 << findBitIndex(x)) == x);
* \endcode
*/
-static int findBitIndex(unsigned int x)
+static int findBitIndex(uint x)
{
if (!x || !is_power_of_2_i(x)) { /* is_power_of_2_i(x) strips lowest bit */
return -1;
@@ -4344,7 +4344,7 @@ PointerRNA *UI_but_operator_ptr_get(uiBut *but)
void UI_but_unit_type_set(uiBut *but, const int unit_type)
{
- but->unit_type = (unsigned char)(RNA_SUBTYPE_UNIT_VALUE(unit_type));
+ but->unit_type = (uchar)(RNA_SUBTYPE_UNIT_VALUE(unit_type));
}
int UI_but_unit_type_get(const uiBut *but)
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index ac3acf5ac53..777df75cbf9 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -84,7 +84,7 @@ int UI_draw_roundbox_corner_get(void)
}
#endif
-void UI_draw_roundbox_3ubAlpha(bool filled, float minx, float miny, float maxx, float maxy, float rad, const unsigned char col[3], unsigned char alpha)
+void UI_draw_roundbox_3ubAlpha(bool filled, float minx, float miny, float maxx, float maxy, float rad, const uchar col[3], uchar alpha)
{
float colv[4];
colv[0] = ((float)col[0]) / 255;
@@ -548,7 +548,7 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo
/* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */
/* based on UI_draw_roundbox_gl_mode, check on making a version which allows us to skip some sides */
-void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highlight[3], unsigned char highlight_fade[3])
+void ui_draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
{
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -732,7 +732,7 @@ static void draw_scope_end(const rctf *rect, GLint *scissor)
static void histogram_draw_one(
float r, float g, float b, float alpha,
float x, float y, float w, float h, const float *data, int res, const bool is_line,
- unsigned int pos_attrib)
+ uint pos_attrib)
{
float color[4] = {r, g, b, alpha};
@@ -1122,7 +1122,7 @@ static float polar_to_y(float center, float diam, float ampli, float angle)
return center + diam * ampli * sinf(angle);
}
-static void vectorscope_draw_target(unsigned int pos, float centerx, float centery, float diam, const float colf[3])
+static void vectorscope_draw_target(uint pos, float centerx, float centery, float diam, const float colf[3])
{
float y, u, v;
float tangle = 0.0f, tampli;
@@ -1280,7 +1280,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(ar), uiBut *but, const uiWidgetColo
GPU_blend(false);
}
-static void ui_draw_colorband_handle_tri_hlight(unsigned int pos, float x1, float y1, float halfwidth, float height)
+static void ui_draw_colorband_handle_tri_hlight(uint pos, float x1, float y1, float halfwidth, float height)
{
GPU_line_smooth(true);
@@ -1293,7 +1293,7 @@ static void ui_draw_colorband_handle_tri_hlight(unsigned int pos, float x1, floa
GPU_line_smooth(false);
}
-static void ui_draw_colorband_handle_tri(unsigned int pos, float x1, float y1, float halfwidth, float height, bool fill)
+static void ui_draw_colorband_handle_tri(uint pos, float x1, float y1, float halfwidth, float height, bool fill)
{
glEnable(fill ? GL_POLYGON_SMOOTH : GL_LINE_SMOOTH);
@@ -1306,7 +1306,7 @@ static void ui_draw_colorband_handle_tri(unsigned int pos, float x1, float y1, f
glDisable(fill ? GL_POLYGON_SMOOTH : GL_LINE_SMOOTH);
}
-static void ui_draw_colorband_handle_box(unsigned int pos, float x1, float y1, float x2, float y2, bool fill)
+static void ui_draw_colorband_handle_box(uint pos, float x1, float y1, float x2, float y2, bool fill)
{
immBegin(fill ? GPU_PRIM_TRI_FAN : GPU_PRIM_LINE_LOOP, 4);
immVertex2f(pos, x1, y1);
@@ -1536,7 +1536,7 @@ void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rec
/* backdrop */
UI_draw_roundbox_corner_set(UI_CNR_ALL);
- UI_draw_roundbox_3ubAlpha(true, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f, (unsigned char *)wcol->inner, 255);
+ UI_draw_roundbox_3ubAlpha(true, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f, (uchar *)wcol->inner, 255);
glCullFace(GL_BACK);
glEnable(GL_CULL_FACE);
@@ -1568,7 +1568,7 @@ void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rec
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor3ubv((unsigned char *)wcol->inner);
+ immUniformColor3ubv((uchar *)wcol->inner);
GPU_blend(true);
GPU_line_smooth(true);
@@ -1582,7 +1582,7 @@ void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rec
immUnbindProgram();
}
-static void ui_draw_but_curve_grid(unsigned int pos, const rcti *rect, float zoomx, float zoomy, float offsx, float offsy, float step)
+static void ui_draw_but_curve_grid(uint pos, const rcti *rect, float zoomx, float zoomy, float offsx, float offsy, float step)
{
float dx = step * zoomx;
float fx = rect->xmin + zoomx * (-offsx);
@@ -1611,7 +1611,7 @@ static void ui_draw_but_curve_grid(unsigned int pos, const rcti *rect, float zoo
}
-static void gl_shaded_color(unsigned char *col, int shade)
+static void gl_shaded_color(uchar *col, int shade)
{
immUniformColor3ub(
col[0] - shade > 0 ? col[0] - shade : 0,
@@ -1687,9 +1687,9 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
}
else {
if (cumap->flag & CUMA_DO_CLIP) {
- gl_shaded_color((unsigned char *)wcol->inner, -20);
+ gl_shaded_color((uchar *)wcol->inner, -20);
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
- immUniformColor3ubv((unsigned char *)wcol->inner);
+ immUniformColor3ubv((uchar *)wcol->inner);
immRectf(pos,
rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
rect->ymin + zoomy * (cumap->clipr.ymin - offsy),
@@ -1697,18 +1697,18 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
rect->ymin + zoomy * (cumap->clipr.ymax - offsy));
}
else {
- immUniformColor3ubv((unsigned char *)wcol->inner);
+ immUniformColor3ubv((uchar *)wcol->inner);
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
}
/* grid, every 0.25 step */
- gl_shaded_color((unsigned char *)wcol->inner, -16);
+ gl_shaded_color((uchar *)wcol->inner, -16);
ui_draw_but_curve_grid(pos, rect, zoomx, zoomy, offsx, offsy, 0.25f);
/* grid, every 1.0 step */
- gl_shaded_color((unsigned char *)wcol->inner, -24);
+ gl_shaded_color((uchar *)wcol->inner, -24);
ui_draw_but_curve_grid(pos, rect, zoomx, zoomy, offsx, offsy, 1.0f);
/* axes */
- gl_shaded_color((unsigned char *)wcol->inner, -50);
+ gl_shaded_color((uchar *)wcol->inner, -50);
immBegin(GPU_PRIM_LINES, 4);
immVertex2f(pos, rect->xmin, rect->ymin + zoomy * (-offsy));
immVertex2f(pos, rect->xmax, rect->ymin + zoomy * (-offsy));
@@ -1795,7 +1795,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
GPU_blend(true);
/* Curve filled. */
- immUniformColor3ubvAlpha((unsigned char *)wcol->item, 128);
+ immUniformColor3ubvAlpha((uchar *)wcol->item, 128);
GPU_polygon_smooth(true);
immBegin(GPU_PRIM_TRI_STRIP, (CM_TABLE * 2 + 2) + 4);
immVertex2f(pos, line_range.xmin, rect->ymin);
@@ -1813,7 +1813,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
/* Curve line. */
GPU_line_width(1.0f);
- immUniformColor3ubvAlpha((unsigned char *)wcol->item, 255);
+ immUniformColor3ubvAlpha((uchar *)wcol->item, 255);
GPU_line_smooth(true);
immBegin(GPU_PRIM_LINE_STRIP, (CM_TABLE + 1) + 2);
immVertex2f(pos, line_range.xmin, line_range.ymin);
@@ -1861,7 +1861,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor3ubv((unsigned char *)wcol->outline);
+ immUniformColor3ubv((uchar *)wcol->outline);
imm_draw_box_wire_2d(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
immUnbindProgram();
@@ -2076,7 +2076,7 @@ void ui_draw_but_NODESOCKET(ARegion *ar, uiBut *but, const uiWidgetColors *UNUSE
* would replace / modify the following 3 functions - merwin
*/
-static void ui_shadowbox(unsigned pos, unsigned color, float minx, float miny, float maxx, float maxy, float shadsize, unsigned char alpha)
+static void ui_shadowbox(unsigned pos, unsigned color, float minx, float miny, float maxx, float maxy, float shadsize, uchar alpha)
{
/**
* <pre>
@@ -2139,7 +2139,7 @@ static void ui_shadowbox(unsigned pos, unsigned color, float minx, float miny, f
immVertex2fv(pos, v3);
}
-void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy)
+void UI_draw_box_shadow(uchar alpha, float minx, float miny, float maxx, float maxy)
{
GPU_blend(true);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index c48ff91e17c..1d8e452ba45 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -288,7 +288,7 @@ typedef struct uiHandleButtonData {
ColorBand *coba;
/* tooltip */
- unsigned int tooltip_force : 1;
+ uint tooltip_force : 1;
/* auto open */
bool used_mouse;
@@ -2756,7 +2756,7 @@ static bool ui_textedit_insert_ascii(uiBut *but, uiHandleButtonData *data, char
if (ui_but_is_utf8(but) && (BLI_str_utf8_size(buf) == -1)) {
printf("%s: entering invalid ascii char into an ascii key (%d)\n",
- __func__, (int)(unsigned char)ascii);
+ __func__, (int)(uchar)ascii);
return false;
}
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index b9202f26a05..eb35f69b627 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -97,8 +97,8 @@
typedef struct IconImage {
int w;
int h;
- unsigned int *rect;
- unsigned char *datatoc_rect;
+ uint *rect;
+ uchar *datatoc_rect;
int datatoc_size;
} IconImage;
@@ -209,7 +209,7 @@ static DrawInfo *def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs,
if (bbuf) {
int y, imgsize;
- iimg->rect = MEM_mallocN(size * size * sizeof(unsigned int), "icon_rect");
+ iimg->rect = MEM_mallocN(size * size * sizeof(uint), "icon_rect");
/* Here we store the rect in the icon - same as before */
if (size == bbuf->x && size == bbuf->y && xofs == 0 && yofs == 0)
@@ -402,15 +402,15 @@ static void vicon_colorset_draw(int index, int x, int y, int w, int h, float UNU
/* XXX: Include alpha into this... */
/* normal */
- immUniformColor3ubv((unsigned char *)cs->solid);
+ immUniformColor3ubv((uchar *)cs->solid);
immRecti(pos, x, y, a, y + h);
/* selected */
- immUniformColor3ubv((unsigned char *)cs->select);
+ immUniformColor3ubv((uchar *)cs->select);
immRecti(pos, a, y, b, y + h);
/* active */
- immUniformColor3ubv((unsigned char *)cs->active);
+ immUniformColor3ubv((uchar *)cs->active);
immRecti(pos, b, y, c, y + h);
immUnbindProgram();
@@ -474,7 +474,7 @@ static void init_brush_icons(void)
#define INIT_BRUSH_ICON(icon_id, name) \
{ \
- unsigned char *rect = (unsigned char *)datatoc_ ##name## _png; \
+ uchar *rect = (uchar *)datatoc_ ##name## _png; \
int size = datatoc_ ##name## _png_size; \
DrawInfo *di; \
\
@@ -722,13 +722,13 @@ static void init_internal_icons(void)
}
#endif
if (b16buf == NULL)
- b16buf = IMB_ibImageFromMemory((unsigned char *)datatoc_blender_icons16_png,
+ b16buf = IMB_ibImageFromMemory((uchar *)datatoc_blender_icons16_png,
datatoc_blender_icons16_png_size, IB_rect, NULL, "<blender icons>");
if (b16buf)
IMB_premultiply_alpha(b16buf);
if (b32buf == NULL)
- b32buf = IMB_ibImageFromMemory((unsigned char *)datatoc_blender_icons32_png,
+ b32buf = IMB_ibImageFromMemory((uchar *)datatoc_blender_icons32_png,
datatoc_blender_icons32_png_size, IB_rect, NULL, "<blender icons>");
if (b32buf)
IMB_premultiply_alpha(b32buf);
@@ -1069,7 +1069,7 @@ int UI_preview_render_size(enum eIconSizes size)
*/
static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size)
{
- unsigned int render_size = UI_preview_render_size(size);
+ uint render_size = UI_preview_render_size(size);
if (!prv_img) {
if (G.debug & G_DEBUG)
@@ -1080,7 +1080,7 @@ static void icon_create_rect(struct PreviewImage *prv_img, enum eIconSizes size)
prv_img->h[size] = render_size;
prv_img->flag[size] |= PRV_CHANGED;
prv_img->changed_timestamp[size] = 0;
- prv_img->rect[size] = MEM_callocN(render_size * render_size * sizeof(unsigned int), "prv_rect");
+ prv_img->rect[size] = MEM_callocN(render_size * render_size * sizeof(uint), "prv_rect");
}
}
@@ -1262,7 +1262,7 @@ PreviewImage *UI_icon_to_preview(int icon_id)
}
static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh,
- unsigned int *rect, float alpha, const float rgb[3], const float desaturate)
+ uint *rect, float alpha, const float rgb[3], const float desaturate)
{
ImBuf *ima = NULL;
int draw_w = w;
@@ -1302,7 +1302,7 @@ static void icon_draw_rect(float x, float y, int w, int h, float UNUSED(aspect),
/* first allocate imbuf for scaling and copy preview into it */
ima = IMB_allocImBuf(rw, rh, 32, IB_rect);
- memcpy(ima->rect, rect, rw * rh * sizeof(unsigned int));
+ memcpy(ima->rect, rect, rw * rh * sizeof(uint));
IMB_scaleImBuf(ima, draw_w, draw_h); /* scale it */
rect = ima->rect;
}
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 98cda801c9d..b0136feaa30 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -233,7 +233,7 @@ struct uiBut {
*/
float a2;
- unsigned char col[4];
+ uchar col[4];
uiButHandleFunc func;
void *func_arg1;
@@ -271,7 +271,7 @@ struct uiBut {
char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */
signed char pie_dir; /* direction in a pie menu, used for collision detection (RadialDirection) */
bool changed; /* could be made into a single flag */
- unsigned char unit_type; /* so buttons can support unit systems which are not RNA */
+ uchar unit_type; /* so buttons can support unit systems which are not RNA */
short modifier_key;
short iconadd;
@@ -295,7 +295,7 @@ struct uiBut {
struct wmOperatorType *optype;
struct PointerRNA *opptr;
short opcontext;
- unsigned char menu_key; /* 'a'-'z', always lower case */
+ uchar menu_key; /* 'a'-'z', always lower case */
/* Draggable data, type is WM_DRAG_... */
char dragtype;
@@ -378,7 +378,7 @@ struct uiBlock {
rctf rect;
float aspect;
- unsigned int puphash; /* popup menu hash for memory */
+ uint puphash; /* popup menu hash for memory */
uiButHandleFunc func;
void *func_arg1;
@@ -679,7 +679,7 @@ extern void ui_draw_dropshadow(const rctf *rct, float radius, float aspect, floa
void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, const float alpha);
-void ui_draw_but_TAB_outline(const rcti *rect, float rad, unsigned char highlight[3], unsigned char highlight_fade[3]);
+void ui_draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3]);
void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, const struct uiWidgetColors *wcol, const rcti *rect);
void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, const struct uiWidgetColors *wcol, const rcti *rect);
void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, const struct uiWidgetColors *wcol, const rcti *rect);
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 221a88bbd1c..0c94705bb1f 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -446,7 +446,7 @@ static void ui_item_array(
PropertyType type;
PropertySubType subtype;
uiLayout *sub;
- unsigned int a, b;
+ uint a, b;
/* retrieve type and subtype */
type = RNA_property_type(prop);
@@ -465,9 +465,9 @@ static void ui_item_array(
/* special check for layer layout */
int butw, buth, unit;
int cols = (len >= 20) ? 2 : 1;
- const unsigned int colbuts = len / (2 * cols);
- unsigned int layer_used = 0;
- unsigned int layer_active = 0;
+ const uint colbuts = len / (2 * cols);
+ uint layer_used = 0;
+ uint layer_active = 0;
UI_block_layout_set_current(block, uiLayoutAbsolute(layout, false));
@@ -497,7 +497,7 @@ static void ui_item_array(
for (a = 0; a < colbuts; a++) {
const int layer_num = a + b * colbuts;
- const unsigned int layer_flag = (1u << layer_num);
+ const uint layer_flag = (1u << layer_num);
if (layer_used & layer_flag) {
if (layer_active & layer_flag)
@@ -515,7 +515,7 @@ static void ui_item_array(
}
for (a = 0; a < colbuts; a++) {
const int layer_num = a + len / 2 + b * colbuts;
- const unsigned int layer_flag = (1u << layer_num);
+ const uint layer_flag = (1u << layer_num);
if (layer_used & layer_flag) {
if (layer_active & layer_flag)
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 6c576e20ffb..610c0d33bc9 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -485,7 +485,7 @@ void UI_draw_icon_tri(float x, float y, char dir, const float color[4])
}
}
-static void ui_draw_anti_x(unsigned int pos, float x1, float y1, float x2, float y2)
+static void ui_draw_anti_x(uint pos, float x1, float y1, float x2, float y2)
{
/* set antialias line */
@@ -510,7 +510,7 @@ static void ui_draw_anti_x(unsigned int pos, float x1, float y1, float x2, float
}
/* x 'icon' for panel header */
-static void ui_draw_x_icon(unsigned int pos, float x, float y)
+static void ui_draw_x_icon(uint pos, float x, float y)
{
ui_draw_anti_x(pos, x, y, x + 9.375f, y + 9.375f);
@@ -519,7 +519,7 @@ static void ui_draw_x_icon(unsigned int pos, float x, float y)
#define PNL_ICON UI_UNIT_X /* could be UI_UNIT_Y too */
-static void ui_draw_panel_scalewidget(unsigned int pos, const rcti *rect)
+static void ui_draw_panel_scalewidget(uint pos, const rcti *rect)
{
float xmin, xmax, dx;
float ymin, ymax, dy;
@@ -561,8 +561,8 @@ static void ui_draw_panel_scalewidget(unsigned int pos, const rcti *rect)
}
static void immRectf_tris_color_ex(
- unsigned int pos, float x1, float y1, float x2, float y2,
- unsigned int col, const float color[3])
+ uint pos, float x1, float y1, float x2, float y2,
+ uint col, const float color[3])
{
immAttr4fv(col, color);
immVertex2f(pos, x1, y1);
@@ -579,7 +579,7 @@ static void immRectf_tris_color_ex(
immVertex2f(pos, x1, y2);
}
-static void ui_draw_panel_dragwidget(unsigned int pos, unsigned int col, const rctf *rect)
+static void ui_draw_panel_dragwidget(uint pos, uint col, const rctf *rect)
{
float col_high[4], col_dark[4];
const int col_tint = 84;
@@ -1742,8 +1742,8 @@ static void ui_panel_category_draw_tab(
bool filled, float minx, float miny, float maxx, float maxy, float rad,
const int roundboxtype,
const bool use_highlight, const bool use_shadow, const bool use_flip_x,
- const unsigned char highlight_fade[3],
- const unsigned char col[3])
+ const uchar highlight_fade[3],
+ const uchar col[3])
{
float vec[4][2] = {
{0.195, 0.02},
@@ -1893,20 +1893,20 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
int y_ofs = tab_v_pad;
/* Primary theme colors */
- unsigned char theme_col_back[4];
- unsigned char theme_col_text[3];
- unsigned char theme_col_text_hi[3];
+ uchar theme_col_back[4];
+ uchar theme_col_text[3];
+ uchar theme_col_text_hi[3];
/* Tab colors */
- unsigned char theme_col_tab_bg[4];
- unsigned char theme_col_tab_active[3];
- unsigned char theme_col_tab_inactive[3];
+ uchar theme_col_tab_bg[4];
+ uchar theme_col_tab_active[3];
+ uchar theme_col_tab_inactive[3];
/* Secondary theme colors */
- unsigned char theme_col_tab_outline[3];
- unsigned char theme_col_tab_divider[3]; /* line that divides tabs from the main region */
- unsigned char theme_col_tab_highlight[3];
- unsigned char theme_col_tab_highlight_inactive[3];
+ uchar theme_col_tab_outline[3];
+ uchar theme_col_tab_divider[3]; /* line that divides tabs from the main region */
+ uchar theme_col_tab_highlight[3];
+ uchar theme_col_tab_highlight_inactive[3];
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index 082459925e0..8830fc6feef 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -189,7 +189,7 @@ static void ui_update_color_picker_buts_rgb(
}
else if (STREQ(bt->str, "Hex: ")) {
float rgb_hex[3];
- unsigned char rgb_hex_uchar[3];
+ uchar rgb_hex_uchar[3];
double intpart;
char col[16];
@@ -544,7 +544,7 @@ static void ui_block_colorpicker(
/* Hex color is in sRGB space. */
float rgb_hex[3];
- unsigned char rgb_hex_uchar[3];
+ uchar rgb_hex_uchar[3];
copy_v3_v3(rgb_hex, rgba);
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c
index f5575b4c7c2..e42d2e0cbac 100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@ -170,7 +170,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
const uiWidgetColors *theme = ui_tooltip_get_theme();
rcti bbox = data->bbox;
float tip_colors[UI_TIP_LC_MAX][3];
- unsigned char drawcol[4] = {0, 0, 0, 255}; /* to store color in while drawing (alpha is always 255) */
+ uchar drawcol[4] = {0, 0, 0, 255}; /* to store color in while drawing (alpha is always 255) */
float *main_color = tip_colors[UI_TIP_LC_MAIN]; /* the color from the theme */
float *value_color = tip_colors[UI_TIP_LC_VALUE];
@@ -189,10 +189,10 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar)
ui_draw_tooltip_background(UI_style_get(), NULL, &bbox);
/* set background_color */
- rgb_uchar_to_float(background_color, (const unsigned char *)theme->inner);
+ rgb_uchar_to_float(background_color, (const uchar *)theme->inner);
/* calculate normal_color */
- rgb_uchar_to_float(main_color, (const unsigned char *)theme->text);
+ rgb_uchar_to_float(main_color, (const uchar *)theme->text);
copy_v3_v3(active_color, main_color);
copy_v3_v3(normal_color, main_color);
copy_v3_v3(python_color, main_color);
diff --git a/source/blender/editors/interface/interface_regions_intern.h b/source/blender/editors/interface/interface_regions_intern.h
index d23cf964c5e..7a0c4cd2111 100644
--- a/source/blender/editors/interface/interface_regions_intern.h
+++ b/source/blender/editors/interface/interface_regions_intern.h
@@ -30,7 +30,7 @@
#define MENU_PADDING (int)(0.2f * UI_UNIT_Y)
/* interface_region_menu_popup.c */
-unsigned int ui_popup_menu_hash(const char *str);
+uint ui_popup_menu_hash(const char *str);
/* interface_regions_intern.h */
ARegion *ui_region_temp_add(bScreen *sc);
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index d36786fed72..94bed87b40b 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -224,7 +224,7 @@ void UI_fontstyle_draw(
}
/* drawn same as above, but at 90 degree angle */
-void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const unsigned char col[4])
+void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
{
float height;
int xofs, yofs;
@@ -285,7 +285,7 @@ void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const ch
*
* For drawing on-screen labels.
*/
-void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const unsigned char col[4])
+void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
{
if (fs->kerning == 1)
BLF_enable(fs->uifont_id, BLF_KERNING_DEFAULT);
@@ -411,7 +411,7 @@ void uiStyleInit(void)
uiFont *font;
uiStyle *style = U.uistyles.first;
int monofont_size = datatoc_bmonofont_ttf_size;
- unsigned char *monofont_ttf = (unsigned char *)datatoc_bmonofont_ttf;
+ uchar *monofont_ttf = (uchar *)datatoc_bmonofont_ttf;
/* recover from uninitialized dpi */
if (U.dpi == 0)
@@ -454,7 +454,7 @@ void uiStyleInit(void)
if (font->uifont_id == UIFONT_DEFAULT) {
#ifdef WITH_INTERNATIONAL
int font_size = datatoc_bfont_ttf_size;
- unsigned char *font_ttf = (unsigned char *)datatoc_bfont_ttf;
+ uchar *font_ttf = (uchar *)datatoc_bfont_ttf;
static int last_font_size = 0;
/* use unicode font for translation */
@@ -464,7 +464,7 @@ void uiStyleInit(void)
if (!font_ttf) {
/* fall back if not found */
font_size = datatoc_bfont_ttf_size;
- font_ttf = (unsigned char *)datatoc_bfont_ttf;
+ font_ttf = (uchar *)datatoc_bfont_ttf;
}
}
@@ -476,13 +476,13 @@ void uiStyleInit(void)
font->blf_id = BLF_load_mem("default", font_ttf, font_size);
#else
- font->blf_id = BLF_load_mem("default", (unsigned char *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ font->blf_id = BLF_load_mem("default", (uchar *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
#endif
}
else {
font->blf_id = BLF_load(font->filename);
if (font->blf_id == -1) {
- font->blf_id = BLF_load_mem("default", (unsigned char *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
+ font->blf_id = BLF_load_mem("default", (uchar *)datatoc_bfont_ttf, datatoc_bfont_ttf_size);
}
}
@@ -515,7 +515,7 @@ void uiStyleInit(void)
if (!monofont_ttf) {
/* fall back if not found */
monofont_size = datatoc_bmonofont_ttf_size;
- monofont_ttf = (unsigned char *)datatoc_bmonofont_ttf;
+ monofont_ttf = (uchar *)datatoc_bmonofont_ttf;
}
}
#endif
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 7653e7e6017..fcb995d089c 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -104,12 +104,12 @@ enum {
/* it has outline, back, and two optional tria meshes */
typedef struct uiWidgetTrias {
- unsigned int tot;
+ uint tot;
int type;
float size, center[2];
float vec[16][2];
- const unsigned int (*index)[3];
+ const uint (*index)[3];
} uiWidgetTrias;
@@ -546,7 +546,7 @@ void ui_draw_anti_tria_rect(const rctf *rect, char dir, const float color[4])
}
-void UI_draw_anti_fan(float tri_array[][2], unsigned int length, const float color[4])
+void UI_draw_anti_fan(float tri_array[][2], uint length, const float color[4])
{
float draw_color[4];
@@ -855,7 +855,7 @@ static void shape_preset_init_trias_ex(
uiWidgetTrias *tria, const rcti *rect, float triasize, char where,
/* input data */
const float verts[][2], const int verts_tot,
- const unsigned int tris[][3], const int tris_tot)
+ const uint tris[][3], const int tris_tot)
{
float centx, centy, sizex, sizey, minsize;
int a, i1 = 0, i2 = 1;
@@ -932,10 +932,10 @@ static void shape_preset_init_scroll_circle(uiWidgetTrias *tria, const rcti *rec
g_shape_preset_scroll_circle_face, ARRAY_SIZE(g_shape_preset_scroll_circle_face));
}
-static void widget_draw_vertex_buffer(unsigned int pos, unsigned int col, int mode,
+static void widget_draw_vertex_buffer(uint pos, uint col, int mode,
const float quads_pos[WIDGET_SIZE_MAX][2],
- const unsigned char quads_col[WIDGET_SIZE_MAX][4],
- unsigned int totvert)
+ const uchar quads_col[WIDGET_SIZE_MAX][4],
+ uint totvert)
{
immBegin(mode, totvert);
for (int i = 0; i < totvert; ++i) {
@@ -1010,7 +1010,7 @@ static void shadecolors4(char coltop[4], char coldown[4], const char *color, sho
coldown[3] = color[3];
}
-static void round_box_shade_col4_r(unsigned char r_col[4], const char col1[4], const char col2[4], const float fac)
+static void round_box_shade_col4_r(uchar r_col[4], const char col1[4], const char col2[4], const float fac)
{
const int faci = unit_float_to_uchar_clamp(fac);
const int facm = 255 - faci;
@@ -1032,7 +1032,7 @@ static void widget_verts_to_triangle_strip(uiWidgetBase *wtb, const int totvert,
copy_v2_v2(triangle_strip[a * 2 + 1], wtb->inner_v[0]);
}
-static void widgetbase_outline(uiWidgetBase *wtb, unsigned int pos)
+static void widgetbase_outline(uiWidgetBase *wtb, uint pos)
{
float triangle_strip[WIDGET_SIZE_MAX * 2 + 2][2]; /* + 2 because the last pair is wrapped */
widget_verts_to_triangle_strip(wtb, wtb->totvert, triangle_strip);
@@ -1071,10 +1071,10 @@ static void widgetbase_set_uniform_discard_factor(
static void widgetbase_set_uniform_colors_ubv(
uiWidgetBase *wtb,
- const unsigned char *col1, const unsigned char *col2,
- const unsigned char *outline,
- const unsigned char *emboss,
- const unsigned char *tria,
+ const uchar *col1, const uchar *col2,
+ const uchar *outline,
+ const uchar *emboss,
+ const uchar *tria,
const bool alpha_check)
{
widgetbase_set_uniform_alpha_check(wtb, alpha_check);
@@ -1188,11 +1188,11 @@ static void widgetbase_draw_ex(
uiWidgetBase *wtb, const uiWidgetColors *wcol,
bool show_alpha_checkers)
{
- unsigned char inner_col1[4] = {0};
- unsigned char inner_col2[4] = {0};
- unsigned char emboss_col[4] = {0};
- unsigned char outline_col[4] = {0};
- unsigned char tria_col[4] = {0};
+ uchar inner_col1[4] = {0};
+ uchar inner_col2[4] = {0};
+ uchar emboss_col[4] = {0};
+ uchar outline_col[4] = {0};
+ uchar tria_col[4] = {0};
/* For color widget. */
if (wcol->shaded != 0) {
show_alpha_checkers = false;
@@ -1204,10 +1204,10 @@ static void widgetbase_draw_ex(
if (wtb->draw_inner) {
if (wcol->shaded == 0) {
/* simple fill */
- inner_col1[0] = inner_col2[0] = (unsigned char)wcol->inner[0];
- inner_col1[1] = inner_col2[1] = (unsigned char)wcol->inner[1];
- inner_col1[2] = inner_col2[2] = (unsigned char)wcol->inner[2];
- inner_col1[3] = inner_col2[3] = (unsigned char)wcol->inner[3];
+ inner_col1[0] = inner_col2[0] = (uchar)wcol->inner[0];
+ inner_col1[1] = inner_col2[1] = (uchar)wcol->inner[1];
+ inner_col1[2] = inner_col2[2] = (uchar)wcol->inner[2];
+ inner_col1[3] = inner_col2[3] = (uchar)wcol->inner[3];
}
else {
/* gradient fill */
@@ -1231,7 +1231,7 @@ static void widgetbase_draw_ex(
tria_col[0] = wcol->item[0];
tria_col[1] = wcol->item[1];
tria_col[2] = wcol->item[2];
- tria_col[3] = (unsigned char)((float)wcol->item[3] / WIDGET_AA_JITTER);
+ tria_col[3] = (uchar)((float)wcol->item[3] / WIDGET_AA_JITTER);
}
/* Draw everything in one drawcall */
@@ -1863,7 +1863,7 @@ static void widget_draw_text(const uiFontStyle *fstyle, const uiWidgetColors *wc
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor4ubv((unsigned char *)wcol->item);
+ immUniformColor4ubv((uchar *)wcol->item);
immRecti(pos, rect->xmin + selsta_draw,
rect->ymin + 2,
min_ii(rect->xmin + selwidth_draw, rect->xmax - 2),
@@ -2004,7 +2004,7 @@ static void widget_draw_text(const uiFontStyle *fstyle, const uiWidgetColors *wc
ul_advance = BLF_width(fstyle->uifont_id, fixedbuf, ul_index) + (1.0f * UI_DPI_FAC);
BLF_position(fstyle->uifont_id, rect->xmin + font_xofs + ul_advance, rect->ymin + font_yofs, 0.0f);
- BLF_color4ubv(fstyle->uifont_id, (unsigned char *)wcol->text);
+ BLF_color4ubv(fstyle->uifont_id, (uchar *)wcol->text);
BLF_draw(fstyle->uifont_id, "_", 2);
if (fstyle->kerning == 1) {
@@ -2668,7 +2668,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, const uiWidgetColors *wcol, const
GPU_blend(true);
GPU_line_smooth(true);
- immUniformColor3ubv((unsigned char *)wcol->outline);
+ immUniformColor3ubv((uchar *)wcol->outline);
imm_draw_circle_wire_2d(pos, centx, centy, radius, tot);
immUnbindProgram();
@@ -2977,7 +2977,7 @@ static void ui_draw_roundbox(const rcti *rect, const float rad, const uiWidgetCo
static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
{
int y = rect->ymin + BLI_rcti_size_y(rect) / 2 - 1;
- unsigned char col[4] = {
+ uchar col[4] = {
wcol->text[0],
wcol->text[1],
wcol->text[2],
@@ -3416,7 +3416,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
if (!ui_but_is_color_gamma(but))
ui_block_cm_to_display_space_v3(but->block, col);
- rgba_float_to_uchar((unsigned char *)wcol->inner, col);
+ rgba_float_to_uchar((uchar *)wcol->inner, col);
const bool show_alpha_checkers = (wcol->inner[3] < 255);
wcol->shaded = 0;
@@ -3662,9 +3662,9 @@ static void widget_state_label(uiWidgetType *wt, int state, int drawflag)
/* call this for option button */
widget_state(wt, state, drawflag);
if (state & UI_SELECT)
- UI_GetThemeColor3ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
+ UI_GetThemeColor3ubv(TH_TEXT_HI, (uchar *)wt->wcol.text);
else
- UI_GetThemeColor3ubv(TH_TEXT, (unsigned char *)wt->wcol.text);
+ UI_GetThemeColor3ubv(TH_TEXT, (uchar *)wt->wcol.text);
}
if (state & UI_BUT_REDALERT) {
@@ -3767,17 +3767,17 @@ static void widget_tab(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
//#define USE_TAB_SHADED_HIGHLIGHT
uiWidgetBase wtb;
- unsigned char theme_col_tab_highlight[3];
+ uchar theme_col_tab_highlight[3];
#ifdef USE_TAB_SHADED_HIGHLIGHT
/* create outline highlight colors */
if (is_active) {
- interp_v3_v3v3_uchar(theme_col_tab_highlight, (unsigned char *)wcol->inner_sel,
- (unsigned char *)wcol->outline, 0.2f);
+ interp_v3_v3v3_uchar(theme_col_tab_highlight, (uchar *)wcol->inner_sel,
+ (uchar *)wcol->outline, 0.2f);
}
else {
- interp_v3_v3v3_uchar(theme_col_tab_highlight, (unsigned char *)wcol->inner,
- (unsigned char *)wcol->outline, 0.12f);
+ interp_v3_v3v3_uchar(theme_col_tab_highlight, (uchar *)wcol->inner,
+ (uchar *)wcol->outline, 0.12f);
}
#endif
@@ -3799,7 +3799,7 @@ static void widget_tab(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
#ifdef USE_TAB_SHADED_HIGHLIGHT
/* draw outline (3d look) */
- ui_draw_but_TAB_outline(rect, rad, theme_col_tab_highlight, (unsigned char *)wcol->inner);
+ ui_draw_but_TAB_outline(rect, rad, theme_col_tab_highlight, (uchar *)wcol->inner);
#endif
#ifndef USE_TAB_SHADED_HIGHLIGHT
@@ -3813,7 +3813,7 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *
uiWidgetColors *wcol = &btheme->tui.wcol_radio;
uiWidgetBase wtb;
const float rad = wcol->roundness * U.widget_unit;
- unsigned char col[4];
+ uchar col[4];
/* state copy! */
wt->wcol = *(wt->wcol_theme);
@@ -4401,7 +4401,7 @@ static void ui_draw_clip_tri(uiBlock *block, rcti *rect, uiWidgetType *wt)
{
if (block) {
float draw_color[4];
- unsigned char *color = (unsigned char *)wt->wcol.text;
+ uchar *color = (uchar *)wt->wcol.text;
draw_color[0] = ((float)color[0]) / 255.0f;
draw_color[1] = ((float)color[1]) / 255.0f;
@@ -4465,7 +4465,7 @@ static void ui_draw_popover_back_impl(
if (ELEM(direction, UI_DIR_UP, UI_DIR_DOWN)) {
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor4ubv((unsigned char *)wcol->inner);
+ immUniformColor4ubv((uchar *)wcol->inner);
GPU_blend(true);
immBegin(GPU_PRIM_TRIS, 3);
if (direction == UI_DIR_DOWN) {
@@ -4516,8 +4516,8 @@ static void draw_disk_shaded(
float s, c;
float y1, y2;
float fac;
- unsigned char r_col[4];
- unsigned int pos, col;
+ uchar r_col[4];
+ uint pos, col;
GPUVertFormat *format = immVertexFormat();
pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -4527,7 +4527,7 @@ static void draw_disk_shaded(
}
else {
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor4ubv((unsigned char *)col1);
+ immUniformColor4ubv((uchar *)col1);
}
immBegin(GPU_PRIM_TRI_STRIP, subd * 2);
@@ -4602,7 +4602,7 @@ void ui_draw_pie_center(uiBlock *block)
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor4ubv((unsigned char *)btheme->tui.wcol_pie_menu.outline);
+ immUniformColor4ubv((uchar *)btheme->tui.wcol_pie_menu.outline);
imm_draw_circle_wire_2d(pos, 0.0f, 0.0f, pie_radius_internal, subd);
imm_draw_circle_wire_2d(pos, 0.0f, 0.0f, pie_radius_external, subd);
@@ -4651,7 +4651,7 @@ void ui_draw_widget_back_color(
rcti rect_copy = *rect;
wt->state(wt, 0, 0);
if (color) {
- rgba_float_to_uchar((unsigned char *)wt->wcol.inner, color);
+ rgba_float_to_uchar((uchar *)wt->wcol.inner, color);
}
wt->draw(&wt->wcol, &rect_copy, 0, UI_CNR_ALL);
}
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index e79c5266a8e..fc761cedb8e 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -89,7 +89,7 @@ void ui_resources_free(void)
/* THEMES */
/* ******************************************************** */
-const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
+const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
{
ThemeSpace *ts = NULL;
static char error[4] = {240, 0, 240, 255};
@@ -743,7 +743,7 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
}
}
- return (const unsigned char *)cp;
+ return (const uchar *)cp;
}
/**
@@ -815,10 +815,10 @@ void UI_Theme_Restore(struct bThemeState *theme_state)
g_theme_state = *theme_state;
}
-void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset, unsigned char col[4])
+void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset, uchar col[4])
{
int r, g, b, a;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
r = coloffset + (int) cp[0];
@@ -836,9 +836,9 @@ void UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset,
col[3] = a;
}
-void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned char col[3])
+void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, uchar col[3])
{
- const unsigned char *cp1, *cp2;
+ const uchar *cp1, *cp2;
cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
@@ -851,7 +851,7 @@ void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned c
void UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[3])
{
- const unsigned char *cp1, *cp2;
+ const uchar *cp1, *cp2;
cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
@@ -864,7 +864,7 @@ void UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[
void UI_FontThemeColor(int fontid, int colorid)
{
- unsigned char color[4];
+ uchar color[4];
UI_GetThemeColor4ubv(colorid, color);
BLF_color4ubv(fontid, color);
}
@@ -872,7 +872,7 @@ void UI_FontThemeColor(int fontid, int colorid)
/* get individual values, not scaled */
float UI_GetThemeValuef(int colorid)
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((float)cp[0]);
@@ -881,7 +881,7 @@ float UI_GetThemeValuef(int colorid)
/* get individual values, not scaled */
int UI_GetThemeValue(int colorid)
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
return ((int) cp[0]);
@@ -890,7 +890,7 @@ int UI_GetThemeValue(int colorid)
/* versions of the function above, which take a space-type */
float UI_GetThemeValueTypef(int colorid, int spacetype)
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
return ((float)cp[0]);
@@ -898,7 +898,7 @@ float UI_GetThemeValueTypef(int colorid, int spacetype)
int UI_GetThemeValueType(int colorid, int spacetype)
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
return ((int)cp[0]);
@@ -908,7 +908,7 @@ int UI_GetThemeValueType(int colorid, int spacetype)
/* get the color, range 0.0-1.0 */
void UI_GetThemeColor3fv(int colorid, float col[3])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
@@ -918,7 +918,7 @@ void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
@@ -931,7 +931,7 @@ void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
{
int r, g, b;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
@@ -947,10 +947,10 @@ void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
col[2] = ((float)b) / 255.0f;
}
-void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3])
+void UI_GetThemeColorShade3ubv(int colorid, int offset, uchar col[3])
{
int r, g, b;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
@@ -966,9 +966,9 @@ void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3])
col[2] = b;
}
-void UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int offset, unsigned char col[3])
+void UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int offset, uchar col[3])
{
- const unsigned char *cp1, *cp2;
+ const uchar *cp1, *cp2;
cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
@@ -983,10 +983,10 @@ void UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int o
unit_float_to_uchar_clamp_v3(col, blend);
}
-void UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4])
+void UI_GetThemeColorShade4ubv(int colorid, int offset, uchar col[4])
{
int r, g, b;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
r = offset + (int) cp[0];
@@ -1005,7 +1005,7 @@ void UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4])
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
{
int r, g, b, a;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
@@ -1027,7 +1027,7 @@ void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset,
void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int offset, float col[3])
{
int r, g, b;
- const unsigned char *cp1, *cp2;
+ const uchar *cp1, *cp2;
cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
@@ -1049,7 +1049,7 @@ void UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int of
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
{
int r, g, b, a;
- const unsigned char *cp1, *cp2;
+ const uchar *cp1, *cp2;
cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
@@ -1072,9 +1072,9 @@ void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int of
}
/* get the color, in char pointer */
-void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
+void UI_GetThemeColor3ubv(int colorid, uchar col[3])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0] = cp[0];
@@ -1086,7 +1086,7 @@ void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
{
int r, g, b, a;
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
@@ -1107,9 +1107,9 @@ void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
}
/* get the color, in char pointer */
-void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
+void UI_GetThemeColor4ubv(int colorid, uchar col[4])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0] = cp[0];
@@ -1120,7 +1120,7 @@ void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
void UI_GetThemeColorType3ubv(int colorid, int spacetype, uchar col[3])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
col[0] = cp[0];
@@ -1130,7 +1130,7 @@ void UI_GetThemeColorType3ubv(int colorid, int spacetype, uchar col[3])
void UI_GetThemeColorType4ubv(int colorid, int spacetype, uchar col[4])
{
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
col[0] = cp[0];
@@ -1154,7 +1154,7 @@ bool UI_GetIconThemeColor4fv(int colorid, float col[4])
return false;
}
- const unsigned char *cp;
+ const uchar *cp;
cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
col[0] = ((float)cp[0]) / 255.0f;
col[1] = ((float)cp[1]) / 255.0f;
@@ -1164,7 +1164,7 @@ bool UI_GetIconThemeColor4fv(int colorid, float col[4])
return true;
}
-void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset)
+void UI_GetColorPtrShade3ubv(const uchar cp[3], uchar col[3], int offset)
{
int r, g, b;
@@ -1183,7 +1183,7 @@ void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], in
/* get a 3 byte color, blended and shaded between two other char color pointers */
void UI_GetColorPtrBlendShade3ubv(
- const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3],
+ const uchar cp1[3], const uchar cp2[3], uchar col[3],
float fac, int offset)
{
int r, g, b;
@@ -1224,9 +1224,9 @@ int UI_ThemeMenuShadowWidth(void)
return (int)(btheme->tui.menu_shadow_width * UI_DPI_FAC);
}
-void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis)
+void UI_make_axis_color(const uchar src_col[3], uchar dst_col[3], const char axis)
{
- unsigned char col[3];
+ uchar col[3];
switch (axis) {
case 'X':
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 80f4bb57baa..35124a78b0a 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1320,7 +1320,7 @@ void UI_view2d_grid_draw(View2D *v2d, View2DGrid *grid, int flag)
int a, step;
int vertical_minor_step = (BLI_rcti_size_x(&v2d->mask) + 1) / (U.v2d_min_gridsize * UI_DPI_FAC),
horizontal_major_step = (BLI_rcti_size_y(&v2d->mask) + 1) / (U.v2d_min_gridsize * UI_DPI_FAC);
- unsigned char grid_line_color[3];
+ uchar grid_line_color[3];
/* check for grid first, as it may not exist */
if (grid == NULL)
@@ -1537,7 +1537,7 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
int offset = -10;
float lstep = step;
- unsigned char grid_line_color[3];
+ uchar grid_line_color[3];
/* Make an estimate of at least how many vertices will be needed */
unsigned vertex_count = 4;
@@ -1832,7 +1832,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
rcti vert, hor;
const int scroll = view2d_scroll_mapped(v2d->scroll);
const char emboss_alpha = btheme->tui.widget_emboss[3];
- unsigned char scrollers_back_color[4];
+ uchar scrollers_back_color[4];
/* Color for scrollbar backs */
UI_GetThemeColor4ubv(TH_BACK, scrollers_back_color);
@@ -2472,7 +2472,7 @@ char UI_view2d_mouse_in_scrollers(
typedef struct View2DString {
struct View2DString *next;
union {
- unsigned char ub[4];
+ uchar ub[4];
int pack;
} col;
rcti rect;