stage4/generate_c/generate_c.cc
changeset 1084 54f72ee52708
parent 1083 fc23bca885f8
child 1089 25271e1a3426
equal deleted inserted replaced
1083:fc23bca885f8 1084:54f72ee52708
   677       else {
   677       else {
   678         /* Test overflow on MUL by pre-condition: If (ULL_MAX / a) < b => overflow! */
   678         /* Test overflow on MUL by pre-condition: If (ULL_MAX / a) < b => overflow! */
   679         overflow = ((ULL_MAX / least_common_ticktime) < (time / common_ticktime));
   679         overflow = ((ULL_MAX / least_common_ticktime) < (time / common_ticktime));
   680         least_common_ticktime = least_common_ticktime * (time / common_ticktime);
   680         least_common_ticktime = least_common_ticktime * (time / common_ticktime);
   681       }
   681       }
   682       fprintf(stderr, "time=%llu  least_common_ticktime=%llu  common_ticktime=%llu\n", time, least_common_ticktime, common_ticktime );
       
   683       return !overflow;
   682       return !overflow;
   684     }
   683     }
   685     
   684     
   686     unsigned long long get_common_ticktime(void) {
   685     unsigned long long get_common_ticktime(void) {
   687       return common_ticktime;
   686       return common_ticktime;