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

Add some const decorations

This commit is contained in:
Peter Eisentraut
2022-01-28 09:13:11 +01:00
parent 9a50f2e51c
commit 5553cbd4fe

View File

@ -116,8 +116,8 @@ static const char BinarySignature[11] = "PGCOPY\n\377\r\n\0";
static void EndCopy(CopyToState cstate); static void EndCopy(CopyToState cstate);
static void ClosePipeToProgram(CopyToState cstate); static void ClosePipeToProgram(CopyToState cstate);
static void CopyOneRowTo(CopyToState cstate, TupleTableSlot *slot); static void CopyOneRowTo(CopyToState cstate, TupleTableSlot *slot);
static void CopyAttributeOutText(CopyToState cstate, char *string); static void CopyAttributeOutText(CopyToState cstate, const char *string);
static void CopyAttributeOutCSV(CopyToState cstate, char *string, static void CopyAttributeOutCSV(CopyToState cstate, const char *string,
bool use_quote, bool single_attr); bool use_quote, bool single_attr);
/* Low-level communications functions */ /* Low-level communications functions */
@ -1009,10 +1009,10 @@ CopyOneRowTo(CopyToState cstate, TupleTableSlot *slot)
} while (0) } while (0)
static void static void
CopyAttributeOutText(CopyToState cstate, char *string) CopyAttributeOutText(CopyToState cstate, const char *string)
{ {
char *ptr; const char *ptr;
char *start; const char *start;
char c; char c;
char delimc = cstate->opts.delim[0]; char delimc = cstate->opts.delim[0];
@ -1162,11 +1162,11 @@ CopyAttributeOutText(CopyToState cstate, char *string)
* CSV-style escaping * CSV-style escaping
*/ */
static void static void
CopyAttributeOutCSV(CopyToState cstate, char *string, CopyAttributeOutCSV(CopyToState cstate, const char *string,
bool use_quote, bool single_attr) bool use_quote, bool single_attr)
{ {
char *ptr; const char *ptr;
char *start; const char *start;
char c; char c;
char delimc = cstate->opts.delim[0]; char delimc = cstate->opts.delim[0];
char quotec = cstate->opts.quote[0]; char quotec = cstate->opts.quote[0];
@ -1194,7 +1194,7 @@ CopyAttributeOutCSV(CopyToState cstate, char *string,
use_quote = true; use_quote = true;
else else
{ {
char *tptr = ptr; const char *tptr = ptr;
while ((c = *tptr) != '\0') while ((c = *tptr) != '\0')
{ {