File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,13 @@ package JSON is
6363 type T_JSON_INDEX is array (NATURAL range <> ) of T_JSON_INDEX_ELEMENT;
6464
6565 constant C_JSON_ERROR_MESSAGE_LENGTH : NATURAL := 64 ;
66+ constant C_JSON_INDEX_MAX : T_UINT16 := 1023 ;
67+ constant C_JSONFILE_INDEX_MAX : T_UINT16 := 4 * C_JSON_INDEX_MAX;
6668
6769 type T_JSON is record
6870 Content : STRING (1 to T_UINT16'high );
6971 ContentCount : T_UINT16;
70- Index : T_JSON_INDEX(0 to 1023 );
72+ Index : T_JSON_INDEX(0 to C_JSON_INDEX_MAX );
7173 IndexCount : T_UINT16;
7274 Error : STRING (1 to C_JSON_ERROR_MESSAGE_LENGTH);
7375 end record ;
@@ -270,11 +272,10 @@ package body JSON is
270272 end procedure ;
271273
272274 impure function jsonLoad(Stream : STRING ) return T_JSON is
273- variable Result : T_JSON; -- TODO: this is only required in order to use Result.Index'high
274275 begin
275276 if ( " .json" = Stream(Stream'length - 4 to Stream'length ) ) then
276277 report " jsonLoad: Filename " & Stream severity NOTE ;
277- return jsonParseStream( jsonReadFile(Stream, 4 * Result. Index 'high ) );
278+ return jsonParseStream( jsonReadFile(Stream, C_JSONFILE_INDEX_MAX ) );
278279 else
279280 report " jsonLoad: Stream" severity NOTE ;
280281 return jsonParseStream(Stream);
You can’t perform that action at this time.
0 commit comments