1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Some cleanup in ecpg code:

Use bool as type for booleans instead of int.
Do not implicitely cast size_t to int.
Make the compiler stop complaining about unused variables by adding an empty statement.
This commit is contained in:
Michael Meskes
2010-11-02 18:12:01 +01:00
parent 8c843fff2d
commit 35d5d962e1
8 changed files with 30 additions and 18 deletions

View File

@ -178,8 +178,8 @@ deccopy(decimal *src, decimal *target)
static char *
ecpg_strndup(const char *str, size_t len)
{
int real_len = strlen(str);
int use_len = (real_len > len) ? (int) len : real_len;
size_t real_len = strlen(str);
int use_len = (int) ((real_len > len) ? len : real_len);
char *new = malloc(use_len + 1);
@ -983,24 +983,33 @@ ldchar(char *src, int len, char *dest)
int
rgetmsg(int msgnum, char *s, int maxsize)
{
(void) msgnum; /* keep the compiler quiet */
(void) s; /* keep the compiler quiet */
(void) maxsize; /* keep the compiler quiet */
return 0;
}
int
rtypalign(int offset, int type)
{
(void) offset; /* keep the compiler quiet */
(void) type; /* keep the compiler quiet */
return 0;
}
int
rtypmsize(int type, int len)
{
(void) type; /* keep the compiler quiet */
(void) len; /* keep the compiler quiet */
return 0;
}
int
rtypwidth(int sqltype, int sqllen)
{
(void) sqltype; /* keep the compiler quiet */
(void) sqllen; /* keep the compiler quiet */
return 0;
}