Re: [PATCH 3/5] Fix some "unknown format" warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/21/2013 12:17 PM, Ramsay Jones wrote:

> +#if !defined(__MINGW32__)
>  			buf += sprintf(buf, "%Lf", expr->fvalue);
> +#else
> +			buf += sprintf(buf, "%f", (double)expr->fvalue);
> +#endif

I don't like to stash !define(__MINW32__) all over the sparse
code. Let's move this to the compat abstract layer. Can you create a
function "char *print_float(float value)" function in compat-mingw.c and
the normal implementation in compat/*.c


> +#if !defined(__MINGW32__)
>  		strftime(buffer, 12, "%b %e %Y", localtime(&t));
> +#else
> +		strftime(buffer, 12, "%b %d %Y", localtime(&t));
> +		if (buffer[4] == '0') buffer[4] = ' ';
> +#endif

Same here, try to move to the compat layer.

> +#if !defined(__MINGW32__)
>  	printf("\tmovf.%d\t\tv%d,$%Lf\n", expr->ctype->bit_size, new, value);
> +#else
> +	printf("\tmovf.%d\t\tv%d,$%f\n", expr->ctype->bit_size, new, (double)value);
> +#endif

Here we can reuse the previous print_float() function.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux