Changeset 2a301ff for libcfa/src/bits


Ignore:
Timestamp:
Aug 31, 2023, 11:31:15 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
950c58e
Parents:
92355883 (diff), 686912c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

Location:
libcfa/src/bits
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/algorithm.hfa

    r92355883 r2a301ff  
    99// Author           : Thierry Delisle
    1010// Created On       : Mon Oct 30 13:37:34 2017
    11 // Last Modified By : --
    12 // Last Modified On : --
    13 // Update Count     : 0
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Sat Jul 22 08:25:29 2023
     13// Update Count     : 3
    1414//
    1515
     
    1717
    1818#ifdef SAFE_SORT
    19 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort2( T * arr );
    20 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort3( T * arr );
    21 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort4( T * arr );
    22 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort5( T * arr );
    23 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort6( T * arr );
    24 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sortN( T * arr, size_t dim );
     19forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort2( T * arr );
     20forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort3( T * arr );
     21forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort4( T * arr );
     22forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort5( T * arr );
     23forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sort6( T * arr );
     24forall( T | { int ?<?( T, T ); int ?>?( T, T ); } ) static inline void __libcfa_small_sortN( T * arr, size_t dim );
    2525
    26 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     26forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    2727static inline void __libcfa_small_sort( T * arr, size_t dim ) {
    2828        switch( dim ) {
     
    4141#define SWAP(x,y) { T a = min(arr[x], arr[y]); T b = max(arr[x], arr[y]); arr[x] = a; arr[y] = b;}
    4242
    43 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     43forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    4444static inline void __libcfa_small_sort2( T * arr ) {
    4545        SWAP(0, 1);
    4646}
    4747
    48 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     48forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    4949static inline void __libcfa_small_sort3( T * arr ) {
    5050        SWAP(1, 2);
     
    5353}
    5454
    55 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     55forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    5656static inline void __libcfa_small_sort4( T * arr ) {
    5757        SWAP(0, 1);
     
    6262}
    6363
    64 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     64forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    6565static inline void __libcfa_small_sort5( T * arr ) {
    6666        SWAP(0, 1);
     
    7575}
    7676
    77 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     77forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    7878static inline void __libcfa_small_sort6( T * arr ) {
    7979        SWAP(1, 2);
     
    9191}
    9292
    93 forall( T | {  int ?<?( T, T ); int ?>?( T, T ); } )
     93forall( T | { int ?<?( T, T ); int ?>?( T, T ); } )
    9494static inline void __libcfa_small_sortN( T * arr, size_t dim ) {
    95         int i, j;
    96         for (i = 1; i < dim; i++) {
     95        for ( i; 1 ~ dim ) {
    9796                T tmp = arr[i];
    98                 for (j = i; j >= 1 && tmp < arr[j-1]; j--) {
     97                int j;
     98                for ( j = i; j >= 1 && tmp < arr[j-1]; j--) {
    9999                        arr[j] = arr[j-1];
    100100                }
     
    175175
    176176static inline void __libcfa_small_sortN( void* * arr, size_t dim ) {
    177         int i, j;
    178         for (i = 1; i < dim; i++) {
    179                 void* tmp = arr[i];
     177        for ( i; 1 ~ dim ) {
     178                void * tmp = arr[i];
     179                int j;
    180180                for (j = i; j >= 1 && tmp < arr[j-1]; j--) {
    181181                        arr[j] = arr[j-1];
  • libcfa/src/bits/collections.hfa

    r92355883 r2a301ff  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // bits/containers.hfa -- Intrusive generic containers.hfa
     7// bits/collections.hfa -- Intrusive generic collections
    88//
    99// Author           : Thierry Delisle
    1010// Created On       : Tue Oct 31 16:38:50 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 11:33:08 2023
    13 // Update Count     : 29
     12// Last Modified On : Wed Aug 30 21:26:39 2023
     13// Update Count     : 30
    1414
    1515#pragma once
  • libcfa/src/bits/debug.cfa

    r92355883 r2a301ff  
    1010// Created On       : Thu Mar 30 12:30:01 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 22 18:20:26 2022
    13 // Update Count     : 13
     12// Last Modified On : Sat Jul 22 08:17:27 2023
     13// Update Count     : 14
    1414//
    1515
     
    3333                        in_buffer += count;
    3434
    35                         for ( ;; ) {
     35                        for () {
    3636                                retcode = write( fd, in_buffer, len - count );
    3737
  • libcfa/src/bits/queue.hfa

    r92355883 r2a301ff  
    9191                        T * prev = 0p;
    9292                        T * curr = (T *)root;
    93                         for ( ;; ) {
     93                        for () {
    9494                                if ( &n == curr ) {                                             // found => remove
    9595                                        if ( (T *)root == &n ) {
  • libcfa/src/bits/weakso_locks.cfa

    r92355883 r2a301ff  
    3030bool register_select( blocking_lock & this, select_node & node ) { return false; }
    3131bool unregister_select( blocking_lock & this, select_node & node ) { return false; }
    32 void on_selected( blocking_lock & this, select_node & node ) {}
     32bool on_selected( blocking_lock & this, select_node & node ) { return true; }
    3333
  • libcfa/src/bits/weakso_locks.hfa

    r92355883 r2a301ff  
    2020#include "bits/locks.hfa"
    2121#include "bits/sequence.hfa"
    22 #include "bits/containers.hfa"
    23 #include "containers/list.hfa"
     22#include "bits/collections.hfa"
     23#include "collections/list.hfa"
    2424
    2525struct select_node;
     
    6262bool register_select( blocking_lock & this, select_node & node ) OPTIONAL_THREAD;
    6363bool unregister_select( blocking_lock & this, select_node & node ) OPTIONAL_THREAD;
    64 void on_selected( blocking_lock & this, select_node & node ) OPTIONAL_THREAD;
     64bool on_selected( blocking_lock & this, select_node & node ) OPTIONAL_THREAD;
     65blocking_lock __CFA_select_get_type( blocking_lock this ) OPTIONAL_THREAD;
    6566
    6667//----------
     
    8081static inline bool   register_select( multiple_acquisition_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); }
    8182static inline bool   unregister_select( multiple_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); }
    82 static inline void   on_selected( multiple_acquisition_lock & this, select_node & node ) { on_selected( (blocking_lock &)this, node ); }
     83static inline bool   on_selected( multiple_acquisition_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); }
     84multiple_acquisition_lock __CFA_select_get_type( multiple_acquisition_lock this );
Note: See TracChangeset for help on using the changeset viewer.