--- freem/src/global_bltin.c 2025/04/09 14:34:30 1.13 +++ freem/src/global_bltin.c 2025/04/09 19:52:02 1.14 @@ -1,5 +1,5 @@ /* - * $Id: global_bltin.c,v 1.13 2025/04/09 14:34:30 snw Exp $ + * $Id: global_bltin.c,v 1.14 2025/04/09 19:52:02 snw Exp $ * freem database engine * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: global_bltin.c,v $ + * Revision 1.14 2025/04/09 19:52:02 snw + * Eliminate as many warnings as possible while building with -Wall + * * Revision 1.13 2025/04/09 14:34:30 snw * Further work on global_bltin.c refactor * @@ -134,19 +137,14 @@ static void panic (void); inline long gbl_path(char *key, char *buf) { long savj; - long savch; /* saved j and ch for multiple pathes */ register long int i; register long int j; register long int k; register long int ch; - long pathscan; /* flag for repeated scan of pathlist setting an undef global */ /* construct full UNIX filename */ savj = 0; - savch = ch = EOL; - pathscan = TRUE; -nextpath: k = 0; j = savj; @@ -170,8 +168,6 @@ nextpath: } } - - if (savj == 0 && ch == EOL) pathscan = FALSE; /* one path only: inhibit search */ if (k > 0) { @@ -184,7 +180,6 @@ nextpath: } - savch = ch; savj = j; i = 0; j = 0; @@ -238,6 +233,8 @@ int gbl_lock(global_handle *g, int type) locking (g->fd, type, 0L); g->locked = TRUE; + + return TRUE; } /* gbl_lock() */ int gbl_unlock(global_handle *g) @@ -248,6 +245,8 @@ int gbl_unlock(global_handle *g) locking (g->fd, 0, 0L); g->locked = FALSE; + + return TRUE; } /* gbl_unlock() */ void gbl_close(global_handle *g) @@ -475,8 +474,6 @@ global_handle *gbl_handle(char *key) global_handle *g; char global_name[256]; int i; - long path_len; - char block[BLOCKLEN]; struct stat dinf; i = 0; @@ -613,7 +610,6 @@ void global_bltin (short action, char *k unsigned long hdr_offset; /* these must be static variables */ - static short filedes; /* filedescr for global access */ static char filnam[256]; /* name of global/unix file */ /* the following vars may be */ @@ -642,15 +638,10 @@ void global_bltin (short action, char *k int iresult; - struct stat dinf; /* get modification date */ - - long savj; - long savch; /* saved j and ch for multiple pathes */ register long int i; register long int j; register long int k; register long int ch; - long pathscan; /* flag for repeated scan of pathlist setting an undef global */ hdr_offset = sizeof (global_header); @@ -1064,7 +1055,9 @@ reopen: /* odd numbered actions get read access (get_sym,data,fra_order) 3 */ /* even ones read/write access (set_sym,kill_sym) 1 */ +/* temporarily disabled lock: +*/ if (action == get_sym) { @@ -1083,9 +1076,9 @@ tfast1: lseek (g->fd, hdr_offset + ((long) blknbr * (long) (BLOCKLEN)), SEEK_SET); read (g->fd, block, BLOCKLEN); - +/* temporarily disabled tfast2: - +*/ if ((typ = block[BTYP]) == DATA) { /* scan data block: here we test for equality only */ offset = UNSIGN (block[OFFS]) * 256 + @@ -3758,7 +3751,7 @@ void gbl_dump_stat(void) access_total = 0; ct = 0; for (g = global_handles_head; g != NULL; g = g->next) { - printf ("%-20s%-10d%-12d%-20d%-10d%s\r\n", + printf ("%-20s%-10ld%-12ld%-20ld%-10ld%s\r\n", g->global_name, g->use_count, g->cache_misses,