Changeset f80e0218 for src/libcfa


Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (10 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (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:

Merge branch 'master' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

Location:
src/libcfa
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/Makefile.am

    r1b5c81ed rf80e0218  
    66## file "LICENCE" distributed with Cforall.
    77##
    8 ## Makefile.am -- 
     8## Makefile.am --
    99##
    1010## Author           : Peter A. Buhr
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Wed Apr  6 21:10:44 2016
    14 ## Update Count     : 123
     13## Last Modified On : Mon Jun 13 14:27:22 2016
     14## Update Count     : 166
    1515###############################################################################
    1616
     
    5050        @BACKEND_CC@ -c -o $@ $<
    5151
    52 CFLAGS = -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
    53 CC = ${abs_top_srcdir}/src/driver/cfa 
     52CFLAGS = -quiet -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
     53CC = ${abs_top_srcdir}/src/driver/cfa
    5454
    55 # extension-less header files are overridden by default make rules => explicitly override rule
     55headers = limits stdlib math iostream fstream iterator rational
     56libobjs = ${headers:=.o}
     57
     58# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
    5659% : %.c
    57         true
     60        @true
    5861
    59 .c.o : ${abs_top_srcdir}/src/driver/cfa-cpp
    60         ${CC} ${CFLAGS} -c -o $@ $<
     62${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp       # add dependency to cfa-cpp so all libraries are rebuilt with new translator
    6163
    62 libs = limits stdlib iostream fstream iterator rational
    63 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
     64libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c}
    6465
    65 cheaders = # expat
    66 cfaheaders = # limits
    67 include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders}
     66include_HEADERS = ${headers}
    6867
     68CLEANFILES = libcfa-prelude.c
    6969MAINTAINERCLEANFILES += ${includedir}/*
  • src/libcfa/Makefile.in

    r1b5c81ed rf80e0218  
    8181AR = ar
    8282ARFLAGS = cru
     83AM_V_AR = $(am__v_AR_@AM_V@)
     84am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
     85am__v_AR_0 = @echo "  AR    " $@;
     86AM_V_at = $(am__v_at_@AM_V@)
     87am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
     88am__v_at_0 = @
    8389libcfa_a_AR = $(AR) $(ARFLAGS)
    8490libcfa_a_LIBADD =
    85 am__objects_1 = limits.$(OBJEXT) stdlib.$(OBJEXT) iostream.$(OBJEXT) \
    86         fstream.$(OBJEXT) iterator.$(OBJEXT) rational.$(OBJEXT)
     91am__objects_1 = limits.$(OBJEXT) stdlib.$(OBJEXT) math.$(OBJEXT) \
     92        iostream.$(OBJEXT) fstream.$(OBJEXT) iterator.$(OBJEXT) \
     93        rational.$(OBJEXT)
    8794am_libcfa_a_OBJECTS = libcfa-prelude.$(OBJEXT) $(am__objects_1)
    8895libcfa_a_OBJECTS = $(am_libcfa_a_OBJECTS)
     
    93100COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    94101        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     102AM_V_CC = $(am__v_CC_@AM_V@)
     103am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
     104am__v_CC_0 = @echo "  CC    " $@;
    95105CCLD = $(CC)
    96106LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
     107AM_V_CCLD = $(am__v_CCLD_@AM_V@)
     108am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
     109am__v_CCLD_0 = @echo "  CCLD  " $@;
     110AM_V_GEN = $(am__v_GEN_@AM_V@)
     111am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
     112am__v_GEN_0 = @echo "  GEN   " $@;
    97113SOURCES = $(libcfa_a_SOURCES)
    98114DIST_SOURCES = $(libcfa_a_SOURCES)
     
    105121ALLOCA = @ALLOCA@
    106122AMTAR = @AMTAR@
     123AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
    107124AUTOCONF = @AUTOCONF@
    108125AUTOHEADER = @AUTOHEADER@
     
    110127AWK = @AWK@
    111128BACKEND_CC = @BACKEND_CC@
    112 CC = ${abs_top_srcdir}/src/driver/cfa 
     129CC = ${abs_top_srcdir}/src/driver/cfa
    113130CCDEPMODE = @CCDEPMODE@
     131CFA_BACKEND_CC = @CFA_BACKEND_CC@
    114132CFA_BINDIR = @CFA_BINDIR@
    115133CFA_INCDIR = @CFA_INCDIR@
    116134CFA_LIBDIR = @CFA_LIBDIR@
    117135CFA_PREFIX = @CFA_PREFIX@
    118 CFLAGS = -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
     136CFLAGS = -quiet -g -Wall -Wno-unused-function -B${abs_top_srcdir}/src/driver -XCFA -t  # TEMPORARY: does not build with -O2
    119137CPP = @CPP@
    120138CPPFLAGS = @CPPFLAGS@
     
    130148EGREP = @EGREP@
    131149EXEEXT = @EXEEXT@
    132 GCC_PATH = @GCC_PATH@
    133150GREP = @GREP@
    134151INSTALL = @INSTALL@
     
    213230MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} \
    214231        ${addprefix ${libdir}/,${lib_LIBRARIES}} ${includedir}/*
    215 libs = limits stdlib iostream fstream iterator rational
    216 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c}
    217 cheaders = # expat
    218 cfaheaders = # limits
    219 include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders}
     232headers = limits stdlib math iostream fstream iterator rational
     233libobjs = ${headers:=.o}
     234libcfa_a_SOURCES = libcfa-prelude.c ${headers:=.c}
     235include_HEADERS = ${headers}
     236CLEANFILES = libcfa-prelude.c
    220237all: all-am
    221238
     
    283300        -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
    284301libcfa.a: $(libcfa_a_OBJECTS) $(libcfa_a_DEPENDENCIES) $(EXTRA_libcfa_a_DEPENDENCIES)
    285         -rm -f libcfa.a
    286         $(libcfa_a_AR) libcfa.a $(libcfa_a_OBJECTS) $(libcfa_a_LIBADD)
    287         $(RANLIB) libcfa.a
     302        $(AM_V_at)-rm -f libcfa.a
     303        $(AM_V_AR)$(libcfa_a_AR) libcfa.a $(libcfa_a_OBJECTS) $(libcfa_a_LIBADD)
     304        $(AM_V_at)$(RANLIB) libcfa.a
    288305
    289306mostlyclean-compile:
     
    298315@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcfa-prelude.Po@am__quote@
    299316@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/limits.Po@am__quote@
     317@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@
    300318@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rational.Po@am__quote@
    301319@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdlib.Po@am__quote@
    302320
     321.c.o:
     322@am__fastdepCC_TRUE@    $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
     323@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
     324@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     325@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     326@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
     327
    303328.c.obj:
    304 @am__fastdepCC_TRUE@    $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
    305 @am__fastdepCC_TRUE@    $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
    306 @AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     329@am__fastdepCC_TRUE@    $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
     330@am__fastdepCC_TRUE@    $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
     331@AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
    307332@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    308 @am__fastdepCC_FALSE@   $(COMPILE) -c `$(CYGPATH_W) '$<'`
     333@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
    309334install-cfalibDATA: $(cfalib_DATA)
    310335        @$(NORMAL_INSTALL)
     
    455480
    456481clean-generic:
     482        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
    457483
    458484distclean-generic:
     
    579605        @BACKEND_CC@ -c -o $@ $<
    580606
    581 # extension-less header files are overridden by default make rules => explicitly override rule
     607# extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing
    582608% : %.c
    583         true
    584 
    585 .c.o : ${abs_top_srcdir}/src/driver/cfa-cpp
    586         ${CC} ${CFLAGS} -c -o $@ $<
     609        @true
     610
     611${libobjs} : ${abs_top_srcdir}/src/driver/cfa-cpp       # add dependency to cfa-cpp so all libraries are rebuilt with new translator
    587612
    588613# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • src/libcfa/fstream

    r1b5c81ed rf80e0218  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr  5 22:37:12 2016
    13 // Update Count     : 82
     12// Last Modified On : Thu Apr 28 08:08:04 2016
     13// Update Count     : 88
    1414//
    1515
     
    2323        void *file;
    2424        _Bool sepDefault;
    25         _Bool sepOnOff;
     25        int sepOnOff;                                                                           // FIX ME: type should be _Bool
    2626        char separator[separateSize];
    2727}; // ofstream
  • src/libcfa/fstream.c

    r1b5c81ed rf80e0218  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // fstream.c -- 
     7// fstream.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Apr  6 17:55:27 2016
    13 // Update Count     : 176
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Mon May 02 15:14:52 2016
     13// Update Count     : 187
    1414//
    1515
     
    7575        if ( fclose( (FILE *)(os->file) ) == EOF ) {
    7676                perror( IO_MSG "close output" );
    77         } // if 
     77        } // if
    7878} // close
    7979
     
    9393int prtfmt( ofstream * os, const char fmt[], ... ) {
    9494    va_list args;
    95 
    9695    va_start( args, fmt );
    9796    int len = vfprintf( (FILE *)(os->file), fmt, args );
     
    103102        } // if
    104103    va_end( args );
     104
     105        sepReset( os );                                                                         // reset separator
    105106        return len;
    106107} // prtfmt
     
    139140        if ( fclose( (FILE *)(is->file) ) == EOF ) {
    140141                perror( IO_MSG "close input" );
    141         } // if 
     142        } // if
    142143} // close
    143144
     
    154155        return is;
    155156} // read
    156  
     157
    157158ifstream *ungetc( ifstream * is, char c ) {
    158159        if ( fail( is ) ) {
  • src/libcfa/iostream.c

    r1b5c81ed rf80e0218  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // iostream.c -- 
     7// iostream.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Apr  6 16:13:29 2016
    13 // Update Count     : 278
     12// Last Modified On : Thu May 26 10:08:31 2016
     13// Update Count     : 305
    1414//
    1515
     
    2121#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    2222#include <complex.h>                                                                    // creal, cimag
    23 #include <ctype.h>                                                                              // isspace, ispunct
    2423}
    2524
     
    3433ostype * ?|?( ostype *os, short int si ) {
    3534        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    36         sepReset( os );
    3735        prtfmt( os, "%hd", si );
    3836        return os;
     
    4240ostype * ?|?( ostype *os, unsigned short int usi ) {
    4341        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    44         sepReset( os );
    4542        prtfmt( os, "%hu", usi );
    4643        return os;
     
    5047ostype * ?|?( ostype *os, int i ) {
    5148        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    52         sepReset( os );
    5349        prtfmt( os, "%d", i );
    5450        return os;
     
    5854ostype * ?|?( ostype *os, unsigned int ui ) {
    5955        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    60         sepReset( os );
    6156        prtfmt( os, "%u", ui );
    6257        return os;
     
    6661ostype * ?|?( ostype *os, long int li ) {
    6762        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    68         sepReset( os );
    6963        prtfmt( os, "%ld", li );
    7064        return os;
     
    7468ostype * ?|?( ostype *os, unsigned long int uli ) {
    7569        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    76         sepReset( os );
    7770        prtfmt( os, "%lu", uli );
    7871        return os;
     
    8275ostype * ?|?( ostype *os, long long int lli ) {
    8376        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    84         sepReset( os );
    8577        prtfmt( os, "%lld", lli );
    8678        return os;
     
    9082ostype * ?|?( ostype *os, unsigned long long int ulli ) {
    9183        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    92         sepReset( os );
    9384        prtfmt( os, "%llu", ulli );
    9485        return os;
     
    9889ostype * ?|?( ostype *os, float f ) {
    9990        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    100         sepReset( os );
    10191        prtfmt( os, "%g", f );
    10292        return os;
     
    10696ostype * ?|?( ostype *os, double d ) {
    10797        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    108         sepReset( os );
    10998        prtfmt( os, "%.*lg", DBL_DIG, d );
    11099        return os;
     
    114103ostype * ?|?( ostype *os, long double ld ) {
    115104        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    116         sepReset( os );
    117105        prtfmt( os, "%.*Lg", LDBL_DIG, ld );
    118106        return os;
     
    155143                // opening delimiters
    156144                ['('] : Open, ['['] : Open, ['{'] : Open,
    157                 ['$'] : Open, [(unsigned char)'£'] : Open, [(unsigned char)'¥'] : Open, [(unsigned char)'¿'] : Open, [(unsigned char)'«'] : Open,
     145                ['$'] : Open, [(unsigned char)'£'] : Open, [(unsigned char)'¥'] : Open,
     146                [(unsigned char)'¡'] : Open, [(unsigned char)'¿'] : Open, [(unsigned char)'«'] : Open,
    158147                // closing delimiters
    159148                [','] : Close, ['.'] : Close, [':'] : Close, [';'] : Close, ['!'] : Close, ['?'] : Close,
     
    162151                // opening-closing delimiters
    163152                ['\''] : OpenClose, ['`'] : OpenClose, ['"'] : OpenClose,
    164                 ['\f'] : OpenClose, ['\n'] : OpenClose, ['\r'] : OpenClose, ['\t'] : OpenClose, ['\v'] : OpenClose, // isspace
     153                [' '] : OpenClose, ['\f'] : OpenClose, ['\n'] : OpenClose, ['\r'] : OpenClose, ['\t'] : OpenClose, ['\v'] : OpenClose, // isspace
    165154        }; // mask
    166155
    167         int len = strlen( cp );
    168         // null string => no separator
    169   if ( len == 0 ) { sepOff( os ); return os; }
     156  if ( cp[0] == '\0' ) { sepOff( os ); return os; }             // null string => no separator
     157
    170158        // first character IS NOT spacing or closing punctuation => add left separator
    171159        unsigned char ch = cp[0];                                                       // must make unsigned
     
    173161                prtfmt( os, "%s", sepGet( os ) );
    174162        } // if
     163
     164        // if string starts line, must reset to determine open state because separator is off
     165        sepReset( os );                                                                         // reset separator
     166
    175167        // last character IS spacing or opening punctuation => turn off separator for next item
    176         unsigned int posn = len - 1;
     168        unsigned int len = strlen( cp ), posn = len - 1;
    177169        ch = cp[posn];                                                                          // must make unsigned
    178         if ( mask[ ch ] == Open || mask[ ch ] == OpenClose ) {
     170        if ( sepPrt( os ) && mask[ ch ] != Open && mask[ ch ] != OpenClose ) {
     171                sepOn( os );
     172        } else {
    179173                sepOff( os );
    180         } else {
    181                 sepOn( os );
    182174        } // if
    183175        return write( os, cp, len );
     
    187179ostype * ?|?( ostype *os, const void *p ) {
    188180        if ( sepPrt( os ) ) prtfmt( os, "%s", sepGet( os ) );
    189         sepReset( os );
    190181        prtfmt( os, "%p", p );
    191182        return os;
     
    193184
    194185
    195 forall( dtype ostype | ostream( ostype ) ) 
     186forall( dtype ostype | ostream( ostype ) )
    196187ostype * ?|?( ostype *os, ostype * (* manip)( ostype * ) ) {
    197188        return manip( os );
    198189} // ?|?
    199190
    200 forall( dtype ostype | ostream( ostype ) ) 
     191forall( dtype ostype | ostream( ostype ) )
    201192ostype * endl( ostype * os ) {
    202193        os | '\n';
     
    206197} // endl
    207198
    208 forall( dtype ostype | ostream( ostype ) ) 
     199forall( dtype ostype | ostream( ostype ) )
    209200ostype * sepOn( ostype * os ) {
    210201        sepOn( os );
     
    212203} // sepOn
    213204
    214 forall( dtype ostype | ostream( ostype ) ) 
     205forall( dtype ostype | ostream( ostype ) )
    215206ostype * sepOff( ostype * os ) {
    216207        sepOff( os );
     
    218209} // sepOff
    219210
    220 forall( dtype ostype | ostream( ostype ) ) 
     211forall( dtype ostype | ostream( ostype ) )
    221212ostype * sepEnable( ostype * os ) {
    222213        sepEnable( os );
     
    224215} // sepEnable
    225216
    226 forall( dtype ostype | ostream( ostype ) ) 
     217forall( dtype ostype | ostream( ostype ) )
    227218ostype * sepDisable( ostype * os ) {
    228219        sepDisable( os );
     
    344335} // ?|?
    345336
    346 _Istream_cstrUC cstr( char * s ) { _Istream_cstrUC s = { s }; return s; }
     337_Istream_cstrUC cstr( char * str ) { return (_Istream_cstrUC){ str }; }
    347338forall( dtype istype | istream( istype ) )
    348339istype * ?|?( istype * is, _Istream_cstrUC cstr ) {
     
    351342} // cstr
    352343
    353 _Istream_cstrC cstr( char * s, int size ) { _Istream_cstrC s = { s, size }; return s; }
     344_Istream_cstrC cstr( char * str, int size ) { return (_Istream_cstrC){ str, size }; }
    354345forall( dtype istype | istream( istype ) )
    355346istype * ?|?( istype * is, _Istream_cstrC cstr ) {
  • src/libcfa/prelude.cf

    r1b5c81ed rf80e0218  
    11# 2 "prelude.cf"  // needed for error messages from this file
    2 //                               -*- Mode: C -*- 
    3 // 
     2//                               -*- Mode: C -*-
     3//
    44// Copyright (C) Glen Ditchfield 1994, 1999
    5 // 
     5//
    66// prelude.cf -- Standard Cforall Preample for C99
    7 // 
     7//
    88// Author           : Glen Ditchfield
    99// Created On       : Sat Nov 29 07:23:41 2014
     
    117117forall( ftype FT ) lvalue FT             *?( FT * );
    118118
    119 _Bool                   +?( _Bool ),                    -?( _Bool ),                    ~?( _Bool );         
    120 signed int              +?( signed int ),               -?( signed int ),               ~?( signed int );           
    121 unsigned int            +?( unsigned int ),             -?( unsigned int ),             ~?( unsigned int );         
    122 signed long int         +?( signed long int ),          -?( signed long int ),          ~?( signed long int );       
    123 unsigned long int       +?( unsigned long int ),        -?( unsigned long int ),        ~?( unsigned long int );             
    124 signed long long int    +?( signed long long int ),     -?( signed long long int ),     ~?( signed long long int );   
    125 unsigned long long int  +?( unsigned long long int ),   -?( unsigned long long int ),   ~?( unsigned long long int ); 
     119_Bool                   +?( _Bool ),                    -?( _Bool ),                    ~?( _Bool );
     120signed int              +?( signed int ),               -?( signed int ),               ~?( signed int );
     121unsigned int            +?( unsigned int ),             -?( unsigned int ),             ~?( unsigned int );
     122signed long int         +?( signed long int ),          -?( signed long int ),          ~?( signed long int );
     123unsigned long int       +?( unsigned long int ),        -?( unsigned long int ),        ~?( unsigned long int );
     124signed long long int    +?( signed long long int ),     -?( signed long long int ),     ~?( signed long long int );
     125unsigned long long int  +?( unsigned long long int ),   -?( unsigned long long int ),   ~?( unsigned long long int );
    126126float                   +?( float ),                    -?( float );
    127127double                  +?( double ),                   -?( double );
     
    627627                        ?+=?( long double _Complex *, long double _Complex ), ?+=?( volatile long double _Complex *, long double _Complex ),
    628628                        ?-=?( long double _Complex *, long double _Complex ), ?-=?( volatile long double _Complex *, long double _Complex );
     629
     630
     631
     632
     633
     634// ------------------------------------------------------------
     635//
     636// Section ??? Constructors and Destructors
     637//
     638// ------------------------------------------------------------
     639
     640// default ctor
     641void    ?{}( _Bool * ),                         ?{}( volatile _Bool * );
     642void    ?{}( char * ),  ?{}( volatile char * );
     643void    ?{}( unsigned char * ), ?{}( volatile unsigned char * );
     644void    ?{}( char signed * ),                   ?{}( volatile char signed * );
     645void    ?{}( int short * ),                             ?{}( volatile int short * );
     646void    ?{}( int short unsigned * ),    ?{}( volatile int short unsigned * );
     647void    ?{}( signed int * ),                    ?{}( volatile signed int * );
     648void    ?{}( unsigned int * ),                  ?{}( volatile unsigned int * );
     649void    ?{}( signed long int * ),               ?{}( volatile signed long int * );
     650void    ?{}( unsigned long int * ),             ?{}( volatile unsigned long int * );
     651void    ?{}( signed long long int * ),          ?{}( volatile signed long long int * );
     652void    ?{}( unsigned long long int * ),        ?{}( volatile unsigned long long int * );
     653void    ?{}( float * ),                         ?{}( volatile float * );
     654void    ?{}( double * ),                        ?{}( volatile double * );
     655void    ?{}( long double * ),                   ?{}( volatile long double * );
     656void    ?{}( float _Complex * ),                ?{}( volatile float _Complex * );
     657void    ?{}( double _Complex * ),               ?{}( volatile double _Complex * );
     658void    ?{}( long double _Complex * ),          ?{}( volatile long double _Complex * );
     659
     660// copy ctor
     661void    ?{}( _Bool *, _Bool ),                                  ?{}( volatile _Bool *, _Bool );
     662void    ?{}( char *, char ),    ?{}( volatile char *, char );
     663void    ?{}( unsigned char *, unsigned char ),                  ?{}( volatile unsigned char *, unsigned char );
     664void    ?{}( char signed *, char signed ),                      ?{}( volatile char signed *, char signed );
     665void    ?{}( int short *, int short ),                          ?{}( volatile int short *, int short );
     666void    ?{}( int short unsigned *, int short unsigned ),        ?{}( volatile int short unsigned *, int short unsigned );
     667void    ?{}( signed int *, signed int),                         ?{}( volatile signed int *, signed int );
     668void    ?{}( unsigned int *, unsigned int),                     ?{}( volatile unsigned int *, unsigned int );
     669void    ?{}( signed long int *, signed long int),               ?{}( volatile signed long int *, signed long int );
     670void    ?{}( unsigned long int *, unsigned long int),           ?{}( volatile unsigned long int *, unsigned long int );
     671void    ?{}( signed long long int *, signed long long int),     ?{}( volatile signed long long int *, signed long long int );
     672void    ?{}( unsigned long long int *, unsigned long long int), ?{}( volatile unsigned long long int *, unsigned long long int );
     673void    ?{}( float *, float),                                   ?{}( volatile float *, float );
     674void    ?{}( double *, double),                                 ?{}( volatile double *, double );
     675void    ?{}( long double *, long double),                       ?{}( volatile long double *, long double );
     676void    ?{}( float _Complex *, float _Complex),                 ?{}( volatile float _Complex *, float _Complex );
     677void    ?{}( double _Complex *, double _Complex),               ?{}( volatile double _Complex *, double _Complex );
     678void    ?{}( long double _Complex *, long double _Complex),     ?{}( volatile long double _Complex *, long double _Complex );
     679
     680// dtor
     681void    ^?{}( _Bool * ),                        ^?{}( volatile _Bool * );
     682void    ^?{}( char * ), ^?{}( volatile char * );
     683void    ^?{}( char unsigned * ),                        ^?{}( volatile char unsigned * );
     684void    ^?{}( char signed * ),                  ^?{}( volatile char signed * );
     685void    ^?{}( int short * ),                            ^?{}( volatile int short * );
     686void    ^?{}( int short unsigned * ),   ^?{}( volatile int short unsigned * );
     687void    ^?{}( signed int * ),                   ^?{}( volatile signed int * );
     688void    ^?{}( unsigned int * ),                 ^?{}( volatile unsigned int * );
     689void    ^?{}( signed long int * ),              ^?{}( volatile signed long int * );
     690void    ^?{}( unsigned long int * ),            ^?{}( volatile unsigned long int * );
     691void    ^?{}( signed long long int * ),         ^?{}( volatile signed long long int * );
     692void    ^?{}( unsigned long long int * ),       ^?{}( volatile unsigned long long int * );
     693void    ^?{}( float * ),                        ^?{}( volatile float * );
     694void    ^?{}( double * ),                       ^?{}( volatile double * );
     695void    ^?{}( long double * ),                  ^?{}( volatile long double * );
     696void    ^?{}( float _Complex * ),               ^?{}( volatile float _Complex * );
     697void    ^?{}( double _Complex * ),              ^?{}( volatile double _Complex * );
     698void    ^?{}( long double _Complex * ),         ^?{}( volatile long double _Complex * );
     699
     700// // default ctor
     701// forall( dtype DT ) void       ?{}(                DT ** );
     702// forall( dtype DT ) void       ?{}( const          DT ** );
     703// forall( dtype DT ) void       ?{}(       volatile DT ** );
     704// forall( dtype DT ) void       ?{}( const volatile DT ** );
     705
     706// // copy ctor
     707// forall( dtype DT ) void       ?{}(                DT **, DT* );
     708// forall( dtype DT ) void       ?{}( const          DT **, DT* );
     709// forall( dtype DT ) void       ?{}(       volatile DT **, DT* );
     710// forall( dtype DT ) void       ?{}( const volatile DT **, DT* );
     711
     712// // dtor
     713// forall( dtype DT ) void      ^?{}(                DT ** );
     714// forall( dtype DT ) void      ^?{}( const          DT ** );
     715// forall( dtype DT ) void      ^?{}(       volatile DT ** );
     716// forall( dtype DT ) void      ^?{}( const volatile DT ** );
     717
     718// copied from assignment section
     719// copy constructors
     720forall( ftype FT ) void ?{}( FT **, FT * );
     721forall( ftype FT ) void ?{}( FT * volatile *, FT * );
     722
     723forall( dtype DT ) void ?{}(                 DT *          *,                   DT * );
     724forall( dtype DT ) void ?{}(                 DT * volatile *,                   DT * );
     725forall( dtype DT ) void ?{}( const           DT *          *,                   DT * );
     726forall( dtype DT ) void ?{}( const           DT * volatile *,                   DT * );
     727forall( dtype DT ) void ?{}( const           DT *          *, const             DT * );
     728forall( dtype DT ) void ?{}( const           DT * volatile *, const             DT * );
     729forall( dtype DT ) void ?{}(       volatile  DT *          *,                   DT * );
     730forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   DT * );
     731forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    DT * );
     732forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    DT * );
     733
     734forall( dtype DT ) void ?{}( const volatile  DT *          *,                   DT * );
     735forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   DT * );
     736forall( dtype DT ) void ?{}( const volatile  DT *          *, const             DT * );
     737forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             DT * );
     738forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    DT * );
     739forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    DT * );
     740forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    DT * );
     741forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    DT * );
     742
     743forall( dtype DT ) void ?{}(                 DT *          *,                   void * );
     744forall( dtype DT ) void ?{}(                 DT * volatile *,                   void * );
     745forall( dtype DT ) void ?{}( const           DT *          *,                   void * );
     746forall( dtype DT ) void ?{}( const           DT * volatile *,                   void * );
     747forall( dtype DT ) void ?{}( const           DT *          *, const             void * );
     748forall( dtype DT ) void ?{}( const           DT * volatile *, const             void * );
     749forall( dtype DT ) void ?{}(       volatile  DT *          *,                   void * );
     750forall( dtype DT ) void ?{}(       volatile  DT * volatile *,                   void * );
     751forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    void * );
     752forall( dtype DT ) void ?{}(       volatile  DT * volatile *,       volatile    void * );
     753
     754forall( dtype DT ) void ?{}( const volatile  DT *          *,                   void * );
     755forall( dtype DT ) void ?{}( const volatile  DT * volatile *,                   void * );
     756forall( dtype DT ) void ?{}( const volatile  DT *          *, const             void * );
     757forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const             void * );
     758forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    void * );
     759forall( dtype DT ) void ?{}( const volatile  DT * volatile *,       volatile    void * );
     760forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    void * );
     761forall( dtype DT ) void ?{}( const volatile  DT * volatile *, const volatile    void * );
     762
     763forall( dtype DT ) void ?{}(                 void *          *,                 DT * );
     764forall( dtype DT ) void ?{}(                 void * volatile *,                 DT * );
     765forall( dtype DT ) void ?{}( const           void *          *,                 DT * );
     766forall( dtype DT ) void ?{}( const           void * volatile *,                 DT * );
     767forall( dtype DT ) void ?{}( const           void *          *, const           DT * );
     768forall( dtype DT ) void ?{}( const           void * volatile *, const           DT * );
     769forall( dtype DT ) void ?{}(        volatile void *          *,                 DT * );
     770forall( dtype DT ) void ?{}(        volatile void * volatile *,                 DT * );
     771forall( dtype DT ) void ?{}(        volatile void *          *,       volatile  DT * );
     772forall( dtype DT ) void ?{}(        volatile void * volatile *,       volatile  DT * );
     773forall( dtype DT ) void ?{}( const volatile void *           *,                 DT * );
     774forall( dtype DT ) void ?{}( const volatile void * volatile *,                  DT * );
     775forall( dtype DT ) void ?{}( const volatile void *           *, const           DT * );
     776forall( dtype DT ) void ?{}( const volatile void * volatile *, const            DT * );
     777forall( dtype DT ) void ?{}( const volatile void *           *,       volatile  DT * );
     778forall( dtype DT ) void ?{}( const volatile void * volatile *,        volatile  DT * );
     779forall( dtype DT ) void ?{}( const volatile void *           *, const volatile  DT * );
     780forall( dtype DT ) void ?{}( const volatile void * volatile *, const volatile   DT * );
     781
     782void    ?{}(                void *          *,                void * );
     783void    ?{}(                void * volatile *,                void * );
     784void    ?{}( const          void *          *,                void * );
     785void    ?{}( const          void * volatile *,                void * );
     786void    ?{}( const          void *          *, const          void * );
     787void    ?{}( const          void * volatile *, const          void * );
     788void    ?{}(       volatile void *          *,                void * );
     789void    ?{}(       volatile void * volatile *,                void * );
     790void    ?{}(       volatile void *          *,       volatile void * );
     791void    ?{}(       volatile void * volatile *,       volatile void * );
     792void    ?{}( const volatile void *          *,                void * );
     793void    ?{}( const volatile void * volatile *,                void * );
     794void    ?{}( const volatile void *          *, const          void * );
     795void    ?{}( const volatile void * volatile *, const          void * );
     796void    ?{}( const volatile void *          *,       volatile void * );
     797void    ?{}( const volatile void * volatile *,       volatile void * );
     798void    ?{}( const volatile void *          *, const volatile void * );
     799void    ?{}( const volatile void * volatile *, const volatile void * );
     800
     801//forall( dtype DT ) void ?{}(              DT *          *, forall( dtype DT2 ) const DT2 * );
     802//forall( dtype DT ) void ?{}(              DT * volatile *, forall( dtype DT2 ) const DT2 * );
     803forall( dtype DT ) void ?{}( const          DT *          *, forall( dtype DT2 ) const DT2 * );
     804forall( dtype DT ) void ?{}( const          DT * volatile *, forall( dtype DT2 ) const DT2 * );
     805//forall( dtype DT ) void ?{}( volatile     DT *          *, forall( dtype DT2 ) const DT2 * );
     806//forall( dtype DT ) void ?{}( volatile     DT * volatile *, forall( dtype DT2 ) const DT2 * );
     807forall( dtype DT ) void ?{}( const volatile DT *          *, forall( dtype DT2 ) const DT2 * );
     808forall( dtype DT ) void ?{}( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 * );
     809
     810forall( ftype FT ) void ?{}( FT *          *, forall( ftype FT2 ) FT2 * );
     811forall( ftype FT ) void ?{}( FT * volatile *, forall( ftype FT2 ) FT2 * );
     812
     813// default ctors
     814forall( ftype FT ) void ?{}( FT *          * );
     815forall( ftype FT ) void ?{}( FT * volatile * );
     816
     817forall( dtype DT ) void ?{}(                 DT *          *);
     818forall( dtype DT ) void ?{}(                 DT * volatile *);
     819forall( dtype DT ) void ?{}( const           DT *          *);
     820forall( dtype DT ) void ?{}( const           DT * volatile *);
     821forall( dtype DT ) void ?{}(       volatile  DT *          *);
     822forall( dtype DT ) void ?{}(       volatile  DT * volatile *);
     823forall( dtype DT ) void ?{}( const volatile  DT *          *);
     824forall( dtype DT ) void ?{}( const volatile  DT * volatile *);
     825
     826void    ?{}(                void *          *);
     827void    ?{}(                void * volatile *);
     828void    ?{}( const          void *          *);
     829void    ?{}( const          void * volatile *);
     830void    ?{}(       volatile void *          *);
     831void    ?{}(       volatile void * volatile *);
     832void    ?{}( const volatile void *          *);
     833void    ?{}( const volatile void * volatile *);
     834
     835// dtors
     836forall( ftype FT ) void ^?{}( FT *         * );
     837forall( ftype FT ) void ^?{}( FT * volatile * );
     838
     839forall( dtype DT ) void ^?{}(                DT *          *);
     840forall( dtype DT ) void ^?{}(                DT * volatile *);
     841forall( dtype DT ) void ^?{}( const          DT *          *);
     842forall( dtype DT ) void ^?{}( const          DT * volatile *);
     843forall( dtype DT ) void ^?{}(      volatile  DT *          *);
     844forall( dtype DT ) void ^?{}(      volatile  DT * volatile *);
     845forall( dtype DT ) void ^?{}( const volatile  DT *         *);
     846forall( dtype DT ) void ^?{}( const volatile  DT * volatile *);
     847
     848void    ^?{}(               void *          *);
     849void    ^?{}(               void * volatile *);
     850void    ^?{}( const         void *          *);
     851void    ^?{}( const         void * volatile *);
     852void    ^?{}(      volatile void *          *);
     853void    ^?{}(      volatile void * volatile *);
     854void    ^?{}( const volatile void *         *);
     855void    ^?{}( const volatile void * volatile *);
  • src/libcfa/rational

    r1b5c81ed rf80e0218  
    1212// Created On       : Wed Apr  6 17:56:25 2016
    1313// Last Modified By : Peter A. Buhr
    14 // Last Modified On : Fri Apr  8 11:38:27 2016
    15 // Update Count     : 15
     14// Last Modified On : Wed May  4 14:11:45 2016
     15// Update Count     : 16
    1616//
    1717
     
    2828
    2929// constructors
    30 Rational rational();
    31 Rational rational( long int n );
    32 Rational rational( long int n, long int d );
     30void ?{}( Rational * r );
     31void ?{}( Rational * r, long int n );
     32void ?{}( Rational * r, long int n, long int d );
    3333
    3434// getter/setter for numerator/denominator
  • src/libcfa/rational.c

    r1b5c81ed rf80e0218  
    1111// Created On       : Wed Apr  6 17:54:28 2016
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Apr 12 21:26:42 2016
    14 // Update Count     : 21
     13// Last Modified On : Wed May  4 14:16:14 2016
     14// Update Count     : 25
    1515//
    1616
     
    1818#include "fstream"
    1919#include "stdlib"
     20#include "math"                                                                                 // floor
    2021
    2122
     
    5253// constructors
    5354
    54 Rational rational() {
    55     return (Rational){ 0, 1 };
     55void ?{}( Rational * r ) {
     56    r{ 0, 1 };
    5657} // rational
    5758
    58 Rational rational( long int n ) {
    59     return (Rational){ n, 1 };
     59void ?{}( Rational * r, long int n ) {
     60    r{ n, 1 };
    6061} // rational
    6162
    62 Rational rational( long int n, long int d ) {
     63void ?{}( Rational * r, long int n, long int d ) {
    6364    long int t = simplify( &n, &d );                                    // simplify
    64     return (Rational){ n / t, d / t };
     65    r->numerator = n / t;
     66        r->denominator = d / t;
    6567} // rational
    6668
     
    171173Rational narrow( double f, long int md ) {
    172174        if ( md <= 1 ) {                                                                        // maximum fractional digits too small?
    173                 Rational t = rational( f, 1 );                                  // truncate fraction
    174                 return t;
     175                return (Rational){ f, 1};                                               // truncate fraction
    175176        } // if
    176177
     
    198199                k[2] = x * k[1] + k[0]; k[0] = k[1]; k[1] = k[2];
    199200        } // for
    200         Rational t = rational( neg ? -h[1] : h[1], k[1] );
    201         return t;
     201        return (Rational){ neg ? -h[1] : h[1], k[1] };
    202202} // narrow
    203203
  • src/libcfa/stdlib

    r1b5c81ed rf80e0218  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Apr 13 14:45:53 2016
    13 // Update Count     : 85
     12// Last Modified On : Wed Apr 27 22:03:29 2016
     13// Update Count     : 96
    1414//
    1515
     
    2828#endif // ! EXIT_FAILURE
    2929void exit( int rc );
     30void abort( void );
    3031} // extern "C"
    3132
    3233//---------------------------------------
    3334
    34 extern "C" {
    35 void * malloc( size_t );                                                                // use default C routine for void *
    36 } // extern "C"
     35extern "C" { void * malloc( size_t ); }                                 // use default C routine for void *
    3736forall( otype T ) T * malloc( void );
    3837forall( otype T ) T * malloc( char fill );
    3938forall( otype T ) T * malloc( T * ptr, size_t size );
    4039forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
    41 extern "C" {
    42 void * calloc( size_t nmemb, size_t size );                             // use default C routine for void *
    43 } // extern "C"
     40extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
    4441forall( otype T ) T * calloc( size_t nmemb );
    45 extern "C" {
    46 void * realloc( void * ptr, size_t size );                              // use default C routine for void *
    47 } // extern "C"
     42extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
    4843forall( otype T ) T * realloc( T * ptr, size_t size );
    4944forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
     
    5348forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
    5449
    55 forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
    56 forall( otype T ) T * memset( T * ptr );                                // remove when default value available
     50extern "C" {
     51void * memset( void * ptr, int fill, size_t size );
     52void free( void * ptr );
     53} // extern "C"
    5754
    5855//---------------------------------------
     
    10097
    10198char abs( char );
    102 extern "C" {
    103 int abs( int );                                                                                 // use default C routine for int
    104 } // extern "C"
     99extern "C" { int abs( int ); }                                                  // use default C routine for int
    105100long int abs( long int );
    106101long long int abs( long long int );
     
    108103double abs( double );
    109104long double abs( long double );
    110 float _Complex abs( float _Complex );
    111 double _Complex abs( double _Complex );
    112 long double _Complex abs( long double _Complex );
    113 
    114 //---------------------------------------
    115 
    116 float floor( float );
    117 extern "C" {
    118 double floor( double );                                                                 // use C routine for double
    119 } // extern "C"
    120 long double floor( long double );
    121 
    122 float ceil( float );
    123 extern "C" {
    124 double ceil( double );                                                                  // use C routine for double
    125 } // extern "C"
    126 long double ceil( long double );
     105float abs( float _Complex );
     106double abs( double _Complex );
     107long double abs( long double _Complex );
    127108
    128109//---------------------------------------
  • src/libcfa/stdlib.c

    r1b5c81ed rf80e0218  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Apr 13 14:49:58 2016
    13 // Update Count     : 155
     12// Last Modified On : Thu Apr 28 07:54:21 2016
     13// Update Count     : 166
    1414//
    1515
     
    2424#include <malloc.h>                                                                             // malloc_usable_size
    2525#include <math.h>                                                                               // fabsf, fabs, fabsl
    26 #include <complex.h>                                                                    // _Complex_I, cabsf, cabs, cabsl
     26#include <complex.h>                                                                    // _Complex_I
    2727} // extern "C"
    2828
     
    3434        //printf( "malloc3\n" );
    3535        T * ptr = (T *)malloc( sizeof(T) );
    36     return memset( ptr );
     36    return memset( ptr, (int)fill, sizeof(T) );
    3737} // malloc
    3838
     
    7878} // posix_memalign
    7979
    80 forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill
    81         //printf( "memset1\n" );
    82     return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) );
    83 } // memset
    84 forall( otype T ) T * memset( T * ptr ) {                               // remove when default value available
    85         //printf( "memset2\n" );
    86     return (T *)memset( ptr, 0, malloc_usable_size( ptr ) );
    87 } // memset
    88 
    8980//---------------------------------------
    9081
    9182int ato( const char * ptr ) {
    9283        int i;
    93         if ( sscanf( ptr, "%d", &i ) == EOF ) {}                        // check return code
     84        if ( sscanf( ptr, "%d", &i ) == EOF ) {}
    9485        return i;
    9586}
    9687unsigned int ato( const char * ptr ) {
    9788        unsigned int ui;
    98         if ( sscanf( ptr, "%u", &ui ) == EOF ) {}                       // check return code
     89        if ( sscanf( ptr, "%u", &ui ) == EOF ) {}
    9990        return ui;
    10091}
    10192long int ato( const char * ptr ) {
    10293        long int li;
    103         if ( sscanf( ptr, "%ld", &li ) == EOF ) {}                      // check return code
     94        if ( sscanf( ptr, "%ld", &li ) == EOF ) {}
    10495        return li;
    10596}
    10697unsigned long int ato( const char * ptr ) {
    10798        unsigned long int uli;
    108         if ( sscanf( ptr, "%lu", &uli ) == EOF ) {}                     // check return code
     99        if ( sscanf( ptr, "%lu", &uli ) == EOF ) {}
    109100        return uli;
    110101}
    111102long long int ato( const char * ptr ) {
    112103        long long int lli;
    113         if ( sscanf( ptr, "%lld", &lli ) == EOF ) {}            // check return code
     104        if ( sscanf( ptr, "%lld", &lli ) == EOF ) {}
    114105        return lli;
    115106}
    116107unsigned long long int ato( const char * ptr ) {
    117108        unsigned long long int ulli;
    118         if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {}           // check return code
     109        if ( sscanf( ptr, "%llu", &ulli ) == EOF ) {}
    119110        return ulli;
    120111}
     
    122113float ato( const char * ptr ) {
    123114        float f;
    124         if ( sscanf( ptr, "%f", &f ) == EOF ) {}                        // check return code
     115        if ( sscanf( ptr, "%f", &f ) == EOF ) {}
    125116        return f;
    126117}
    127118double ato( const char * ptr ) {
    128119        double d;
    129         if ( sscanf( ptr, "%lf", &d ) == EOF ) {}                       // check return code
     120        if ( sscanf( ptr, "%lf", &d ) == EOF ) {}
    130121        return d;
    131122}
    132123long double ato( const char * ptr ) {
    133124        long double ld;
    134         if ( sscanf( ptr, "%Lf", &ld ) == EOF ) {}                      // check return code
     125        if ( sscanf( ptr, "%Lf", &ld ) == EOF ) {}
    135126        return ld;
    136127}
     
    138129float _Complex ato( const char * ptr ) {
    139130        float re, im;
    140         if ( sscanf( ptr, "%g%gi", &re, &im ) == EOF ) {}       // check return code
     131        if ( sscanf( ptr, "%g%gi", &re, &im ) == EOF ) {}
    141132        return re + im * _Complex_I;
    142133}
    143134double _Complex ato( const char * ptr ) {
    144135        double re, im;
    145         if ( sscanf( ptr, "%lf%lfi", &re, &im ) == EOF ) {} // check return code
     136        if ( sscanf( ptr, "%lf%lfi", &re, &im ) == EOF ) {}
    146137        return re + im * _Complex_I;
    147138}
    148139long double _Complex ato( const char * ptr ) {
    149140        long double re, im;
    150         if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {}     // check return code
     141        if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {}
    151142        return re + im * _Complex_I;
    152143}       
     
    222213//---------------------------------------
    223214
    224 forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    225 [ T, T ] div( T t1, T t2 ) { /* return [ t1 / t2, t1 % t2 ]; */ }
     215// forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
     216// [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; }
    226217
    227218//---------------------------------------
     
    230221long int abs( long int v ) { return labs( v ); }
    231222long long int abs( long long int v ) { return llabs( v ); }
    232 float abs( float v ) { return fabsf( v ); }
    233 double abs( double v ) { return fabs( v ); }
    234 long double abs( long double v ) { return fabsl( v ); }
    235 float _Complex abs( float _Complex v ) { return cabsf( v ); }
    236 double _Complex abs( double _Complex v ) { return cabs( v ); }
    237 long double _Complex abs( long double _Complex v ) { return cabsl( v ); }
    238 
    239 //---------------------------------------
    240 
    241 float floor( float v ) { return floorf( v ); }
    242 long double floor( long double v ) { return floorl( v ); }
    243 
    244 float ceil( float v ) { return ceilf( v ); }
    245 long double ceil( long double v ) { return ceill( v ); }
     223float abs( float x ) { return fabsf( x ); }
     224double abs( double x ) { return fabs( x ); }
     225long double abs( long double x ) { return fabsl( x ); }
     226float abs( float _Complex x ) { return cabsf( x ); }
     227double abs( double _Complex x ) { return cabs( x ); }
     228long double abs( long double _Complex x ) { return cabsl( x ); }
    246229
    247230//---------------------------------------
Note: See TracChangeset for help on using the changeset viewer.