• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision6260 (tree)
Time2016-01-12 01:38:49
Authormaya

Log Message

不要な条件を削除
可読性のために括弧を追加
コメント追加

Change Summary

Incremental Difference

--- branches/vs2015_warn/teraterm/common/ttlib.c (revision 6259)
+++ branches/vs2015_warn/teraterm/common/ttlib.c (revision 6260)
@@ -1039,13 +1039,13 @@
10391039 GetVersionEx(&osvi);
10401040
10411041 if (dwTypeMask & VER_BUILDNUMBER) {
1042- cond = (WORD)((dwlConditionMask >> 2 * 3) & 0x07);
1042+ cond = (WORD)((dwlConditionMask >> (2*3)) & 0x07);
10431043 if (!vercmp(lpVersionInformation->dwBuildNumber, osvi.dwBuildNumber, cond)) {
10441044 return FALSE;
10451045 }
10461046 }
10471047 if (dwTypeMask & VER_PLATFORMID) {
1048- cond = (WORD)((dwlConditionMask >> 3 * 3) & 0x07);
1048+ cond = (WORD)((dwlConditionMask >> (3*3)) & 0x07);
10491049 if (!vercmp(lpVersionInformation->dwPlatformId, osvi.dwPlatformId, cond)) {
10501050 return FALSE;
10511051 }
@@ -1054,7 +1054,7 @@
10541054 if (dwTypeMask & (VER_MAJORVERSION | VER_MINORVERSION)) {
10551055 check_next = TRUE;
10561056 if (dwTypeMask & VER_MAJORVERSION) {
1057- cond = (WORD)((dwlConditionMask >> 1 * 3) & 0x07);
1057+ cond = (WORD)((dwlConditionMask >> (1*3)) & 0x07);
10581058 if (cond == VER_EQUAL) {
10591059 if (!vercmp(lpVersionInformation->dwMajorVersion, osvi.dwMajorVersion, cond)) {
10601060 return FALSE;
@@ -1062,13 +1062,28 @@
10621062 }
10631063 else {
10641064 ret = vercmp(lpVersionInformation->dwMajorVersion, osvi.dwMajorVersion, cond);
1065- if (ret && !vercmp(lpVersionInformation->dwMajorVersion, osvi.dwMajorVersion, VER_EQUAL)) {
1065+ // ret: result of major version
1066+ if (!vercmp(lpVersionInformation->dwMajorVersion, osvi.dwMajorVersion, VER_EQUAL)) {
1067+ // !vercmp(...: result of GRATOR/LESS than (not "GRATOR/LESS than or equal to") of major version
1068+ // e.g.
1069+ // lpvi:5.1 actual:5.0 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:FALSE must check minor
1070+ // lpvi:5.1 actual:5.1 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:FALSE must check minor
1071+ // lpvi:5.1 actual:5.2 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:FALSE must check minor
1072+ // lpvi:5.1 actual:6.0 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:TRUE must not check minor
1073+ // lpvi:5.1 actual:6.1 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:TRUE must not check minor
1074+ // lpvi:5.1 actual:6.2 cond:VER_GREATER_EQUAL ret:TRUE !vercmp(...:TRUE must not check minor
1075+ // lpvi:5.1 actual:5.0 cond:VER_GREATER ret:FALSE !vercmp(...:FALSE must check minor
1076+ // lpvi:5.1 actual:5.1 cond:VER_GREATER ret:FALSE !vercmp(...:FALSE must check minor
1077+ // lpvi:5.1 actual:5.2 cond:VER_GREATER ret:FALSE !vercmp(...:FALSE must check minor
1078+ // lpvi:5.1 actual:6.0 cond:VER_GREATER ret:TRUE !vercmp(...:TRUE must not check minor
1079+ // lpvi:5.1 actual:6.1 cond:VER_GREATER ret:TRUE !vercmp(...:TRUE must not check minor
1080+ // lpvi:5.1 actual:6.2 cond:VER_GREATER ret:TRUE !vercmp(...:TRUE must not check minor
10661081 check_next = FALSE;
10671082 }
10681083 }
10691084 }
10701085 if (check_next && (dwTypeMask & VER_MINORVERSION)) {
1071- cond = (WORD)((dwlConditionMask >> 0 * 3) & 0x07);
1086+ cond = (WORD)((dwlConditionMask >> (0*3)) & 0x07);
10721087 if (cond == VER_EQUAL) {
10731088 if (!vercmp(lpVersionInformation->dwMinorVersion, osvi.dwMinorVersion, cond)) {
10741089 return FALSE;
Show on old repository browser