Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08d25d7

Browse files
committed
Add some const decorations
These mainly help understanding the function signatures better.
1 parent 3677a0b commit 08d25d7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/backend/utils/adt/like.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131
#define LIKE_ABORT (-1)
3232

3333

34-
static int SB_MatchText(char *t, int tlen, char *p, int plen,
34+
static int SB_MatchText(const char *t, int tlen, const char *p, int plen,
3535
pg_locale_t locale, bool locale_is_c);
3636
static text *SB_do_like_escape(text *, text *);
3737

38-
static int MB_MatchText(char *t, int tlen, char *p, int plen,
38+
static int MB_MatchText(const char *t, int tlen, const char *p, int plen,
3939
pg_locale_t locale, bool locale_is_c);
4040
static text *MB_do_like_escape(text *, text *);
4141

42-
static int UTF8_MatchText(char *t, int tlen, char *p, int plen,
42+
static int UTF8_MatchText(const char *t, int tlen, const char *p, int plen,
4343
pg_locale_t locale, bool locale_is_c);
4444

45-
static int SB_IMatchText(char *t, int tlen, char *p, int plen,
45+
static int SB_IMatchText(const char *t, int tlen, const char *p, int plen,
4646
pg_locale_t locale, bool locale_is_c);
4747

48-
static int GenericMatchText(char *s, int slen, char *p, int plen);
48+
static int GenericMatchText(const char *s, int slen, const char *p, int plen);
4949
static int Generic_Text_IC_like(text *str, text *pat, Oid collation);
5050

5151
/*--------------------
@@ -54,7 +54,7 @@ static int Generic_Text_IC_like(text *str, text *pat, Oid collation);
5454
*--------------------
5555
*/
5656
static inline int
57-
wchareq(char *p1, char *p2)
57+
wchareq(const char *p1, const char *p2)
5858
{
5959
int p1_len;
6060

@@ -148,7 +148,7 @@ SB_lower_char(unsigned char c, pg_locale_t locale, bool locale_is_c)
148148

149149
/* Generic for all cases not requiring inline case-folding */
150150
static inline int
151-
GenericMatchText(char *s, int slen, char *p, int plen)
151+
GenericMatchText(const char *s, int slen, const char *p, int plen)
152152
{
153153
if (pg_database_encoding_max_length() == 1)
154154
return SB_MatchText(s, slen, p, plen, 0, true);

src/backend/utils/adt/like_match.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#endif
7777

7878
static int
79-
MatchText(char *t, int tlen, char *p, int plen,
79+
MatchText(const char *t, int tlen, const char *p, int plen,
8080
pg_locale_t locale, bool locale_is_c)
8181
{
8282
/* Fast path for match-everything pattern */

0 commit comments

Comments
 (0)