- union { ubyte c[4]; float f; } u;
- u.c[0]=(ubyte)(cr*255);
- u.c[1]=(ubyte)(cg*255);
- u.c[2]=(ubyte)(cb*255);
- u.c[3]=(ubyte)(ca*255);
- data.push_back(u.f);
+ union { unsigned char c[4]; float f; } u;
+ u.c[0] = static_cast<unsigned char>(cr*255);
+ u.c[1] = static_cast<unsigned char>(cg*255);
+ u.c[2] = static_cast<unsigned char>(cb*255);
+ u.c[3] = static_cast<unsigned char>(ca*255);
+ *ptr++ = u.f;