mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03: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:
@ -150,6 +150,8 @@ HV_to_JsonbValue(HV *obj, JsonbParseState **jsonb_state)
|
|||||||
dTHX;
|
dTHX;
|
||||||
JsonbValue key;
|
JsonbValue key;
|
||||||
SV *val;
|
SV *val;
|
||||||
|
char *kstr;
|
||||||
|
I32 klen;
|
||||||
|
|
||||||
key.type = jbvString;
|
key.type = jbvString;
|
||||||
|
|
||||||
@ -157,9 +159,10 @@ HV_to_JsonbValue(HV *obj, JsonbParseState **jsonb_state)
|
|||||||
|
|
||||||
(void) hv_iterinit(obj);
|
(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);
|
pushJsonbValue(jsonb_state, WJB_KEY, &key);
|
||||||
(void) SV_to_JsonbValue(val, jsonb_state, false);
|
(void) SV_to_JsonbValue(val, jsonb_state, false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user