[GRASS-SVN] r47039 - grass/trunk/lib/vector/diglib

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 7 04:55:49 EDT 2011


Author: mmetz
Date: 2011-07-07 01:55:49 -0700 (Thu, 07 Jul 2011)
New Revision: 47039

Modified:
   grass/trunk/lib/vector/diglib/cindex_rw.c
   grass/trunk/lib/vector/diglib/head.c
   grass/trunk/lib/vector/diglib/list.c
   grass/trunk/lib/vector/diglib/plus_area.c
   grass/trunk/lib/vector/diglib/plus_line.c
   grass/trunk/lib/vector/diglib/plus_struct.c
   grass/trunk/lib/vector/diglib/spindex.c
Log:
avoid compiler warnings

Modified: grass/trunk/lib/vector/diglib/cindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/cindex_rw.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/cindex_rw.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -37,7 +37,7 @@
     buf[2] = GV_CIDX_EARLIEST_MAJOR;
     buf[3] = GV_CIDX_EARLIEST_MINOR;
     buf[4] = plus->cidx_port.byte_order;
-    if (0 >= dig__fwrite_port_C(buf, 5, fp))
+    if (0 >= dig__fwrite_port_C((const char *)buf, 5, fp))
 	return (-1);
 
     /* get required offset size */
@@ -125,7 +125,7 @@
     dig_rewind(fp);
 
     /* bytes 1 - 5 */
-    if (0 >= dig__fread_port_C(buf, 5, fp))
+    if (0 >= dig__fread_port_C((char *)buf, 5, fp))
 	return (-1);
     plus->cidx_Version_Major = buf[0];
     plus->cidx_Version_Minor = buf[1];

Modified: grass/trunk/lib/vector/diglib/head.c
===================================================================
--- grass/trunk/lib/vector/diglib/head.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/head.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -36,7 +36,7 @@
     buf[3] = Map->head.Back_Minor;
 
     buf[4] = Map->head.port.byte_order;
-    if (0 >= dig__fwrite_port_C(buf, 5, &(Map->dig_fp)))
+    if (0 >= dig__fwrite_port_C((char *)buf, 5, &(Map->dig_fp)))
 	return (0);
 
     /* increase header size for new vectors, already set in V1_open_new_nat() */
@@ -48,7 +48,7 @@
 
     /* byte 10 : dimension 2D or 3D */
     buf[0] = Map->head.with_z;
-    if (0 >= dig__fwrite_port_C(buf, 1, &(Map->dig_fp)))
+    if (0 >= dig__fwrite_port_C((char *)buf, 1, &(Map->dig_fp)))
 	return (0);
 
     /* bytes 11 - 18 : size of coordinate file */
@@ -87,7 +87,7 @@
     dig_fseek(&(Map->dig_fp), 0L, 0);
 
     /* bytes 1 - 5 */
-    if (0 >= dig__fread_port_C(buf, 5, &(Map->dig_fp)))
+    if (0 >= dig__fread_port_C((char *)buf, 5, &(Map->dig_fp)))
 	return (0);
     Map->head.Version_Major = buf[0];
     Map->head.Version_Minor = buf[1];
@@ -132,7 +132,7 @@
     G_debug(2, "  header size %ld", Map->head.head_size);
 
     /* byte 10 : dimension 2D or 3D */
-    if (0 >= dig__fread_port_C(buf, 1, &(Map->dig_fp)))
+    if (0 >= dig__fread_port_C((char *)buf, 1, &(Map->dig_fp)))
 	return (0);
     Map->head.with_z = buf[0];
     G_debug(2, "  with_z %d", Map->head.with_z);

Modified: grass/trunk/lib/vector/diglib/list.c
===================================================================
--- grass/trunk/lib/vector/diglib/list.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/list.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -76,7 +76,7 @@
 
 	    if (p == NULL)
 		return 0;
-	    list->box = (int *)p;
+	    list->box = (struct bound_box *)p;
 	}
 
 	list->alloc_values = list->n_values + 1000;

Modified: grass/trunk/lib/vector/diglib/plus_area.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_area.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/plus_area.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -583,7 +583,7 @@
 {
     int next, prev;
     float angle1, angle2;
-    plus_t node;
+    plus_t node = 0;
     struct P_line *Line;
 
     G_debug(3, "dig_node_angle_check: line = %d, type = %d", line, type);

Modified: grass/trunk/lib/vector/diglib/plus_line.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_line.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/plus_line.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -208,7 +208,7 @@
 int dig_del_line(struct Plus_head *plus, int line, double x, double y, double z)
 {
     int i, mv;
-    plus_t N1, N2;
+    plus_t N1 = 0, N2 = 0;
     struct P_line *Line;
     struct P_node *Node;
 

Modified: grass/trunk/lib/vector/diglib/plus_struct.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_struct.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/plus_struct.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -196,7 +196,7 @@
 	    return -1;
     }
     /* boundaries */
-    if (ptr->type & GV_BOUNDARY) {
+    else if (ptr->type & GV_BOUNDARY) {
 	struct P_topo_b *topo = (struct P_topo_b *)ptr->topo;
 
 	if (0 >= dig__fread_port_P(&(topo->N1), 1, fp))
@@ -494,7 +494,7 @@
     dig_rewind(fp);
 
     /* bytes 1 - 5 */
-    if (0 >= dig__fread_port_C(buf, 5, fp))
+    if (0 >= dig__fread_port_C((char *)buf, 5, fp))
 	return (-1);
     ptr->Version_Major = buf[0];
     ptr->Version_Minor = buf[1];
@@ -555,7 +555,7 @@
     G_debug(1, "topo off_t size = %d", ptr->off_t_size);
 
     /* byte 10 : dimension 2D or 3D */
-    if (0 >= dig__fread_port_C(buf, 1, fp))
+    if (0 >= dig__fread_port_C((char *)buf, 1, fp))
 	return (-1);
     ptr->with_z = buf[0];
     G_debug(2, "  with_z %d", ptr->with_z);
@@ -645,7 +645,7 @@
     buf[2] = GV_TOPO_EARLIEST_MAJOR;
     buf[3] = GV_TOPO_EARLIEST_MINOR;
     buf[4] = ptr->port.byte_order;
-    if (0 >= dig__fwrite_port_C(buf, 5, fp))
+    if (0 >= dig__fwrite_port_C((char *)buf, 5, fp))
 	return (-1);
 
     /* determine required offset size from coor file size */
@@ -670,7 +670,7 @@
 
     /* byte 10 : dimension 2D or 3D */
     buf[0] = ptr->with_z;
-    if (0 >= dig__fwrite_port_C(buf, 1, fp))
+    if (0 >= dig__fwrite_port_C((char *)buf, 1, fp))
 	return (0);
 
     /* bytes 11 - 58 : bound box */

Modified: grass/trunk/lib/vector/diglib/spindex.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex.c	2011-07-07 08:55:16 UTC (rev 47038)
+++ grass/trunk/lib/vector/diglib/spindex.c	2011-07-07 08:55:49 UTC (rev 47039)
@@ -668,7 +668,7 @@
    \return number of lines found
    \return 0 not found
  */
-int dig_find_line_box(const struct Plus_head *Plus, struct boxlist *list)
+int dig_find_line_box(struct Plus_head *Plus, struct boxlist *list)
 {
     struct RTree_Rect rect;
     int ret;
@@ -736,7 +736,7 @@
    \return number of areas found
    \return 0 not found
  */
-int dig_find_area_box(const struct Plus_head *Plus, struct boxlist *list)
+int dig_find_area_box(struct Plus_head *Plus, struct boxlist *list)
 {
     struct RTree_Rect rect;
     int ret;
@@ -804,7 +804,7 @@
    \return number of isles found
    \return 0 not found
  */
-int dig_find_isle_box(const struct Plus_head *Plus, struct boxlist *list)
+int dig_find_isle_box(struct Plus_head *Plus, struct boxlist *list)
 {
     struct RTree_Rect rect;
     int ret;



More information about the grass-commit mailing list