[GRASS-SVN] r52049 - grass/trunk/lib/ogsf
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 12 06:59:46 PDT 2012
Author: mmetz
Date: 2012-06-12 06:59:45 -0700 (Tue, 12 Jun 2012)
New Revision: 52049
Modified:
grass/trunk/lib/ogsf/GS2.c
grass/trunk/lib/ogsf/gs.c
grass/trunk/lib/ogsf/gsd_img_tif.c
grass/trunk/lib/ogsf/gsd_wire.c
grass/trunk/lib/ogsf/gsds.c
Log:
ogsf lib: fix return types and var types
Modified: grass/trunk/lib/ogsf/GS2.c
===================================================================
--- grass/trunk/lib/ogsf/GS2.c 2012-06-12 13:20:39 UTC (rev 52048)
+++ grass/trunk/lib/ogsf/GS2.c 2012-06-12 13:59:45 UTC (rev 52049)
@@ -1730,13 +1730,13 @@
atty = ATTY_INT;
}
- if (0 > gs_malloc_att_buff(gs, att, ATTY_NULL)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_NULL)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
switch (atty) {
case ATTY_MASK:
- if (0 > gs_malloc_att_buff(gs, att, ATTY_MASK)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_MASK)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
@@ -1744,7 +1744,7 @@
break;
case ATTY_CHAR:
- if (0 > gs_malloc_att_buff(gs, att, ATTY_CHAR)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_CHAR)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
@@ -1753,7 +1753,7 @@
break;
case ATTY_SHORT:
- if (0 > gs_malloc_att_buff(gs, att, ATTY_SHORT)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_SHORT)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
@@ -1761,7 +1761,7 @@
tbuff->nm, &has_null);
break;
case ATTY_FLOAT:
- if (0 > gs_malloc_att_buff(gs, att, ATTY_FLOAT)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_FLOAT)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
@@ -1771,7 +1771,7 @@
break;
case ATTY_INT:
default:
- if (0 > gs_malloc_att_buff(gs, att, ATTY_INT)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_INT)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
@@ -1819,7 +1819,7 @@
}
else if (ATTY_FLOAT == atty) {
if (!reuse) {
- if (0 > gs_malloc_att_buff(gs, att, ATTY_INT)) {
+ if (0 == gs_malloc_att_buff(gs, att, ATTY_INT)) {
G_fatal_error(_("GS_load_att_map(): Out of memory. Unable to load map"));
}
Modified: grass/trunk/lib/ogsf/gs.c
===================================================================
--- grass/trunk/lib/ogsf/gs.c 2012-06-12 13:20:39 UTC (rev 52048)
+++ grass/trunk/lib/ogsf/gs.c 2012-06-12 13:59:45 UTC (rev 52049)
@@ -731,7 +731,7 @@
}
}
- return (-1);
+ return 0;
}
/*!
Modified: grass/trunk/lib/ogsf/gsd_img_tif.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_img_tif.c 2012-06-12 13:20:39 UTC (rev 52048)
+++ grass/trunk/lib/ogsf/gsd_img_tif.c 2012-06-12 13:59:45 UTC (rev 52049)
@@ -51,7 +51,7 @@
int GS_write_tif(const char *name)
{
TIFF *out;
- int y, x;
+ unsigned int y, x;
unsigned int xsize, ysize;
int mapsize, linebytes;
unsigned char *buf, *tmpptr;
@@ -96,7 +96,7 @@
/* Done with Header Info */
for (y = 0; y < ysize; y++) {
- int yy = ysize - y - 1;
+ unsigned int yy = ysize - y - 1;
tmpptr = buf;
Modified: grass/trunk/lib/ogsf/gsd_wire.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_wire.c 2012-06-12 13:20:39 UTC (rev 52048)
+++ grass/trunk/lib/ogsf/gsd_wire.c 2012-06-12 13:59:45 UTC (rev 52049)
@@ -485,6 +485,7 @@
*/
check_color = 1;
+ curcolor = 0;
coloratt = &(surf->att[ATT_COLOR]);
col_src = surf->att[ATT_COLOR].att_src;
@@ -690,6 +691,7 @@
/* will need to check for color source of FUNC_ATT & NOTSET_ATT,
or else use more general and inefficient gets */
check_color = 1;
+ curcolor = 0;
coloratt = &(surf->att[ATT_COLOR]);
col_src = surf->att[ATT_COLOR].att_src;
Modified: grass/trunk/lib/ogsf/gsds.c
===================================================================
--- grass/trunk/lib/ogsf/gsds.c 2012-06-12 13:20:39 UTC (rev 52048)
+++ grass/trunk/lib/ogsf/gsds.c 2012-06-12 13:59:45 UTC (rev 52049)
@@ -502,11 +502,11 @@
case ATTY_NULL:
if (ndims != 2) {
/* higher dimension bitmaps not supported */
- return (-1);
+ return 0;
}
if (NULL == (ds->databuff.nm = BM_create(dims[1], dims[0]))) {
- return (-1);
+ return 0;
}
siz = BM_get_map_size(ds->databuff.nm);
@@ -520,7 +520,7 @@
}
if (NULL == (ds->databuff.bm = BM_create(dims[1], dims[0]))) {
- return (-1);
+ return 0;
}
siz = BM_get_map_size(ds->databuff.bm);
@@ -533,11 +533,11 @@
if (siz) {
if (NULL ==
(ds->databuff.cb = (unsigned char *)G_malloc(siz))) {
- return (-1);
+ return 0;
}
}
else {
- return (-1);
+ return 0;
}
break;
@@ -547,11 +547,11 @@
if (siz) {
if (NULL == (ds->databuff.sb = (short *)G_malloc(siz))) {
- return (-1);
+ return 0;
}
}
else {
- return (-1);
+ return 0;
}
break;
@@ -561,11 +561,11 @@
if (siz) {
if (NULL == (ds->databuff.ib = (int *)G_malloc(siz))) {
- return (-1);
+ return 0;
}
}
else {
- return (-1);
+ return 0;
}
break;
@@ -575,17 +575,17 @@
if (siz) {
if (NULL == (ds->databuff.fb = (float *)G_malloc(siz))) {
- return (-1);
+ return 0;
}
}
else {
- return (-1);
+ return 0;
}
break;
default:
- return (-1);
+ return 0;
}
ds->changed = 0; /* starting with clean slate */
@@ -601,7 +601,7 @@
return (siz);
}
- return (-1);
+ return 0;
}
/*!
More information about the grass-commit
mailing list