X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fkinput.c;h=c982b3f1c17e63fe7faad177ab3660c98a2ef8ff;hb=e6c873a1bf7291b89cfcfe76184c4154c61056e1;hp=781ec9a80112479667999ba08d0e5690fb1e1c76;hpb=247f1ebfc107315f1c0b2b59bb59fe4774f3b0d4;p=idzebra-moved-to-github.git diff --git a/index/kinput.c b/index/kinput.c index 781ec9a..c982b3f 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,17 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.27 1998-02-17 10:32:52 adam + * Revision 1.30 1998-10-28 10:53:57 adam + * Added type cast to prevent warning. + * + * Revision 1.29 1998/06/11 15:41:39 adam + * Minor changes. + * + * Revision 1.28 1998/03/05 08:45:12 adam + * New result set model and modular ranking system. Moved towards + * descent server API. System information stored as "SGML" records. + * + * Revision 1.27 1998/02/17 10:32:52 adam * Fixed bug: binary files weren't opened with flag b on NT. * * Revision 1.26 1998/01/29 13:39:13 adam @@ -150,7 +160,7 @@ void getFnameTmp (char *fname, int no) void key_file_chunk_read (struct key_file *f) { - int nr = 0, r, fd; + int nr = 0, r = 0, fd; char fname[1024]; getFnameTmp (fname, f->no); fd = open (fname, O_BINARY|O_RDONLY); @@ -451,7 +461,6 @@ int heap_inpc (struct heap_info *hi) char *dict_info; strcpy (this_name, hci.cur_name); - logf (LOG_DEBUG, "inserting %s", 1+hci.cur_name); assert (hci.cur_name[1]); no_diffs++; if ((dict_info = dict_lookup (hi->dict, hci.cur_name))) @@ -509,7 +518,7 @@ int heap_inp (struct heap_info *hi) break; memcpy (key_buf + key_buf_ptr, next_key, KEY_SIZE); key_buf_ptr += KEY_SIZE; - if (key_buf_ptr+KEY_SIZE >= key_buf_size) + if (key_buf_ptr+(int) KEY_SIZE >= key_buf_size) { char *new_key_buf; new_key_buf = xmalloc (key_buf_size + INP_BUF_ADD); @@ -521,11 +530,10 @@ int heap_inp (struct heap_info *hi) } no_diffs++; nmemb = key_buf_ptr / KEY_SIZE; - assert (nmemb*KEY_SIZE == key_buf_ptr); + assert (nmemb * (int) KEY_SIZE == key_buf_ptr); if ((info = dict_lookup (hi->dict, cur_name))) { ISAM_P isam_p, isam_p2; - logf (LOG_DEBUG, "updating %s", 1+cur_name); memcpy (&isam_p, info+1, sizeof(ISAM_P)); isam_p2 = is_merge (hi->isam, isam_p, nmemb, key_buf); if (!isam_p2) @@ -544,7 +552,6 @@ int heap_inp (struct heap_info *hi) else { ISAM_P isam_p; - logf (LOG_DEBUG, "inserting %s", 1+cur_name); no_insertions++; isam_p = is_merge (hi->isam, 0, nmemb, key_buf); dict_insert (hi->dict, cur_name, sizeof(ISAM_P), &isam_p); @@ -574,8 +581,8 @@ void progressFunc (struct key_file *keyp, void *info) if (now >= p->lastTime+10) { p->lastTime = now; - remaining = (now - p->startTime)* - ((double) p->totalBytes/p->totalOffset - 1.0); + remaining = (time_t) ((now - p->startTime)* + ((double) p->totalBytes/p->totalOffset - 1.0)); if (remaining <= 130) logf (LOG_LOG, "Merge %2.1f%% completed; %ld seconds remaining", (100.0*p->totalOffset) / p->totalBytes, (long) remaining);