Changeset ebf8ca5 for libcfa/src


Ignore:
Timestamp:
Sep 19, 2022, 6:25:23 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
23a08aa0
Parents:
aa122e9
git-author:
Peter A. Buhr <pabuhr@…> (09/19/22 18:21:09)
git-committer:
Peter A. Buhr <pabuhr@…> (09/19/22 18:25:23)
Message:

switch for-loop from C to CFA format

Location:
libcfa/src
Files:
2 edited

Legend:

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

    raa122e9 rebf8ca5  
    1313// Created On       : Tue Oct 31 15:14:38 2017
    1414// Last Modified By : Peter A. Buhr
    15 // Last Modified On : Wed Aug 12 14:18:07 2020
    16 // Update Count     : 13
     15// Last Modified On : Sat Aug 27 15:06:39 2022
     16// Update Count     : 15
    1717//
    1818
     
    3232                extern void disable_interrupts() OPTIONAL_THREAD;
    3333                extern void enable_interrupts( bool poll = true ) OPTIONAL_THREAD;
     34                extern void poll_interrupts() OPTIONAL_THREAD;
    3435                #define __cfaabi_dbg_record_lock(x, y)
    3536        }
     
    5960
    6061                disable_interrupts();
    61                 for ( unsigned int i = 1;; i += 1 ) {
     62                for ( i; 1 ~ @ ) {
    6263                        if ( (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0) ) break;
    6364                        #ifndef NOEXPBACK
    6465                                // exponential spin
    65                                 for ( volatile unsigned int s = 0; s < spin; s += 1 ) Pause();
     66                        for ( volatile unsigned int s; 0 ~ spin ) Pause();
    6667
    6768                                // slowly increase by powers of 2
  • libcfa/src/iostream.cfa

    raa122e9 rebf8ca5  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 25 18:05:49 2022
    13 // Update Count     : 1354
     12// Last Modified On : Sat Aug 27 15:04:15 2022
     13// Update Count     : 1358
    1414//
    1515
     
    765765                        fmtuc.flags.pc = f.flags.pc;
    766766                        fmtuc.flags.nobsdp = f.flags.nobsdp;
    767                         for ( unsigned int i = 0; f.val[i] != '\0'; i += 1 ) {
     767                        for ( i; 0 ~ @ : @; f.val[i] != '\0' ) {
    768768                                fmtuc.val = f.val[i];
    769769//                              os | fmtuc | nonl;
     
    931931                if ( fmt( is, "%39[0-9]%*[0-9]", s ) == 1 ) {   // take first 39 characters, ignore remaining
    932932                        ullli = 0;
    933                         for ( unsigned int i = 0; s[i] != '\0'; i += 1 ) {
     933                        for ( i; 0 ~ @ : @; s[i] != '\0' ) {
    934934                                ullli = ullli * 10 + s[i] - '0';
    935935                        } // for
Note: See TracChangeset for help on using the changeset viewer.