Ignore:
Timestamp:
Feb 1, 2016, 2:24:50 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, string, with_gc
Children:
2a4b088, b4cd03b7
Parents:
ae8b942
Message:

correctly set type for complex constants, consolidate function name tables, add offsetof, refactor printing complex constants to use basic types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/iostream.c

    rae8b942 r5721a6d  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 29 15:38:34 2016
    13 // Update Count     : 47
     12// Last Modified On : Mon Feb  1 14:20:30 2016
     13// Update Count     : 60
    1414//
    1515
     
    8383forall( dtype ostype | ostream( ostype ) )
    8484ostype * ?|?( ostype *os, float _Complex c ) {
    85         char buffer[64];
    86         return write( os, buffer, sprintf( buffer, "%g+i%g", crealf( c ), cimagf( c ) ) );
     85        return os | crealf( c ) | (cimagf( c ) < 0 ? "" : "+") | cimagf( c ) | 'i';
    8786} // ?|?
    8887
    8988forall( dtype ostype | ostream( ostype ) )
    9089ostype * ?|?( ostype *os, double _Complex c ) {
    91         char buffer[64];
    92         return write( os, buffer, sprintf( buffer, "%g+i%g", creal( c ), cimag( c ) ) );
     90        return os | creal( c ) | (cimag( c ) < 0 ? "" : "+") | cimag( c ) | 'i';
    9391} // ?|?
    9492
    9593forall( dtype ostype | ostream( ostype ) )
    9694ostype * ?|?( ostype *os, long double _Complex c ) {
    97         char buffer[64];
    98         return write( os, buffer, sprintf( buffer, "%Lg+i%Lg", creall( c ), cimagl( c ) ) );
     95        return os | creall( c ) | (cimagl( c ) < 0 ? "" : "+") | cimagl( c ) | 'i';
    9996} // ?|?
    10097
Note: See TracChangeset for help on using the changeset viewer.