---------- * alloc_var() - * * Allocate a digit buffer of ndigits digits (plus a spare digit for rounding) * ---------- */
| 30 | * ---------- |
| 31 | */ |
| 32 | static int |
| 33 | alloc_var(numeric *var, int ndigits) |
| 34 | { |
| 35 | digitbuf_free(var->buf); |
| 36 | var->buf = digitbuf_alloc(ndigits + 1); |
| 37 | if (var->buf == NULL) |
| 38 | return -1; |
| 39 | var->buf[0] = 0; |
| 40 | var->digits = var->buf + 1; |
| 41 | var->ndigits = ndigits; |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | numeric * |
| 46 | PGTYPESnumeric_new(void) |
no outgoing calls
no test coverage detected