Merge pull request #3413 from Optimizer0/master
[Bug-Fix] Fixed Strict Aliasing Level 3 Warningspull/3446/head
commit
c7ab7ff457
|
@ -197,12 +197,15 @@ M3D_INDEX addMaterial(const Assimp::M3DWrapper &m3d, const aiMaterial *mat) {
|
||||||
break;
|
break;
|
||||||
case m3dpf_float:
|
case m3dpf_float:
|
||||||
if (mat->Get(aiProps[k].pKey, aiProps[k].type,
|
if (mat->Get(aiProps[k].pKey, aiProps[k].type,
|
||||||
aiProps[k].index, f) == AI_SUCCESS)
|
aiProps[k].index, f) == AI_SUCCESS) {
|
||||||
|
uint32_t f_uint32;
|
||||||
|
memcpy(&f_uint32, &f, sizeof(uint32_t));
|
||||||
addProp(&m3d->material[mi],
|
addProp(&m3d->material[mi],
|
||||||
m3d_propertytypes[k].id,
|
m3d_propertytypes[k].id,
|
||||||
/* not (uint32_t)f, because we don't want to convert
|
/* not (uint32_t)f, because we don't want to convert
|
||||||
* it, we want to see it as 32 bits of memory */
|
* it, we want to see it as 32 bits of memory */
|
||||||
*((uint32_t *)&f));
|
f_uint32);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case m3dpf_uint8:
|
case m3dpf_uint8:
|
||||||
if (mat->Get(aiProps[k].pKey, aiProps[k].type,
|
if (mat->Get(aiProps[k].pKey, aiProps[k].type,
|
||||||
|
|
|
@ -3590,7 +3590,7 @@ m3d_t *m3d_load(unsigned char *data, m3dread_t readfilecb, m3dfree_t freecb, m3d
|
||||||
case 4: f = (float)(*((float *)(data + 0))); break;
|
case 4: f = (float)(*((float *)(data + 0))); break;
|
||||||
case 8: f = (float)(*((double *)(data + 0))); break;
|
case 8: f = (float)(*((double *)(data + 0))); break;
|
||||||
}
|
}
|
||||||
h->cmd[i].arg[k] = *((uint32_t *)&f);
|
memcpy(&(h->cmd[i].arg[k]), &f, sizeof(uint32_t));
|
||||||
data += model->vc_s;
|
data += model->vc_s;
|
||||||
break;
|
break;
|
||||||
case m3dcp_hi_t: data = _m3d_getidx(data, model->hi_s, &h->cmd[i].arg[k]); break;
|
case m3dcp_hi_t: data = _m3d_getidx(data, model->hi_s, &h->cmd[i].arg[k]); break;
|
||||||
|
|
Loading…
Reference in New Issue