[xiph-commits] r12790 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Mar 21 23:47:31 PDT 2007


Author: xiphmont
Date: 2007-03-21 23:47:29 -0700 (Wed, 21 Mar 2007)
New Revision: 12790

Modified:
   trunk/sushivision/example_spirograph.c
   trunk/sushivision/panel-1d.c
   trunk/sushivision/panel-2d.c
   trunk/sushivision/sushivision.h
Log:
Fixes to a few return value oversights



Modified: trunk/sushivision/example_spirograph.c
===================================================================
--- trunk/sushivision/example_spirograph.c	2007-03-21 20:14:03 UTC (rev 12789)
+++ trunk/sushivision/example_spirograph.c	2007-03-22 06:47:29 UTC (rev 12790)
@@ -97,8 +97,9 @@
 			    (int []){0,1},
 			    "XY", 0);
   
-  sv_scale_t *axis = sv_scale_new(NULL,3,(double []){-MAX_TEETH*3,0,MAX_TEETH*3},NULL,0);
-  
+  //sv_scale_t *axis = sv_scale_new(NULL,3,(double []){-MAX_TEETH*3,0,MAX_TEETH*3},NULL,0);
+  sv_scale_t *axis = svm_scale(NULL,3,-MAX_TEETH*3,0,MAX_TEETH*3);
+
   sv_panel_new_xy(s,0,"spirograph (TM)",
 		  axis,axis,
 		  (sv_obj_t *[]){o0,o1,NULL},

Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-03-21 20:14:03 UTC (rev 12789)
+++ trunk/sushivision/panel-1d.c	2007-03-22 06:47:29 UTC (rev 12790)
@@ -1555,7 +1555,7 @@
   p->private->def_oversample_n = p->private->oversample_n = 1;
   p->private->def_oversample_d = p->private->oversample_d = 8;
   
-  return 0;
+  return p;
 }
 
 int sv_panel_link_1d (sv_panel_t *p,
@@ -1564,20 +1564,20 @@
 
 
   if(!p){
-    fprintf(stderr,"Cannot link to a NULL 1d panel\n");
+    fprintf(stderr,"Cannot link a NULL 1d panel\n");
     errno = -EINVAL;
     return errno;
   }
 
-  if(panel_2d->type != SV_PANEL_2D){
-    fprintf(stderr,"Panel %d (\"%s\"): Can only link to a 2d paenl\n",
+  if(!panel_2d){
+    fprintf(stderr,"Panel %d (\"%s\"): Attempted to link NULL panel\n",
 	    p->number,p->name);
     errno = -EINVAL;
     return errno;
   }
 
-  if(!panel_2d){
-    fprintf(stderr,"Panel %d (\"%s\"): Attempted to link NULL panel\n",
+  if(panel_2d->type != SV_PANEL_2D){
+    fprintf(stderr,"Panel %d (\"%s\"): Can only link to a 2d paenl\n",
 	    p->number,p->name);
     errno = -EINVAL;
     return errno;

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2007-03-21 20:14:03 UTC (rev 12789)
+++ trunk/sushivision/panel-2d.c	2007-03-22 06:47:29 UTC (rev 12790)
@@ -2052,5 +2052,5 @@
   p2->y_planetodo = calloc(p2->y_obj_num,sizeof(*p2->y_planetodo));
   p2->y_planes = calloc(p2->y_obj_num,sizeof(*p2->y_planes));
 
-  return 0;
+  return p;
 }

Modified: trunk/sushivision/sushivision.h
===================================================================
--- trunk/sushivision/sushivision.h	2007-03-21 20:14:03 UTC (rev 12789)
+++ trunk/sushivision/sushivision.h	2007-03-22 06:47:29 UTC (rev 12790)
@@ -85,6 +85,8 @@
 				 char **scalelabel_list,
 				 unsigned flags);
 
+#define svm_scale(legend,vals,...) sv_scale_new(legend,vals,(double []){__VA_ARGS__},NULL,0)
+
 sv_scale_t       *sv_scale_copy (sv_scale_t *s);
 
 void              sv_scale_free (sv_scale_t *s);



More information about the commits mailing list