M REPEATS Compilation Problems

From SnOwy - Ed's Wiki Notebook

Jump to: navigation, search

In M_REPEATS from http://nihserver.mbi.ucla.edu/Repeats/ ...

Two source files refer to a function nint()-- no prototype is given, and in both OSX 10.4 and Ubuntu, none of stdlib.h, string.h nor unistd.h have this function.

From what I understand, there is a fortran function called nint which means nearest integer.

Here are the source files affected and how nint is called:

Contents

smith_wat.c

printf("  number of repeats %5d </h4><hr>\n",(int) nint(numrep));

aside: isn't it interesting that this is designed to print out html?

his_sort.c

iscore = (int) nint(score_sum[i][j] + 100.0);

Prototype hints

Solution

Insert this as the very first line of smith_wat.c and his_sort.c

double nint(double a){if((int)(a*10)%10<5){return(int)a;}return(int)a+1;}

It's a real basic homebrew nint function satisfying the above observations-- it works. :D

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox