FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
XCode_Snippets_iOS/SourceCode/hmCheckError.m at master · hwsyy/XCode_Snippets_iOS · GitHub
hwsyy
/
XCode_Snippets_iOS
Public
forked from
KevinHM/XCode_Snippets_iOS
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
XCode_Snippets_iOS
/
SourceCode
/
hmCheckError.m
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (21 loc) · 620 Bytes
Breadcrumbs
XCode_Snippets_iOS
/
SourceCode
/
hmCheckError.m
Copy path
File metadata and controls
24 lines (21 loc) · 620 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
title
:
"
CheckError
"
summary
:
"
Function that extracts human-readable information from OSStatus codes.
"
platform
:
iOS
completion
-
scope
:
Top
Level
---
static
void CheckError(OSStatus error, const char *operation) {
if
(
error
==
noErr
) {
return
;
}
char
str[20]
;
*(
UInt32
*) (
str
+
1
)
=
CFSwapInt32HostToBig(
error
);
if
(isprint(
str
[
1
])
&&
isprint(
str
[
2
])
&&
isprint(
str
[
3
])
&&
isprint(
str
[
4
])) {
str
[
0
]
=
str
[
5
]
=
'
\
''
;
str[6] =
'
\
0
'
;
}
else
{
sprintf(
str
,
"
%d
"
, (
int
)
error
);
}
fprintf(
stderr
,
"
[Error] %s (%s)\n
"
,
operation
,
str
);
exit(
1
);
}
Back
|
FazBrowse Home
|
New Git URL