forked from bartvdbraak/blender
style cleanup
This commit is contained in:
parent
e6cdee370e
commit
153b63e0fd
@ -93,14 +93,14 @@ void BLF_free_unifont(void)
|
||||
unsigned char *BLF_get_unifont_mono(int *unifont_size_r)
|
||||
{
|
||||
#ifdef WITH_INTERNATIONAL
|
||||
if(unifont_mono_ttf == NULL) {
|
||||
if (unifont_mono_ttf == NULL) {
|
||||
const char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
|
||||
if (fontpath) {
|
||||
char unifont_path[1024];
|
||||
|
||||
BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_mono_filename);
|
||||
|
||||
unifont_mono_ttf = (unsigned char*)BLI_file_ungzip_to_mem(unifont_path, &unifont_mono_size);
|
||||
unifont_mono_ttf = (unsigned char *)BLI_file_ungzip_to_mem(unifont_path, &unifont_mono_size);
|
||||
}
|
||||
else {
|
||||
printf("%s: 'fonts' data path not found for international monospace font, continuing\n", __func__);
|
||||
@ -119,7 +119,7 @@ unsigned char *BLF_get_unifont_mono(int *unifont_size_r)
|
||||
void BLF_free_unifont_mono(void)
|
||||
{
|
||||
#ifdef WITH_INTERNATIONAL
|
||||
if(unifont_mono_ttf)
|
||||
if (unifont_mono_ttf)
|
||||
MEM_freeN(unifont_mono_ttf);
|
||||
#else
|
||||
#endif
|
||||
|
@ -668,9 +668,9 @@ static AVStream *alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
|
||||
const int *p = codec->supported_samplerates;
|
||||
int best = 0;
|
||||
int best_dist = INT_MAX;
|
||||
for (; *p; p++){
|
||||
for (; *p; p++) {
|
||||
int dist = abs(st->codec->sample_rate - *p);
|
||||
if (dist < best_dist){
|
||||
if (dist < best_dist) {
|
||||
best_dist = dist;
|
||||
best = *p;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ void uiStyleInit(void)
|
||||
uiFont *font = U.uifonts.first;
|
||||
uiStyle *style = U.uistyles.first;
|
||||
int monofont_size = datatoc_bmonofont_ttf_size;
|
||||
unsigned char *monofont_ttf = (unsigned char*)datatoc_bmonofont_ttf;
|
||||
unsigned char *monofont_ttf = (unsigned char *)datatoc_bmonofont_ttf;
|
||||
|
||||
/* recover from uninitialized dpi */
|
||||
if (U.dpi == 0)
|
||||
@ -410,7 +410,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 = (unsigned char *)datatoc_bmonofont_ttf;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ BLI_INLINE void console_step_sel(ConsoleDrawContext *cdc, const int step)
|
||||
}
|
||||
|
||||
static void console_draw_sel(const char *str, const int sel[2], const int xy[2], const int str_len_draw,
|
||||
int cwidth, int lheight, const unsigned char bg_sel[4])
|
||||
int cwidth, int lheight, const unsigned char bg_sel[4])
|
||||
{
|
||||
if (sel[0] <= str_len_draw && sel[1] >= 0) {
|
||||
const int sta = txt_utf8_offset_to_column(str, max_ii(sel[0], 0));
|
||||
@ -99,7 +99,7 @@ static int console_wrap_offsets(const char *str, int len, int width, int *lines,
|
||||
*lines = 1;
|
||||
|
||||
*offsets = MEM_callocN(sizeof(**offsets) * (len * BLI_UTF8_WIDTH_MAX / MAX2(1, width - (BLI_UTF8_WIDTH_MAX - 1)) + 1),
|
||||
"console_wrap_offsets");
|
||||
"console_wrap_offsets");
|
||||
(*offsets)[0] = 0;
|
||||
|
||||
for (i = 0, end = width, j = 0; j < len && str[j]; j += BLI_str_utf8_size_safe(str + j)) {
|
||||
@ -145,7 +145,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
|
||||
|
||||
/* last part */
|
||||
ofs += txt_utf8_column_to_offset(str + ofs,
|
||||
(int)floor((float)cdc->mval[0] / cdc->cwidth));
|
||||
(int)floor((float)cdc->mval[0] / cdc->cwidth));
|
||||
|
||||
CLAMP(ofs, 0, str_len);
|
||||
*cdc->pos_pick += str_len - ofs;
|
||||
|
@ -310,7 +310,7 @@ static void restrictbutton_ebone_visibility_cb(bContext *C, void *UNUSED(poin),
|
||||
{
|
||||
EditBone *ebone = (EditBone *)poin2;
|
||||
if (ebone->flag & BONE_HIDDEN_A) {
|
||||
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL);
|
||||
}
|
||||
|
||||
if (CTX_wm_window(C)->eventstate->ctrl) {
|
||||
@ -359,7 +359,7 @@ static int group_select_flag(Group *gr)
|
||||
}
|
||||
|
||||
void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag)
|
||||
{
|
||||
{
|
||||
Scene *scene = (Scene *)poin;
|
||||
GroupObject *gob;
|
||||
Group *gr = (Group *)poin2;
|
||||
|
@ -823,8 +823,8 @@ static int do_outliner_item_activate(bContext *C, Scene *scene, ARegion *ar, Spa
|
||||
/* always makes active object */
|
||||
if (tselem->type != TSE_SEQUENCE && tselem->type != TSE_SEQ_STRIP && tselem->type != TSE_SEQUENCE_DUP)
|
||||
tree_element_set_active_object(C, scene, soops, te,
|
||||
1 + (extend != 0 && tselem->type == 0),
|
||||
recursive && tselem->type == 0 );
|
||||
1 + (extend != 0 && tselem->type == 0),
|
||||
recursive && tselem->type == 0 );
|
||||
|
||||
if (tselem->type == 0) { // the lib blocks
|
||||
/* editmode? */
|
||||
|
@ -7452,4 +7452,4 @@ bool checkUseLocalCenter_GraphEdit(TransInfo *t)
|
||||
return ((t->around == V3D_LOCAL) && !ELEM3(t->mode, TFM_TRANSLATION, TFM_TIME_TRANSLATE, TFM_TIME_SLIDE));
|
||||
}
|
||||
|
||||
#undef MAX_INFO_LEN
|
||||
#undef MAX_INFO_LEN
|
||||
|
Loading…
Reference in New Issue
Block a user