소스 검색

explicit operator precedence with parentheses

Francois Perrad 10 년 전
부모
커밋
a7ceb49cad
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      tests/test39.c

+ 2 - 2
tests/test39.c

@@ -13,7 +13,7 @@ int main() {
   ns_t *nsp;
   ns_t *nsp;
   ns_t *head = NULL;
   ns_t *head = NULL;
 
 
-  for(i=0; i < sizeof(keys)/sizeof(keys[0]); i++) {
+  for(i=0; i < (sizeof(keys)/sizeof(keys[0])); i++) {
     printf("adding key %s\n", keys[i]);
     printf("adding key %s\n", keys[i]);
     nsp = (ns_t*)malloc(sizeof(ns_t));
     nsp = (ns_t*)malloc(sizeof(ns_t));
     if (nsp == NULL) exit(-1);
     if (nsp == NULL) exit(-1);
@@ -22,7 +22,7 @@ int main() {
   }
   }
   printf("hash count is %u\n", HASH_COUNT(head));
   printf("hash count is %u\n", HASH_COUNT(head));
 
 
-  for(i=0; i < sizeof(keys)/sizeof(keys[0]); i++) {
+  for(i=0; i < (sizeof(keys)/sizeof(keys[0])); i++) {
     printf("looking for key %s... ", keys[i]);
     printf("looking for key %s... ", keys[i]);
     HASH_FIND(hh,head,keys[i],strlen(keys[i]),nsp);
     HASH_FIND(hh,head,keys[i],strlen(keys[i]),nsp);
     printf("%s.\n", (nsp!=NULL)?"found":"not found");
     printf("%s.\n", (nsp!=NULL)?"found":"not found");