Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created VSIError to report VSI errors. #98

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't use CPL_DLL on static private functions; use TRUE and FALSE ins…
…tead of 1 and 0.
  • Loading branch information
lossyrob committed Mar 20, 2016
commit 7a1887e82341e0ef6f53ccdb0debac7a26257d57
8 changes: 4 additions & 4 deletions gdal/port/cpl_vsi_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct {
/* Do not add anything here. szLastErrMsg must be the last field. See CPLRealloc() below */
} VSIErrorContext;

static void CPL_DLL VSIErrorV(VSIErrorNum, const char *, va_list );
static void VSIErrorV(VSIErrorNum, const char *, va_list );

/************************************************************************/
/* CPLGetErrorContext() */
Expand Down Expand Up @@ -257,14 +257,14 @@ const char* CPL_STDCALL VSIGetLastErrorMsg()
* with the given CPLErr error class, and either an appropriate CPLErrorNum
* given the VSIErrorNum, or the given defualt CPLErrorNum.
*
* @return 1 if a CPLError was issued, or 0 if not.
* @return TRUE if a CPLError was issued, or FALSE if not.
*/

int CPL_DLL CPL_STDCALL VSIToCPLError(CPLErr eErrClass, CPLErrorNum eDefaultErrorNo) {
int err = VSIGetLastErrorNo();
switch(err) {
case VSIE_None:
return 0;
return FALSE;
case VSIE_FileError:
CPLError(eErrClass, eDefaultErrorNo, "%s", VSIGetLastErrorMsg());
break;
Expand All @@ -291,5 +291,5 @@ int CPL_DLL CPL_STDCALL VSIToCPLError(CPLErr eErrClass, CPLErrorNum eDefaultErro
break;
}

return 1;
return TRUE;
}