Changes in / [3da7c19:d57e349]
- Files:
-
- 1 added
- 2 deleted
- 6 edited
-
libcfa/src/iostream.cfa (modified) (4 diffs)
-
libcfa/src/iostream.hfa (modified) (3 diffs)
-
tests/.expect/manipulatorsInput.txt (modified) (1 diff)
-
tests/.expect/manipulatorsOutput2.txt (added)
-
tests/.expect/manipulatorsOutput2.x64.txt (deleted)
-
tests/.expect/manipulatorsOutput2.x86.txt (deleted)
-
tests/.in/manipulatorsInput.txt (modified) (1 diff)
-
tests/manipulatorsInput.cfa (modified) (2 diffs)
-
tests/sum.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r3da7c19 rd57e349 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 10 18:06:16201913 // Update Count : 80 912 // Last Modified On : Sun Jun 9 20:54:05 2019 13 // Update Count : 804 14 14 // 15 15 … … 797 797 } // ?|? 798 798 799 forall( dtype istype | istream( istype ) )800 istype & ?|?( istype & is, _Istream_Char f ) {801 fmt( is, "%*c" ); // argument variable unused802 return is;803 } // ?|?804 805 799 #define InputFMTImpl( T, CODE ) \ 806 800 forall( dtype istype | istream( istype ) ) \ … … 808 802 enum { size = 16 }; \ 809 803 char fmtstr[size]; \ 810 if ( f.wd == -1 ) {\804 if ( f.wd == -1 || strcmp( CODE, "c" ) == 0 ) { /* ignore width with "c" */ \ 811 805 snprintf( fmtstr, size, "%%%s%s", f.ignore ? "*" : "", CODE ); \ 812 806 } else { \ … … 818 812 } // ?|? 819 813 814 InputFMTImpl( char, "c" ) 820 815 InputFMTImpl( signed char, "hhi" ) 821 816 InputFMTImpl( unsigned char, "hhi" ) -
libcfa/src/iostream.hfa
r3da7c19 rd57e349 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 10 18:05:13201913 // Update Count : 3 2012 // Last Modified On : Sun Jun 9 22:46:17 2019 13 // Update Count : 315 14 14 // 15 15 … … 347 347 static inline _Istream_Cstr excl( const char * scanset, _Istream_Cstr & fmt ) { fmt.scanset = scanset; fmt.flags.inex = true; return fmt; } 348 348 static inline _Istream_Cstr cstr( char * s ) { return (_Istream_Cstr){ s, 0p, -1, { .all : 0 } }; } 349 static inline _Istream_Cstr ignore( const char * s ) { return (_Istream_Cstr)@{ 0p, 0p, -1, { .flags.ignore : true } }; }349 static inline _Istream_Cstr ignore( const char * s ) { return (_Istream_Cstr)@{ s, 0p, -1, { .flags.ignore : true } }; } 350 350 static inline _Istream_Cstr ignore( _Istream_Cstr & fmt ) { fmt.flags.ignore = true; return fmt; } 351 351 static inline _Istream_Cstr wd( unsigned int w, char * s ) { return (_Istream_Cstr)@{ s, 0p, w, { .all : 0 } }; } 352 352 static inline _Istream_Cstr wd( unsigned int w, _Istream_Cstr & fmt ) { fmt.wd = w; return fmt; } 353 forall( dtype istype | istream( istype ) ) istype & ?|?( istype & is, _Istream_Cstr f ); 354 355 struct _Istream_Char { 356 bool ignore; // do not change input argument 357 }; // _Istream_Char 358 359 static inline _Istream_Char ignore( const char c ) { return (_Istream_Char)@{ true }; } 360 static inline _Istream_Char ignore( _Istream_Char & fmt ) { fmt.ignore = true; return fmt; } 361 forall( dtype istype | istream( istype ) ) istype & ?|?( istype & is, _Istream_Char f ); 353 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Istream_Cstr ); 362 354 363 355 forall( otype T ) … … 376 368 } // ?|? 377 369 370 InputFMTDecl( char ) 378 371 InputFMTDecl( signed char ) 379 372 InputFMTDecl( unsigned char ) -
tests/.expect/manipulatorsInput.txt
r3da7c19 rd57e349 26 26 13 wwwwwwww 27 27 a 28 a 28 b 29 b 30 b 29 31 -1 30 32 15 -
tests/.in/manipulatorsInput.txt
r3da7c19 rd57e349 7 7 abcyyy 8 8 aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww 9 ab 9 abcd 10 10 0xff 017 15-15 11 11 0xff 017 15-15 -
tests/manipulatorsInput.cfa
r3da7c19 rd57e349 7 7 // Created On : Sat Jun 8 17:58:54 2019 8 8 // Last Modified By : Peter A. Buhr 9 // Last Modified On : Mon Jun 10 18:38:35201910 // Update Count : 89 // Last Modified On : Mon Jun 10 08:11:03 2019 10 // Update Count : 7 11 11 // 12 12 … … 52 52 char c; 53 53 sin | c; sout | c; 54 sin | wdi( 3, c ); sout | c; 54 55 sin | ignore( c ); sout | c; 56 sin | ignore( wdi( 3, c ) ); sout | c; 55 57 56 58 signed char sc; -
tests/sum.cfa
r3da7c19 rd57e349 11 11 // Created On : Wed May 27 17:56:53 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Thu Jun 6 16:18:22 201914 // Update Count : 33 313 // Last Modified On : Sun May 19 11:21:02 2019 14 // Update Count : 330 15 15 // 16 16 … … 111 111 }; 112 112 GS(int) gs; 113 // FIX ME, resolution problem with anew not picking up the LH type 114 gs.x = (typeof(gs.x))anew( size ); // create array storage for field 113 gs.x = anew( size ); // create array storage for field 115 114 s = 0; v = low; 116 115 for ( int i = 0; i < size; i += 1, v += 1 ) {
Note:
See TracChangeset
for help on using the changeset viewer.