Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d41f510c
Commit
d41f510c
authored
Mar 02, 2012
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecpg: Clean up some const usage
parent
8efb0bc5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/execute.c
+6
-6
src/interfaces/ecpg/ecpglib/prepare.c
src/interfaces/ecpg/ecpglib/prepare.c
+2
-2
src/interfaces/ecpg/preproc/descriptor.c
src/interfaces/ecpg/preproc/descriptor.c
+5
-5
No files found.
src/interfaces/ecpg/ecpglib/execute.c
View file @
d41f510c
...
@@ -1083,7 +1083,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
...
@@ -1083,7 +1083,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari
}
}
static
void
static
void
free_params
(
c
onst
c
har
**
paramValues
,
int
nParams
,
bool
print
,
int
lineno
)
free_params
(
char
**
paramValues
,
int
nParams
,
bool
print
,
int
lineno
)
{
{
int
n
;
int
n
;
...
@@ -1091,7 +1091,7 @@ free_params(const char **paramValues, int nParams, bool print, int lineno)
...
@@ -1091,7 +1091,7 @@ free_params(const char **paramValues, int nParams, bool print, int lineno)
{
{
if
(
print
)
if
(
print
)
ecpg_log
(
"free_params on line %d: parameter %d = %s
\n
"
,
lineno
,
n
+
1
,
paramValues
[
n
]
?
paramValues
[
n
]
:
"null"
);
ecpg_log
(
"free_params on line %d: parameter %d = %s
\n
"
,
lineno
,
n
+
1
,
paramValues
[
n
]
?
paramValues
[
n
]
:
"null"
);
ecpg_free
(
(
void
*
)
(
paramValues
[
n
])
);
ecpg_free
(
paramValues
[
n
]
);
}
}
ecpg_free
(
paramValues
);
ecpg_free
(
paramValues
);
}
}
...
@@ -1138,7 +1138,7 @@ ecpg_execute(struct statement * stmt)
...
@@ -1138,7 +1138,7 @@ ecpg_execute(struct statement * stmt)
PGnotify
*
notify
;
PGnotify
*
notify
;
struct
variable
*
var
;
struct
variable
*
var
;
int
desc_counter
=
0
;
int
desc_counter
=
0
;
c
onst
char
**
paramValues
=
NULL
;
c
har
**
paramValues
=
NULL
;
int
nParams
=
0
;
int
nParams
=
0
;
int
position
=
0
;
int
position
=
0
;
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
struct
sqlca_t
*
sqlca
=
ECPGget_sqlca
();
...
@@ -1380,7 +1380,7 @@ ecpg_execute(struct statement * stmt)
...
@@ -1380,7 +1380,7 @@ ecpg_execute(struct statement * stmt)
else
else
{
{
nParams
++
;
nParams
++
;
if
(
!
(
paramValues
=
(
c
onst
char
**
)
ecpg_realloc
(
paramValues
,
sizeof
(
const
char
*
)
*
nParams
,
stmt
->
lineno
)))
if
(
!
(
paramValues
=
(
c
har
**
)
ecpg_realloc
(
paramValues
,
sizeof
(
char
*
)
*
nParams
,
stmt
->
lineno
)))
{
{
ecpg_free
(
paramValues
);
ecpg_free
(
paramValues
);
return
false
;
return
false
;
...
@@ -1441,7 +1441,7 @@ ecpg_execute(struct statement * stmt)
...
@@ -1441,7 +1441,7 @@ ecpg_execute(struct statement * stmt)
ecpg_log
(
"ecpg_execute on line %d: query: %s; with %d parameter(s) on connection %s
\n
"
,
stmt
->
lineno
,
stmt
->
command
,
nParams
,
stmt
->
connection
->
name
);
ecpg_log
(
"ecpg_execute on line %d: query: %s; with %d parameter(s) on connection %s
\n
"
,
stmt
->
lineno
,
stmt
->
command
,
nParams
,
stmt
->
connection
->
name
);
if
(
stmt
->
statement_type
==
ECPGst_execute
)
if
(
stmt
->
statement_type
==
ECPGst_execute
)
{
{
results
=
PQexecPrepared
(
stmt
->
connection
->
connection
,
stmt
->
name
,
nParams
,
paramValues
,
NULL
,
NULL
,
0
);
results
=
PQexecPrepared
(
stmt
->
connection
->
connection
,
stmt
->
name
,
nParams
,
(
const
char
*
const
*
)
paramValues
,
NULL
,
NULL
,
0
);
ecpg_log
(
"ecpg_execute on line %d: using PQexecPrepared for
\"
%s
\"\n
"
,
stmt
->
lineno
,
stmt
->
command
);
ecpg_log
(
"ecpg_execute on line %d: using PQexecPrepared for
\"
%s
\"\n
"
,
stmt
->
lineno
,
stmt
->
command
);
}
}
else
else
...
@@ -1453,7 +1453,7 @@ ecpg_execute(struct statement * stmt)
...
@@ -1453,7 +1453,7 @@ ecpg_execute(struct statement * stmt)
}
}
else
else
{
{
results
=
PQexecParams
(
stmt
->
connection
->
connection
,
stmt
->
command
,
nParams
,
NULL
,
paramValues
,
NULL
,
NULL
,
0
);
results
=
PQexecParams
(
stmt
->
connection
->
connection
,
stmt
->
command
,
nParams
,
NULL
,
(
const
char
*
const
*
)
paramValues
,
NULL
,
NULL
,
0
);
ecpg_log
(
"ecpg_execute on line %d: using PQexecParams
\n
"
,
stmt
->
lineno
);
ecpg_log
(
"ecpg_execute on line %d: using PQexecParams
\n
"
,
stmt
->
lineno
);
}
}
}
}
...
...
src/interfaces/ecpg/ecpglib/prepare.c
View file @
d41f510c
...
@@ -19,7 +19,7 @@ typedef struct
...
@@ -19,7 +19,7 @@ typedef struct
char
stmtID
[
STMTID_SIZE
];
char
stmtID
[
STMTID_SIZE
];
char
*
ecpgQuery
;
char
*
ecpgQuery
;
long
execs
;
/* # of executions */
long
execs
;
/* # of executions */
c
har
*
connection
;
/* connection for the statement */
c
onst
char
*
connection
;
/* connection for the statement */
}
stmtCacheEntry
;
}
stmtCacheEntry
;
static
int
nextStmtID
=
1
;
static
int
nextStmtID
=
1
;
...
@@ -456,7 +456,7 @@ AddStmtToCache(int lineno, /* line # of statement */
...
@@ -456,7 +456,7 @@ AddStmtToCache(int lineno, /* line # of statement */
entry
=
&
stmtCacheEntries
[
entNo
];
entry
=
&
stmtCacheEntries
[
entNo
];
entry
->
lineno
=
lineno
;
entry
->
lineno
=
lineno
;
entry
->
ecpgQuery
=
ecpg_strdup
(
ecpgQuery
,
lineno
);
entry
->
ecpgQuery
=
ecpg_strdup
(
ecpgQuery
,
lineno
);
entry
->
connection
=
(
char
*
)
connection
;
entry
->
connection
=
connection
;
entry
->
execs
=
0
;
entry
->
execs
=
0
;
memcpy
(
entry
->
stmtID
,
stmtID
,
sizeof
(
entry
->
stmtID
));
memcpy
(
entry
->
stmtID
,
stmtID
,
sizeof
(
entry
->
stmtID
));
...
...
src/interfaces/ecpg/preproc/descriptor.c
View file @
d41f510c
...
@@ -317,14 +317,14 @@ struct variable *
...
@@ -317,14 +317,14 @@ struct variable *
descriptor_variable
(
const
char
*
name
,
int
input
)
descriptor_variable
(
const
char
*
name
,
int
input
)
{
{
static
char
descriptor_names
[
2
][
MAX_DESCRIPTOR_NAMELEN
];
static
char
descriptor_names
[
2
][
MAX_DESCRIPTOR_NAMELEN
];
static
const
struct
ECPGtype
descriptor_type
=
{
ECPGt_descriptor
,
NULL
,
NULL
,
NULL
,
{
NULL
},
0
};
static
struct
ECPGtype
descriptor_type
=
{
ECPGt_descriptor
,
NULL
,
NULL
,
NULL
,
{
NULL
},
0
};
static
const
struct
variable
varspace
[
2
]
=
{
static
struct
variable
varspace
[
2
]
=
{
{
descriptor_names
[
0
],
(
struct
ECPGtype
*
)
&
descriptor_type
,
0
,
NULL
},
{
descriptor_names
[
0
],
&
descriptor_type
,
0
,
NULL
},
{
descriptor_names
[
1
],
(
struct
ECPGtype
*
)
&
descriptor_type
,
0
,
NULL
}
{
descriptor_names
[
1
],
&
descriptor_type
,
0
,
NULL
}
};
};
strlcpy
(
descriptor_names
[
input
],
name
,
sizeof
(
descriptor_names
[
input
]));
strlcpy
(
descriptor_names
[
input
],
name
,
sizeof
(
descriptor_names
[
input
]));
return
(
struct
variable
*
)
&
varspace
[
input
];
return
&
varspace
[
input
];
}
}
struct
variable
*
struct
variable
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment