git.ithinksw.org
/
ITFoundation.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(ITCarbonSupport) Rewrite FCC utilities, add "extern"
[ITFoundation.git]
/
ITCarbonSupport.m
diff --git
a/ITCarbonSupport.m
b/ITCarbonSupport.m
index
9e8d1ee
..
3995a65
100644
(file)
--- a/
ITCarbonSupport.m
+++ b/
ITCarbonSupport.m
@@
-1,9
+1,16
@@
#import "ITCarbonSupport.h"
NSString *NSStringFromFourCharCode(unsigned long code) {
#import "ITCarbonSupport.h"
NSString *NSStringFromFourCharCode(unsigned long code) {
- return [NSString stringWith
UTF8String:(const char *)
&code];
+ return [NSString stringWith
Format:@"%.4s",
&code];
}
unsigned long FourCharCodeFromNSString(NSString *string) {
}
unsigned long FourCharCodeFromNSString(NSString *string) {
- return (*((unsigned long*)[string UTF8String]));
+ const unsigned char *c_s = [string UTF8String];
+ unsigned long tmp = *c_s++;
+ tmp <<= 8;
+ tmp |= *c_s++;
+ tmp <<= 8;
+ tmp |= *c_s++;
+ tmp <<= 8;
+ return tmp |= *c_s++;
}
\ No newline at end of file
}
\ No newline at end of file