[Gdal-dev] return from sdedataset.cpp

Frank Warmerdam warmerdam at pobox.com
Tue Sep 25 12:01:20 EDT 2007


Xuexia,

Reviewing the sdedataset.cpp code I agree there is a problem
that the "else" case looks very broken.  Removing the return
FALSE might be sufficient.

Could you file a bug in Trac on this issue, and hopefully
Howard will soon have a chance to address it.

I'd add that the Open() method should be returning NULL on
failure, not FALSE.

Best regards,

On 9/24/07, chenxuexia <xuex_chen at 126.com> wrote:
> hi, ALL.
>   I try to read  raster data from sde cinfigured oracle database.  My
> program always returned from SDEDataset::Open( GDALOpenInfo * poOpenInfo ),
> traced here:
> //////////////////////////////////////////
> GDALDataset *SDEDataset::Open( GDALOpenInfo * poOpenInfo )
> {
> ............
> ............
>  SDEDataset *poDS;
>  poDS = new SDEDataset();
> ..............
> /*
> --------------------------------------------------------------------
> */
> /*      If we were given a layer name, use that directly, otherwise     */
> /*      query for subdatasets.
>             */
> /*
> --------------------------------------------------------------------
> */
>   if (CSLCount( papszTokens ) == 6 ) {
> ......
> }
> else {
>  ...........//without given a layer name,we get each subdataset.
>          return FALSE;
> // why? when runs to the ELSE{} always return FALSE.
> //Should we drop this last sentence "return FALSE;"?
>     }
>     CSLDestroy( papszTokens);
>     return( poDS );
> }
>
> ________________________________
>  Íø Ò× Yeah.net ÓÊ Ïä ÏÄ ÈÕ ´ó ±ä Á³£¬´ø Ä㠸РÊÜ Ð һ ´ú ÓÊ Ïä µÄ È« Р÷È Á¦ >>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>


-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list