As part of a project I have been provided with a header file that contains a function call. When I try to compile my program with this error file I get four error messages. Three are "conversion may lose significant digits in function search_file" and the last is a "cannot compile pre-compiled header: code in header" I assume the last one is caused by the previous three? As it is the weekend I can't contact my tutors so any advice would be appreciated. The complete header file is listed below with the lines shown by the compiler as causing the problem shown.
#include "stdlib.h"
#include "string.h"

#define IDXSIZE sizeof(RECORD_IDX)
#define RECSIZE sizeof(RECORD_DATA)

typedef struct
{
char key[7];
char desc[20];
short supp_code;
long free_stock;
short min_stock;
char movement_date[7];
float price;
} RECORD_DATA;


typedef struct
{
char key[7];
unsigned long rec_num;
} RECORD_IDX;

static RECORD_DATA *search_file(char *key);

static RECORD_DATA *search_file(char *key)
{ /*THIS LINE IDENTIFIED AS CANNOT COMPILE PRE-COMPILED HEADER: CODE IN HEADER*/
int compare(const void *a, const void *b);

static RECORD_DATA record;
static RECORD_IDX index,
*idx_list,
*entry_ptr;

char path[80] = "STCKMAST.IDX";
register long recs;

FILE *fp_idx,
*fp_dat;

/* Open the index file, calculate the number of record entries */


if((fp_idx = fopen(path, "rb"))!=NULL)
{
fseek(fp_idx, 0L, SEEK_END);
if(ftell(fp_idx) > 2000)
{
fclose(fp_idx);
fp_idx = NULL;
}
}

if(fp_idx==NULL)
{
strcpy(path,"A:\\STCKMAST.IDX");
if((fp_idx = fopen(path,"rb"))!=NULL)
{
fseek(fp_idx,0L,SEEK_END);
if(ftell(fp_idx)>2000)
{
fclose(fp_idx);
fp_idx = NULL;
}
}

if(fp_idx == NULL)
{
printf("\nUnable to open file \"STCKMAST.IDX\" - \n");
printf("\nPlease enter pathname for this file - eg ");
printf("<C:\\PROJECT\\PROGS>\n\n>> ");
fflush(stdin);
fgets(path,80,stdin);
fflush(stdin);
if(path[strlen(path)-1]=='\n')
path[strlen(path)-1] = 0;
if(!*path)
{
printf("\nNo path entered, Program abandoned\n");
exit(1);
}
else
{
if(path[strlen(path)-1] == '\\')
strcat(path,"STCKMAST.IDX");
else
strcat(path,"\\STCKMAST.IDX");
if((fp_idx = fopen(path,"rb"))==NULL)
{
printf("File not found on path %s\n",path);
printf("Program abandoned\n\n");
exit(1);
}
}
}
}

fseek(fp_idx,0L,SEEK_END);
recs = ftell(fp_idx)/IDXSIZE;

/* Use malloc(), create a list */
idx_list = (RECORD_IDX *)malloc(recs * IDXSIZE);/*CAUSES FIRST ERROR MSG*/
rewind(fp_idx);
fread(idx_list, IDXSIZE * recs, 1, fp_idx);/*CAUSES SECOND ERROR MSG*/
fclose(fp_idx);


strcpy(index.key, key);
entry_ptr = (RECORD_IDX *) bsearch(&index, idx_list, recs, IDXSIZE, compare);
/*LINE ABOVE CAUSES FINAL SIGNIFICANT DIGIT ERR MSG*/
if(entry_ptr)
index = *entry_ptr;
else
index.key[0] = '\0';
free(idx_list);

if( strcmp(index.key, "\0") )
{
strcpy(&path[strlen(path)-3],"DAT");
if((fp_dat = fopen(path,"rb"))==NULL)
{
printf("\nUnable to open file \"STCKMAST.DAT\" - \n");
printf("Program abandoned\n\n");
exit(1);
}
fread(record.key,sizeof(char),1,fp_dat);
fseek(fp_dat,0L,SEEK_END);
if(record.key[0] > '9'|| ftell(fp_dat) > 6000)
{
printf("Incorrect data file loaded\n\n");
printf("Program abandoned\n\n");
exit(1);
}
fseek(fp_dat, RECSIZE * index.rec_num, SEEK_SET);
fread(&record, RECSIZE, 1, fp_dat);
if(ferror(fp_dat))
{
printf("Unable to access data file\n\n");
printf("Program abandoned\n\n");
exit(1);
}
fclose(fp_dat);
return &record;
}

return NULL;
}

int compare(const void *a, const void *b)
{
return (strcmp ( ((RECORD_IDX *)a)->key,
((RECORD_IDX *)b)->key) );
}

Thanks