PATCH: library/port.c cleanup
Gerald Pfeifer
pfeifer at dbai.tuwien.ac.at
Thu Sep 27 01:41:42 CDT 2001
port.c alone is (or at least was) responsible for 50+ percent of all
warnings I have been getting during recent weeks. This fixes the worst
offenders.
All of these are portability bugs -- especially the required cast from
size_t to int in the last part.
Gerald
ChangeLog:
Fix implicit type declarations. Add required cast.
Index: port.c
===================================================================
RCS file: /home/wine/wine/library/port.c,v
retrieving revision 1.15
diff -u -3 -p -r1.15 port.c
--- port.c 2001/09/07 18:46:14 1.15
+++ port.c 2001/09/27 05:24:31
@@ -653,7 +653,7 @@ unsigned short* wine_rewrite_s4tos2(cons
*/
char *ecvt (double number, int ndigits, int *decpt, int *sign)
{
- static buf[40]; /* ought to be enough */
+ static char buf[40]; /* ought to be enough */
char *dec;
sprintf(buf, "%.*e", ndigits /* FIXME wrong */, number);
*sign = (number < 0);
@@ -667,7 +667,7 @@ char *ecvt (double number, int ndigits,
*/
char *fcvt (double number, int ndigits, int *decpt, int *sign)
{
- static buf[40]; /* ought to be enough */
+ static char buf[40]; /* ought to be enough */
char *dec;
sprintf(buf, "%.*e", ndigits, number);
*sign = (number < 0);
@@ -683,7 +683,7 @@ char *fcvt (double number, int ndigits,
*/
char *gcvt (double number, size_t ndigit, char *buff)
{
- sprintf(buff, "%.*E", ndigit, number);
+ sprintf(buff, "%.*E", (int)ndigit, number);
return buff;
}
#endif /* HAVE_ECVT */
More information about the wine-patches
mailing list