news: Raise the limit for "number of times" from 127 to 65535

News reporting merges news items into recent items with same contents,
until their count reaches 127.  Raise that limit to 65535, by making
struct nwsstr member nws_ntm unsigned short.  Size of struct nwsstr
stays the same on all common machines.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-27 21:34:42 +02:00
parent 68e595af8a
commit fda2ecb910
3 changed files with 5 additions and 4 deletions

View file

@ -499,7 +499,7 @@ struct castr news_ca[] = {
{"action", fldoff(nws_vrb), NSC_UCHAR, 0, NULL, EF_NEWS_CHR, 0,
CA_DUMP},
{"victim", fldoff(nws_vno), NSC_NATID, 0, NULL, EF_NATION, 0, CA_DUMP},
{"times", fldoff(nws_ntm), NSC_CHAR, 0, NULL, EF_BAD, 0, CA_DUMP},
{"times", fldoff(nws_ntm), NSC_USHORT, 0, NULL, EF_BAD, 0, CA_DUMP},
{"duration", fldoff(nws_duration), NSC_SHORT, 0, NULL, EF_BAD, 0,
CA_DUMP},
{"time", fldoff(nws_when), NSC_TIME, 0, NULL, EF_BAD, 0, CA_DUMP},

View file

@ -30,7 +30,7 @@
* Dave Pare, 1994
* Steve McClure, 1997
* Ron Koenderink, 2005
* Markus Armbruster, 2004-2012
* Markus Armbruster, 2004-2016
*/
#include <config.h>
@ -169,7 +169,7 @@ ncache(int actor, int event, int victim, int times)
if (dur > minutes(5))
continue;
if (np->news.nws_vrb == event && np->news.nws_vno == victim &&
np->news.nws_ntm + times <= 127) {
np->news.nws_ntm + times <= 65535) {
np->news.nws_ntm += times;
np->news.nws_duration = dur;
return np;