Closed yutotnh closed 1 year ago
現在は、エラーチェックが指定した範囲が baffuer の幅を超えていたら 返り値に UINT32_MAX を返しているがそれと、返り値の型が uint32 であるため、 31bit が安全に値を取得できる最大になる
https://github.com/yutotnh/spirit/blob/62dd6467d199d7455a4ade670a203816b6d399a1/include/bit.h#L9-L17
もしかしたら、前述の変更に伴って同じような以下の関数も変更したほうがいいかも
https://github.com/yutotnh/spirit/blob/62dd6467d199d7455a4ade670a203816b6d399a1/include/bit.h#L19-L29
get_range_value() の返り値をエラーチェックの結果にして、出力として値を返す引数を追加する。
なぜ機能が欲しいのか
現在は、エラーチェックが指定した範囲が baffuer の幅を超えていたら 返り値に UINT32_MAX を返しているがそれと、返り値の型が uint32 であるため、 31bit が安全に値を取得できる最大になる
https://github.com/yutotnh/spirit/blob/62dd6467d199d7455a4ade670a203816b6d399a1/include/bit.h#L9-L17
もしかしたら、前述の変更に伴って同じような以下の関数も変更したほうがいいかも
https://github.com/yutotnh/spirit/blob/62dd6467d199d7455a4ade670a203816b6d399a1/include/bit.h#L19-L29
提案の説明
get_range_value() の返り値をエラーチェックの結果にして、出力として値を返す引数を追加する。
その他