On 01-Mar-2016 9:13 AM, Bram Moolenaar (Vim Github Repository) wrote:
Nick Owens wrote:
> my vim port has no FEAT_FLOAT currently, so these helped fix my build.
>
> the moved define in json.c fixes gcc -Werror -Wunused-variable.
> You can view, comment on, or merge this pull request online at:
>
> https://github.com/vim/vim/pull/667
>
> -- Commit Summary --
>
> * json: fix unused variable sp when no FEAT_FLOAT
> * eval: f_reltimefloat is only defined if FEAT_FLOAT is
Thanks, I'll include it.
Here are a couple more warnings with FEAT_FLOAT disabled (both Windows
and HP-UX builds):
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DFEAT_GUI_W32 -DFEAT_CLIPBOAR
D -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return
-s ex_docmd.c -o gobjnative/ex_docmd.o
eval.c: In function 'tv_op':
eval.c:3090:2: warning: enumeration value 'VAR_FLOAT' not handled in
switch [-Wswitch]
switch (tv1->v_type)
^
eval.c: In function 'tv2string':
eval.c:8006:5: warning: enumeration value 'VAR_FLOAT' not handled in
switch [-Wswitch]
switch (tv->v_type)
^
The attached patch fixes it.
Cheers
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
--- eval_old.c 2016-03-02 05:10:29.845000000 +1100
+++ eval.c 2016-03-02 09:09:38.732529700 +1100
@@ -3152,8 +3152,8 @@
}
return OK;
-#ifdef FEAT_FLOAT
case VAR_FLOAT:
+#ifdef FEAT_FLOAT
{
float_T f;
@@ -3170,8 +3170,8 @@
else
tv1->vval.v_float -= f;
}
- return OK;
#endif
+ return OK;
}
}
@@ -8011,8 +8011,8 @@
case VAR_STRING:
*tofree = string_quote(tv->vval.v_string, FALSE);
return *tofree;
-#ifdef FEAT_FLOAT
case VAR_FLOAT:
+#ifdef FEAT_FLOAT
*tofree = NULL;
vim_snprintf((char *)numbuf, NUMBUFLEN - 1, "%g", tv->vval.v_float);
return numbuf;