Revision: 29800
          http://sourceforge.net/p/bibdesk/svn/29800
Author:   hofman
Date:     2025-11-14 15:19:00 +0000 (Fri, 14 Nov 2025)
Log Message:
-----------
no need for struct

Modified Paths:
--------------
    trunk/bibdesk/BDSKFileMatcher.h
    trunk/bibdesk/BDSKFileMatcher.m

Modified: trunk/bibdesk/BDSKFileMatcher.h
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.h     2025-11-14 15:13:44 UTC (rev 29799)
+++ trunk/bibdesk/BDSKFileMatcher.h     2025-11-14 15:19:00 UTC (rev 29800)
@@ -54,9 +54,7 @@
     
     NSMutableArray *matches;
     dispatch_group_t group;
-    struct __matchFlags {
-        _Atomic(BOOL) shouldAbort;
-    } _matchFlags;
+    _Atomic(BOOL) shouldAbort;
     
     BOOL documentWasRemoved;
 }

Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m     2025-11-14 15:13:44 UTC (rev 29799)
+++ trunk/bibdesk/BDSKFileMatcher.m     2025-11-14 15:19:00 UTC (rev 29800)
@@ -107,7 +107,7 @@
     self = [super initWithWindow:nil];
     if (self) {
         matches = [[NSMutableArray alloc] init];
-        _matchFlags.shouldAbort = NO;
+        shouldAbort = NO;
     }
     return self;
 }
@@ -155,7 +155,7 @@
 
     // wait for the current aborted block is finished
     if (group) {
-        atomic_store(&_matchFlags.shouldAbort, YES);
+        atomic_store(&shouldAbort, YES);
         dispatch_group_wait(group, DISPATCH_TIME_FOREVER); 
     } else {
         group = dispatch_group_create();
@@ -164,7 +164,7 @@
     [matches removeAllObjects];
     [outlineView reloadData];
     
-    atomic_store(&_matchFlags.shouldAbort, NO);
+    atomic_store(&shouldAbort, NO);
     
     // get the root nodes array on the main thread, since it uses BibItem 
methods
     NSArray *treeNodes = [self copyTreeNodesWithPublications:pubs];
@@ -188,7 +188,7 @@
 - (IBAction)abort:(id)sender;
 {
     BOOL expected = NO;
-    if (NO == atomic_compare_exchange_strong(&_matchFlags.shouldAbort, 
&expected, YES))
+    if (NO == atomic_compare_exchange_strong(&shouldAbort, &expected, YES))
         NSBeep();
     [abortButton setEnabled:NO];
     [progressIndicator stopAnimation:nil];
@@ -433,7 +433,7 @@
     
     for (BDSKTreeNode *node in pubNodes) {
     
-        if (atomic_load(&_matchFlags.shouldAbort)) break;
+        if (atomic_load(&shouldAbort)) break;
         
         @autoreleasepool {
             
@@ -500,7 +500,7 @@
         }
     }
     
-    if (NO == atomic_load(&_matchFlags.shouldAbort)) {
+    if (NO == atomic_load(&shouldAbort)) {
         dispatch_async(dispatch_get_main_queue(), ^{
             [progressIndicator setDoubleValue:(1.0)];
             [statusField setStringValue:NSLocalizedString(@"Search complete!", 
@"")];
@@ -544,7 +544,7 @@
     BOOL shouldLog = [[NSUserDefaults standardUserDefaults] 
boolForKey:BDSKShouldLogFilesAddedToMatchingSearchIndexKey];
     
     for (NSURL *url in fileURLs) {
-        if (atomic_load(&_matchFlags.shouldAbort)) break;
+        if (atomic_load(&shouldAbort)) break;
         
         SKDocumentRef doc = SKDocumentCreateWithURL((__bridge CFURLRef)url);
         
@@ -562,7 +562,7 @@
         });
     }
     
-    if (NO == atomic_load(&_matchFlags.shouldAbort)) {
+    if (NO == atomic_load(&shouldAbort)) {
         dispatch_async(dispatch_get_main_queue(), ^{
             [progressIndicator setDoubleValue:(1.0)];
             [statusField setStringValue:NSLocalizedString(@"Indexing 
complete!", @"")];

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to