diff options
author | Kenneth Venken <kenneth.venken@gmail.com> | 2010-10-16 20:56:58 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-16 20:56:58 +0100 |
commit | 095a3decf54d42b1c24c151b6db7599c7d0393da (patch) | |
tree | a7e63620f5a6bb53ff12cb2a22b70c11e3843527 /hwpfilter | |
parent | 38f65640b46fe5dec965a984f4e615398d3d58a3 (diff) |
some patches that replace sizeof(a)/sizeof(a[0]) with SAL_N_ELEMENTS(a)
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hcode.cpp | 7 | ||||
-rw-r--r-- | hwpfilter/source/hwpeq.cpp | 3 | ||||
-rw-r--r-- | hwpfilter/source/mapping.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/hwpfilter/source/hcode.cpp b/hwpfilter/source/hcode.cpp index a5583b8c351e..02651926d0de 100644 --- a/hwpfilter/source/hcode.cpp +++ b/hwpfilter/source/hcode.cpp @@ -34,6 +34,7 @@ */ #include "precompile.h" #include <sal/types.h> +#include <sal/macros.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -596,7 +597,7 @@ static int is_jaso(hchar hh) { unsigned int i; - for (i = 0; i < sizeof(jaso_hh_code) / sizeof(jaso_hh_code[0]); i++) + for (i = 0; i < SAL_N_ELEMENTS(jaso_hh_code); i++) if (hh == jaso_hh_code[i]) return 1; return 0; @@ -607,7 +608,7 @@ static hchar jaso2ks(hchar hh) { unsigned int i; - for (i = 0; i < sizeof(jaso_hh_code) / sizeof(jaso_hh_code[0]); i++) + for (i = 0; i < SAL_N_ELEMENTS(jaso_hh_code); i++) if (hh == jaso_hh_code[i]) { return sal::static_int_cast<hchar>(0xa4a1 + i); @@ -1117,7 +1118,7 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) } else{ /* °í¾îÆ÷ÇÔ ÀÚ¸ðÁ¶ÇÕ : Å×ÀÌºí ¹Ì¿Ï¼º */ unsigned int index = choseong * 32 + jongseong - 308; - if( index < sizeof(jamocomp1_to_unicode)/sizeof(jamocomp1_to_unicode[0])){ + if( index < SAL_N_ELEMENTS(jamocomp1_to_unicode) ){ dest[0] = jamocomp1_to_unicode[index].v1; dest[1] = jamocomp1_to_unicode[index].v2; dest[2] = jamocomp1_to_unicode[index].v3; diff --git a/hwpfilter/source/hwpeq.cpp b/hwpfilter/source/hwpeq.cpp index fbb0c86a4f56..6b663879cb92 100644 --- a/hwpfilter/source/hwpeq.cpp +++ b/hwpfilter/source/hwpeq.cpp @@ -38,6 +38,7 @@ using namespace std; #include "mzstring.h" #include "hwpeq.h" #include <sal/types.h> +#include <sal/macros.h> //#define TEST //#define DEBUG @@ -392,7 +393,7 @@ static hwpeq eq_tbl[] = { static hwpeq *lookup_eqn(char *str) { - static int eqCount = sizeof(eq_tbl) / sizeof(eq_tbl[0]); + static int eqCount = SAL_N_ELEMENTS(eq_tbl); int m, k, l = 0, r = eqCount; hwpeq *result = 0; diff --git a/hwpfilter/source/mapping.h b/hwpfilter/source/mapping.h index 7c7ceb086bf3..bf445ef6e52f 100644 --- a/hwpfilter/source/mapping.h +++ b/hwpfilter/source/mapping.h @@ -30,6 +30,7 @@ #include <string.h> #include <stdio.h> +#include <sal/macros.h> typedef unsigned short hchar; @@ -369,7 +370,7 @@ const struct FormulaEntry FormulaMapTab[] = { #ifndef DEBUG hchar *getMathMLEntity(const char *tex, hchar *buf) { - static int tabSize = sizeof( FormulaMapTab ) / sizeof( FormulaMapTab[0] ); + static int tabSize = SAL_N_ELEMENTS( FormulaMapTab ); int i, len; for( i = 0 ; i < tabSize ; i++ ){ |