[LON-CAPA-cvs] cvs: loncom /homework/caparesponse capa.i

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 22 Mar 2004 01:43:28 -0000


albertel		Sun Mar 21 20:43:28 2004 EDT

  Modified files:              
    /loncom/homework/caparesponse	capa.i 
  Log:
  - that's right in C you need/should declare all variables at the beginning of the function
  
  
Index: loncom/homework/caparesponse/capa.i
diff -u loncom/homework/caparesponse/capa.i:1.4 loncom/homework/caparesponse/capa.i:1.5
--- loncom/homework/caparesponse/capa.i:1.4	Fri Mar 12 19:23:27 2004
+++ loncom/homework/caparesponse/capa.i	Sun Mar 21 20:43:28 2004
@@ -5,6 +5,7 @@
 
 %typemap(perl5,in) char** reterror (char* cvalue) {
   SV* tempsv;
+  int len;
   if (!SvROK($source)) {
     croak("expected a reference\n");
   }
@@ -12,7 +13,6 @@
   if ((!SvPOK(tempsv))) {
     croak("expected a double reference\n");
   }
-  int len;
   cvalue = SvPV(tempsv,len);
   $target = &cvalue;
 }