summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-01 14:39:38 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-03-01 14:39:38 -0500
commit9ecdda049cde08aef45ace790c3b1d62994e8dfa (patch)
treecc41130145fa24ccc020cd8e26297a22b8e6c71b
parentd34e53143a87920cbe8e67926f288faac08df951 (diff)
downloadgpsd-9ecdda049cde08aef45ace790c3b1d62994e8dfa.tar.gz
Tell the compiler that gos_errstr() ia an observer.
All regression tests pass. Patch due to Jon Schlueter.
-rw-r--r--gps.h2
-rw-r--r--libgps.xml2
-rw-r--r--libgps_core.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/gps.h b/gps.h
index 73be4ded..736a35a7 100644
--- a/gps.h
+++ b/gps.h
@@ -1427,7 +1427,7 @@ extern int gps_send(struct gps_data_t *, const char *, ... );
extern int gps_read(/*@out@*/struct gps_data_t *);
extern bool gps_waiting(struct gps_data_t *);
extern int gps_stream(struct gps_data_t *, unsigned int, /*@null@*/void *);
-extern char /*@observer@*/ *gps_errstr(const int);
+extern const char /*@observer@*/ *gps_errstr(const int);
/* this only needs to be visible for the unit tests */
extern int gps_unpack(char *, struct gps_data_t *);
diff --git a/libgps.xml b/libgps.xml
index b8b21756..959fac80 100644
--- a/libgps.xml
+++ b/libgps.xml
@@ -56,7 +56,7 @@ C:
<paramdef>void *<parameter>data</parameter></paramdef>
</funcprototype>
<funcprototype>
-<funcdef>char *<function>gps_errstr</function></funcdef>
+<funcdef>const char *<function>gps_errstr</function></funcdef>
<paramdef>int <parameter>err</parameter></paramdef>
</funcprototype>
<funcsynopsisinfo>
diff --git a/libgps_core.c b/libgps_core.c
index 3cb523f3..8a95f409 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -698,7 +698,7 @@ int gps_stream(struct gps_data_t *gpsdata, unsigned int flags,
}
}
-extern char /*@observer@*/ *gps_errstr(const int err)
+extern const char /*@observer@*/ *gps_errstr(const int err)
{
/*
* We might add our own error codes in the future, e.g for