Skip to content

Commit

Permalink
Combined pointer definition and initialization in ogrsf_frmts/ plscenes
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/gdal/trunk@35146 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
schwehr committed Aug 18, 2016
1 parent 1019357 commit 1d3f312
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions gdal/ogr/ogrsf_frmts/plscenes/ogrplscenesdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ GDALDataset* OGRPLScenesDataset::OpenRasterScene(GDALOpenInfo* poOpenInfo,

for( char** papszIter = papszOptions; papszIter && *papszIter; papszIter ++ )
{
char* pszKey;
char* pszKey = NULL;
const char* pszValue = CPLParseNameValue(*papszIter, &pszKey);
if( pszValue != NULL )
{
Expand Down Expand Up @@ -493,7 +493,7 @@ GDALDataset* OGRPLScenesDataset::Open(GDALOpenInfo* poOpenInfo)

for( char** papszIter = papszOptions; papszIter && *papszIter; papszIter ++ )
{
char* pszKey;
char* pszKey = NULL;
const char* pszValue = CPLParseNameValue(*papszIter, &pszKey);
if( pszValue != NULL )
{
Expand Down
9 changes: 4 additions & 5 deletions gdal/ogr/ogrsf_frmts/plscenes/ogrplsceneslayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ CPLString OGRPLScenesLayer::BuildFilter(swq_expr_node* poNode)
poNode->papoSubExpr[0]->field_index != poFeatureDefn->GetFieldIndex("id") &&
poNode->papoSubExpr[0]->field_index < poFeatureDefn->GetFieldCount() )
{
OGRFieldDefn *poFieldDefn;
poFieldDefn = poFeatureDefn->GetFieldDefn(poNode->papoSubExpr[0]->field_index);
OGRFieldDefn *poFieldDefn =
poFeatureDefn->GetFieldDefn(poNode->papoSubExpr[0]->field_index);

CPLString osFilter(poFieldDefn->GetNameRef());

Expand Down Expand Up @@ -514,10 +514,9 @@ OGRFeature *OGRPLScenesLayer::GetNextFeature()
if( !bFilterMustBeClientSideEvaluated )
return GetNextRawFeature();

OGRFeature *poFeature;

while( true )
{
OGRFeature *poFeature = NULL;
poFeature = GetNextRawFeature();
if (poFeature == NULL)
return NULL;
Expand Down Expand Up @@ -556,8 +555,8 @@ OGRFeature* OGRPLScenesLayer::GetNextRawFeature()
{
bEOF = TRUE;
OGRFeature* poFeature = new OGRFeature(poFeatureDefn);
OGRGeometry* poGeom;
const char* pszWKT = "MULTIPOLYGON(((-180 90,180 90,180 -90,-180 -90,-180 90)))";
OGRGeometry* poGeom = NULL;
OGRGeometryFactory::createFromWkt((char**)&pszWKT, poSRS, &poGeom);
poFeature->SetGeometryDirectly(poGeom);
return poFeature;
Expand Down
6 changes: 3 additions & 3 deletions gdal/ogr/ogrsf_frmts/plscenes/ogrplscenesv1dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ json_object* OGRPLScenesV1Dataset::RunRequest(const char* pszURL,
papszOptions = CSLSetNameValue(papszOptions, "HEADERS", osHeaders);
papszOptions = CSLSetNameValue(papszOptions, "POSTFIELDS", pszPostContent);
}
CPLHTTPResult * psResult;
CPLHTTPResult *psResult = NULL;
if( STARTS_WITH(m_osBaseURL, "/vsimem/") &&
STARTS_WITH(pszURL, "/vsimem/") )
{
Expand Down Expand Up @@ -413,7 +413,7 @@ GDALDataset* OGRPLScenesV1Dataset::OpenRasterScene(GDALOpenInfo* poOpenInfo,

for( char** papszIter = papszOptions; papszIter && *papszIter; papszIter ++ )
{
char* pszKey;
char* pszKey = NULL;
const char* pszValue = CPLParseNameValue(*papszIter, &pszKey);
if( pszValue != NULL )
{
Expand Down Expand Up @@ -734,7 +734,7 @@ GDALDataset* OGRPLScenesV1Dataset::Open(GDALOpenInfo* poOpenInfo)

for( char** papszIter = papszOptions; papszIter && *papszIter; papszIter ++ )
{
char* pszKey;
char* pszKey = NULL;
const char* pszValue = CPLParseNameValue(*papszIter, &pszKey);
if( pszValue != NULL )
{
Expand Down
14 changes: 7 additions & 7 deletions gdal/ogr/ogrsf_frmts/plscenes/ogrplscenesv1layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ void OGRPLScenesV1Layer::ParseAssetProperties(json_object* poSpec,
continue;
}

const char* pszOGRFieldName;
const char* pszOGRFieldName = NULL;
CPLString osSrcField(CPLString("/assets.") + m_aoAssetCategories[i] + CPLString("."));
json_object* poLinksRef = NULL;
if( EQUAL(pszJSonFieldName, "_links") &&
Expand Down Expand Up @@ -915,7 +915,7 @@ void OGRPLScenesV1Layer::ProcessAssetFileProperties( json_object* poPropertiesAs
if( strcmp(pszJSonFieldName, "type") == 0 )
continue; // "http" not really interesting

const char* pszOGRFieldName;
const char* pszOGRFieldName = NULL;
CPLString osSrcField(CPLString("/assets.") + osAssetCategory + CPLString(".files."));
if( EQUAL(pszJSonFieldName, "_links") )
{
Expand Down Expand Up @@ -979,11 +979,11 @@ bool OGRPLScenesV1Layer::GetNextPage()
return false;
}

json_object* poObj;
if( m_osRequestURL == m_poDS->GetBaseURL() + GetName() + "/quick-search" )
poObj = m_poDS->RunRequest(m_osRequestURL, FALSE, "POST", true, m_poDS->GetFilter());
else
poObj = m_poDS->RunRequest(m_osRequestURL);
json_object* poObj =
m_osRequestURL == m_poDS->GetBaseURL() + GetName() + "/quick-search"
? m_poDS->RunRequest(m_osRequestURL, FALSE, "POST", true,
m_poDS->GetFilter())
: m_poDS->RunRequest(m_osRequestURL);
if( poObj == NULL )
{
m_bEOF = true;
Expand Down

0 comments on commit 1d3f312

Please sign in to comment.