Fix some aliasing warnings

This commit is contained in:
rdb 2015-08-08 20:52:47 +02:00
parent 74190f9e50
commit bff070430e
5 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ int main(int argc, char *mb_argv[]) {
size_t len = mbstowcs(NULL, mb_argv[i], 0); size_t len = mbstowcs(NULL, mb_argv[i], 0);
argv[i] = new wchar_t[len + 1]; argv[i] = new wchar_t[len + 1];
mbstowcs(argv[i], mb_argv[i], len); mbstowcs(argv[i], mb_argv[i], len);
argv[i][len] = NULL; argv[i][len] = 0;
} }
// Just for good measure // Just for good measure
argv[argc] = NULL; argv[argc] = NULL;

View File

@ -1398,9 +1398,9 @@ modify_ends() {
// you do, be sure you know what you are doing! // you do, be sure you know what you are doing!
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void GeomPrimitive:: void GeomPrimitive::
set_ends(CPTA_int ends) { set_ends(PTA_int ends) {
CDWriter cdata(_cycler, true); CDWriter cdata(_cycler, true);
cdata->_ends = (PTA_int &)ends; cdata->_ends = ends;
cdata->_modified = Geom::get_next_modified(); cdata->_modified = Geom::get_next_modified();
cdata->_got_minmax = false; cdata->_got_minmax = false;

View File

@ -169,7 +169,7 @@ PUBLISHED:
INLINE CPTA_int get_ends() const; INLINE CPTA_int get_ends() const;
PTA_int modify_ends(); PTA_int modify_ends();
void set_ends(CPTA_int ends); void set_ends(PTA_int ends);
INLINE CPT(GeomVertexArrayData) get_mins() const; INLINE CPT(GeomVertexArrayData) get_mins() const;
INLINE CPT(GeomVertexArrayData) get_maxs() const; INLINE CPT(GeomVertexArrayData) get_maxs() const;

View File

@ -20,7 +20,7 @@
// type. // type.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE Filename Shader:: INLINE Filename Shader::
get_filename(const ShaderType &type) const { get_filename(ShaderType type) const {
if (_filename._separate && type != ST_none) { if (_filename._separate && type != ST_none) {
switch (type) { switch (type) {
case ST_vertex: case ST_vertex:
@ -59,7 +59,7 @@ get_filename(const ShaderType &type) const {
// Description: Return the Shader's text for the given shader type. // Description: Return the Shader's text for the given shader type.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE const string &Shader:: INLINE const string &Shader::
get_text(const ShaderType &type) const { get_text(ShaderType type) const {
if (_text._separate) { if (_text._separate) {
nassertr(type != ST_none || !_text._shared.empty(), _text._shared); nassertr(type != ST_none || !_text._shared.empty(), _text._shared);
switch (type) { switch (type) {

View File

@ -97,8 +97,8 @@ PUBLISHED:
const string &tess_evaluation = ""); const string &tess_evaluation = "");
static PT(Shader) make_compute(ShaderLanguage lang, const string &body); static PT(Shader) make_compute(ShaderLanguage lang, const string &body);
INLINE Filename get_filename(const ShaderType &type = ST_none) const; INLINE Filename get_filename(ShaderType type = ST_none) const;
INLINE const string &get_text(const ShaderType &type = ST_none) const; INLINE const string &get_text(ShaderType type = ST_none) const;
INLINE bool get_error_flag() const; INLINE bool get_error_flag() const;
INLINE ShaderLanguage get_language() const; INLINE ShaderLanguage get_language() const;