Changeset 11537
- Timestamp:
- 05/15/07 23:35:17 (2 years ago)
- Files:
-
- trunk/gdal/ogr/ogrsf_frmts/s57/ogrs57datasource.cpp (modified) (3 diffs)
- trunk/gdal/ogr/ogrsf_frmts/s57/s57.h (modified) (1 diff)
- trunk/gdal/ogr/ogrsf_frmts/s57/s57reader.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/gdal/ogr/ogrsf_frmts/s57/ogrs57datasource.cpp
r10645 r11537 229 229 } 230 230 231 int bSuccess = TRUE; 232 231 233 nModules = 1; 232 234 papoModules = (S57Reader **) CPLMalloc(sizeof(void*)); … … 301 303 302 304 for( iModule = 0; iModule < nModules; iModule++ ) 303 {304 305 papoModules[iModule]->SetClassBased( OGRS57Driver::GetS57Registrar() ); 305 }306 306 307 307 panClassCount = (int *) CPLCalloc(sizeof(int),MAX_CLASSES); 308 308 309 309 for( iModule = 0; iModule < nModules; iModule++ ) 310 papoModules[iModule]->CollectClassList(panClassCount,MAX_CLASSES); 310 { 311 bSuccess &= 312 papoModules[iModule]->CollectClassList(panClassCount, 313 MAX_CLASSES); 314 } 311 315 312 316 for( iClass = 0; iClass < MAX_CLASSES; iClass++ ) … … 354 358 } 355 359 356 return TRUE;360 return bSuccess; 357 361 } 358 362 trunk/gdal/ogr/ogrsf_frmts/s57/s57.h
r11415 r11537 299 299 const char *GetDSNM() { return pszDSNM; } 300 300 301 voidIngest();301 int Ingest(); 302 302 int ApplyUpdates( DDFModule * ); 303 303 int FindAndApplyUpdates( const char *pszPath=NULL ); trunk/gdal/ogr/ogrsf_frmts/s57/s57reader.cpp
r10645 r11537 343 343 /************************************************************************/ 344 344 345 voidS57Reader::Ingest()345 int S57Reader::Ingest() 346 346 347 347 { … … 349 349 350 350 if( poModule == NULL || bFileIngested ) 351 return ;351 return TRUE; 352 352 353 353 /* -------------------------------------------------------------------- */ … … 355 355 /* appropriate indexes. */ 356 356 /* -------------------------------------------------------------------- */ 357 CPLErrorReset(); 357 358 while( (poRecord = poModule->ReadRecord()) != NULL ) 358 359 { … … 432 433 } 433 434 435 if( CPLGetLastErrorType() == CE_Failure ) 436 return FALSE; 437 434 438 bFileIngested = TRUE; 435 439 … … 438 442 /* -------------------------------------------------------------------- */ 439 443 if( nOptionFlags & S57M_UPDATES ) 440 FindAndApplyUpdates(); 444 return FindAndApplyUpdates(); 445 else 446 return TRUE; 441 447 } 442 448 … … 495 501 496 502 { 497 if( !bFileIngested )498 Ingest();503 if( !bFileIngested && !Ingest() ) 504 return NULL; 499 505 500 506 /* -------------------------------------------------------------------- */ … … 2170 2176 int bSuccess = TRUE; 2171 2177 2172 if( !bFileIngested )2173 Ingest();2178 if( !bFileIngested && !Ingest() ) 2179 return FALSE; 2174 2180 2175 2181 for( int iFEIndex = 0; iFEIndex < oFE_Index.GetCount(); iFEIndex++ ) … … 2517 2523 /* Ensure base file is loaded. */ 2518 2524 /* -------------------------------------------------------------------- */ 2519 Ingest(); 2525 if( !bFileIngested && !Ingest() ) 2526 return FALSE; 2520 2527 2521 2528 /* -------------------------------------------------------------------- */ 2522 2529 /* Read records, and apply as updates. */ 2523 2530 /* -------------------------------------------------------------------- */ 2531 CPLErrorReset(); 2524 2532 while( (poRecord = poUpdateModule->ReadRecord()) != NULL ) 2525 2533 { … … 2636 2644 } 2637 2645 2638 return TRUE;2646 return CPLGetLastErrorType() != CE_Failure; 2639 2647 } 2640 2648 … … 2764 2772 return OGRERR_FAILURE; 2765 2773 2766 Ingest(); 2774 if( !Ingest() ) 2775 return OGRERR_FAILURE; 2767 2776 2768 2777 /* -------------------------------------------------------------------- */
