1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

Remove unnecessary (char *) casts [mem]

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 7f798aca1d.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://www.postgresql.org/message-id/flat/fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-02-12 08:50:13 +01:00
parent 506183bce7
commit 827b4060a8
20 changed files with 44 additions and 48 deletions

View File

@@ -597,7 +597,7 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
if (cmd_str != NULL)
{
memcpy((char *) beentry->st_activity_raw, cmd_str, len);
memcpy(beentry->st_activity_raw, cmd_str, len);
beentry->st_activity_raw[len] = '\0';
beentry->st_activity_start_timestamp = start_timestamp;
}
@@ -670,7 +670,7 @@ pgstat_report_appname(const char *appname)
*/
PGSTAT_BEGIN_WRITE_ACTIVITY(beentry);
memcpy((char *) beentry->st_appname, appname, len);
memcpy(beentry->st_appname, appname, len);
beentry->st_appname[len] = '\0';
PGSTAT_END_WRITE_ACTIVITY(beentry);