@@ -33,7 +33,7 @@ char *double_to_string(double d, char *buffer) {
3333 return buffer + written ;
3434}
3535
36- inline ffc_outcome parse_outcome (uint64_t len , const char * outcome_text ) {
36+ static inline ffc_outcome parse_outcome (uint64_t len , const char * outcome_text ) {
3737 static const struct { const char * name ; ffc_outcome val ; } map [] = {
3838 {"ok" , FFC_OUTCOME_OK },
3939 {"out_of_range" , FFC_OUTCOME_OUT_OF_RANGE },
@@ -115,7 +115,7 @@ bool float_eq(float exp, float act) {
115115 };
116116}
117117
118- void assert_double (size_t len , char * input , double exp , double act ) {
118+ void assert_double (size_t len , const char * input , double exp , double act ) {
119119 if (!double_eq (exp , act )) {
120120 printf ("\n\ninput: %.*s\n" , (int )len , input );
121121 printf ("\texp: %f\n\tact: %f\n\n" , exp , act );
@@ -124,7 +124,7 @@ void assert_double(size_t len, char *input, double exp, double act) {
124124 }
125125}
126126
127- void assert_float (size_t len , char * input , float exp , float act ) {
127+ void assert_float (size_t len , const char * input , float exp , float act ) {
128128 if (!float_eq (exp , act )) {
129129 printf ("\n\ninput: %.*s\n" , (int )len , input );
130130 printf ("\texp: %f\n\tact: %f\n\n" , exp , act );
@@ -133,10 +133,10 @@ void assert_float(size_t len, char *input, float exp, float act) {
133133 }
134134}
135135
136- void verify_ext (size_t len , char input [ len ] , ffc_value exp_value , ffc_value_kind vk , ffc_outcome exp_outcome , ffc_parse_options options ) {
136+ void verify_ext (size_t len , const char * input , ffc_value exp_value , ffc_value_kind vk , ffc_outcome exp_outcome , ffc_parse_options options ) {
137137 ffc_value value ;
138138
139- ffc_result result = ffc_from_chars (input , & input [len ], options , & value , vk );
139+ ffc_result result = ffc_from_chars (( char * ) input , ( char * ) & input [len ], options , & value , vk );
140140
141141 if (exp_outcome != result .outcome ) {
142142 printf ("\n\ninput: %.*s\n" , (int )len , input );
@@ -158,19 +158,19 @@ void verify_ext(size_t len, char input[len], ffc_value exp_value, ffc_value_kind
158158 }
159159}
160160
161- void verify_double_ext (size_t len , char input [ len ] , double exp_value , ffc_outcome exp_outcome , ffc_parse_options options ) {
161+ void verify_double_ext (size_t len , const char * input , double exp_value , ffc_outcome exp_outcome , ffc_parse_options options ) {
162162 ffc_value expected ;
163163 expected .d = exp_value ;
164164 verify_ext (len , input , expected , FFC_VALUE_KIND_DOUBLE , exp_outcome , options );
165165}
166166
167- void verify_float_ext (size_t len , char input [ len ] , float exp_value , ffc_outcome exp_outcome , ffc_parse_options options ) {
167+ void verify_float_ext (size_t len , const char * input , float exp_value , ffc_outcome exp_outcome , ffc_parse_options options ) {
168168 ffc_value expected ;
169169 expected .f = exp_value ;
170170 verify_ext (len , input , expected , FFC_VALUE_KIND_FLOAT , exp_outcome , options );
171171}
172172
173- void verify_float (char * input , float exp_value ) {
173+ void verify_float (const char * input , float exp_value ) {
174174 verify_float_ext (strlen (input ), input , exp_value , FFC_OUTCOME_OK , ffc_parse_options_default ());
175175}
176176
@@ -634,4 +634,3 @@ int main(void) {
634634
635635 return 0 ;
636636}
637-
0 commit comments