From f7c5af893bb99e33db23d513500d6b66f7dbf0ce Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 6 Oct 2017 22:00:40 +0000 Subject: [PATCH] Mark twkb input buffers as const git-svn-id: http://svn.osgeo.org/postgis/trunk@15927 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/liblwgeom.h.in | 2 +- liblwgeom/lwin_twkb.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 4a8b38c81..e72f42fb6 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -2151,7 +2151,7 @@ extern char *lwmessage_truncate(char *str, int startpos, int endpos, int maxleng * @param check parser check flags, see LW_PARSER_CHECK_* macros * @param size parser check flags, see LW_PARSER_CHECK_* macros */ -extern LWGEOM* lwgeom_from_twkb(uint8_t *twkb, size_t twkb_size, char check); +extern LWGEOM* lwgeom_from_twkb(const uint8_t *twkb, size_t twkb_size, char check); /** * @param geom input geometry diff --git a/liblwgeom/lwin_twkb.c b/liblwgeom/lwin_twkb.c index 861c9acc2..4ada8816c 100644 --- a/liblwgeom/lwin_twkb.c +++ b/liblwgeom/lwin_twkb.c @@ -36,9 +36,9 @@ typedef struct { /* Pointers to the bytes */ - uint8_t *twkb; /* Points to start of TWKB */ - uint8_t *twkb_end; /* Points to end of TWKB */ - uint8_t *pos; /* Current read position */ + const uint8_t *twkb; /* Points to start of TWKB */ + const uint8_t *twkb_end; /* Points to end of TWKB */ + const uint8_t *pos; /* Current read position */ uint32_t check; /* Simple validity checks on geometries */ uint32_t lwtype; /* Current type we are handling */ @@ -653,7 +653,7 @@ LWGEOM* lwgeom_from_twkb_state(twkb_parse_state *s) * Check is a bitmask of: LW_PARSER_CHECK_MINPOINTS, LW_PARSER_CHECK_ODD, * LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_NONE, LW_PARSER_CHECK_ALL */ -LWGEOM* lwgeom_from_twkb(uint8_t *twkb, size_t twkb_size, char check) +LWGEOM* lwgeom_from_twkb(const uint8_t *twkb, size_t twkb_size, char check) { int64_t coords[TWKB_IN_MAXCOORDS] = {0, 0, 0, 0}; twkb_parse_state s; -- 2.40.0