cvsuser     02/01/01 12:23:46

  Modified:    docs     Makefile
               encodings singlebyte.c utf16.c utf32.c utf8.c
               include/parrot encoding.h
  Log:
  Got rid of unneeded tmp var and eliminated const from encode prototype since
  it does make changes to the string.
  
  Courtesy of "David & Lisa Jacobs" <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.4       +2 -2      parrot/docs/Makefile
  
  Index: Makefile
  ===================================================================
  RCS file: /home/perlcvs/parrot/docs/Makefile,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -r1.3 -r1.4
  --- Makefile  2 Dec 2001 04:40:02 -0000       1.3
  +++ Makefile  1 Jan 2002 20:23:46 -0000       1.4
  @@ -1,5 +1,5 @@
  +PERL = /usr/bin/perl
   RM_F=rm -f
  -PERL=perl
   
   all: packfile-c.pod packfile-perl.pod core_ops.pod
   
  
  
  
  1.10      +5 -7      parrot/encodings/singlebyte.c
  
  Index: singlebyte.c
  ===================================================================
  RCS file: /home/perlcvs/parrot/encodings/singlebyte.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- singlebyte.c      1 Jan 2002 18:43:54 -0000       1.9
  +++ singlebyte.c      1 Jan 2002 20:23:46 -0000       1.10
  @@ -1,7 +1,7 @@
   /* singlebyte.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: singlebyte.c,v 1.9 2002/01/01 18:43:54 dan Exp $
  + *     $Id: singlebyte.c,v 1.10 2002/01/01 20:23:46 dan Exp $
    *  Overview:
    *     This defines the single byte encoding routines.
    *  Data Structure and Algorithms:
  @@ -21,13 +21,11 @@
   
   static UINTVAL
   singlebyte_decode (const void *ptr) {
  -    const byte_t *bptr = ptr;
  -
  -    return *bptr;
  +    return *(const byte_t *)ptr;
   }
   
   static void *
  -singlebyte_encode (const void *ptr, UINTVAL c) {
  +singlebyte_encode (void *ptr, UINTVAL c) {
       byte_t *bptr = (byte_t*)ptr;
   
       if (c > 255) {
  @@ -41,14 +39,14 @@
   }
   
   static void *
  -singlebyte_skip_forward (void *ptr, UINTVAL n) {
  +singlebyte_skip_forward (const void *ptr, UINTVAL n) {
       byte_t *bptr = (byte_t*)ptr;
   
       return bptr + n;
   }
   
   static void *
  -singlebyte_skip_backward (void *ptr, UINTVAL n) {
  +singlebyte_skip_backward (const void *ptr, UINTVAL n) {
       byte_t *bptr = (byte_t*)ptr;
   
       return bptr - n;
  
  
  
  1.8       +2 -2      parrot/encodings/utf16.c
  
  Index: utf16.c
  ===================================================================
  RCS file: /home/perlcvs/parrot/encodings/utf16.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- utf16.c   1 Jan 2002 18:43:54 -0000       1.7
  +++ utf16.c   1 Jan 2002 20:23:46 -0000       1.8
  @@ -1,7 +1,7 @@
   /* utf16.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: utf16.c,v 1.7 2002/01/01 18:43:54 dan Exp $
  + *     $Id: utf16.c,v 1.8 2002/01/01 20:23:46 dan Exp $
    *  Overview:
    *     This defines the UTF-16 encoding routines.
    *  Data Structure and Algorithms:
  @@ -57,7 +57,7 @@
   }
   
   static void *
  -utf16_encode (const void *ptr, UINTVAL c) {
  +utf16_encode (void *ptr, UINTVAL c) {
       utf16_t *u16ptr = (utf16_t*)ptr;
   
       if (c > 0x10FFFF || UNICODE_IS_SURROGATE(c)) {
  
  
  
  1.5       +2 -2      parrot/encodings/utf32.c
  
  Index: utf32.c
  ===================================================================
  RCS file: /home/perlcvs/parrot/encodings/utf32.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- utf32.c   1 Jan 2002 18:43:54 -0000       1.4
  +++ utf32.c   1 Jan 2002 20:23:46 -0000       1.5
  @@ -1,7 +1,7 @@
   /* utf32.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: utf32.c,v 1.4 2002/01/01 18:43:54 dan Exp $
  + *     $Id: utf32.c,v 1.5 2002/01/01 20:23:46 dan Exp $
    *  Overview:
    *     This defines the UTF-32 encoding routines.
    *  Data Structure and Algorithms:
  @@ -30,7 +30,7 @@
   }
   
   static void *
  -utf32_encode (const void *ptr, UINTVAL c) {
  +utf32_encode (void *ptr, UINTVAL c) {
       utf32_t *u32ptr = (utf32_t*)ptr;
   
       if (c > 0x10FFFF || UNICODE_IS_SURROGATE(c)) {
  
  
  
  1.9       +2 -2      parrot/encodings/utf8.c
  
  Index: utf8.c
  ===================================================================
  RCS file: /home/perlcvs/parrot/encodings/utf8.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -r1.8 -r1.9
  --- utf8.c    1 Jan 2002 18:43:54 -0000       1.8
  +++ utf8.c    1 Jan 2002 20:23:46 -0000       1.9
  @@ -1,7 +1,7 @@
   /* utf8.c
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: utf8.c,v 1.8 2002/01/01 18:43:54 dan Exp $
  + *     $Id: utf8.c,v 1.9 2002/01/01 20:23:46 dan Exp $
    *  Overview:
    *     This defines the UTF-8 encoding routines.
    *  Data Structure and Algorithms:
  @@ -77,7 +77,7 @@
   }
   
   static void *
  -utf8_encode (const void *ptr, UINTVAL c) {
  +utf8_encode (void *ptr, UINTVAL c) {
       utf8_t *u8ptr = (utf8_t*)ptr;
       UINTVAL len = UNISKIP(c);
       utf8_t *u8end = u8ptr + len - 1;
  
  
  
  1.8       +2 -2      parrot/include/parrot/encoding.h
  
  Index: encoding.h
  ===================================================================
  RCS file: /home/perlcvs/parrot/include/parrot/encoding.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -r1.7 -r1.8
  --- encoding.h        1 Jan 2002 17:09:52 -0000       1.7
  +++ encoding.h        1 Jan 2002 20:23:46 -0000       1.8
  @@ -1,7 +1,7 @@
   /* encoding.h
    *  Copyright: (When this is determined...it will go here)
    *  CVS Info
  - *     $Id: encoding.h,v 1.7 2002/01/01 17:09:52 dan Exp $
  + *     $Id: encoding.h,v 1.8 2002/01/01 20:23:46 dan Exp $
    *  Overview:
    *     This is the api header for the string encoding subsystem
    *  Data Structure and Algorithms:
  @@ -18,7 +18,7 @@
       UINTVAL max_bytes;
       UINTVAL (*characters)(const void *ptr, UINTVAL bytes);
       UINTVAL (*decode)(const void *ptr);
  -    void *(*encode)(const void *ptr, UINTVAL c);
  +    void *(*encode)(void *ptr, UINTVAL c);
       void *(*skip_forward)(const void *ptr, UINTVAL n);
       void *(*skip_backward)(const void *ptr, UINTVAL n);
   } ENCODING;
  
  
  


Reply via email to