MCPcopy Create free account
hub / github.com/Kitware/VTK / proj_errno_reset

Function proj_errno_reset

ThirdParty/libproj/vtklibproj/src/4D_api.cpp:1488–1522  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

1486
1487/*****************************************************************************/
1488int proj_errno_reset (const PJ *P) {
1489/******************************************************************************
1490 Clears errno in the context and thread local levels
1491 through the low level pj_ctx interface.
1492
1493 Returns the previous value of the errno, for convenient reset/restore
1494 operations:
1495
1496 int foo (PJ *P) {
1497 // errno may be set on entry, but we need to reset it to be able to
1498 // check for errors from "do_something_with_P(P)"
1499 int last_errno = proj_errno_reset (P);
1500
1501 // local failure
1502 if (0==P)
1503 return proj_errno_set (P, 42);
1504
1505 // call to function that may fail
1506 do_something_with_P (P);
1507
1508 // failure in do_something_with_P? - keep latest error status
1509 if (proj_errno(P))
1510 return proj_errno (P);
1511
1512 // success - restore previous error status, return 0
1513 return proj_errno_restore (P, last_errno);
1514 }
1515******************************************************************************/
1516 int last_errno;
1517 last_errno = proj_errno (P);
1518
1519 proj_context_errno_set (pj_get_ctx ((PJ *) P), 0);
1520 errno = 0;
1521 return last_errno;
1522}
1523
1524
1525/* Create a new context based on the default context */

Callers 14

set_ellipsoidFunction · 0.85
pipeline.cppFile · 0.85
pj_factorsFunction · 0.85
pj_invFunction · 0.85
pj_inv3dFunction · 0.85
pj_inv4dFunction · 0.85
pj_ellipsoidFunction · 0.85
ellps_ellpsFunction · 0.85
proj_transFunction · 0.85
pj_fwdFunction · 0.85
pj_fwd3dFunction · 0.85

Calls 3

proj_errnoFunction · 0.85
proj_context_errno_setFunction · 0.85
pj_get_ctxFunction · 0.85

Tested by

no test coverage detected