Commit cfcbe5e3 authored by Per Cederqvist's avatar Per Cederqvist

Fixed bogus printf-style modifiers in calls to log and/or restart_kom.

parent 660607f7
/*
* $Id: admin.c,v 0.21 1996/07/24 23:57:12 ceder Exp $
* $Id: admin.c,v 0.22 1996/07/28 23:43:14 ceder Exp $
* Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Administrative calls.
*/
static char *rcsid = "$Id: admin.c,v 0.21 1996/07/24 23:57:12 ceder Exp $";
static char *rcsid = "$Id: admin.c,v 0.22 1996/07/28 23:43:14 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -152,8 +152,8 @@ set_motd_of_lyskom (Text_no motd)
GET_T_STAT(new_motd, motd, FAILURE);
if ( new_motd->no_of_marks >= param.max_marks_text )
{
log("LIMIT: set_motd_of_lyskom(%d): New motd has %d marks.\n",
motd, new_motd->no_of_marks);
log("LIMIT: set_motd_of_lyskom(%lu): New motd has %d marks.\n",
(unsigned long)motd, new_motd->no_of_marks);
kom_errno = KOM_MARK_LIMIT;
return FAILURE;
}
......
/*
* $Id: cache-node.c,v 0.13 1994/04/05 08:00:06 ceder Exp $
* $Id: cache-node.c,v 0.14 1996/07/28 23:43:16 ceder Exp $
* Copyright (C) 1991, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Used in diskomd.
*/
static char *rcsid = "$Id: cache-node.c,v 0.13 1994/04/05 08:00:06 ceder Exp $";
static char *rcsid = "$Id: cache-node.c,v 0.14 1996/07/28 23:43:16 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -210,7 +210,7 @@ set_mru(Cache_node_mcb *mcb,
node = get_cache_node(mcb, key);
if (node == NULL)
restart_kom("set_mru(%d): nonexistent.\n", key);
restart_kom("set_mru(%lu): nonexistent.\n", key);
unlink_lru(node, &mcb->lru, &mcb->mru);
insert_mru(node, &mcb->lru, &mcb->mru);
......
/*
* $Id: conference.c,v 0.32 1996/07/24 23:57:14 ceder Exp $
* $Id: conference.c,v 0.33 1996/07/28 23:43:18 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* All atomic calls that deals with conferences.
*/
static char *rcsid = "$Id: conference.c,v 0.32 1996/07/24 23:57:14 ceder Exp $";
static char *rcsid = "$Id: conference.c,v 0.33 1996/07/28 23:43:18 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1026,9 +1026,9 @@ do_set_presentation(Conf_no conf_no,
GET_T_STAT(new_pres, text_no, FAILURE);
if ( new_pres->no_of_marks >= param.max_marks_text )
{
log("%s(%d, ptr, %d): New presentation has %d marks.\n",
log("%s(%d, ptr, %lu): New presentation has %d marks.\n",
"LIMIT: do_set_presentation",
conf_no, text_no, new_pres->no_of_marks);
conf_no, (unsigned long)text_no, new_pres->no_of_marks);
kom_errno = KOM_MARK_LIMIT;
return FAILURE;
}
......@@ -1084,8 +1084,8 @@ do_set_etc_motd(Conf_no conf_no,
GET_T_STAT(new_motd, text_no, FAILURE);
if ( new_motd->no_of_marks >= param.max_marks_text )
{
log("LIMIT: do_set_motd(%d, ptr, %d): New motd has %d marks.\n",
conf_no, text_no, new_motd->no_of_marks);
log("LIMIT: do_set_motd(%d, ptr, %lu): New motd has %d marks.\n",
conf_no, (unsigned long)text_no, new_motd->no_of_marks);
kom_errno = KOM_MARK_LIMIT;
return FAILURE;
}
......
/*
* $Id: connections.c,v 0.43 1996/07/28 13:35:20 ceder Exp $
* $Id: connections.c,v 0.44 1996/07/28 23:43:21 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -30,7 +30,7 @@
* Created by Willf|r 31/3-90. Mostly written by ceder.
*/
static char *rcsid = "$Id: connections.c,v 0.43 1996/07/28 13:35:20 ceder Exp $";
static char *rcsid = "$Id: connections.c,v 0.44 1996/07/28 23:43:21 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -124,7 +124,7 @@ logout_client(Connection *cp)
if ( active_connection != NULL )
{
log("BUGCHK: logout_client(%d): connection %d is active.\n",
log("BUGCHK: logout_client(%ld): connection %ld is active.\n",
cp->session_no, active_connection->session_no);
}
......@@ -181,14 +181,14 @@ logout_all_clients(void)
conn = get_conn_by_number (sess);
if ( conn == NULL )
restart_kom("logout_all_clients(): cant get session %d.\n",
restart_kom("logout_all_clients(): cant get session %ld.\n",
sess);
else
logout_client (conn);
}
if ( traverse_connections (0) != 0)
restart_kom("logout_all_clients(): traverse_connections(0) == %d.\n",
restart_kom("logout_all_clients(): traverse_connections(0) == %ld.\n",
traverse_connections(0));
}
......@@ -208,7 +208,7 @@ call_function (Connection * client,
if ( active_connection != NULL )
{
log("call_function(%d): active_connection = %d",
log("call_function(%ld): active_connection = %ld",
client->session_no, active_connection->session_no);
}
......@@ -665,7 +665,7 @@ add_to_kill_list(Connection *conn)
for (i = 0; i < kill_list_size; i++)
if (kill_list[i] == conn->session_no)
{
log("add_to_kill_list(%d): already present as %d of %d.\n",
log("add_to_kill_list(%ld): already present as %d of %d.\n",
conn->session_no, i, kill_list_size);
return;
}
......@@ -697,7 +697,7 @@ check_kill_flg(void)
if ( active_connection != NULL )
{
restart_kom("check_kill_flg: active_connection == %d",
restart_kom("check_kill_flg: active_connection == %ld",
active_connection->session_no);
}
......@@ -707,7 +707,7 @@ check_kill_flg(void)
conn = get_conn_by_number (kill_list[kill_list_size]);
if (conn == NULL)
{
log("check_kill_flg(): Connection %d doesn't exist.\n",
log("check_kill_flg(): Connection %ld doesn't exist.\n",
kill_list[kill_list_size]);
}
else
......@@ -759,7 +759,7 @@ login_request(IscEvent *event)
isc_adr = isc_getladdress (event->session);
if (isc_adr == NULL)
restart_kom("login_request(): can't isc_getladdress (%lu)\n",
event->session);
(unsigned long)event->session);
localport = isc_getportnum (isc_adr);
isc_freeaddress (isc_adr);
......
/*
* $Id: dbck-cache.c,v 0.26 1996/07/27 11:21:14 byers Exp $
* $Id: dbck-cache.c,v 0.27 1996/07/28 23:43:24 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -32,7 +32,7 @@
* Also save time as a time_t instead of a struct tm.
*/
static char *rcsid = "$Id: dbck-cache.c,v 0.26 1996/07/27 11:21:14 byers Exp $";
static char *rcsid = "$Id: dbck-cache.c,v 0.27 1996/07/28 23:43:24 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -339,9 +339,9 @@ cached_get_text( Text_no text )
if ( fread(the_string.string, sizeof(char), the_string.len, text_file)
!= the_string.len )
{
log("%s read enough characters of text %d\n",
log("%s read enough characters of text %lu\n",
"WARNING: cached_get_text: couldn't",
text);
(unsigned long)text);
}
return the_string;
......@@ -423,8 +423,8 @@ cached_flush_text(Text_no text_no,
if ( fwrite(message.string, sizeof(char), message.len, new_text_file)
!= message.len )
{
log("WARNING: cached_flush_text: Couldn't write the text %d\n",
text_no);
log("WARNING: cached_flush_text: Couldn't write the text %ld\n",
(unsigned long)text_no);
}
fflush(new_text_file);
......@@ -605,7 +605,7 @@ cache_sync(void)
kom_info.motd_of_lyskom);
break;
default:
restart_kom("Unknown output file format: %d\n", oformat);
restart_kom("Unknown output file format: %ld\n", oformat);
}
for ( i = 1; i < next_free_num; i++ ) /* CONFS */
......@@ -632,7 +632,7 @@ cache_sync(void)
break;
default:
restart_kom("Bad output file format: %d\n", oformat);
restart_kom("Bad output file format: %ld\n", oformat);
}
}
#ifdef TIME_SYNC
......@@ -667,7 +667,7 @@ cache_sync(void)
break;
default:
restart_kom("Bad output file format: %d\n", oformat);
restart_kom("Bad output file format: %ld\n", oformat);
}
}
#ifdef TIME_SYNC
......@@ -687,7 +687,7 @@ cache_sync(void)
case 1:
break;
default:
restart_kom("Unknown output file format: %d\n", oformat);
restart_kom("Unknown output file format: %ld\n", oformat);
}
......@@ -714,7 +714,7 @@ cache_sync(void)
}
break;
default:
restart_kom("Unknown output file format: %d\n", oformat);
restart_kom("Unknown output file format: %ld\n", oformat);
}
}
......@@ -734,7 +734,7 @@ cache_sync(void)
case 1:
break;
default:
restart_kom("Unknown output file format: %d\n", oformat);
restart_kom("Unknown output file format: %ld\n", oformat);
}
#ifdef TIME_SYNC
......@@ -873,18 +873,18 @@ init_cache(void)
read_conf_num = 1;
if (vflag)
{
log("Data file version is '%c'\n", data_file_version);
log("Reading %d conferences, starting at pos %d.\n",
next_free_num-1, ftell(fp));
log("Data file version is '%ld'\n", data_file_version);
log("Reading %d conferences, starting at pos %ld.\n",
next_free_num-1, (unsigned long)ftell(fp));
}
break;
case 1:
fseek(fp, 12, SEEK_SET);
if (vflag)
log("Data file version is '%c'\n", data_file_version);
log("Data file version is '%ld'\n", data_file_version);
break;
default:
restart_kom("Unknown input file format: %d\n", data_file_version);
restart_kom("Unknown input file format: %ld\n", data_file_version);
}
done = 0;
......@@ -910,7 +910,7 @@ init_cache(void)
{
case 0:
restart_kom("Unexpected end-of-file reading conferences "
"in data file version %d.",
"in data file version %ld.",
data_file_version);
break;
......@@ -919,7 +919,7 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -931,11 +931,11 @@ init_cache(void)
conf_arr[num] = NULL;
break;
case 1:
restart_kom("@ record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("@ record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -944,8 +944,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("I record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("I record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
kom_info.conf_pres_conf = fparse_long(fp);
......@@ -986,7 +986,7 @@ init_cache(void)
}
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -995,8 +995,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("C record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("C record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
......@@ -1005,14 +1005,14 @@ init_cache(void)
free_conference(conf_arr[num]);
conf_arr[num] = alloc_conference();
if (fparse_conference(fp, conf_arr[num]) != OK)
restart_kom("init_cache(): %s. i == %d\n",
restart_kom("init_cache(): %s. i == %lu\n",
"fparse_conference failed", i);
name_list[num] = EMPTY_STRING;
s_strcpy(&name_list[num], conf_arr[ num ]->name);
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -1021,8 +1021,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("P record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("P record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
......@@ -1031,12 +1031,12 @@ init_cache(void)
free_person(pers_arr[num]);
pers_arr[num] = alloc_person();
if ( fparse_person(fp, pers_arr[ num ]) != OK )
restart_kom("init_cache: fparse_person failed. num == %d\n",
restart_kom("init_cache: fparse_person failed. num==%ld\n",
num);
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -1045,8 +1045,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("T record in data file version %d at %d\n",
data_file_version, ftell(fp));
restart_kom("T record in data file version %ld at %lu\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
......@@ -1060,7 +1060,7 @@ init_cache(void)
error might be that the file has been truncated (maybe
due to an overfull disk). */
log("init_cache(): fparse_text_stat failed "
"for text %d.\n%s",
"for text %ld.\n%s",
num, "Everything remaining is lost.\n");
next_text_num = i;
read_text_num = 1;
......@@ -1070,7 +1070,7 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -1081,17 +1081,17 @@ init_cache(void)
case 0:
conf_arr[ i ] = alloc_conference();
if ( fparse_conference(fp, conf_arr[ i ]) != OK )
restart_kom("init_cache(): %s. i == %d\n",
restart_kom("init_cache(): %s. i == %lu\n",
"fparse_conference failed", i);
name_list[i] = EMPTY_STRING;
s_strcpy(&name_list[i], conf_arr[ i ]->name);
break;
case 1:
restart_kom("+ record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("+ record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -1100,8 +1100,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("#record in data file version %d at %d.\n",
data_file_version);
restart_kom("#record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
......@@ -1117,13 +1117,14 @@ init_cache(void)
break;
default:
restart_kom("Unknown # record (#%c) in data "
"file version %d at %d.\n",
c, data_file_version, ftell(fp));
"file version %ld at %lu.\n",
c, data_file_version,
(unsigned long)ftell(fp));
}
break;
default:
restart_kom("Unknown input file format: %d\n",
restart_kom("Unknown input file format: %ld\n",
data_file_version);
}
break;
......@@ -1132,8 +1133,8 @@ init_cache(void)
switch (data_file_version)
{
case 0:
restart_kom("- record in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("- record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
......@@ -1159,20 +1160,22 @@ init_cache(void)
break;
default:
restart_kom("Unknown - record (%c) in data file "
"version %d at %d.\n",
c, data_file_version, ftell(fp));
"version %ld at %lu.\n",
c, data_file_version,
(unsigned long)ftell(fp));
}
break;
default:
restart_kom("Unknown input file format %d\n",
restart_kom("Unknown input file format %ld\n",
data_file_version);
}
break;
default:
restart_kom("Unknown record type in data file version %d at %d.\n",
data_file_version, ftell(fp));
restart_kom("Unknown record type in data file version "
"%ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
}
}
......@@ -1184,8 +1187,8 @@ init_cache(void)
if (data_file_version == 0)
{
if ( vflag )
log("Reading %d persons, starting at pos %d.\n",
next_free_num-1, ftell(fp));
log("Reading %d persons, starting at pos %lu.\n",
next_free_num-1, (unsigned long)ftell(fp));
for ( i = 1; i < next_free_num; i++ ) /* PERSONS */
{
fskipwhite(fp);
......@@ -1198,7 +1201,7 @@ init_cache(void)
case '+':
pers_arr[ i ] = alloc_person();
if ( fparse_person(fp, pers_arr[ i ]) != OK )
restart_kom("init_cache: fparse_person failed. i == %d\n",
restart_kom("init_cache: fparse_person failed. i == %ld\n",
i);
break;
}
......@@ -1208,8 +1211,8 @@ init_cache(void)
read_text_num = 1;
if ( vflag )
log("Reading %d texts, starting at pos %d.\n",
next_text_num-1, ftell(fp));
log("Reading %d texts, starting at pos %lu.\n",
next_text_num-1, (unsigned long)ftell(fp));
for ( i = 1; i < next_text_num; i++ ) /* TEXT_STATS */
{
......@@ -1228,8 +1231,8 @@ init_cache(void)
error might be that the file has been truncated (maybe
due to an overfull disk). */
log("init_cache(): fparse_text_stat failed for text %d.\n%s",
i, "All remaining texts are lost.\n");
log("init_cache(): fparse_text_stat failed for text %ld.\n"
"All remaining texts are lost.\n", i);
next_text_num = i;
truncated_texts = TRUE;
}
......@@ -1238,8 +1241,8 @@ init_cache(void)
}
} /* if (datafile_version == 0) */
log("Read %d confs/persons and %d texts, eof at %d\n",
next_free_num-1, next_text_num-1, ftell(fp));
log("Read %d confs/persons and %d texts, eof at %lu\n",
next_free_num-1, next_text_num-1, (unsigned long)ftell(fp));
if (read_text_num == 0 || read_conf_num == 0)
restart_kom("init_cache(): Failed to read next_conf or text num.\n");
......
/*
* $Id: dbck.c,v 0.33 1996/07/26 00:33:59 ceder Exp $
* $Id: dbck.c,v 0.34 1996/07/28 23:43:27 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Author: Per Cederqvist.
*/
static char *rcsid = "$Id: dbck.c,v 0.33 1996/07/26 00:33:59 ceder Exp $";
static char *rcsid = "$Id: dbck.c,v 0.34 1996/07/28 23:43:27 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -983,7 +983,7 @@ check_persons(void)
}
if (vflag)
log("Total of %lu persons.\n", number_of_persons);
log("Total of %lu persons.\n", (unsigned long)number_of_persons);
return errors;
}
......
/*
* $Id: internal-connections.c,v 0.25 1996/07/28 13:36:23 ceder Exp $
* $Id: internal-connections.c,v 0.26 1996/07/28 23:43:29 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Abstract routines on the data type Connection.
*/
static char *rcsid = "$Id: internal-connections.c,v 0.25 1996/07/28 13:36:23 ceder Exp $";
static char *rcsid = "$Id: internal-connections.c,v 0.26 1996/07/28 23:43:29 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -236,7 +236,7 @@ kill_client(Connection *cp)
if ( cp->mux != NULL )
{
log("kill_client(): client %d has mux != NULL.\n",
log("kill_client(): client %ld has mux != NULL.\n",
cp->session_no);
}
......@@ -273,7 +273,7 @@ check_conn_exists(Connection *foo)
while ( c != all_connections && found == FALSE );
if ( found == FALSE )
restart_kom("%s: foo == %d not found in all_connections.\n",
restart_kom("%s: foo == %ld not found in all_connections.\n",
"get_conn_by_number",
last_conn->session_no);
}
......@@ -292,7 +292,7 @@ get_conn_by_number (Session_no session_no)
last_conn = all_connections;
else if ( all_connections == NULL )
{
restart_kom("get_conn_by_number(%d): last_conn = %d %s",
restart_kom("get_conn_by_number(%ld): last_conn = %ld %s",
session_no,
last_conn->session_no,
"and all_connections == NULL");
......
/*
* $Id: person.c,v 0.33 1996/07/24 23:57:28 ceder Exp $
* $Id: person.c,v 0.34 1996/07/28 23:43:32 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* All atomic calls that deals with persons.
*/
static char *rcsid = "$Id: person.c,v 0.33 1996/07/24 23:57:28 ceder Exp $";
static char *rcsid = "$Id: person.c,v 0.34 1996/07/28 23:43:32 ceder Exp $";
#include "rcs.h"
USE(rcsid);