Changeset 688:94da28639c7f
- Timestamp:
- 05/21/08 16:16:49 (2 years ago)
- Branch:
- default
- Convert:
- svn:1766ff46-f334-0410-ab20-d63176f87757/trunk@756
- File:
-
- 1 edited
-
src/las_c_api.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/las_c_api.cpp
r662 r688 64 64 #include <exception> 65 65 #include <vector> 66 66 #include <sstream> // std::stringstream 67 #include <fstream> 67 68 #include <iostream> 68 #include <fstream>69 69 using namespace liblas; 70 70 … … 95 95 static std::stack<LASError > errors; 96 96 97 #ifdef _MSC_VER 98 # pragma warning(disable: 4127) // warning C4127: conditional expression is constant 99 #endif 100 97 101 #define VALIDATE_POINTER0(ptr, func) \ 98 do { if( NULL == ptr ) \ 99 { \ 102 do { if( NULL == ptr ) { \ 100 103 LASErrorEnum const ret = LE_Failure; \ 101 104 std::ostringstream msg; \ 102 105 msg << "Pointer \'" << #ptr << "\' is NULL in \'" << (func) <<"\'."; \ 103 106 std::string message(msg.str()); \ 104 LASError_PushError( ret, \105 message.c_str(), (func)); \106 return;}} while(0)107 LASError_PushError( ret, message.c_str(), (func)); \ 108 return; \ 109 }} while(0) 107 110 108 111 #define VALIDATE_POINTER1(ptr, func, rc) \ 109 do { if( NULL == ptr ) \ 110 { \ 112 do { if( NULL == ptr ) { \ 111 113 LASErrorEnum const ret = LE_Failure; \ 112 114 std::ostringstream msg; \ 113 115 msg << "Pointer \'" << #ptr << "\' is NULL in \'" << (func) <<"\'."; \ 114 116 std::string message(msg.str()); \ 115 LASError_PushError( ret, \116 message.c_str(), (func)); \117 return (rc);}} while(0)117 LASError_PushError( ret, message.c_str(), (func)); \ 118 return (rc); \ 119 }} while(0) 118 120 119 121 LAS_DLL void LASError_Reset(void) { … … 269 271 } catch (invalid_point_data const& e /*e */) { 270 272 LASError_PushError(LE_Failure, e.what(), "LASReader_GetNextPoint Invalid Point"); 271 return NULL;272 273 } catch (std::exception const& e) 273 274 { 274 275 LASError_PushError(LE_Failure, e.what(), "LASReader_GetNextPoint"); 275 return NULL;276 276 } 277 277 278 278 return NULL; 279 280 279 } 281 280 … … 293 292 } catch (invalid_point_data const& e /*e */) { 294 293 LASError_PushError(LE_Failure, e.what(), "LASReader_GetPointAt Invalid Point"); 295 return NULL;296 294 } catch (std::exception const& e) 297 295 { 298 296 LASError_PushError(LE_Failure, e.what(), "LASReader_GetPointAt"); 299 return NULL;300 297 } 301 298 … … 860 857 LAS_DLL liblas::uint8_t LASHeader_GetDataFormatId(const LASHeaderH hHeader) { 861 858 VALIDATE_POINTER1(hHeader, "LASHeader_GetDataFormatId", 0); 862 863 unsigned char value= ((LASHeader*) hHeader)->GetDataFormatId();864 return value;859 860 LASHeader::PointFormat id = ((LASHeader*) hHeader)->GetDataFormatId(); 861 return static_cast<liblas::uint8_t>(id); 865 862 } 866 863 … … 1507 1504 LAS_C_END 1508 1505 1506 #ifdef _MSC_VER 1507 # pragma warning(default: 4127) // enable warning C4127: conditional expression is constant 1508 #endif
Note: See TracChangeset
for help on using the changeset viewer.
