File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -90,19 +90,14 @@ typedef enum {
9090    FETCH_END 
9191} fetch_type_t ;
9292
93- struct  fetch_type_map  {
94-     char  * name ;
95-     fetch_type_t  id ;
96- };
97- 
98- struct  fetch_type_map  type_map [] =  {
99-     { "MD"         , FETCH_MD  },
100-     { "CIPHER"     , FETCH_CIPHER  },
101-     { "KDF"        , FETCH_KDF  },
102-     { "MAC"        , FETCH_MAC  },
103-     { "RAND"       , FETCH_RAND  },
104-     { "KEM"        , FETCH_PQ_KEM  },
105-     { "SIGNATURE"  , FETCH_PQ_SIGNATURE  },
93+ static  const  char  * type_map [] =  {
94+     [FETCH_MD ]           =  "MD" ,
95+     [FETCH_CIPHER ]       =  "CIPHER" ,
96+     [FETCH_KDF ]          =  "KDF" ,
97+     [FETCH_MAC ]          =  "MAC" ,
98+     [FETCH_RAND ]         =  "RAND" ,
99+     [FETCH_PQ_KEM ]       =  "KEM" ,
100+     [FETCH_PQ_SIGNATURE ] =  "SIGNATURE" ,
106101};
107102
108103fetch_type_t  exclusive_fetch_type  =  FETCH_END ;
@@ -338,8 +333,8 @@ int main(int argc, char *argv[])
338333        * exclusive_fetch_alg  =  '\0' ;
339334        exclusive_fetch_alg ++ ;
340335        for  (i  =  0 ; i  <  ARRAY_SIZE (type_map ); i ++ ) {
341-             if  (! strcmp (fetch_type , type_map [i ]. name )) {
342-                 exclusive_fetch_type  =  type_map [ i ]. id ;
336+             if  (type_map [ i ]  !=   NULL , ! strcmp (fetch_type , type_map [i ])) {
337+                 exclusive_fetch_type  =  i ;
343338                break ;
344339            }
345340        }
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments