Commit c9f71129 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Get rid of functions we don't need

parent 149025e3
......@@ -159,84 +159,16 @@ struct IDIISG : public std::vector<InputDeviceInputInfoStruct>
MDFN_HIDE extern const IDIISG IDII_Empty;
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_Button(const char* sname, const char* name, int16 co, const char* exn = nullptr)
static INLINE InputDeviceInputInfoStruct IDIIS_Button(const char* sname, const char* name, int16 co, const char* exn)
{
return { sname, name, co, IDIT_BUTTON, 0, 0, 0, { { exn } } };
}
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_ButtonCR(const char* sname, const char* name, int16 co, const char* exn = nullptr)
static INLINE InputDeviceInputInfoStruct IDIIS_ButtonCR(const char* sname, const char* name, int16 co, const char* exn)
{
return { sname, name, co, IDIT_BUTTON_CAN_RAPID, 0, 0, 0, { { exn } } };
}
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_AnaButton(const char* sname, const char* name, int16 co)
{
return { sname, name, co, IDIT_BUTTON_ANALOG, 0, 0, 0 };
}
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_Rumble(const char* sname = "rumble", const char* name = "Rumble")
{
return { sname, name, -1, IDIT_RUMBLE, 0, 0, 0 };
}
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_ResetButton(void)
{
return { nullptr, nullptr, -1, IDIT_RESET_BUTTON, 0, 0, 0 };
}
template<unsigned nbits = 1>
static INLINE constexpr InputDeviceInputInfoStruct IDIIS_Padding(void)
{
return { nullptr, nullptr, -1, IDIT_PADDING, 0, nbits, 0 };
}
static INLINE /*constexpr*/ InputDeviceInputInfoStruct IDIIS_Axis(const char* sname_pfx, const char* name_pfx, const char* sname_neg, const char* name_neg, const char* sname_pos, const char* name_pos, int16 co, bool co_invert = false, bool sqlr = false)
{
InputDeviceInputInfoStruct ret = { sname_pfx, name_pfx, co, IDIT_AXIS, (uint8)((sqlr ? IDIT_AXIS_FLAG_SQLR : 0) | (co_invert ? IDIT_AXIS_FLAG_INVERT_CO : 0)), 0, 0 };
ret.Axis.sname_dir[0] = sname_neg;
ret.Axis.sname_dir[1] = sname_pos;
ret.Axis.name_dir[0] = name_neg;
ret.Axis.name_dir[1] = name_pos;
return ret;
}
static INLINE /*constexpr*/ InputDeviceInputInfoStruct IDIIS_AxisRel(const char* sname_pfx, const char* name_pfx, const char* sname_neg, const char* name_neg, const char* sname_pos, const char* name_pos, int16 co, bool co_invert = false, bool sqlr = false)
{
InputDeviceInputInfoStruct ret = { sname_pfx, name_pfx, co, IDIT_AXIS_REL, (uint8)(co_invert ? IDIT_AXIS_REL_FLAG_INVERT_CO : 0), 0, 0 };
ret.AxisRel.sname_dir[0] = sname_neg;
ret.AxisRel.sname_dir[1] = sname_pos;
ret.AxisRel.name_dir[0] = name_neg;
ret.AxisRel.name_dir[1] = name_pos;
return ret;
}
template<uint32 spn_count, uint32 defpos = 0>
static INLINE /*constexpr*/ InputDeviceInputInfoStruct IDIIS_Switch(const char* sname, const char* name, int16 co, const IDIIS_SwitchPos (&spn)[spn_count], const bool undoc_defpos_setting = true)
{
InputDeviceInputInfoStruct ret = { sname, name, co, IDIT_SWITCH, (uint8)(undoc_defpos_setting ? IDIT_FLAG_AUX_SETTINGS_UNDOC : 0), 0, 0 };
ret.Switch.Pos = spn;
ret.Switch.NumPos = spn_count;
ret.Switch.DefPos = defpos;
return ret;
}
template<uint32 ss_count>
static INLINE /*constexpr*/ InputDeviceInputInfoStruct IDIIS_Status(const char* sname, const char* name, const IDIIS_StatusState (&ss)[ss_count])
{
InputDeviceInputInfoStruct ret = { sname, name, -1, IDIT_STATUS, 0, 0, 0 };
ret.Status.States = ss;
ret.Status.NumStates = ss_count;
return ret;
}
struct InputDeviceInfoStruct
{
const char *ShortName;
......
......@@ -53,17 +53,17 @@ static INLINE sha1_digest sha1(const void* data, const uint64 len)
void sha1_test(void);
sha1_digest sha1(const void* data, const uint64 len);
static INLINE constexpr uint8 sha1_cton(char c)
static INLINE uint8 sha1_cton(char c)
{
return ((c >= 'A' && c <= 'F') ? c - 'A' + 0xa : ((c >= 'a' && c <= 'f') ? c - 'a' + 0xa : c - '0'));
}
static INLINE constexpr uint8 sha1_cton2(char c, char d)
static INLINE uint8 sha1_cton2(char c, char d)
{
return (sha1_cton(c) << 4) | (sha1_cton(d) << 0);
}
static INLINE constexpr sha1_digest operator "" _sha1(const char *s, std::size_t sz)
static INLINE sha1_digest operator "" _sha1(const char *s, std::size_t sz)
{
return /*(sz == 41 ? (void)0 : abort()),*/ sha1_digest({{ sha1_cton2(s[0], s[1]), sha1_cton2(s[2], s[3]), sha1_cton2(s[4], s[5]), sha1_cton2(s[6], s[7]),
sha1_cton2(s[8], s[9]), sha1_cton2(s[10], s[11]), sha1_cton2(s[12], s[13]), sha1_cton2(s[14], s[15]),
......
......@@ -85,17 +85,17 @@ static INLINE sha256_digest sha256(const void* data, uint64 len)
}
static INLINE constexpr uint8 sha256_cton(char c)
static INLINE uint8 sha256_cton(char c)
{
return ((c >= 'A' && c <= 'F') ? c - 'A' + 0xa : ((c >= 'a' && c <= 'f') ? c - 'a' + 0xa : c - '0'));
}
static INLINE constexpr uint8 sha256_cton2(char c, char d)
static INLINE uint8 sha256_cton2(char c, char d)
{
return (sha256_cton(c) << 4) | (sha256_cton(d) << 0);
}
static INLINE constexpr sha256_digest operator "" _sha256(const char *s, std::size_t sz)
static INLINE sha256_digest operator "" _sha256(const char *s, std::size_t sz)
{
return /*(sz == 65 ? (void)0 : abort()),*/ sha256_digest({{ sha256_cton2(s[0], s[1]), sha256_cton2(s[2], s[3]), sha256_cton2(s[4], s[5]), sha256_cton2(s[6], s[7]),
sha256_cton2(s[8], s[9]), sha256_cton2(s[10], s[11]), sha256_cton2(s[12], s[13]), sha256_cton2(s[14], s[15]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment