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

Post-feature-freeze pgindent run.

Discussion: https://postgr.es/m/15719.1523984266@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2018-04-26 14:47:16 -04:00
parent f83bf385c1
commit bdf46af748
167 changed files with 1174 additions and 1061 deletions

View File

@@ -464,15 +464,22 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (varcharsize == 0 || varcharsize > size)
{
/* compatibility mode, blank pad and null terminate char array */
/*
* compatibility mode, blank pad and null
* terminate char array
*/
if (ORACLE_MODE(compat) && (type == ECPGt_char || type == ECPGt_unsigned_char))
{
memset(str, ' ', varcharsize);
memcpy(str, pval, size);
str[varcharsize-1] = '\0';
str[varcharsize - 1] = '\0';
/* compatibility mode empty string gets -1 indicator but no warning */
if (size == 0) {
/*
* compatibility mode empty string gets -1
* indicator but no warning
*/
if (size == 0)
{
/* truncation */
switch (ind_type)
{
@@ -488,12 +495,12 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
case ECPGt_unsigned_long:
*((long *) (ind + ind_offset * act_tuple)) = -1;
break;
#ifdef HAVE_LONG_LONG_INT
#ifdef HAVE_LONG_LONG_INT
case ECPGt_long_long:
case ECPGt_unsigned_long_long:
*((long long int *) (ind + ind_offset * act_tuple)) = -1;
break;
#endif /* HAVE_LONG_LONG_INT */
#endif /* HAVE_LONG_LONG_INT */
default:
break;
}
@@ -523,7 +530,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
if (ORACLE_MODE(compat) && (varcharsize - 1) < size)
{
if (type == ECPGt_char || type == ECPGt_unsigned_char)
str[varcharsize-1] = '\0';
str[varcharsize - 1] = '\0';
}
if (varcharsize < size || (ORACLE_MODE(compat) && (varcharsize - 1) < size))

View File

@@ -479,7 +479,8 @@ main(int argc, char *const argv[])
}
}
if (output_filename && out_option == 0) {
if (output_filename && out_option == 0)
{
free(output_filename);
output_filename = NULL;
}

View File

@@ -611,14 +611,16 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize
if (ind_p != NULL && ind_p != &struct_no_indicator)
{
ind_p = ind_p->next;
if (ind_p == NULL && p->next != NULL) {
if (ind_p == NULL && p->next != NULL)
{
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too few members", ind_name);
ind_p = &struct_no_indicator;
}
}
}
if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator) {
if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator)
{
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too many members", ind_name);
}