Changeset 6152c81 for src


Ignore:
Timestamp:
Mar 9, 2017, 10:38:44 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
149d297
Parents:
d3bc0ad
Message:

fix type of sepDefault

Location:
src/libcfa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/fstream

    rd3bc0ad r6152c81  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 28 08:08:04 2016
    13 // Update Count     : 88
     12// Last Modified On : Tue Mar  7 14:48:08 2017
     13// Update Count     : 91
    1414//
    1515
     
    2323        void *file;
    2424        _Bool sepDefault;
    25         int sepOnOff;                                                                           // FIX ME: type should be _Bool
     25        _Bool sepOnOff;
    2626        char separator[separateSize];
    2727}; // ofstream
     
    3232void sepReset( ofstream * );
    3333void sepReset( ofstream *, _Bool );
     34const char * sepGet( ofstream * );
    3435void sepSet( ofstream *, const char * );
    35 const char * sepGet( ofstream * );
    3636_Bool sepDisable( ofstream * );
    3737_Bool sepEnable( ofstream * );
     38
    3839int fail( ofstream * );
    3940int flush( ofstream * );
  • src/libcfa/fstream.c

    rd3bc0ad r6152c81  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 15 13:35:29 2016
    13 // Update Count     : 188
     12// Last Modified On : Tue Mar  7 14:48:09 2017
     13// Update Count     : 192
    1414//
    1515
     
    2121#include <stdarg.h>                                                                             // varargs
    2222#include <string.h>                                                                             // strlen
     23#include <stdbool.h>                                                                    // true/false
    2324#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    2425#include <complex.h>                                                                    // creal, cimag
     
    3233void sepReset( ofstream * os ) { os->sepOnOff = os->sepDefault; }
    3334void sepReset( ofstream * os, _Bool reset ) { os->sepDefault = reset; os->sepOnOff = os->sepDefault; }
     35const char * sepGet( ofstream * os ) { return &(os->separator[0]); }
     36
    3437void sepSet( ofstream * os, const char * s ) {
    3538        strncpy( &(os->separator[0]), s, separateSize - 1 );
    3639        os->separator[separateSize - 1] = '\0';
    3740} // sepSet
    38 const char * sepGet( ofstream * os ) { return &(os->separator[0]); }
     41
    3942_Bool sepDisable( ofstream *os ) {
    4043        _Bool temp = os->sepDefault;
    41         os->sepDefault = 0;
     44        os->sepDefault = false;
    4245        sepReset( os );
    4346        return temp;
    4447} // sepDisable
     48
    4549_Bool sepEnable( ofstream *os ) {
    4650        _Bool temp = os->sepDefault;
    47         os->sepDefault = 1;
     51        os->sepDefault = true;
    4852        sepReset( os );
    4953        return temp;
Note: See TracChangeset for help on using the changeset viewer.