location: pass the location first

* src/location.h, src/location.c (location_print): For consistency
with other data structures and other location_* routines, pass the
location argument first.
* src/complain.c: Adjust.
(location_caret): Likewise.
* src/parse-gram.y: Adjust.
This commit is contained in:
Akim Demaille
2013-02-01 14:24:48 +01:00
parent e6c25014bb
commit b805eca764
4 changed files with 7 additions and 7 deletions

View File

@@ -89,7 +89,7 @@ error_message (const location *loc, warnings flags, const char *prefix,
unsigned pos = 0;
if (loc)
pos += location_print (stderr, *loc);
pos += location_print (*loc, stderr);
else
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
pos += fprintf (stderr, ": ");
@@ -117,7 +117,7 @@ error_message (const location *loc, warnings flags, const char *prefix,
putc ('\n', stderr);
fflush (stderr);
if (loc && feature_flag & feature_caret && !(flags & no_caret))
location_caret (stderr, *loc);
location_caret (*loc, stderr);
}
}
fflush (stderr);