Revision: 7164
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7164&view=rev
Author:   hofman
Date:     2011-03-14 18:18:41 +0000 (Mon, 14 Mar 2011)

Log Message:
-----------
avoid some assignment warnings

Modified Paths:
--------------
    trunk/SkimNotes/SKNExtendedAttributeManager.m
    trunk/SkimNotes/skimpdf.m

Modified: trunk/SkimNotes/SKNExtendedAttributeManager.m
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.m       2011-03-14 12:36:28 UTC 
(rev 7163)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.m       2011-03-14 18:18:41 UTC 
(rev 7164)
@@ -96,7 +96,8 @@
 
 - (id)initWithPrefix:(NSString *)prefix;
 {
-    if (self = [super init]) {
+    self = [super init];
+    if (self) {
         namePrefix = [[prefix stringByAppendingString:NAME_SEPARATOR] retain];
         uniqueKey = [[prefix stringByAppendingString:UNIQUE_KEY_SUFFIX] 
retain];
         wrapperKey = [[prefix stringByAppendingString:WRAPPER_KEY_SUFFIX] 
retain];
@@ -187,7 +188,7 @@
     NSData *data = nil;
     NSString *attrName = nil;
     
-    while(attrName = [e nextObject]){
+    while((attrName = [e nextObject])){
         data = [self extendedAttributeNamed:attrName atPath:path 
traverseLink:follow error:&anError];
         if(data != nil){
             [attributes setObject:data forKey:attrName];
@@ -312,11 +313,11 @@
     // options passed to xattr functions
     int xopts = 0;
     if(options & kSKNXattrNoFollow)
-        xopts = xopts | XATTR_NOFOLLOW;
+        xopts = XATTR_NOFOLLOW;
     if(options & kSKNXattrCreateOnly)
-        xopts = xopts | XATTR_CREATE;
+        xopts |= XATTR_CREATE;
     if(options & kSKNXattrReplaceOnly)
-        xopts = xopts | XATTR_REPLACE;
+        xopts |= XATTR_REPLACE;
     
     BOOL success;
 
@@ -472,7 +473,7 @@
     
     NSEnumerator *e = [allAttributes objectEnumerator];
     NSString *attrName;
-    while (attrName = [e nextObject]) {
+    while ((attrName = [e nextObject])) {
         
         fsPath = [path fileSystemRepresentation];
         status = removexattr(fsPath, [attrName UTF8String], xopts);

Modified: trunk/SkimNotes/skimpdf.m
===================================================================
--- trunk/SkimNotes/skimpdf.m   2011-03-14 12:36:28 UTC (rev 7163)
+++ trunk/SkimNotes/skimpdf.m   2011-03-14 18:18:41 UTC (rev 7164)
@@ -120,14 +120,14 @@
             [fm removeFileAtPath:outPath handler:nil];
         success = [fm copyPath:inPath toPath:outPath handler:nil];
 #endif
-        if (success == NO) {
-            *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Cannot write PDF 
document", NSLocalizedDescriptionKey, nil]];
-        } else {
+        if (success) {
             NSURL *inURL = [NSURL fileURLWithPath:inPath];
             NSURL *outURL = [NSURL fileURLWithPath:outPath];
             NSString *textNotes = [fm 
readSkimTextNotesFromExtendedAttributesAtURL:inURL error:NULL];
             NSData *rtfNotesData = [fm 
readSkimRTFNotesFromExtendedAttributesAtURL:inURL error:NULL];
             success = [fm writeSkimNotes:notes textNotes:textNotes 
richTextNotes:rtfNotesData toExtendedAttributesAtURL:outURL error:error];
+        } else if (error) {
+            *error = [NSError errorWithDomain:NSPOSIXErrorDomain code:ENOENT 
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Cannot write PDF 
document", NSLocalizedDescriptionKey, nil]];
         }
         
     }
@@ -259,7 +259,7 @@
                 NSEnumerator *e = [[[[page annotations] copy] autorelease] 
objectEnumerator];
                 PDFAnnotation *annotation;
                 
-                while (annotation = [e nextObject]) {
+                while ((annotation = [e nextObject])) {
                     if ([convertibleTypes containsObject:[annotation type]]) {
                         NSDictionary *note = [annotation SkimNoteProperties];
                         if ([[annotation type] isEqualToString:SKNTextString]) 
{
@@ -314,7 +314,7 @@
             NSEnumerator *e = [notes2 objectEnumerator];
             NSDictionary *note;
             
-            while (note = [e nextObject]) {
+            while ((note = [e nextObject])) {
                 NSMutableDictionary *mutableNote = [note mutableCopy];
                 NSUInteger pageIndex = [[note 
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntValue] + count;
                 [mutableNote setObject:[NSNumber 
numberWithUnsignedInt:pageIndex] forKey:SKNPDFAnnotationPageIndexKey];
@@ -392,7 +392,7 @@
                 NSEnumerator *e = [inNotes objectEnumerator];
                 NSDictionary *note;
                 
-                while (note = [e nextObject]) {
+                while ((note = [e nextObject])) {
                     NSUInteger pageIndex = [[note 
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntValue];
                     if ([indexes containsIndex:pageIndex]) {
                         NSUInteger newPageIndex = [indexes 
countOfIndexesInRange:NSMakeRange(0, pageIndex)];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to