diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-01-29 09:19:46 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-01-29 09:19:46 -0500 |
commit | 9a3b1d1078a5d435c7d2bb1a903c3e8356a3f7bf (patch) | |
tree | 7d369af9e522eef2d72546caefc5991c6ef121a4 /src | |
parent | 9023f62707c47cd0dc9bbd711099faee0d93e3a6 (diff) | |
parent | 5b8d84d2c2c10e74e9b4959871b4e4d04acdea18 (diff) | |
download | rneovim-9a3b1d1078a5d435c7d2bb1a903c3e8356a3f7bf.tar.gz rneovim-9a3b1d1078a5d435c7d2bb1a903c3e8356a3f7bf.tar.bz2 rneovim-9a3b1d1078a5d435c7d2bb1a903c3e8356a3f7bf.zip |
Merge pull request #1834 from Pyrohh/misc-float-double
Factor out float usage & remove '+float' references
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/hardcopy.c | 33 | ||||
-rw-r--r-- | src/nvim/testdir/test65.in | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test86.in | 20 | ||||
-rw-r--r-- | src/nvim/testdir/test87.in | 20 | ||||
-rw-r--r-- | src/nvim/version.c | 1 |
5 files changed, 26 insertions, 52 deletions
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 70ec3678c8..fb04f4407c 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -181,9 +181,9 @@ typedef struct { } prt_pos_T; struct prt_mediasize_S { - char *name; - float width; /* width and height in points for portrait */ - float height; + char *name; + double width; /* width and height in points for portrait */ + double height; }; /* PS font names, must be in Roman, Bold, Italic, Bold-Italic order */ @@ -1991,8 +1991,8 @@ static void prt_page_margins(double width, double height, double *left, double * static void prt_font_metrics(int font_scale) { - prt_line_height = (float)font_scale; - prt_char_width = (float)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx); + prt_line_height = (double)font_scale; + prt_char_width = (double)PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx); } @@ -2031,10 +2031,10 @@ static int prt_get_lpp(void) * font height (based on its bounding box) and the line height, handling the * case where the font height can exceed the line height. */ - prt_bgcol_offset = (float)PRT_PS_FONT_TO_USER(prt_line_height, + prt_bgcol_offset = (double)PRT_PS_FONT_TO_USER(prt_line_height, prt_ps_font->bbox_min_y); if ((prt_ps_font->bbox_max_y - prt_ps_font->bbox_min_y) < 1000.0) { - prt_bgcol_offset -= (float)PRT_PS_FONT_TO_USER(prt_line_height, + prt_bgcol_offset -= (double)PRT_PS_FONT_TO_USER(prt_line_height, (1000.0 - (prt_ps_font->bbox_max_y - prt_ps_font->bbox_min_y)) / 2); } @@ -2099,10 +2099,6 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) int paper_strlen; int fontsize; char_u *p; - double left; - double right; - double top; - double bottom; int props; int cmap = 0; char_u *p_encoding; @@ -2260,16 +2256,15 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) prt_page_height = prt_mediasize[i].width; } - /* - * Set PS page margins based on the PS pagesize, not the mediasize - this - * needs to be done before the cpl and lpp are calculated. - */ + // Set PS page margins based on the PS pagesize, not the mediasize - this + // needs to be done before the cpl and lpp are calculated. + double left, right, top, bottom; prt_page_margins(prt_page_width, prt_page_height, &left, &right, &top, &bottom); - prt_left_margin = (float)left; - prt_right_margin = (float)right; - prt_top_margin = (float)top; - prt_bottom_margin = (float)bottom; + prt_left_margin = left; + prt_right_margin = right; + prt_top_margin = top; + prt_bottom_margin = bottom; /* * Set up the font size. diff --git a/src/nvim/testdir/test65.in b/src/nvim/testdir/test65.in index ca53f27555..2fc5aacdcc 100644 --- a/src/nvim/testdir/test65.in +++ b/src/nvim/testdir/test65.in @@ -2,10 +2,6 @@ Test for floating point and logical operators. STARTTEST :so small.vim -:if !has("float") -: e! test.ok -: wq! test.out -:endif :" :$put =printf('%f', 123.456) :$put =printf('%e', 123.456) diff --git a/src/nvim/testdir/test86.in b/src/nvim/testdir/test86.in index 99102c4d89..958bd57e29 100644 --- a/src/nvim/testdir/test86.in +++ b/src/nvim/testdir/test86.in @@ -255,14 +255,10 @@ EOF :py f=l[0] :delfunction New :py ee('f(1, 2, 3)') -:if has('float') -: let l=[0.0] -: py l=vim.bindeval('l') -: py l.extend([0.0]) -: $put =string(l) -:else -: $put ='[0.0, 0.0]' -:endif +:let l=[0.0] +:py l=vim.bindeval('l') +:py l.extend([0.0]) +:$put =string(l) :let messages=[] :delfunction DictNew py <<EOF @@ -328,12 +324,8 @@ EOF :$put =string(l) :let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}') :$put =sort(items(d)) -:if has('float') -: let f=pyeval('0.0') -: $put =string(f) -:else -: $put ='0.0' -:endif +:let f=pyeval('0.0') +:$put =string(f) :" Invalid values: :for e in ['"\0"', '{"\0": 1}', 'undefined_name', 'vim'] : try diff --git a/src/nvim/testdir/test87.in b/src/nvim/testdir/test87.in index 0bb5119624..cad778e858 100644 --- a/src/nvim/testdir/test87.in +++ b/src/nvim/testdir/test87.in @@ -252,14 +252,10 @@ EOF :py3 f=l[0] :delfunction New :py3 ee('f(1, 2, 3)') -:if has('float') -: let l=[0.0] -: py3 l=vim.bindeval('l') -: py3 l.extend([0.0]) -: $put =string(l) -:else -: $put ='[0.0, 0.0]' -:endif +:let l=[0.0] +:py3 l=vim.bindeval('l') +:py3 l.extend([0.0]) +:$put =string(l) :let messages=[] :delfunction DictNew py3 <<EOF @@ -325,12 +321,8 @@ EOF :$put =string(l) :let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}') :$put =sort(items(d)) -:if has('float') -: let f=py3eval('0.0') -: $put =string(f) -:else -: $put ='0.0' -:endif +:let f=py3eval('0.0') +:$put =string(f) :" Invalid values: :for e in ['"\0"', '{"\0": 1}', 'undefined_name', 'vim'] : try diff --git a/src/nvim/version.c b/src/nvim/version.c index afafc0b1bc..6056a9d2a7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -68,7 +68,6 @@ static char *(features[]) = { "+farsi", "+file_in_path", "+find_in_path", - "+float", "+folding", "-footer", |