[GRASS5] PATCH: Remove Tape_Info and related funcs

Hamish hamish_nospam at yahoo.com
Wed Mar 30 01:28:45 EST 2005


> The attached patches will remove the legacy Tape_Info struct and
> associated functions from lib/imagery.
> 
> After applied, the files advance.c, band_io.c and tape_info.c can be
> removed.


3 comments:

a) what functionality is lost? (which modules would be removed from the
to-be-ported list?) Can anyone comment on Tape storage functions used in
historical versions of GRASS?

b) It is nice to keep cosmetic / simple fixes separate from functional
changes in the diff files. This makes understanding and tracking 
fundamental changes in the CVS easier (also makes it easier to back them
out later if needed). On the other side, the small changes can be
applied quickly without much debate and less review.

c) I take it this fixes a "reached the end of non-void fn" warning.
 i)  this fn can probably be replaced by G_percent() and removed.
 ii) an exit code of 0 should be used, not 1. The UNIX convention is
     zero means success, else means failed. (many ways to fail)

Index: lib/imagery/percent.c
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/imagery/percent.c,v
retrieving revision 2.0
diff -u -u -r2.0 percent.c
--- lib/imagery/percent.c	9 Nov 2004 12:27:57 -0000	2.0
+++ lib/imagery/percent.c	28 Mar 2005 00:46:37 -0000
@@ -24,7 +24,7 @@
     register int x;
 
     x = n*100/d ;
-    if (x % s) return;
+    if (x % s) return 1;
     if (n <= 0 || n >= d || x != prev)
     {
 	prev = x;
@@ -36,4 +36,6 @@
 	fprintf (stdout,"\n");
 	prev = -1;
     }
+
+    return 1;
 }



thanks for the code,
Hamish




More information about the grass-dev mailing list