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;
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);