mirror of
https://github.com/postgres/postgres.git
synced 2026-04-21 14:19:26 -04:00
Suppress compiler warning in new jsonb_plperl code.
Some compilers are evidently pickier than others about whether Perl's I32 typedef should be considered equivalent to int. Dodge the problem by using a separate variable; the prior coding was a bit confusing anyway. Per buildfarm. Note this does nothing to fix the test failures due to SV_to_JsonbValue not covering enough variable types.
This commit is contained in:
parent
242408dbef
commit
d4a4c3d5b4
1 changed files with 5 additions and 2 deletions
|
|
@ -150,6 +150,8 @@ HV_to_JsonbValue(HV *obj, JsonbParseState **jsonb_state)
|
|||
dTHX;
|
||||
JsonbValue key;
|
||||
SV *val;
|
||||
char *kstr;
|
||||
I32 klen;
|
||||
|
||||
key.type = jbvString;
|
||||
|
||||
|
|
@ -157,9 +159,10 @@ HV_to_JsonbValue(HV *obj, JsonbParseState **jsonb_state)
|
|||
|
||||
(void) hv_iterinit(obj);
|
||||
|
||||
while ((val = hv_iternextsv(obj, &key.val.string.val, &key.val.string.len)))
|
||||
while ((val = hv_iternextsv(obj, &kstr, &klen)))
|
||||
{
|
||||
key.val.string.val = pnstrdup(key.val.string.val, key.val.string.len);
|
||||
key.val.string.val = pnstrdup(kstr, klen);
|
||||
key.val.string.len = klen;
|
||||
pushJsonbValue(jsonb_state, WJB_KEY, &key);
|
||||
(void) SV_to_JsonbValue(val, jsonb_state, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue