[GRASS-SVN] r38737 - grass/branches/releasebranch_6_4/lib/ogsf
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 15 02:55:24 EDT 2009
Author: martinl
Date: 2009-08-15 02:55:23 -0400 (Sat, 15 Aug 2009)
New Revision: 38737
Modified:
grass/branches/releasebranch_6_4/lib/ogsf/GS2.c
grass/branches/releasebranch_6_4/lib/ogsf/gs.c
Log:
marisn: Don't use invalid pointers for debug output. Fixes #417
(backported from devbr6, r38672)
Modified: grass/branches/releasebranch_6_4/lib/ogsf/GS2.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/GS2.c 2009-08-15 06:44:57 UTC (rev 38736)
+++ grass/branches/releasebranch_6_4/lib/ogsf/GS2.c 2009-08-15 06:55:23 UTC (rev 38737)
@@ -1009,7 +1009,7 @@
}
/*!
- \brief Unset ?
+ \brief Unset Scaled Difference surface
*/
void GS_unset_SDsurf(void)
{
@@ -1020,7 +1020,7 @@
}
/*!
- \brief Set ?
+ \brief Set surface as Scaled Difference surface
\param id surface id
Modified: grass/branches/releasebranch_6_4/lib/ogsf/gs.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/gs.c 2009-08-15 06:44:57 UTC (rev 38736)
+++ grass/branches/releasebranch_6_4/lib/ogsf/gs.c 2009-08-15 06:55:23 UTC (rev 38737)
@@ -235,12 +235,12 @@
geosurf *ps;
int i;
- G_debug(5, "gs_init_surf() id=%d", gs->gsurf_id);
-
if (!gs) {
return (-1);
}
+ G_debug(5, "gs_init_surf() id=%d", gs->gsurf_id);
+
/* default attributes */
for (i = 0; i < MAX_ATTS; i++) {
gs->att[i].att_src = NOTSET_ATT;
@@ -282,7 +282,7 @@
gs->norms = NULL;
gs->draw_mode = DM_GOURAUD;
-
+
/* default z_exag value */
if (gs->gsurf_id == FIRST_SURF_ID) {
gs->z_exag = 1.0;
@@ -655,8 +655,8 @@
*/
int gs_get_att_src(geosurf * gs, int desc)
{
- G_debug(5, "gs_get_att_src(): id=%d desc=%d", gs->gsurf_id, desc);
-
+ if (gs)
+ G_debug(5, "gs_get_att_src(): id=%d, desc=%d", gs->gsurf_id, desc);
if (!LEGAL_ATT(desc)) {
return (-1);
}
@@ -683,10 +683,9 @@
typbuff *tb;
geosurf *gsref;
- G_debug(5, "gs_get_att_typbuff(): id=%d desc=%d to_write=%d",
- gs->gsurf_id, desc, to_write);
-
if (gs) {
+ G_debug(5, "gs_get_att_typbuff(): id=%d desc=%d to_write=%d",
+ gs->gsurf_id, desc, to_write);
if ((tb = gsds_get_typbuff(gs->att[desc].hdata, to_write))) {
tb->tfunc = NULL;
@@ -827,8 +826,9 @@
*/
int gs_set_att_src(geosurf * gs, int desc, int src)
{
- G_debug(5, "gs_set_att_src(): id=%d desc=%d src=%d",
- gs->gsurf_id, desc, src);
+ if (gs)
+ G_debug(5, "gs_set_att_src(): id=%d desc=%d src=%d",
+ gs->gsurf_id, desc, src);
/* check if old source was MAP_ATT, free buff */
if (MAP_ATT == gs_get_att_src(gs, desc)) {
@@ -871,10 +871,10 @@
*/
int gs_set_att_const(geosurf * gs, int desc, float constant)
{
- G_debug(5, "gs_set_att_const(): id=%d, desc=%d, const=%f",
- gs->gsurf_id, desc, constant);
if (gs) {
+ G_debug(5, "gs_set_att_const(): id=%d, desc=%d, const=%f",
+ gs->gsurf_id, desc, constant);
gs->att[desc].constant = constant;
if (ATT_MASK == desc) {
More information about the grass-commit
mailing list