diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-30 09:07:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-30 09:07:12 +0400 |
commit | 4052ef16674bd981c9139eff373482bf0ae6abad (patch) | |
tree | 10408031507ea0ce7a9c41e9077597e95791b82c /source/blender/editors | |
parent | 91881dce85424860bb97d7e6ccbffc492ac98bd3 (diff) |
quiet gcc's float/double warnings.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 48 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_scopes.c | 62 |
2 files changed, 55 insertions, 55 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 944b7229372..2f95e8fa64c 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -303,20 +303,20 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire /* set up co-ordinates/dimensions for either left or right handle */ if (direction == SEQ_LEFTHANDLE) { rx1 = x1; - rx2 = x1+handsize*0.75; + rx2 = x1+handsize * 0.75f; - v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); - v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); - v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0; + v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0f - y1)/2); + v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0f - y1)/2); + v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0f; whichsel = SEQ_LEFTSEL; } else if (direction == SEQ_RIGHTHANDLE) { - rx1 = x2-handsize*0.75; + rx1 = x2-handsize*0.75f; rx2 = x2; - v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); - v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); - v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0; + v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0f - y1)/2); + v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0f - y1)/2); + v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0f; whichsel = SEQ_RIGHTSEL; } @@ -351,11 +351,11 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire if (direction == SEQ_LEFTHANDLE) { sprintf(str, "%d", seq->startdisp); x1= rx1; - y1 -= 0.45; + y1 -= 0.45f; } else { sprintf(str, "%d", seq->enddisp - 1); - x1= x2 - handsize*0.75; - y1= y2 + 0.05; + x1= x2 - handsize*0.75f; + y1= y2 + 0.05f; } UI_view2d_text_cache_add(v2d, x1, y1, str, col); } @@ -441,7 +441,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) glColor3ubv((GLubyte *)col); - for(a=y1; a< y2; a+= pixely*2.0 ) { + for(a=y1; a< y2; a+= pixely * 2.0f) { fdrawline(x1, a, (float)(seq->start), a); } } @@ -459,7 +459,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq) glColor3ubv((GLubyte *)col); - for(a=y1; a< y2; a+= pixely*2.0 ) { + for(a=y1; a< y2; a+= pixely * 2.0f) { fdrawline((float)(seq->start+seq->len), a, x2, a); } } @@ -541,8 +541,8 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa glPolygonStipple(stipple_halftone); } - ymid1 = (y2-y1)*0.25 + y1; - ymid2 = (y2-y1)*0.65 + y1; + ymid1 = (y2-y1)*0.25f + y1; + ymid2 = (y2-y1)*0.65f + y1; glShadeModel(GL_SMOOTH); glBegin(GL_QUADS); @@ -719,8 +719,8 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { viewrectx *= scene->r.xasp / scene->r.yasp; - viewrectx /= proxy_size / 100.0; - viewrecty /= proxy_size / 100.0; + viewrectx /= proxy_size / 100.0f; + viewrecty /= proxy_size / 100.0f; } if(frame_ofs == 0) { @@ -835,10 +835,10 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 1.0, 0); glBegin(GL_LINE_LOOP); - glVertex2f(x1-0.5, y1-0.5); - glVertex2f(x1-0.5, y2+0.5); - glVertex2f(x2+0.5, y2+0.5); - glVertex2f(x2+0.5, y1-0.5); + glVertex2f(x1-0.5f, y1-0.5f); + glVertex2f(x1-0.5f, y2+0.5f); + glVertex2f(x2+0.5f, y2+0.5f); + glVertex2f(x2+0.5f, y1-0.5f); glEnd(); /* safety border */ @@ -968,7 +968,7 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar) else if (seq == last_seq) continue; else if (MIN2(seq->startdisp, seq->start) > v2d->cur.xmax) continue; else if (MAX2(seq->enddisp, seq->start+seq->len) < v2d->cur.xmin) continue; - else if (seq->machine+1.0 < v2d->cur.ymin) continue; + else if (seq->machine+1.0f < v2d->cur.ymin) continue; else if (seq->machine > v2d->cur.ymax) continue; /* strip passed all tests unscathed... so draw it now */ @@ -1022,9 +1022,9 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); if (ed && ed->metastack.first) - glClearColor(col[0], col[1], col[2]-0.1, 0.0); + glClearColor(col[0], col[1], col[2]-0.1f, 0.0f); else - glClearColor(col[0], col[1], col[2], 0.0); + glClearColor(col[0], col[1], col[2], 0.0f); glClear(GL_COLOR_BUFFER_BIT); UI_view2d_view_ortho(v2d); diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index d91d675042f..49ad1e2825c 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -42,16 +42,16 @@ static void rgb_to_yuv(float rgb[3], float yuv[3]) { - yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]; - yuv[1]= 0.492*(rgb[2] - yuv[0]); - yuv[2]= 0.877*(rgb[0] - yuv[0]); + yuv[0]= 0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2]; + yuv[1]= 0.492f*(rgb[2] - yuv[0]); + yuv[2]= 0.877f*(rgb[0] - yuv[0]); /* Normalize */ - yuv[1]*= 255.0/(122*2.0); - yuv[1]+= 0.5; + yuv[1]*= 255.0f/(122*2.0f); + yuv[1]+= 0.5f; - yuv[2]*= 255.0/(157*2.0); - yuv[2]+= 0.5; + yuv[2]*= 255.0f/(157*2.0f); + yuv[2]+= 0.5f; } static void scope_put_pixel(unsigned char* table, unsigned char * pos) @@ -132,7 +132,7 @@ static void wform_put_gridrow(unsigned char * tgt, float perc, int w, int h) { int i; - tgt += (int) (perc/100.0 * h) * w * 4; + tgt += (int) (perc/100.0f * h) * w * 4; for (i = 0; i < w*2; i++) { tgt[0] = 255; @@ -217,13 +217,13 @@ static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf) for (x = 0; x < ibuf->x; x++) { float * rgb = src + 4 * (ibuf->x * y + x); - float v = 1.0 * - ( 0.299*rgb[0] - + 0.587*rgb[1] - + 0.114*rgb[2]); + float v = 1.0f * + ( 0.299f*rgb[0] + + 0.587f*rgb[1] + + 0.114f*rgb[2]); unsigned char * p = tgt; - CLAMP(v, 0.0, 1.0); + CLAMP(v, 0.0f, 1.0f); p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1); @@ -333,7 +333,7 @@ static struct ImBuf *make_sep_waveform_view_from_ibuf_float( unsigned char * p = tgt; float v = rgb[c]; - CLAMP(v, 0.0, 1.0); + CLAMP(v, 0.0f, 1.0f); p += 4 * (w * ((int) (v * (h - 3)) + 1) + c * sw + x/3 + 1); @@ -367,7 +367,7 @@ struct ImBuf *make_sep_waveform_view_from_ibuf(struct ImBuf * ibuf) static void draw_zebra_byte(struct ImBuf * src,struct ImBuf * ibuf, float perc) { - unsigned int limit = 255 * perc / 100.0; + unsigned int limit = 255.0f * perc / 100.0f; unsigned char * p = (unsigned char*) src->rect; unsigned char * o = (unsigned char*) ibuf->rect; int x; @@ -398,7 +398,7 @@ static void draw_zebra_byte(struct ImBuf * src,struct ImBuf * ibuf, float perc) static void draw_zebra_float(struct ImBuf * src,struct ImBuf * ibuf,float perc) { - float limit = perc / 100.0; + float limit = perc / 100.0f; float * p = src->rect_float; unsigned char * o = (unsigned char*) ibuf->rect; int x; @@ -456,7 +456,7 @@ static void draw_histogram_marker(struct ImBuf * ibuf, int x) static void draw_histogram_bar(struct ImBuf * ibuf, int x,float val, int col) { unsigned char * p = (unsigned char*) ibuf->rect; - int barh = ibuf->y * val * 0.9; + int barh = ibuf->y * val * 0.9f; int i; p += 4 * (x + ibuf->x); @@ -513,13 +513,13 @@ static struct ImBuf *make_histogram_view_from_ibuf_byte( static int get_bin_float(float f) { - if (f < -0.25) { - f = -0.25; - } else if (f > 1.25) { - f = 1.25; + if (f < -0.25f) { + f = -0.25f; + } else if (f > 1.25f) { + f = 1.25f; } - return (int) (((f + 0.25) / 1.5) * 512); + return (int) (((f + 0.25f) / 1.5f) * 512); } static struct ImBuf *make_histogram_view_from_ibuf_float( @@ -582,9 +582,9 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g, int x = 0; int y = 0; - rgb[0]= (float)r/255.0; - rgb[1]= (float)g/255.0; - rgb[2]= (float)b/255.0; + rgb[0]= (float)r/255.0f; + rgb[1]= (float)g/255.0f; + rgb[2]= (float)b/255.0f; rgb_to_yuv(rgb, yuv); p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) @@ -633,9 +633,9 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) char * src1 = src + 4 * (ibuf->x * y + x); char * p; - rgb[0]= (float)src1[0]/255.0; - rgb[1]= (float)src1[1]/255.0; - rgb[2]= (float)src1[2]/255.0; + rgb[0]= (float)src1[0]/255.0f; + rgb[1]= (float)src1[1]/255.0f; + rgb[2]= (float)src1[2]/255.0f; rgb_to_yuv(rgb, yuv); p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) @@ -682,9 +682,9 @@ static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) memcpy(rgb, src1, 3 * sizeof(float)); - CLAMP(rgb[0], 0.0, 1.0); - CLAMP(rgb[1], 0.0, 1.0); - CLAMP(rgb[2], 0.0, 1.0); + CLAMP(rgb[0], 0.0f, 1.0f); + CLAMP(rgb[1], 0.0f, 1.0f); + CLAMP(rgb[2], 0.0f, 1.0f); rgb_to_yuv(rgb, yuv); |