From: Kimmo Varis Date: Tue, 21 Oct 2008 19:11:35 +0000 (+0000) Subject: Small cleanup - use countof() macro to calculate array size. X-Git-Tag: 2.16.5~2881 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=31cfc24e58c51e1ab31ae9fdabaf4344db16b1d4;p=winmerge-jp%2Fwinmerge-jp.git Small cleanup - use countof() macro to calculate array size. --- diff --git a/Src/DirViewColItems.cpp b/Src/DirViewColItems.cpp index f067341bd..73510d54e 100644 --- a/Src/DirViewColItems.cpp +++ b/Src/DirViewColItems.cpp @@ -887,7 +887,7 @@ CDirView::GetColDefaultOrder(int col) const const DirColInfo * CDirView::DirViewColItems_GetDirColInfo(int col) const { - if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0])) + if (col < 0 || col >= countof(f_cols)) { ASSERT(0); // fix caller, should not ask for nonexistent columns return 0; @@ -901,7 +901,7 @@ CDirView::DirViewColItems_GetDirColInfo(int col) const static bool IsColById(int col, int id) { - if (col < 0 || col >= sizeof(f_cols)/sizeof(f_cols[0])) + if (col < 0 || col >= countof(f_cols)) { ASSERT(0); // fix caller, should not ask for nonexistent columns return false;