From 2f2c747ffcabd906c3451b0ee20758b07c0f1cce Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 4 Jan 2012 17:57:53 +0100 Subject: extensions: fix unused param warnings in ObjC files The namespace handling in the spotlight plugin XML parser looks broken, added some FIXMEs for that. --- .../source/macosx/spotlight/GetMetadataForFile.m | 2 +- .../source/macosx/spotlight/OOoContentDataParser.m | 11 +++++ .../source/macosx/spotlight/OOoMetaDataParser.m | 9 ++++ extensions/source/macosx/spotlight/ioapi.m | 56 +++++++++++----------- extensions/source/macosx/spotlight/main.m | 3 +- 5 files changed, 51 insertions(+), 30 deletions(-) (limited to 'extensions/source/macosx') diff --git a/extensions/source/macosx/spotlight/GetMetadataForFile.m b/extensions/source/macosx/spotlight/GetMetadataForFile.m index e47603dc7027..f93449a4472e 100644 --- a/extensions/source/macosx/spotlight/GetMetadataForFile.m +++ b/extensions/source/macosx/spotlight/GetMetadataForFile.m @@ -48,7 +48,7 @@ typedef int NSColorRenderingIntent; and return it as a dictionary ----------------------------------------------------------------------------- */ -Boolean GetMetadataForFile(void* thisInterface, +Boolean GetMetadataForFile(void* /*thisInterface*/, CFMutableDictionaryRef attributes, CFStringRef contentTypeUTI, CFStringRef pathToFile) diff --git a/extensions/source/macosx/spotlight/OOoContentDataParser.m b/extensions/source/macosx/spotlight/OOoContentDataParser.m index a35b2194a4da..d5abd1d168ff 100644 --- a/extensions/source/macosx/spotlight/OOoContentDataParser.m +++ b/extensions/source/macosx/spotlight/OOoContentDataParser.m @@ -78,6 +78,11 @@ typedef int NSColorRenderingIntent; - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { + (void) parser; // unused + (void) namespaceURI; // FIXME this should not be ignored but should be used + // instead of text: prefix in the comparison below! + (void) qualifiedName; // unused + (void) attributeDict; // unused // all text content is stored inside elements if ([elementName isEqualToString:@"text:p"] == YES) { runningTextContent = [NSMutableString new]; @@ -92,6 +97,10 @@ typedef int NSColorRenderingIntent; - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { + (void) parser; // unused + (void) elementName; // unused + (void) namespaceURI; // unused + (void) qName; // unused if (shouldReadCharacters == TRUE) { if (textContent == nil) { textContent = [NSMutableString new]; @@ -109,6 +118,7 @@ typedef int NSColorRenderingIntent; - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { + (void) parser; // unused if (shouldReadCharacters == NO) { return; } @@ -138,6 +148,7 @@ typedef int NSColorRenderingIntent; - (void)parserDidEndDocument:(NSXMLParser *)parser { + (void) parser; // unused if (textContent != nil && [textContent length] > 0) { [mdiValues setObject:[NSString stringWithString:textContent] forKey:(NSString*)kMDItemTextContent]; [textContent release]; diff --git a/extensions/source/macosx/spotlight/OOoMetaDataParser.m b/extensions/source/macosx/spotlight/OOoMetaDataParser.m index cb26f916e083..cd69772c3dbf 100644 --- a/extensions/source/macosx/spotlight/OOoMetaDataParser.m +++ b/extensions/source/macosx/spotlight/OOoMetaDataParser.m @@ -48,6 +48,7 @@ static NSDictionary *metaXML2MDIKeys; if (isInitialized == NO) { //set up the meta elements with only one value NSMutableSet *temp = [NSMutableSet new]; +//FIXME these should use namespace URIs and not prefixes [temp addObject:@"dc:title"]; [temp addObject:@"dc:description"]; [temp addObject:@"meta:user-defined"]; @@ -121,6 +122,10 @@ static NSDictionary *metaXML2MDIKeys; - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { + (void) parser; // unused + (void) namespaceURI; // FIXME this should not be ignored but should be used + // instead of meta: prefix in the comparison below! + (void) qualifiedName; // unused // NSLog(@"<%@>", elementName); if ([singleValueXMLElements containsObject:elementName] == YES) { shouldReadCharacters = YES; @@ -146,6 +151,9 @@ static NSDictionary *metaXML2MDIKeys; - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { + (void) parser; // unused + (void) namespaceURI; // unused + (void) qName; // unused // NSLog(@"", elementName); if (shouldReadCharacters == YES) { NSString *mdiName = nil; @@ -190,6 +198,7 @@ static NSDictionary *metaXML2MDIKeys; - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { + (void) parser; // unused // NSLog(@"%@", string); if (shouldReadCharacters == NO) { return; diff --git a/extensions/source/macosx/spotlight/ioapi.m b/extensions/source/macosx/spotlight/ioapi.m index fb9d53fdf404..683eb9722e13 100644 --- a/extensions/source/macosx/spotlight/ioapi.m +++ b/extensions/source/macosx/spotlight/ioapi.m @@ -93,10 +93,10 @@ int ZCALLBACK ferror_file_func OF(( voidpf stream)); -voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; +voidpf ZCALLBACK fopen_file_func( + voidpf /*opaque*/, + const char* filename, + int mode) { FILE* file = NULL; const char* mode_fopen = NULL; @@ -115,11 +115,11 @@ voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) } -uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; +uLong ZCALLBACK fread_file_func( + voidpf /*opaque*/, + voidpf stream, + void* buf, + uLong size) { uLong ret; ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); @@ -127,31 +127,31 @@ uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) } -uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; +uLong ZCALLBACK fwrite_file_func( + voidpf /*opaque*/, + voidpf stream, + const void* buf, + uLong size) { uLong ret; ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } -long ZCALLBACK ftell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +long ZCALLBACK ftell_file_func( + voidpf /*opaque*/, + voidpf stream) { long ret; ret = ftell((FILE *)stream); return ret; } -long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; +long ZCALLBACK fseek_file_func( + voidpf /*opaque*/, + voidpf stream, + uLong offset, + int origin) { int fseek_origin=0; long ret; @@ -173,18 +173,18 @@ long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) return ret; } -int ZCALLBACK fclose_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +int ZCALLBACK fclose_file_func( + voidpf /*opaque*/, + voidpf stream) { int ret; ret = fclose((FILE *)stream); return ret; } -int ZCALLBACK ferror_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +int ZCALLBACK ferror_file_func( + voidpf /*opaque*/, + voidpf stream) { int ret; ret = ferror((FILE *)stream); diff --git a/extensions/source/macosx/spotlight/main.m b/extensions/source/macosx/spotlight/main.m index 74bcca93e7f3..2fa2723a9c7f 100644 --- a/extensions/source/macosx/spotlight/main.m +++ b/extensions/source/macosx/spotlight/main.m @@ -206,7 +206,8 @@ ULONG MetadataImporterPluginRelease(void *thisInstance) // ----------------------------------------------------------------------------- // Implementation of the factory function for this type. // -void *MetadataImporterPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID) +void * +MetadataImporterPluginFactory(CFAllocatorRef /*allocator*/, CFUUIDRef typeID) { MetadataImporterPluginType *result; CFUUIDRef uuid; -- cgit