Cleanup: warnings

- remove NULL checks for args already set as ATTR_NONNULL.
- double promotion.
This commit is contained in:
Campbell Barton 2015-10-17 16:06:45 +11:00
parent 3d69ef240e
commit eb49a76dca
5 changed files with 12 additions and 27 deletions

View File

@ -176,9 +176,6 @@ int BLF_load(const char *name)
char *filename;
int i;
if (!name)
return -1;
/* check if we already load this font. */
i = blf_search(name);
if (i >= 0) {
@ -216,9 +213,6 @@ int BLF_load_unique(const char *name)
char *filename;
int i;
if (!name)
return -1;
/* Don't search in the cache!! make a new
* object font, this is for keep fonts threads safe.
*/
@ -260,9 +254,6 @@ int BLF_load_mem(const char *name, const unsigned char *mem, int mem_size)
FontBLF *font;
int i;
if (!name)
return -1;
i = blf_search(name);
if (i >= 0) {
/*font = global_font[i];*/ /*UNUSED*/
@ -275,7 +266,7 @@ int BLF_load_mem(const char *name, const unsigned char *mem, int mem_size)
return -1;
}
if (!mem || !mem_size) {
if (!mem_size) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}
@ -295,9 +286,6 @@ int BLF_load_mem_unique(const char *name, const unsigned char *mem, int mem_size
FontBLF *font;
int i;
if (!name)
return -1;
/*
* Don't search in the cache, make a new object font!
* this is to keep the font thread safe.
@ -308,7 +296,7 @@ int BLF_load_mem_unique(const char *name, const unsigned char *mem, int mem_size
return -1;
}
if (!mem || !mem_size) {
if (!mem_size) {
printf("Can't load font: %s from memory!!\n", name);
return -1;
}

View File

@ -960,7 +960,7 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits)
*/
bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits)
{
if (path && *path) {
if (*path) {
char *file = (char *)BLI_last_slash(path);
char *c;
int len, numdigits;
@ -1009,9 +1009,9 @@ bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits)
return false;
}
void BLI_path_frame_strip(char *path, bool setsharp, char *ext)
void BLI_path_frame_strip(char *path, bool set_frame_char, char *ext)
{
if (path && *path) {
if (*path) {
char *file = (char *)BLI_last_slash(path);
char *c, *suffix;
int len;
@ -1046,15 +1046,12 @@ void BLI_path_frame_strip(char *path, bool setsharp, char *ext)
if (numdigits) {
/* replace the number with the suffix and terminate the string */
while (numdigits--) {
if (ext) *ext++ = *suffix;
if (setsharp) *c++ = '#';
else *c++ = *suffix;
*ext++ = *suffix;
*c++ = set_frame_char ? '#' : *suffix;
suffix++;
}
*c = 0;
if (ext) *ext = 0;
*c = '\0';
*ext = '\0';
}
}
}

View File

@ -2093,7 +2093,7 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
BLI_assert(step > 0.0);
step_final = (step / scale_unit) / UI_PRECISION_FLOAT_SCALE;
step_final = (step / scale_unit) / (double)UI_PRECISION_FLOAT_SCALE;
if (step == step_unit) {
/* Logic here is to scale by the original 'step_orig'

View File

@ -2116,7 +2116,7 @@ static float snap_v2_angle(float r[2], const float v[2], const float v_ref[2], f
normalize_v2_v2(v_unit, v);
angle = angle_signed_v2v2(v_unit, v_ref);
angle_delta = (round(angle / angle_snap) * angle_snap) - angle;
angle_delta = (roundf(angle / angle_snap) * angle_snap) - angle;
rotate_m2(m2, angle_delta);
mul_v2_m2v2(r, m2, v);

View File

@ -1035,7 +1035,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
sub_v3_v3v3(dvec, newvec, vod->trackvec);
angle = (len_v3(dvec) / (2.0f * TRACKBALLSIZE)) * M_PI;
angle = (len_v3(dvec) / (2.0f * TRACKBALLSIZE)) * (float)M_PI;
/* Allow for rotation beyond the interval [-pi, pi] */
angle = angle_wrap_rad(angle);