develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34647 - trunk/compilers/pirc/new

From:
kjs
Date:
December 30, 2008 06:08
Subject:
[svn:parrot] r34647 - trunk/compilers/pirc/new
Message ID:
20081230140830.E7B03CB9FA@x12.develooper.com
Author: kjs
Date: Tue Dec 30 06:08:30 2008
New Revision: 34647

Modified:
   trunk/compilers/pirc/new/pircompunit.c

Log:
[pirc] rename some stuff, so I can understand what's going on. 

Modified: trunk/compilers/pirc/new/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.c	(original)
+++ trunk/compilers/pirc/new/pircompunit.c	Tue Dec 30 06:08:30 2008
@@ -740,10 +740,10 @@
 /*
 
 =item C<argument *
-add_arg(argument *arg1, argument * const arg2)>
+add_arg(argument *last, argument * const newarg)>
 
-Add argument C<arg2> at the end of the list pointed to by C<arg1>.
-The list is circular linked, and C<arg1> points to the last item.
+Add argument C<newarg> at the end of the list pointed to by C<last>.
+The list is circular linked, and C<last> points to the last item.
 Being circular linked, C<<arg1->next>> points to the first item.
 
 After adding the element, the I<root> pointer (that points to the last
@@ -755,15 +755,15 @@
 PARROT_IGNORABLE_RESULT
 PARROT_CANNOT_RETURN_NULL
 argument *
-add_arg(argument *arg1, argument * const arg2) {
-    PARROT_ASSERT(arg1);
-    PARROT_ASSERT(arg2);
-
-    arg2->next = arg1->next; /* arg2->next is last one, must point to first item */
-    arg1->next = arg2;
-    arg1       = arg2;
+add_arg(argument *last, argument * const newarg) {
+    PARROT_ASSERT(last);
+    PARROT_ASSERT(newarg);
+
+    newarg->next = last->next; /* arg2->next is last one, must point to first item */
+    last->next   = newarg;
+    last         = newarg;
 
-    return arg1;
+    return last;
 }
 
 /*



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About