From 827b4060a8e35047c1adc9ca2ab3d8e7ad905df0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 12 Feb 2025 08:50:13 +0100 Subject: Remove unnecessary (char *) casts [mem] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove (char *) casts around memory functions such as memcmp(), memcpy(), or memset() where the cast is useless. Since these functions don't take char * arguments anyway, these casts are at best complicated casts to (void *), about which see commit 7f798aca1d5. Reviewed-by: Dagfinn Ilmari Mannsåker Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org --- contrib/pg_trgm/trgm_gist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/pg_trgm/trgm_gist.c') diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index 7f482f958fd..14285a919ad 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -228,7 +228,7 @@ gtrgm_consistent(PG_FUNCTION_ARGS) if (cache == NULL || cache->strategy != strategy || VARSIZE(cache->query) != querysize || - memcmp((char *) cache->query, (char *) query, querysize) != 0) + memcmp(cache->query, query, querysize) != 0) { gtrgm_consistent_cache *newcache; TrgmPackedGraph *graph = NULL; @@ -284,12 +284,12 @@ gtrgm_consistent(PG_FUNCTION_ARGS) newcache->strategy = strategy; newcache->query = (text *) ((char *) newcache + MAXALIGN(sizeof(gtrgm_consistent_cache))); - memcpy((char *) newcache->query, (char *) query, querysize); + memcpy(newcache->query, query, querysize); if (qtrg) { newcache->trigrams = (TRGM *) ((char *) newcache->query + MAXALIGN(querysize)); - memcpy((char *) newcache->trigrams, (char *) qtrg, qtrgsize); + memcpy((char *) newcache->trigrams, qtrg, qtrgsize); /* release qtrg in case it was made in fn_mcxt */ pfree(qtrg); } -- cgit v1.2.3