OPENDAP/libdap4

This is function should take an unsigned long long type as it's parameter

ndp-opendap opened this issue · 1 comments

void set_size(unsigned long size) { d_size = size; }

Because the internal variable d_size is an unsigned long long (and why don't we just migrate to size_t?) and setting it's value with an unsigned long is, well, it defeats the purpose of making the internal variable an unsigned long long and screws the whole deal for large datasets.

For example if I make a D4Dimension with size 3429693028 I get this gem:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Dataset xmlns="http://xml.opendap.org/ns/DAP/4.0#" xmlns:dmrpp="http://xml.opendap.org/dap/dmrpp/1.0.0#" dapVersion="4.0" dmrVersion="1.0" name="" dmrpp:href="https://harmony-uat-staging.s3.us-west-2.amazonaws.com/public/sds/staged/ATL03_20200714235814_03000802_003_01.h5">
    <Byte name="data">
        <Dim size="-865274268"/>
        <dmrpp:chunks byteOrder="LE">
            <dmrpp:chunkDimensionSizes>342969302</dmrpp:chunkDimensionSizes>
            <dmrpp:chunk offset="0" nBytes="342969302" chunkPositionInArray="[0]"/>
            <dmrpp:chunk offset="342969302" nBytes="342969302" chunkPositionInArray="[342969302]"/>
            <dmrpp:chunk offset="685938604" nBytes="342969302" chunkPositionInArray="[685938604]"/>
            <dmrpp:chunk offset="1028907906" nBytes="342969302" chunkPositionInArray="[1028907906]"/>
            <dmrpp:chunk offset="1371877208" nBytes="342969302" chunkPositionInArray="[1371877208]"/>
            <dmrpp:chunk offset="1714846510" nBytes="342969302" chunkPositionInArray="[1714846510]"/>
            <dmrpp:chunk offset="2057815812" nBytes="342969302" chunkPositionInArray="[2057815812]"/>
            <dmrpp:chunk offset="2400785114" nBytes="342969302" chunkPositionInArray="[2400785114]"/>
            <dmrpp:chunk offset="2743754416" nBytes="342969302" chunkPositionInArray="[2743754416]"/>
            <dmrpp:chunk offset="3086723718" nBytes="342969302" chunkPositionInArray="[3086723718]"/>
            <dmrpp:chunk offset="3429693020" nBytes="8" chunkPositionInArray="[3429693020]"/>
        </dmrpp:chunks>
    </Byte>
</Dataset>

Fixed. Merged. Tested against the BES on OSX. Reopen if a force BES build fails.