[Gd-chatter] r11363 - in trunk/libraries: monday/examples/calc monday/lib/language/simple-parser monday/lib/program-representation/cpr network/koala/sources/koala packetizer

agent at gwydiondylan.org agent at gwydiondylan.org
Mon May 21 03:57:59 CEST 2007


Author: agent
Date: Mon May 21 03:57:56 2007
New Revision: 11363

Modified:
   trunk/libraries/monday/examples/calc/calc.dylan
   trunk/libraries/monday/lib/language/simple-parser/simple-lexical-scanner.dylan
   trunk/libraries/monday/lib/program-representation/cpr/cpr-internals.dylan
   trunk/libraries/monday/lib/program-representation/cpr/interned-string.dylan
   trunk/libraries/network/koala/sources/koala/substring.dylan
   trunk/libraries/packetizer/leaf-frames.dylan
   trunk/libraries/packetizer/packetizer.dylan
Log:
Bug: 7352
Rationalized copy-bytes argument order.



Modified: trunk/libraries/monday/examples/calc/calc.dylan
==============================================================================
--- trunk/libraries/monday/examples/calc/calc.dylan	(original)
+++ trunk/libraries/monday/examples/calc/calc.dylan	Mon May 21 03:57:56 2007
@@ -9,7 +9,7 @@
      token-end :: <integer>)
  => (result :: <byte-string>);
   let result = make(<byte-string>, size: token-end - token-start);
-  copy-bytes(token-string, token-start, result, 0, token-end - token-start);
+  copy-bytes(result, 0, token-string, token-start, token-end - token-start);
   result
 end;
 
@@ -185,7 +185,7 @@
   iterate buf-loop (buf :: false-or(<buffer>) = buf)
     if (buf)
       let text-size :: <integer> = buf.buffer-end - buf.buffer-next;
-      copy-bytes(buf, buf.buffer-next, text, 0, text-size);
+      copy-bytes(text, 0, buf, buf.buffer-next, text-size);
 
       scan-tokens(scanner, simple-parser-consume-token, parser, text,
                   end: text-size, partial?: #t);

Modified: trunk/libraries/monday/lib/language/simple-parser/simple-lexical-scanner.dylan
==============================================================================
--- trunk/libraries/monday/lib/language/simple-parser/simple-lexical-scanner.dylan	(original)
+++ trunk/libraries/monday/lib/language/simple-parser/simple-lexical-scanner.dylan	Mon May 21 03:57:56 2007
@@ -133,10 +133,10 @@
   let new-saved-size = saved-size + (text-end - text-start);
   let new-saved-text :: <byte-string>
     = make(<byte-string>, size: new-saved-size);
-  copy-bytes(scanner.scanner-saved-text, saved-size + token-start,
-             new-saved-text, 0, saved-size);
-  copy-bytes(text, text-start,
-             new-saved-text, saved-size, text-end - text-start);
+  copy-bytes(new-saved-text, 0, 
+             scanner.scanner-saved-text, saved-size + token-start, saved-size);
+  copy-bytes(new-saved-text, saved-size, 
+             text, text-start, text-end - text-start);
   scanner.scanner-saved-text := new-saved-text;
   scanner.scanner-source-position
     := scanner.scanner-source-position + new-saved-size;
@@ -144,7 +144,7 @@
   let new-saved-size = text-end - token-start;
   let new-saved-text :: <byte-string>
     = make(<byte-string>, size: new-saved-size);
-  copy-bytes(text, token-start, new-saved-text, 0, text-end - token-start);
+  copy-bytes(new-saved-text, 0, text, token-start, text-end - token-start);
   scanner.scanner-saved-text := new-saved-text;
   scanner.scanner-source-position
     := scanner.scanner-source-position + new-saved-size;
@@ -218,8 +218,8 @@
         let accept-text-size = saved-size + (accepting-index - text-start);
         let accept-text :: <byte-string>
           = make(<byte-string>, size: accept-text-size);
-        copy-bytes(scanner.scanner-saved-text, 0, accept-text, 0, saved-size);
-        copy-bytes(text, text-start, accept-text, saved-size,
+        copy-bytes(accept-text, 0, scanner.scanner-saved-text, 0, saved-size);
+        copy-bytes(accept-text, saved-size, text, text-start, 
                    accept-text-size - saved-size);
         scanner.scanner-saved-text := "";
         values(token-semantic-value-function(accept-text, 0, accept-text-size),

Modified: trunk/libraries/monday/lib/program-representation/cpr/cpr-internals.dylan
==============================================================================
--- trunk/libraries/monday/lib/program-representation/cpr/cpr-internals.dylan	(original)
+++ trunk/libraries/monday/lib/program-representation/cpr/cpr-internals.dylan	Mon May 21 03:57:56 2007
@@ -576,7 +576,7 @@
   iterate buf-loop (buf :: false-or(<buffer>) = buf)
     if (buf)
       let text-size :: <integer> = buf.buffer-end - buf.buffer-next;
-      copy-bytes(buf, buf.buffer-next, text, 0, text-size);
+      copy-bytes(text, 0, buf, buf.buffer-next, text-size);
       
 iterate char-loop (start :: <buffer-index> = 0,
                    i :: <buffer-index> = 0)
@@ -660,7 +660,7 @@
      token-end :: <integer>)
  => (result :: <byte-string>);
   let result = make(<byte-string>, size: token-end - token-start);
-  copy-bytes(token-string, token-start, result, 0, token-end - token-start);
+  copy-bytes(result, 0, token-string, token-start, token-end - token-start);
   result
 end;
             

Modified: trunk/libraries/monday/lib/program-representation/cpr/interned-string.dylan
==============================================================================
--- trunk/libraries/monday/lib/program-representation/cpr/interned-string.dylan	(original)
+++ trunk/libraries/monday/lib/program-representation/cpr/interned-string.dylan	Mon May 21 03:57:56 2007
@@ -88,7 +88,7 @@
   bucket-value := modulo(hash-value, *interned-string-buckets*.size);
 end if;
 let new-string = make(<byte-string>, size: _end - start);
-copy-bytes(name, start, new-string, 0, _end - start);
+copy-bytes(new-string, 0, name, start, _end - start);
 let new-entry = make(<interned-string-entry>,
                      interned-string: new-string,
                      hash: hash-value,

Modified: trunk/libraries/network/koala/sources/koala/substring.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/substring.dylan	(original)
+++ trunk/libraries/network/koala/sources/koala/substring.dylan	Mon May 21 03:57:56 2007
@@ -35,8 +35,8 @@
 
 /*
 define open method copy-bytes
-    (src :: <substring>, src-start :: <integer>, dst :: <byte-string>,
-     dst-start :: <integer>, n :: <integer>)
+    (dst :: <byte-string>, dst-start :: <integer>, 
+     src :: <substring>, src-start :: <integer>, n :: <integer>)
  => ()
   for (i :: <integer> from 0 below n)
     dst[dst-start + i] := src[src-start + i]

Modified: trunk/libraries/packetizer/leaf-frames.dylan
==============================================================================
--- trunk/libraries/packetizer/leaf-frames.dylan	(original)
+++ trunk/libraries/packetizer/leaf-frames.dylan	Mon May 21 03:57:56 2007
@@ -208,7 +208,7 @@
 
 define method assemble-frame-into (frame :: <fixed-size-byte-vector-frame>,
                                    packet :: <stretchy-byte-vector-subsequence>) => (res :: <integer>)
-  copy-bytes(frame.data, 0, packet, 0, byte-offset(frame-size(frame)));
+  copy-bytes(packet, 0, frame.data, 0, byte-offset(frame-size(frame)));
   frame-size(frame)
 end;
 
@@ -426,7 +426,7 @@
 
 define method assemble-frame-into (frame :: <variable-size-byte-vector>,
                                    packet :: <stretchy-byte-vector-subsequence>) => (res :: <integer>)
-  copy-bytes(frame.data, 0, packet, 0, frame.data.size);
+  copy-bytes(packet, 0, frame.data, 0, frame.data.size);
   frame-size(frame)
 end;
 
@@ -436,7 +436,7 @@
 define method as (class == <string>, frame :: <externally-delimited-string>)
  => (res :: <string>)
   let res = make(<string>, size: byte-offset(frame-size(frame)));
-  copy-bytes(frame.data, 0, res, 0, byte-offset(frame-size(frame)));
+  copy-bytes(res, 0, frame.data, 0, byte-offset(frame-size(frame)));
   res;
 end;
 
@@ -444,7 +444,7 @@
  => (res :: <externally-delimited-string>)
   let res = make(<externally-delimited-string>,
                  data: make(<byte-sequence>, capacity: string.size));
-  copy-bytes(string, 0, res.data, 0, string.size);
+  copy-bytes(res.data, 0, string, 0, string.size);
   res;
 end;
 

Modified: trunk/libraries/packetizer/packetizer.dylan
==============================================================================
--- trunk/libraries/packetizer/packetizer.dylan	(original)
+++ trunk/libraries/packetizer/packetizer.dylan	Mon May 21 03:57:56 2007
@@ -513,7 +513,7 @@
 
 define method assemble-frame-into (frame :: <unparsed-container-frame>,
                                    to-packet :: <stretchy-vector-subsequence>) => (res :: <integer>)
-  copy-bytes(frame.packet, 0, to-packet, 0, frame.packet.size);
+  copy-bytes(to-packet, 0, frame.packet, 0, frame.packet.size);
   frame.packet.size * 8;
 end;
 



More information about the chatter mailing list