-/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.60 2009/08/14 13:28:22 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.61 2009/09/03 09:59:20 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
size_t fmt_len = strlen(fmt);
size_t temp_len;
int i,
- j,
+ j, /* position in temp */
k,
dotpos;
int leftalign = 0,
blank = 0,
sign = 0,
- entity = 0,
entitydone = 0,
signdone = 0,
brackets_ok = 0;
/* start to parse the formatstring */
temp[0] = '\0';
- j = 0; /* position in temp */
k = value.digits - 1; /* position in the value_string */
for (i = fmt_len - 1, j = 0; i >= 0; i--, j++)
{
if (k < 0)
{
blank = 1;
- if (k == -2)
- entity = 1;
- else if (k == -1)
+ if (k == -1)
sign = 1;
if (leftalign)
{
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c,v 1.33 2006/10/04 00:30:12 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/numeric.c,v 1.34 2009/09/03 09:59:20 meskes Exp $ */
#include "postgres_fe.h"
#include <ctype.h>
NumericDigit firstdigit1,
firstdigit2;
int res_dscale;
- int res_rscale;
/*
* The result scale of a division isn't specified in any SQL standard. For
res_dscale = Min(res_dscale, NUMERIC_MAX_DISPLAY_SCALE);
/* Select result scale */
- *rscale = res_rscale = res_dscale + 4;
+ *rscale = res_dscale + 4;
return res_dscale;
}
PGTYPESnumeric_to_double(numeric *nv, double *dp)
{
double tmp;
- int i;
- if ((i = numericvar_to_double(nv, &tmp)) != 0)
+ if (numericvar_to_double(nv, &tmp) != 0)
return -1;
*dp = tmp;
return 0;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.84 2009/08/07 10:51:20 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.85 2009/09/03 09:59:20 meskes Exp $ */
#include "postgres_fe.h"
char *varcharsize,
char *arrsiz, const char *siz, const char *prefix, int);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
- struct ECPGtype * type, struct ECPGtype * ind_type, const char *offset, const char *prefix, const char *ind_prefix);
+ struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix);
void
ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
type->size,
type->u.element,
(ind_type == NULL) ? NULL : ((ind_type->type == ECPGt_NO_INDICATOR) ? ind_type : ind_type->u.element),
- NULL, prefix, ind_prefix);
+ prefix, ind_prefix);
break;
default:
if (!IS_SIMPLE_TYPE(type->u.element->type))
if (indicator_set && ind_type->type != ECPGt_struct)
mmerror(INDICATOR_NOT_STRUCT, ET_FATAL, "indicator for struct has to be a struct");
- ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, NULL, prefix, ind_prefix);
+ ECPGdump_a_struct(o, name, ind_name, make_str("1"), type, ind_type, prefix, ind_prefix);
break;
case ECPGt_union: /* cannot dump a complete union */
base_yyerror("type of union has to be specified");
/* Penetrate a struct and dump the contents. */
static void
-ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, struct ECPGtype * type, struct ECPGtype * ind_type, const char *offsetarg, const char *prefix, const char *ind_prefix)
+ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, struct ECPGtype * type, struct ECPGtype * ind_type, const char *prefix, const char *ind_prefix)
{
/*
* If offset is NULL, then this is the first recursive level. If not then
*/
struct ECPGstruct_member *p,
*ind_p = NULL;
- char obuf[BUFSIZ];
char pbuf[BUFSIZ],
ind_pbuf[BUFSIZ];
- const char *offset;
-
- if (offsetarg == NULL)
- {
- sprintf(obuf, "sizeof(%s)", name);
- offset = obuf;
- }
- else
- offset = offsetarg;
if (atoi(arrsiz) == 1)
sprintf(pbuf, "%s%s.", prefix ? prefix : "", name);