Skip to content

Commit a317fc0

Browse files
committed
Fix contructor usage in C++98
1 parent 84892b4 commit a317fc0

File tree

1 file changed

+7
-9
lines changed
  • include/internal/libfreenect2/protocol

1 file changed

+7
-9
lines changed

include/internal/libfreenect2/protocol/command.h

+7-9
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,14 @@ struct ColorSettingCommand : public Command<KCMD_RGB_SETTING, ColorSettingRespon
242242

243243
// Could overload ctor to ease usage for float-valued settings.
244244
ColorSettingCommand(ColorSettingCommandType cmd, float value)
245-
: ColorSettingCommand(cmd, float_bytes_to_uint32_(value))
245+
: Command<KCMD_RGB_SETTING, ColorSettingResponseSize, ColorSettingResponseSize, 4>(0)
246246
{
247-
}
248-
249-
private:
250-
static uint32_t float_bytes_to_uint32_(float value)
251-
{
252-
uint32_t out;
253-
memcpy(&out, &value, sizeof(out));
254-
return out;
247+
this->data_.parameters[0] = 1;
248+
this->data_.parameters[1] = 0;
249+
this->data_.parameters[2] = (uint32_t)cmd;
250+
uint32_t value2;
251+
memcpy(&value2, &value, sizeof(value2));
252+
this->data_.parameters[3] = value2;
255253
}
256254
};
257255

0 commit comments

Comments
 (0)