/*
** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
cstring filelocList_unparseUses (filelocList s)
{
int i;
- int linelen = 0;
+ size_t linelen = 0;
int maxlen = context_getLineLen () - 3;
cstring st = cstring_undefined;
fileId lastFile = fileId_invalid;
+ bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT);
if (filelocList_isDefined (s))
{
{
if (fileId_equal (fileloc_fileId (s->elements[i]), lastFile))
{
- if (linelen + 7 > maxlen)
+ if (linelen + 7 > size_fromInt (maxlen))
{
st = message ("%q\n ", st);
linelen = 6;
st = message ("%q, ", st);
}
- st = message ("%q%d,%d",
- st, fileloc_lineno (s->elements[i]),
- fileloc_column (s->elements[i]));
+ if (parenFormat)
+ {
+ st = message ("%q(%d,%d)",
+ st, fileloc_lineno (s->elements[i]),
+ fileloc_column (s->elements[i]));
+ }
+ else
+ {
+ st = message ("%q%d:%d",
+ st, fileloc_lineno (s->elements[i]),
+ fileloc_column (s->elements[i]));
+ }
+
linelen += 3 + int_log (fileloc_lineno (s->elements[i]))
+ int_log (fileloc_column (s->elements[i]));
}