emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/coding.c


From: Ken Raeburn
Subject: [Emacs-diffs] Changes to emacs/src/coding.c
Date: Fri, 19 Jul 2002 10:26:57 -0400

Index: emacs/src/coding.c
diff -c emacs/src/coding.c:1.250 emacs/src/coding.c:1.251
*** emacs/src/coding.c:1.250    Tue Jul 16 15:48:04 2002
--- emacs/src/coding.c  Fri Jul 19 10:26:57 2002
***************
*** 1061,1067 ****
    } while (0)
  
  
! static void encode_eol P_ ((struct coding_system *, unsigned char *,
                            unsigned char *, int, int));
  
  static void
--- 1061,1067 ----
    } while (0)
  
  
! static void encode_eol P_ ((struct coding_system *, const unsigned char *,
                            unsigned char *, int, int));
  
  static void
***************
*** 3236,3247 ****
  static void
  encode_eol (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      unsigned char *source, *destination;
       int src_bytes, dst_bytes;
  {
!   unsigned char *src = source;
    unsigned char *dst = destination;
!   unsigned char *src_end = src + src_bytes;
    unsigned char *dst_end = dst + dst_bytes;
    Lisp_Object translation_table;
    /* SRC_BASE remembers the start position in source in each loop.
--- 3236,3248 ----
  static void
  encode_eol (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      const unsigned char *source;
!      unsigned char *destination;
       int src_bytes, dst_bytes;
  {
!   const unsigned char *src = source;
    unsigned char *dst = destination;
!   const unsigned char *src_end = src + src_bytes;
    unsigned char *dst_end = dst + dst_bytes;
    Lisp_Object translation_table;
    /* SRC_BASE remembers the start position in source in each loop.
***************
*** 3249,3255 ****
       analyze multi-byte codes (within macro ONE_MORE_CHAR), or when
       there's not enough destination area to produce encoded codes
       (within macro EMIT_BYTES).  */
!   unsigned char *src_base;
    int c;
    int selective_display = coding->mode & CODING_MODE_SELECTIVE_DISPLAY;
  
--- 3250,3257 ----
       analyze multi-byte codes (within macro ONE_MORE_CHAR), or when
       there's not enough destination area to produce encoded codes
       (within macro EMIT_BYTES).  */
!   const unsigned char *src_base;
!   unsigned char *tmp;
    int c;
    int selective_display = coding->mode & CODING_MODE_SELECTIVE_DISPLAY;
  
***************
*** 3299,3311 ****
        }
        if (coding->eol_type == CODING_EOL_CR)
        {
!         for (src = destination; src < dst; src++)
!           if (*src == '\n') *src = '\r';
        }
        else if (selective_display)
        {
!         for (src = destination; src < dst; src++)
!           if (*src == '\r') *src = '\n';
        }
      }
    if (coding->src_multibyte)
--- 3301,3313 ----
        }
        if (coding->eol_type == CODING_EOL_CR)
        {
!         for (tmp = destination; tmp < dst; tmp++)
!           if (*tmp == '\n') *tmp = '\r';
        }
        else if (selective_display)
        {
!         for (tmp = destination; tmp < dst; tmp++)
!           if (*tmp == '\r') *tmp = '\n';
        }
      }
    if (coding->src_multibyte)
***************
*** 4094,4100 ****
  void
  detect_coding (coding, src, src_bytes)
       struct coding_system *coding;
!      unsigned char *src;
       int src_bytes;
  {
    unsigned int idx;
--- 4096,4102 ----
  void
  detect_coding (coding, src, src_bytes)
       struct coding_system *coding;
!      const unsigned char *src;
       int src_bytes;
  {
    unsigned int idx;
***************
*** 4267,4273 ****
  void
  detect_eol (coding, src, src_bytes)
       struct coding_system *coding;
!      unsigned char *src;
       int src_bytes;
  {
    Lisp_Object val;
--- 4269,4275 ----
  void
  detect_eol (coding, src, src_bytes)
       struct coding_system *coding;
!      const unsigned char *src;
       int src_bytes;
  {
    Lisp_Object val;
***************
*** 4685,4691 ****
  int
  decode_coding (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      unsigned char *source, *destination;
       int src_bytes, dst_bytes;
  {
    int extra = 0;
--- 4687,4694 ----
  int
  decode_coding (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      const unsigned char *source;
!      unsigned char *destination;
       int src_bytes, dst_bytes;
  {
    int extra = 0;
***************
*** 4764,4770 ****
    if (coding->mode & CODING_MODE_LAST_BLOCK
        && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
      {
!       unsigned char *src = source + coding->consumed;
        unsigned char *dst = destination + coding->produced;
  
        src_bytes -= coding->consumed;
--- 4767,4773 ----
    if (coding->mode & CODING_MODE_LAST_BLOCK
        && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
      {
!       const unsigned char *src = source + coding->consumed;
        unsigned char *dst = destination + coding->produced;
  
        src_bytes -= coding->consumed;
***************
*** 4798,4804 ****
  int
  encode_coding (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      unsigned char *source, *destination;
       int src_bytes, dst_bytes;
  {
    coding->produced = coding->produced_char = 0;
--- 4801,4808 ----
  int
  encode_coding (coding, source, destination, src_bytes, dst_bytes)
       struct coding_system *coding;
!      const unsigned char *source;
!      unsigned char *destination;
       int src_bytes, dst_bytes;
  {
    coding->produced = coding->produced_char = 0;
***************
*** 4840,4846 ****
    if (coding->mode & CODING_MODE_LAST_BLOCK
        && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
      {
!       unsigned char *src = source + coding->consumed;
        unsigned char *dst = destination + coding->produced;
  
        if (coding->type == coding_type_iso2022)
--- 4844,4850 ----
    if (coding->mode & CODING_MODE_LAST_BLOCK
        && coding->result == CODING_FINISH_INSUFFICIENT_SRC)
      {
!       const unsigned char *src = source + coding->consumed;
        unsigned char *dst = destination + coding->produced;
  
        if (coding->type == coding_type_iso2022)
***************
*** 6014,6025 ****
    else
      newstr = make_uninit_string (produced + shrinked_bytes);
    if (from > 0)
!     bcopy (SDATA (str), SDATA (newstr), from);
!   bcopy (buf.data, SDATA (newstr) + from, produced);
    if (shrinked_bytes > from)
!     bcopy (SDATA (str) + to_byte,
!          SDATA (newstr) + from + produced,
!          shrinked_bytes - from);
    free_conversion_buffer (&buf);
  
    if (coding->cmp_data && coding->cmp_data->used)
--- 6018,6029 ----
    else
      newstr = make_uninit_string (produced + shrinked_bytes);
    if (from > 0)
!     STRING_COPYIN (newstr, 0, SDATA (str), from);
!   STRING_COPYIN (newstr, from, buf.data, produced);
    if (shrinked_bytes > from)
!     STRING_COPYIN (newstr, from + produced,
!                  SDATA (str) + to_byte,
!                  shrinked_bytes - from);
    free_conversion_buffer (&buf);
  
    if (coding->cmp_data && coding->cmp_data->used)
***************
*** 6114,6125 ****
  
    newstr = make_uninit_string (produced + shrinked_bytes);
    if (from > 0)
!     bcopy (SDATA (str), SDATA (newstr), from);
!   bcopy (buf.data, SDATA (newstr) + from, produced);
    if (shrinked_bytes > from)
!     bcopy (SDATA (str) + to_byte,
!          SDATA (newstr) + from + produced,
!          shrinked_bytes - from);
  
    free_conversion_buffer (&buf);
    coding_free_composition_data (coding);
--- 6118,6129 ----
  
    newstr = make_uninit_string (produced + shrinked_bytes);
    if (from > 0)
!     STRING_COPYIN (newstr, 0, SDATA (str), from);
!   STRING_COPYIN (newstr, from, buf.data, produced);
    if (shrinked_bytes > from)
!     STRING_COPYIN (newstr, from + produced,
!                  SDATA (str) + to_byte,
!                  shrinked_bytes - from);
  
    free_conversion_buffer (&buf);
    coding_free_composition_data (coding);
***************
*** 6197,6203 ****
  
  Lisp_Object
  detect_coding_system (src, src_bytes, highest, multibytep)
!      unsigned char *src;
       int src_bytes, highest;
       int multibytep;
  {
--- 6201,6207 ----
  
  Lisp_Object
  detect_coding_system (src, src_bytes, highest, multibytep)
!      const unsigned char *src;
       int src_bytes, highest;
       int multibytep;
  {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]