-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prototype mismatch warning for JSON functions.
The prototypes used in RapidApp::JSON::MixedEncoder for encode_json() and decode_json() match the respective prototypes in JSON::XS, but they don't match the prototypes used for those functions in Cpanel::JSON::XS, which JSON::MaybeXS will use in preference to JSON::XS. This can be easily demonstrated by including both modules: $ perl -MJSON::MaybeXS -MRapidApp::JSON::MixedEncoder -e 0 Prototype mismatch: sub main::encode_json ($;$) vs ($) at /usr/share/perl/5.26/Exporter.pm line 66. at -e line 0. Prototype mismatch: sub main::decode_json ($;$$) vs ($) at /usr/share/perl/5.26/Exporter.pm line 66. at -e line 0. RapidApp uses Catalyst, which uses JSON::MaybeXS, causing this prototype mismatch warning. This commit fixes this problem by using JSON::MaybeXS where the JSON module was previously used, and changing the prototypes for encode_json() and decode_json() in RapidApp::JSON::MixedEncoder to match the prototypes in Cpanel::JSON::XS, rather than JSON::XS. Note that this change means that using RapidApp::JSON::MixedEncoder with either JSON::XS or JSON will now cause a prototype mismatch warning!
- Loading branch information
Showing
5 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters