util  Check-in [da3eccdcfa]

Overview
Comment:fix static assert
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: da3eccdcfad7f7077c35b8059a71a2aa3375ed49d5f6e83b4a6944e06f639312
User & Date: lexi on 2019-07-19 11:50:51
Other Links: manifest | tags
Context
2019-07-19
12:07
fxi ubgs check-in: 8ce91f9627 user: lexi tags: trunk
11:50
fix static assert check-in: da3eccdcfa user: lexi tags: trunk
11:47
switch from syscall to getrandom check-in: 6b3b3fa87f user: lexi tags: trunk
Changes

Modified clib/iaia.c from [b9f828e90b] to [f7f2775d1b].

    97     97    * this table needs to be kept in sync with the
    98     98    * itoa algorithm by hand. unfortunately, given C's
    99     99    * abject lack of metaprogramming, we have to do this
   100    100    * by hand. */
   101    101   const char iaia_ref_table[] = /* numerals[10] */ "0123456789"
   102    102   	/* bigalpha[26] */ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
   103    103   	/* smallalpha[26] */ "abcdefghijklmnopqrstuvwxyz";
   104         -_Static_assert (sizeof iaia_ref_table - 1 == maxbase);
          104  +_Static_assert (sizeof iaia_ref_table - 1 == maxbase, "tables out of sync");
   105    105   
   106    106   iaia_error_type _IAIA_FN_ITOASC(iaia_word_type val, const char* buf_start, char* buf_end, char** newbuf) {
   107    107   	char* ptr = buf_end;
   108    108   
   109    109   	*ptr-- = 0;
   110    110   	while(val > 0) {
   111    111   		if (ptr < buf_start) return iaia_e_overflow;