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

Diff of /emacs/src/editfns.c

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

revision 1.359.2.12 by miles, Fri Oct 22 10:13:35 2004 UTC revision 1.359.2.13 by miles, Wed Oct 27 06:03:07 2004 UTC
# Line 2858  It returns the number of characters chan Line 2858  It returns the number of characters chan
2858    
2859    pos = XINT (start);    pos = XINT (start);
2860    pos_byte = CHAR_TO_BYTE (pos);    pos_byte = CHAR_TO_BYTE (pos);
2861    end_pos = XINT (end);    end_pos = XINT (end);
2862    modify_region (current_buffer, pos, end_pos);    modify_region (current_buffer, pos, end_pos);
2863    
2864    cnt = 0;    cnt = 0;
# Line 3387  usage: (format STRING &rest OBJECTS)  */ Line 3387  usage: (format STRING &rest OBJECTS)  */
3387    /* discarded[I] is 1 if byte I of the format    /* discarded[I] is 1 if byte I of the format
3388       string was not copied into the output.       string was not copied into the output.
3389       It is 2 if byte I was not the first byte of its character.  */       It is 2 if byte I was not the first byte of its character.  */
3390    char *discarded;    char *discarded = 0;
3391    
3392    /* Each element records, for one argument,    /* Each element records, for one argument,
3393       the start and end bytepos in the output string,       the start and end bytepos in the output string,
# Line 3438  usage: (format STRING &rest OBJECTS)  */ Line 3438  usage: (format STRING &rest OBJECTS)  */
3438    {    {
3439      int nbytes = (nargs+1) * sizeof *info;      int nbytes = (nargs+1) * sizeof *info;
3440      int i;      int i;
3441      info = (struct info *) alloca (nbytes);      if (!info)
3442          info = (struct info *) alloca (nbytes);
3443      bzero (info, nbytes);      bzero (info, nbytes);
3444      for (i = 0; i <= nargs; i++)      for (i = 0; i <= nargs; i++)
3445        info[i].start = -1;        info[i].start = -1;
3446      discarded = (char *) alloca (SBYTES (args[0]));      if (!discarded)
3447          SAFE_ALLOCA (discarded, char *, SBYTES (args[0]));
3448      bzero (discarded, SBYTES (args[0]));      bzero (discarded, SBYTES (args[0]));
3449    }    }
3450    
# Line 3803  usage: (format STRING &rest OBJECTS)  */ Line 3805  usage: (format STRING &rest OBJECTS)  */
3805    val = make_specified_string (buf, nchars, p - buf, multibyte);    val = make_specified_string (buf, nchars, p - buf, multibyte);
3806    
3807    /* If we allocated BUF with malloc, free it too.  */    /* If we allocated BUF with malloc, free it too.  */
3808    SAFE_FREE (total);    SAFE_FREE ();
3809    
3810    /* If the format string has text properties, or any of the string    /* If the format string has text properties, or any of the string
3811       arguments has text properties, set up text properties of the       arguments has text properties, set up text properties of the
# Line 4187  Transposing beyond buffer boundaries is Line 4189  Transposing beyond buffer boundaries is
4189            bcopy (start2_addr, temp, len2_byte);            bcopy (start2_addr, temp, len2_byte);
4190            bcopy (start1_addr, start1_addr + len2_byte, len1_byte);            bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
4191            bcopy (temp, start1_addr, len2_byte);            bcopy (temp, start1_addr, len2_byte);
4192            SAFE_FREE (len2_byte);            SAFE_FREE ();
4193          }          }
4194        else        else
4195          /* First region not smaller than second.  */          /* First region not smaller than second.  */
# Line 4200  Transposing beyond buffer boundaries is Line 4202  Transposing beyond buffer boundaries is
4202            bcopy (start1_addr, temp, len1_byte);            bcopy (start1_addr, temp, len1_byte);
4203            bcopy (start2_addr, start1_addr, len2_byte);            bcopy (start2_addr, start1_addr, len2_byte);
4204            bcopy (temp, start1_addr + len2_byte, len1_byte);            bcopy (temp, start1_addr + len2_byte, len1_byte);
4205            SAFE_FREE (len1_byte);            SAFE_FREE ();
4206          }          }
4207        graft_intervals_into_buffer (tmp_interval1, start1 + len2,        graft_intervals_into_buffer (tmp_interval1, start1 + len2,
4208                                     len1, current_buffer, 0);                                     len1, current_buffer, 0);
# Line 4236  Transposing beyond buffer boundaries is Line 4238  Transposing beyond buffer boundaries is
4238            bcopy (start1_addr, temp, len1_byte);            bcopy (start1_addr, temp, len1_byte);
4239            bcopy (start2_addr, start1_addr, len2_byte);            bcopy (start2_addr, start1_addr, len2_byte);
4240            bcopy (temp, start2_addr, len1_byte);            bcopy (temp, start2_addr, len1_byte);
4241            SAFE_FREE (len1_byte);            SAFE_FREE ();
4242    
4243            graft_intervals_into_buffer (tmp_interval1, start2,            graft_intervals_into_buffer (tmp_interval1, start2,
4244                                         len1, current_buffer, 0);                                         len1, current_buffer, 0);
# Line 4265  Transposing beyond buffer boundaries is Line 4267  Transposing beyond buffer boundaries is
4267            bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);            bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
4268            safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);            safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4269            bcopy (temp, start1_addr, len2_byte);            bcopy (temp, start1_addr, len2_byte);
4270            SAFE_FREE (len2_byte);            SAFE_FREE ();
4271    
4272            graft_intervals_into_buffer (tmp_interval1, end2 - len1,            graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4273                                         len1, current_buffer, 0);                                         len1, current_buffer, 0);
# Line 4296  Transposing beyond buffer boundaries is Line 4298  Transposing beyond buffer boundaries is
4298            bcopy (start2_addr, start1_addr, len2_byte);            bcopy (start2_addr, start1_addr, len2_byte);
4299            bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);            bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4300            bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);            bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
4301            SAFE_FREE (len1_byte);            SAFE_FREE ();
4302    
4303            graft_intervals_into_buffer (tmp_interval1, end2 - len1,            graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4304                                         len1, current_buffer, 0);                                         len1, current_buffer, 0);

Legend:
Removed from v.1.359.2.12  
changed lines
  Added in v.1.359.2.13

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