Re: [SeaBIOS] [Qemu-devel] [RFC PATCH v4 07/30] Add SIZE type to qdev properties

2013-03-20 Thread li guang
在 2013-03-20三的 08:24 -0600,Eric Blake写道: > On 03/20/2013 12:06 AM, li guang wrote: > > >> +return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffixes[i]); > > ^^ ^^^ > >> +} > >> + > > > > IMHO, you may need (double)(*ptr/div),

Re: [SeaBIOS] [Qemu-devel] [RFC PATCH v4 07/30] Add SIZE type to qdev properties

2013-03-20 Thread Eric Blake
On 03/20/2013 12:06 AM, li guang wrote: >> +return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffixes[i]); > ^^ ^^^ >> +} >> + > > IMHO, you may need (double)(*ptr/div), for type cast is right > associated. No, the code as wri

Re: [SeaBIOS] [Qemu-devel] [RFC PATCH v4 07/30] Add SIZE type to qdev properties

2013-03-20 Thread li guang
在 2012-12-18二的 13:41 +0100,Vasilis Liaskovitis写道: > This patch adds a 'SIZE' type property to qdev. > > It will make dimm description more convenient by allowing sizes to be > specified > with K,M,G,T prefixes instead of number of bytes e.g.: > -device dimm,id=mem0,size=2G,bus=membus.0 > > Credi