Commit 3622bfc5 authored by malenov's avatar malenov
Browse files

fixes inside count.c

parent 7e421efa
Loading
Loading
Loading
Loading
Loading
+31 −2
Original line number Diff line number Diff line
@@ -55,6 +55,34 @@
static double frameRate = FRAME_RATE; /* default value : 10 ms */
#endif                                /* ifdef WMOPS */

#define MAX_RECORDS 1024
#define MAX_STACK   64
#define MAX_CHAR    64

struct wmops_record
{
    char label[MAX_CHAR];
    long call_number;
    long update_cnt;
    int call_tree[MAX_RECORDS];
    double start_selfcnt;
    double current_selfcnt;
    double max_selfcnt;
    double min_selfcnt;
    double tot_selfcnt;
    double start_cnt; /* The following take into account the decendants */
    double current_cnt;
    double max_cnt;
    double min_cnt;
    double tot_cnt;
};

static struct wmops_record wmops[MAX_RECORDS];

static int stack[MAX_STACK];
static int sptr;


#ifdef WMOPS
/* Global counter variable for calculation of complexity weight */
/* Some enhancement written by Vail., GJR and M.Mul. during EVS time */
@@ -291,7 +319,7 @@ static char *my_strdup( const char *s )

    /* allocate memory for copy of ID string (including string terminator) */
    /* NOTE: the ID strings will never be deallocated because there is no way to "destroy" a counter that is not longer needed */
    if ( ( dup = (char *) malloc( strlen( s ) + 1 ) ) == NULL )
    if ( ( dup = (char *) malloc_( strlen( s ) + 1 ) ) == NULL )
        return NULL;

    return strcpy( dup, s );
@@ -1069,7 +1097,7 @@ void WMOPS_destroy( void )
    {
        if ( NULL != objectName[i] )
        {
            free( objectName[i] );
            free_( objectName[i] );
            objectName[i] = NULL;
        }
    }
@@ -1380,3 +1408,4 @@ void BASOP_get_total_wmops( double *min, double *max, double *avg )
}
/* end of file */
#undef WMC_TOOL_SKIP
/*AddedByWMC_Tool*/ int PROM_Size_Func( count ) { return 131; }