Permalink
Browse files

Fixing tidy build support (enable by defining TOUCHXMLUSETIDY as 1).

  • Loading branch information...
1 parent 8250703 commit b95de87a715343a661cdf265dc8aec1316a1af8a Jan Weiß committed Jan 30, 2014
Showing with 10 additions and 10 deletions.
  1. +4 −4 Source/CXMLDocument.m
  2. +6 −6 Source/Tidy/CTidy.m
@@ -51,11 +51,11 @@ - (id)initWithXMLString:(NSString *)inString options:(NSUInteger)inOptions error
#if TOUCHXMLUSETIDY
if (inOptions & CXMLDocumentTidyHTML)
{
- inString = [[CTidy tidy] tidyString:inString inputFormat:TidyFormat_HTML outputFormat:TidyFormat_XHTML diagnostics:NULL error:&theError];
+ inString = [[CTidy tidy] tidyString:inString inputFormat:TidyFormat_HTML outputFormat:TidyFormat_XHTML encoding:NULL diagnostics:NULL error:outError];
}
else if (inOptions & CXMLDocumentTidyXML)
{
- inString = [[CTidy tidy] tidyString:inString inputFormat:TidyFormat_XML outputFormat:TidyFormat_XML diagnostics:NULL error:&theError];
+ inString = [[CTidy tidy] tidyString:inString inputFormat:TidyFormat_XML outputFormat:TidyFormat_XML encoding:NULL diagnostics:NULL error:outError];
}
#endif
NSError *theError = NULL;
@@ -110,11 +110,11 @@ - (id)initWithData:(NSData *)inData encoding:(NSStringEncoding)encoding options:
#if TOUCHXMLUSETIDY
if (inOptions & CXMLDocumentTidyHTML)
{
- inData = [[CTidy tidy] tidyData:inData inputFormat:TidyFormat_HTML outputFormat:TidyFormat_XHTML diagnostics:NULL error:&theError];
+ inData = [[CTidy tidy] tidyData:inData inputFormat:TidyFormat_HTML outputFormat:TidyFormat_XHTML encoding:NULL diagnostics:NULL error:outError];
}
else if (inOptions & CXMLDocumentTidyXML)
{
- inData = [[CTidy tidy] tidyData:inData inputFormat:TidyFormat_XML outputFormat:TidyFormat_XML diagnostics:NULL error:&theError];
+ inData = [[CTidy tidy] tidyData:inData inputFormat:TidyFormat_XML outputFormat:TidyFormat_XML encoding:NULL diagnostics:NULL error:outError];
}
#endif
{
View
@@ -42,7 +42,7 @@ @implementation CTidy
+ (CTidy *)tidy
{
- return([[[self alloc] init] autorelease]);
+ return([[self alloc] init]);
}
- (NSData *)tidyData:(NSData *)inData inputFormat:(CTidyFormat)inInputFormat outputFormat:(CTidyFormat)inOutputFormat encoding:(const char*)encoding diagnostics:(NSString **)outDiagnostics error:(NSError **)outError
@@ -72,7 +72,7 @@ - (NSData *)tidyData:(NSData *)inData inputFormat:(CTidyFormat)inInputFormat out
NSAssert(theResultCode >= 0, @"tidyOptSetBool() should return 0");
// Set encoding - same for input and output
- theResultCode = tidySetInCharEncoding(theTidyDocument, encoding)
+ theResultCode = tidySetInCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetInCharEncoding() should return 0");
theResultCode = tidySetOutCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetOutCharEncoding() should return 0");
@@ -131,7 +131,7 @@ - (NSData *)tidyData:(NSData *)inData inputFormat:(CTidyFormat)inInputFormat out
if (outDiagnostics && theErrorBuffer.bp != NULL)
{
NSData *theErrorData = [NSData dataWithBytes:theErrorBuffer.bp length:theErrorBuffer.size];
- *outDiagnostics = [[[NSString alloc] initWithData:theErrorData encoding:NSUTF8StringEncoding] autorelease];
+ *outDiagnostics = [[NSString alloc] initWithData:theErrorData encoding:NSUTF8StringEncoding];
}
tidyBufFree(&theErrorBuffer);
@@ -169,7 +169,7 @@ - (NSString *)tidyString:(NSString *)inString inputFormat:(CTidyFormat)inInputFo
NSAssert(theResultCode >= 0, @"tidyOptSetBool() should return 0");
// Set encoding - same for input and output
- theResultCode = tidySetInCharEncoding(theTidyDocument, encoding)
+ theResultCode = tidySetInCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetInCharEncoding() should return 0");
theResultCode = tidySetOutCharEncoding(theTidyDocument, encoding);
NSAssert(theResultCode >= 0, @"tidySetOutCharEncoding() should return 0");
@@ -214,13 +214,13 @@ - (NSString *)tidyString:(NSString *)inString inputFormat:(CTidyFormat)inInputFo
theResultCode = tidySaveString(theTidyDocument, [theOutputBuffer mutableBytes], &theBufferLength);
- NSString *theString = [[[NSString alloc] initWithData:theOutputBuffer encoding:NSUTF8StringEncoding] autorelease];
+ NSString *theString = [[NSString alloc] initWithData:theOutputBuffer encoding:NSUTF8StringEncoding];
//
if (outDiagnostics && theErrorBuffer.bp != NULL)
{
NSData *theErrorData = [NSData dataWithBytes:theErrorBuffer.bp length:theErrorBuffer.size];
- *outDiagnostics = [[[NSString alloc] initWithData:theErrorData encoding:NSUTF8StringEncoding] autorelease];
+ *outDiagnostics = [[NSString alloc] initWithData:theErrorData encoding:NSUTF8StringEncoding];
}
tidyBufFree(&theErrorBuffer);

0 comments on commit b95de87

Please sign in to comment.