[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-patches
Subject: PATCH: library/port.c cleanup
From: Gerald Pfeifer <pfeifer () dbai ! tuwien ! ac ! at>
Date: 2001-09-27 6:41:42
[Download RAW message or body]
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 */
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic