Permalink
Browse files

Fixed const encoding in C method parsing

  • Loading branch information...
1 parent 8b8e18a commit a6cb2e2861bd085a3b86d78818ebefc13d4257bc @parmanoir committed Sep 27, 2012
@@ -1325,7 +1325,6 @@ + (NSMutableArray*)parseCFunctionEncoding:(NSString*)xml functionName:(NSString*
id argumentEncodings = [NSMutableArray array];
id xmlDocument = [[NSXMLDocument alloc] initWithXMLString:xml options:0 error:nil];
[xmlDocument autorelease];
-
id rootElement = [xmlDocument rootElement];
*functionNamePlaceHolder = [[rootElement attributeForName:@"name"] stringValue];
@@ -1347,6 +1346,8 @@ + (NSMutableArray*)parseCFunctionEncoding:(NSString*)xml functionName:(NSString*
id typeEncoding = [[child attributeForName:@"type"] stringValue];
#endif
char typeEncodingChar = [typeEncoding UTF8String][0];
+ if (typeEncodingChar == _C_CONST)
+ typeEncodingChar = [typeEncoding UTF8String][1];
id argumentEncoding = [[JSCocoaFFIArgument alloc] init];
// Set return value — NO, as return value might not be the first element. Use retval to decide.
View
@@ -1,13 +1,10 @@
-var getName = function(object) {
- var name = new outArgument;
-
- MIDIObjectGetStringProperty(object, kMIDIPropertyName, name)
- return name;
-};
-
-var device = MIDIGetDevice(0);
-//log("Device from js: " + getName(device));
+var device = MIDIGetDevice(0)
if (!device)
throw 'No device'
+
+var buffer = new memoryBuffer('@')
+MIDIObjectGetStringProperty(device, kMIDIPropertyName, new outArgument(buffer, 0))
+
+//log('Device from js: ' + device + ' name=' + buffer[0])

0 comments on commit a6cb2e2

Please sign in to comment.