Ignore:
Timestamp:
Apr 14, 2017, 4:51:13 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
1504536, e3de500
Parents:
3895b8b5
Message:

Update benchmarks, cleanup edits to the evaluation section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/c-print.c

    r3895b8b5 r3fb7f5e  
    1717void print_fmt(FILE* out, char fmt, void* p) {
    1818        switch( fmt ) {
    19         case 's': print_string(out, (const char*)p); break;
    20         case 'b': print_bool(out, *(_Bool*)p); break;
    21         case 'c': print_char(out, *(char*)p); break;
    22         case 'd': print_int(out, *(int*)p); break;
     19        case 's': print_string(out, (const char*)p); break; /***/
     20        case 'b': print_bool(out, *(_Bool*)p); break; /***/
     21        case 'c': print_char(out, *(char*)p); break; /***/
     22        case 'd': print_int(out, *(int*)p); break; /***/
    2323        }
    2424}
     
    2929        for (const char* it = fmt; *it; ++it) {
    3030                switch( *it ) {
    31                 case 's': print_string(out, va_arg(args, const char*)); break;
    32                 case 'b': print_bool(out, va_arg(args, int)); break;
    33                 case 'c': print_char(out, va_arg(args, int)); break;
    34                 case 'd': print_int(out, va_arg(args, int)); break;
     31                case 's': print_string(out, va_arg(args, const char*)); break; /***/
     32                case 'b': print_bool(out, va_arg(args, int)); break; /***/
     33                case 'c': print_char(out, va_arg(args, int)); break; /***/
     34                case 'd': print_int(out, va_arg(args, int)); break; /***/
    3535                case 'p': {
    36                         const struct pair x = va_arg(args, const struct pair);
     36                        const struct pair x = va_arg(args, const struct pair); /***/
    3737                        fprintf(out, "[");
    38                         print_fmt(out, *++it, x.first);
     38                        print_fmt(out, *++it, x.first); /***/
    3939                        fprintf(out, ", ");
    40                         print_fmt(out, *++it, x.second);
     40                        print_fmt(out, *++it, x.second); /***/
    4141                        fprintf(out, "]");
    4242                        break;
Note: See TracChangeset for help on using the changeset viewer.