/[emacs]/emacs/src/coding.c
ViewVC logotype

Diff of /emacs/src/coding.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.239.2.17 by handa, Wed May 22 11:14:45 2002 UTC revision 1.239.2.18 by handa, Wed May 22 11:30:00 2002 UTC
# Line 4336  decode_coding_charset (coding) Line 4336  decode_coding_charset (coding)
4336            Lisp_Object val;            Lisp_Object val;
4337            struct charset *charset;            struct charset *charset;
4338            int dim;            int dim;
4339            unsigned code;            int len = 1;
4340            int c1;            unsigned code = c;
4341    
4342            val = AREF (valids, c);            val = AREF (valids, c);
4343            if (NILP (val))            if (NILP (val))
# Line 4346  decode_coding_charset (coding) Line 4346  decode_coding_charset (coding)
4346              {              {
4347                charset = CHARSET_FROM_ID (XFASTINT (val));                charset = CHARSET_FROM_ID (XFASTINT (val));
4348                dim = CHARSET_DIMENSION (charset);                dim = CHARSET_DIMENSION (charset);
4349                code = c;                while (len++ < dim)
               if (dim > 1)  
4350                  {                  {
4351                    ONE_MORE_BYTE (c1);                    ONE_MORE_BYTE (c);
4352                    code = (code << 8) | c1;                    code = (code << 8) | c;
                   if (dim > 2)  
                     {  
                       ONE_MORE_BYTE (c1);  
                       code = (code << 8) | c1;  
                       if (dim > 3)  
                         {  
                           ONE_MORE_BYTE (c1);  
                           code = (c << 8) | c1;  
                         }  
                     }  
4353                  }                  }
4354                CODING_DECODE_CHAR (coding, src, src_base, src_end,                CODING_DECODE_CHAR (coding, src, src_base, src_end,
4355                                    charset, code, c);                                    charset, code, c);
# Line 4370  decode_coding_charset (coding) Line 4359  decode_coding_charset (coding)
4359                /* VAL is a list of charset IDs.  It is assured that the                /* VAL is a list of charset IDs.  It is assured that the
4360                   list is sorted by charset dimensions (smaller one                   list is sorted by charset dimensions (smaller one
4361                   comes first).  */                   comes first).  */
               int b[4];  
               int len = 1;  
   
               b[0] = c;  
               /* VAL is a list of charset IDs.  */  
4362                while (CONSP (val))                while (CONSP (val))
4363                  {                  {
4364                    charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));                    charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));
4365                    dim = CHARSET_DIMENSION (charset);                    dim = CHARSET_DIMENSION (charset);
4366                    while (len < dim)                    while (len++ < dim)
4367                      {                      {
4368                        ONE_MORE_BYTE (c1);                        ONE_MORE_BYTE (c);
4369                        b[len++] = c1;                        code = (code << 8) | c;
4370                      }                      }
                   if (dim == 1)  
                     code = b[0];  
                   else if (dim == 2)  
                     code = (b[0] << 8) | b[1];  
                   else if (dim == 3)  
                     code = (b[0] << 16) | (b[1] << 8) | b[2];  
                   else  
                     code = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];  
4371                    CODING_DECODE_CHAR (coding, src, src_base,                    CODING_DECODE_CHAR (coding, src, src_base,
4372                                        src_end, charset, code, c);                                        src_end, charset, code, c);
4373                    if (c >= 0)                    if (c >= 0)

Legend:
Removed from v.1.239.2.17  
changed lines
  Added in v.1.239.2.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26