Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

構造体比較にmemcmpを使うのをやめる #877

Commits on Apr 29, 2019

  1. 構造体比較にmemcmpを使うのをやめる

    構造体の比較でmemcmpを使うと、構造体内のパディング部分の差異で等価判断を正しく行えなくなる恐れがある。
    構造体に比較演算子を定義して、有効なメンバだけを比較するように変更する。
    berryzplus committed Apr 29, 2019
    Configuration menu
    Copy the full SHA
    a3a02a6 View commit details
    Browse the repository at this point in the history
  2. 指摘対応

    文字列比較に_tcscmpではなく_tcsncmpを使う。
    完全に同じ構造体同士を比較した場合にバッファオーバランが発生する可能性があるため。
    berryzplus committed Apr 29, 2019
    Configuration menu
    Copy the full SHA
    7a19601 View commit details
    Browse the repository at this point in the history
  3. 自分自身との比較を考慮した判定を追加

    物理的に同じ構造体を比較した場合の判定をショートカットできるようにthis == &rhsの判定を追加。
    berryzplus committed Apr 29, 2019
    Configuration menu
    Copy the full SHA
    8a7769f View commit details
    Browse the repository at this point in the history
  4. 比較演算子の引数型を修正

    変更しない引数にはconst修飾を付けるべきだが付けていなかった。
    この変更を適用しておかないと定数との比較ができない。
    単体テスト作成中に発見した凡ミス修正。
    berryzplus committed Apr 29, 2019
    Configuration menu
    Copy the full SHA
    814365a View commit details
    Browse the repository at this point in the history
  5. 単体テスト追加

    berryzplus committed Apr 29, 2019
    Configuration menu
    Copy the full SHA
    35a68c8 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2019

  1. Configuration menu
    Copy the full SHA
    f925648 View commit details
    Browse the repository at this point in the history
  2. MSVCリリース版のテストが失敗する対策

    失敗する原因が不明なので当面は実行しないように対策する。
    berryzplus committed Apr 30, 2019
    Configuration menu
    Copy the full SHA
    c0d02c5 View commit details
    Browse the repository at this point in the history