Changes proposed by Mathieu Malaterre from the GDCM project... Thanks a lot Mathieu

- '//' replaced by '/* */'
- inclusion of int.h in int.c
- inclusion of j2k.h in int.h in order to export symbols
- adding (void) var when a variable is declared but not used
- some explicit cast
- CLOCKS_PER_SEC is declared as float in bcc55, so there is a need to cast it to int for the modulo operation
- some variables changed from float -> double
This commit is contained in:
Antonin Descampe
2005-11-01 10:15:34 +00:00
parent 18a9bcb882
commit 8f3bd54c3d
12 changed files with 169 additions and 158 deletions

View File

@@ -25,7 +25,7 @@
*/
#include "fix.h"
#include <math.h> //Add Antonin : multbug1
#include <math.h> /*Add Antonin : multbug1*/
#ifdef WIN32
#define int64 __int64
@@ -37,13 +37,13 @@
* Multiply two fixed-precision rational numbers.
*/
//int fix_mul(int a, int b)
//{
// return (int) ((int64) a * (int64) b >> 13);
//}
/*int fix_mul(int a, int b)
{
return (int) ((int64) a * (int64) b >> 13);
}*/
//Mod Antonin : multbug1
/*Mod Antonin : multbug1*/
/*
int fix_mul(int a, int b)
{
@@ -53,9 +53,9 @@ int fix_mul(int a, int b)
return (int) v;
}
*/
//doM
/*doM*/
int fix_mul(int a, int b) // Luke Lee optimized : 11/16/2004
int fix_mul(int a, int b) /* Luke Lee optimized : 11/16/2004*/
{
int64 temp = (int64) a * (int64) b >> 12;
return (int) ((temp >> 1) + (temp & 1)) ;