diff --git a/examples/common/hud.h b/examples/common/hud.h index 51b80b68..a7859cd8 100644 --- a/examples/common/hud.h +++ b/examples/common/hud.h @@ -26,9 +26,10 @@ #define HUD_H #include -#include -#include #include +#include +#include +#include #include "hud.h" @@ -128,7 +129,8 @@ protected: void SetValue(float v) { value = std::max(std::min(v, max), min); if (intStep) { - value = (int)value; + // MSVC 2010 does not have std::round() or roundf() + value = v>0.0f ? floor(v+0.5f) : ceil(v-0.5f); } } }; diff --git a/opensubdiv/far/patchTables.cpp b/opensubdiv/far/patchTables.cpp index c257869f..2824be67 100644 --- a/opensubdiv/far/patchTables.cpp +++ b/opensubdiv/far/patchTables.cpp @@ -436,7 +436,7 @@ Vtr::Array PatchTables::getFVarPatchTypes(int channel) { FVarPatchChannel & c = getFVarPatchChannel(channel); return Vtr::Array(&c.patchTypes[0], - c.patchTypes.size()); + (int)c.patchTypes.size()); } Vtr::ConstArray PatchTables::GetFVarPatchTypes(int channel) const { @@ -445,18 +445,18 @@ PatchTables::GetFVarPatchTypes(int channel) const { return Vtr::ConstArray(&c.patchesType, 1); } else { return Vtr::ConstArray(&c.patchTypes[0], - c.patchTypes.size()); + (int)c.patchTypes.size()); } } ConstIndexArray PatchTables::GetFVarPatchesValues(int channel) const { FVarPatchChannel const & c = getFVarPatchChannel(channel); - return ConstIndexArray(&c.patchValues[0], c.patchValues.size()); + return ConstIndexArray(&c.patchValues[0], (int)c.patchValues.size()); } IndexArray PatchTables::getFVarPatchesValues(int channel) { FVarPatchChannel & c = getFVarPatchChannel(channel); - return IndexArray(&c.patchValues[0], c.patchValues.size()); + return IndexArray(&c.patchValues[0], (int)c.patchValues.size()); } PatchDescriptor::Type PatchTables::getFVarPatchType(int channel, int patch) const {