Ignore:
Timestamp:
Oct 19, 2022, 4:33:34 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
135143b
Parents:
72b5805e
Message:

Change parse args to use new arrays instead of C arrays.
Also added const ?? to arrays.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/configs/parsenums.cfa

    r72b5805e rd1abc63c  
    1515//
    1616
     17#include <fstream.hfa>
    1718#include <parseargs.hfa>
    18 #include <fstream.hfa>
    1919
    2020#include "../meta/fork+exec.hfa"
     
    4242
    4343
    44         cfa_option options[] = {
    45                 { 'i', "int",              "test int",                i   },
    46                 { 'u', "unsigned",         "test unsigned",           u   },
    47                 { 'l', "unsignedlong",     "test unsigned long",      ul  },
    48                 { 'L', "unsignedlonglong", "test unsigned long long", ull },
    49                 { 'd', "double",           "test double",             d   },
    50         };
    51         int options_cnt = sizeof(options) / sizeof(cfa_option);
     44        array( cfa_option, 5 ) options;
     45        options[0] = (cfa_option){ 'i', "int",              "test int",                i   };
     46        options[1] = (cfa_option){ 'u', "unsigned",         "test unsigned",           u   };
     47        options[2] = (cfa_option){ 'l', "unsignedlong",     "test unsigned long",      ul  };
     48        options[3] = (cfa_option){ 'L', "unsignedlonglong", "test unsigned long long", ull };
     49        options[4] = (cfa_option){ 'd', "double",           "test double",             d   };
    5250
    5351        char **left;
    54         parse_args( options, options_cnt, "[OPTIONS]...\ntesting bool parameters", left);
     52        parse_args( options, "[OPTIONS]...\ntesting bool parameters", left);
    5553
    5654        sout | "int                :" | i;
Note: See TracChangeset for help on using the changeset viewer.