NREL/OpenStudio — pull request #915 by mbadams5 (2014-03-19 17:16:58+00:00)
Title: Fix various compiler warnings

This fixes various compiler warnings output by Clang 5.1.

Some are simple unused variables, which if needed in the future will have to be added again.

I also added -Wno-dynamic-class-memaccess compile flag for swig targets to get rid of a clang specific warning (annoying warning) [1]. I don’t think this is something to worry about from my research but I also can not figure out a way to fix the warning, other than to suppress it.

For the changes in ServiceWaterGridItems, the compiler was implicitly converting the double’s to int’s since the various Qt functions use int parameters. This just changes the doubles to the implicitly converted int, explicitly.

GeometryTranslator was only applying the ’not’ to the left hand side of the equation [2]. This worked because objects.size() for GlobalGeometryRules and Building should be 0 or 1 only since they are
unique objects. Thus the ’not’ operator would flip these and compare to 1. This just changes the comparison to != which can deal with size() > 1 (but shouldn’t ever happen)

@kbenne @macumber @axelstudios

[1] - Warning
~/osbuilds/develop_branch/OpenStudioCore-prefix/src/OpenStudioCore-build/src/utilities/ruby_OpenStudioUtilitiesDocument_wrap.cxx:3267:9:
warning:
destination for this 'memset' call is a pointer to dynamic class
'openstudio::DocumentElement'; vtable pointer will be overwritten
[-Wdynamic-class-memaccess]
memset(v_def,0,sizeof(Type));
~~~~~~ ^
~/osbuilds/develop_branch/OpenStudioCore-prefix/src/OpenStudioCore-build/src/utilities/ruby_OpenStudioUtilitiesDocument_wrap.cxx:3293:66: note:
in instantiation of member function 'swig::traits_as::as' requested here
return traits_as< Type, typename traits< Type >::category>::as(obj, te);
^
~/osbuilds/develop_branch/OpenStudioCore-prefix/src/OpenStudioCore-build/src/utilities/ruby_OpenStudioUtilitiesDocument_wrap.cxx:5053:114:
note:
in instantiation of function template specialization
'swig::as' requested here
...openstudio::DocumentElement > >::value_type val = swig::as