[Libreoffice-commits] .: hwpfilter/source

Julien Nabet serval2412 at kemper.freedesktop.org
Thu Jun 9 14:07:37 PDT 2011


 hwpfilter/source/hbox.cpp      |    5 ++---
 hwpfilter/source/hcode.cpp     |    8 ++++----
 hwpfilter/source/hpara.cpp     |    4 +---
 hwpfilter/source/hwpeq.cpp     |    8 +++++---
 hwpfilter/source/hwpreader.cxx |    6 +++---
 5 files changed, 15 insertions(+), 16 deletions(-)

New commits:
commit 3b1b2a9b37ea280f4085db8aabbc5c49f40f65be
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu Jun 9 23:06:51 2011 +0200

    Some cppcheck cleaning

diff --git a/hwpfilter/source/hbox.cpp b/hwpfilter/source/hbox.cpp
index 1fa7478..2746084 100644
--- a/hwpfilter/source/hbox.cpp
+++ b/hwpfilter/source/hbox.cpp
@@ -444,7 +444,6 @@ static hchar olHanglJaso(int num, int type)
     static unsigned char jung2[] = { 3, 7, 13, 20, 27, 29, 30 };
 
     hchar hh = 0;
-    int j;
 
     if (type == OL_HANGL_JASO)
     {
@@ -461,7 +460,7 @@ static hchar olHanglJaso(int num, int type)
             hh = (han_init[num] << 8) | 'a';
         else
         {
-            j = (num / 14) % (sizeof(jung2) / sizeof(char));
+            int j = (num / 14) % (sizeof(jung2) / sizeof(char));
 
             num = num % 14;
             hh = (han_init[num] << 8) | (jung2[j] << 5) | 1;
@@ -571,13 +570,13 @@ enum
  */
 hchar *Outline::GetUnicode(hchar * hstr, int)
 {
-    int levelnum;
     hchar *p;
      hchar buffer[255];
 
     buffer[0] = 0;
     if (kind == OUTLINE_NUM)
     {
+        int levelnum;
         switch (shape)
         {
             case OLSTY_NUMS1:
diff --git a/hwpfilter/source/hcode.cpp b/hwpfilter/source/hcode.cpp
index de4e95b..2c513a6 100644
--- a/hwpfilter/source/hcode.cpp
+++ b/hwpfilter/source/hcode.cpp
@@ -914,9 +914,7 @@ static JamoComp jamocomp1_to_unicode[] =
 //#define IS_OLD_HAN(x)	(((x) >= 0x8020 && (x) <= 0x83ff ) || ( (x) >= 0x8420 && (x) <= 0x843f )) // beside these, there are very much characters in the hangul.
 int hcharconv(hchar ch, hchar *dest, int codeType)
 {
-    unsigned int index;
-    unsigned char lo, hi;
-     int res;
+    unsigned char lo;
      //printf("hcharconv[%04x]\n",ch);
     if (ch < 128){
          dest[0] = ch;
@@ -932,7 +930,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
                     dest[0] = 0xd55c;
                     return 1 ;
                 }
-                res = kssm_hangul_to_ucs2(ch, dest);
+                int res = kssm_hangul_to_ucs2(ch, dest);
                //printf("hcharconv Hangul[%04x]\n",dest[0]);
                 return res;
           }
@@ -942,6 +940,8 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
       /* ÇÑÀÚ´Â 0x4000ºÎÅÍ 4888°¡ÁöÀÇ °ªÀ» °¡Áø´Ù. */
     else if (IsHanja(ch))
     {
+        unsigned int index;
+        unsigned char hi;
         /*  4888ÀÌ¿ÜÀÇ ¼ö´Â ¾Æ·¡Çѱۿ¡¼­ Á¤ÀÇÇÑ È®ÀåÇÑÀÚÀÌ´Ù. ÀÌ°Í¿¡ ´ëÇؼ­´Â
             À¯´ÏÄڵ峪 ¿Ï¼ºÇüÄÚµå·ÎÀÇ º¯È¯À» À§ÇÑ ¸ÅÇÎÅ×À̺í¾î ¾ø´Â ½ÇÁ¤ÀÌ´Ù.
          */
diff --git a/hwpfilter/source/hpara.cpp b/hwpfilter/source/hpara.cpp
index 2ad6202..6c44831 100644
--- a/hwpfilter/source/hpara.cpp
+++ b/hwpfilter/source/hpara.cpp
@@ -72,8 +72,6 @@ HWPPara::HWPPara(void)
 
 HWPPara::~HWPPara(void)
 {
-    int ii;
-
     if (linfo)
         delete[]linfo;
     if (cshapep)
@@ -82,7 +80,7 @@ HWPPara::~HWPPara(void)
     {
 // virtual destructor
 /* C++은 null에 대해서도 동작한다. */
-        for (ii = 0; ii < nch; ++ii)
+        for (int ii = 0; ii < nch; ++ii)
             delete hhstr[ii];
 
         delete[]hhstr;
diff --git a/hwpfilter/source/hwpeq.cpp b/hwpfilter/source/hwpeq.cpp
index 05d64a2..60d00d5 100644
--- a/hwpfilter/source/hwpeq.cpp
+++ b/hwpfilter/source/hwpeq.cpp
@@ -540,7 +540,7 @@ static int next_token(MzString &white, MzString &token, istream *strm)
 
 static int read_white_space(MzString& outs, istream *strm)
 {
-  int	ch, result;
+  int	result;
 
   if( stk->state(strm) ) {
     outs << stk->white;
@@ -548,6 +548,7 @@ static int read_white_space(MzString& outs, istream *strm)
     result = stk->token[0];
   }
   else {
+    int	ch;
     while( IS_WS(ch = strm->get()) )
       outs << (char )ch;
     strm->putback(sal::static_int_cast<char>(ch));
@@ -573,7 +574,7 @@ static int read_white_space(MzString& outs, istream *strm)
 static int eq_word(MzString& outs, istream *strm, int status)
 {
   MzString	token, white, state;
-  int		ch, result, nargs;
+  int		result;
   char		keyword[256];
   hwpeq		*eq;
 
@@ -610,7 +611,8 @@ static int eq_word(MzString& outs, istream *strm, int status)
     script_status = SCRIPT_NONE;
 
       if( 0 != (eq = lookup_eqn(keyword)) ) {
-    nargs = eq->nargs;
+    int nargs = eq->nargs;
+    int ch;
     while( nargs-- ) {
       ch = read_white_space(state, strm);
       if( ch != '{' ) state << '{';
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index 37e6cb0..e0c293d 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -1531,7 +1531,6 @@ void HwpReader::parseParaShape(ParaShape * pshape)
  */
 void HwpReader::makePStyle(ParaShape * pshape)
 {
-    unsigned char tf = 0;
     int nscount = pshape->tabs[MAXTABS -1].type;
     padd(ascii("style:name"), sXML_CDATA,
         ascii(Int2Str(pshape->index, "P%d", buf)));
@@ -1545,6 +1544,7 @@ void HwpReader::makePStyle(ParaShape * pshape)
 
     if( nscount )
     {
+        unsigned char tf = 0;
         rstartEl(ascii("style:tab-stops"),rList);
 
           int tab_margin = pshape->left_margin + pshape->indent;
@@ -3658,11 +3658,11 @@ void HwpReader::makeTextBox(TxtBox * hbox)
         ascii(Int2Str(hbox->style.boxnum, "Txtbox%d", buf)));
     padd(ascii("draw:name"), sXML_CDATA,
         ascii(Int2Str(hbox->style.boxnum, "Frame%d", buf)));
-    int x = 0;
-    int y = 0;
 
     if( hbox->style.cap_len <= 0 || hbox->type != TXT_TYPE )
     {
+        int x = 0;
+        int y = 0;
         switch (hbox->style.anchor_type)
         {
             case CHAR_ANCHOR:


More information about the Libreoffice-commits mailing list