This commit is contained in:
Baudouin Raoult 2023-06-28 14:27:18 +01:00
parent e6a0a2fb2b
commit 1518bbd4b3
34 changed files with 594 additions and 459 deletions

2
.gitignore vendored
View File

@ -74,3 +74,5 @@ build/
*.back
converted/
*.pyc
*-tmp.cc
*-tmp.h

View File

@ -405,440 +405,440 @@ list( APPEND eccodes_src_files
)
list( APPEND eccodes_src_files
converted/eccodes/accessor/Long.cc
converted/eccodes/accessor/Dictionary.cc
converted/eccodes/accessor/Time.h
converted/eccodes/accessor/Divdouble.h
converted/eccodes/accessor/Generic.h
converted/eccodes/accessor/DataG2shsimplePacking.h
converted/eccodes/accessor/G1HalfByteCodeflag.cc
converted/eccodes/accessor/Size.h
converted/eccodes/accessor/OctetNumber.h
converted/eccodes/accessor/UnpackBufrValues.h
converted/eccodes/accessor/Bytes.cc
converted/eccodes/accessor/G1forecastmonth.cc
converted/eccodes/accessor/SectionPadding.cc
converted/eccodes/accessor/ValidityTime.cc
converted/eccodes/accessor/G1monthlydate.h
converted/eccodes/accessor/GdsNotPresentBitmap.cc
converted/eccodes/accessor/Concept.h
converted/eccodes/accessor/NonAlpha.h
converted/eccodes/accessor/Padtomultiple.h
converted/eccodes/accessor/AbstractVector.h
converted/eccodes/accessor/BufrExtractSubsets.cc
converted/eccodes/accessor/Array.cc
converted/eccodes/accessor/SimplePackingError.cc
converted/eccodes/accessor/GdsIsPresent.h
converted/eccodes/accessor/Sexagesimal2decimal.h
converted/eccodes/accessor/Scale.h
converted/eccodes/accessor/Int64LittleEndian.cc
converted/eccodes/accessor/ChangeAlternativeRowScanning.h
converted/eccodes/accessor/Constant.cc
converted/eccodes/accessor/NonAlpha.cc
converted/eccodes/accessor/G1forecastmonth.h
converted/eccodes/accessor/Uint32LittleEndian.h
converted/eccodes/accessor/DataPngPacking.cc
converted/eccodes/accessor/ChangeScanningDirection.cc
converted/eccodes/accessor/FromScaleFactorScaledValue.cc
converted/eccodes/accessor/Evaluate.cc
converted/eccodes/accessor/DataG1secondaryBitmap.cc
converted/eccodes/accessor/G2MarsLabeling.h
converted/eccodes/accessor/When.cc
converted/eccodes/accessor/OctahedralGaussian.h
converted/eccodes/accessor/Budgdate.h
converted/eccodes/accessor/Uint32LittleEndian.cc
converted/eccodes/accessor/Statistics.cc
converted/eccodes/accessor/Data2orderPacking.cc
converted/eccodes/accessor/Latitudes.h
converted/eccodes/accessor/BufrSimpleThinning.h
converted/eccodes/accessor/BufrExtractAreaSubsets.h
converted/eccodes/accessor/OctetNumber.cc
converted/eccodes/accessor/Latlonvalues.h
converted/eccodes/accessor/BufrStringValues.cc
converted/eccodes/accessor/Bitmap.cc
converted/eccodes/accessor/CodetableTitle.h
converted/eccodes/accessor/Double.cc
converted/eccodes/accessor/Sum.cc
converted/eccodes/accessor/DataG2complexPacking.cc
converted/eccodes/accessor/Latlonvalues.cc
converted/eccodes/accessor/StepInUnits.h
converted/eccodes/accessor/Label.h
converted/eccodes/accessor/G1endOfIntervalMonthly.h
converted/eccodes/accessor/G2level.cc
converted/eccodes/accessor/DataDummyField.h
converted/eccodes/accessor/MarsParam.cc
converted/eccodes/accessor/Md5Sum.cc
converted/eccodes/accessor/BufrElementsTable.cc
converted/eccodes/accessor/Laplacian.h
converted/eccodes/accessor/DataShUnpacked.cc
converted/eccodes/accessor/DataApplyBoustrophedonic.cc
converted/eccodes/accessor/FromScaleFactorScaledValue.h
converted/eccodes/accessor/G2Chemical.cc
converted/eccodes/accessor/Sexagesimal2decimal.cc
converted/eccodes/accessor/DataApplyBitmap.h
converted/eccodes/accessor/UnsignedBits.cc
converted/eccodes/accessor/G2bitmapPresent.h
converted/eccodes/accessor/GtsHeader.h
converted/eccodes/accessor/IfsParam.cc
converted/eccodes/accessor/SpectralTruncation.cc
converted/eccodes/accessor/HashArray.h
converted/eccodes/accessor/Nearest.cc
converted/eccodes/accessor/G2bitmap.cc
converted/eccodes/accessor/HashArray.cc
converted/eccodes/accessor/LocalDefinition.h
converted/eccodes/accessor/Budgdate.cc
converted/eccodes/accessor/DataSecondaryBitmap.h
converted/eccodes/accessor/ChangeAlternativeRowScanning.cc
converted/eccodes/accessor/BufrDataElement.h
converted/eccodes/accessor/ValidityDate.h
converted/eccodes/accessor/NumberOfValuesDataRawPacking.cc
converted/eccodes/accessor/DataG1secondOrderGeneralPacking.h
converted/eccodes/accessor/SectionPointer.cc
converted/eccodes/accessor/Int8.cc
converted/eccodes/accessor/DataSimplePacking.cc
converted/eccodes/accessor/CountTotal.h
converted/eccodes/accessor/G2date.cc
converted/eccodes/accessor/ToString.h
converted/eccodes/accessor/LongVector.cc
converted/eccodes/accessor/DataG2simplePacking.h
converted/eccodes/accessor/Int64.h
converted/eccodes/accessor/GdsIsPresent.cc
converted/eccodes/accessor/G2lon.h
converted/eccodes/accessor/SectionPointer.h
converted/eccodes/accessor/ScaleValues.cc
converted/eccodes/accessor/DataShPacked.h
converted/eccodes/accessor/Scale.cc
converted/eccodes/accessor/BufrDataArray.h
converted/eccodes/accessor/SectionPadding.h
converted/eccodes/accessor/OffsetFile.h
converted/eccodes/accessor/Blob.cc
converted/eccodes/accessor/Codetable.h
converted/eccodes/accessor/Padding.cc
converted/eccodes/accessor/Int16LittleEndian.h
converted/eccodes/accessor/Unsigned.h
converted/eccodes/accessor/DataG1secondOrderConstantWidthPacking.cc
converted/eccodes/accessor/NumberOfCodedValues.cc
converted/eccodes/accessor/DataApplyGdsnotpresent.cc
converted/eccodes/accessor/UnexpandedDescriptors.h
converted/eccodes/accessor/Ksec1expver.h
converted/eccodes/accessor/Int32LittleEndian.h
converted/eccodes/accessor/Times.h
converted/eccodes/accessor/DataG1simplePacking.cc
converted/eccodes/accessor/Round.cc
converted/eccodes/accessor/Uint32.h
converted/eccodes/accessor/DataApplyBoustrophedonicBitmap.cc
converted/eccodes/accessor/OffsetValues.h
converted/eccodes/accessor/DecimalPrecision.h
converted/eccodes/accessor/CheckInternalVersion.cc
converted/eccodes/accessor/Blob.h
converted/eccodes/accessor/Getenv.cc
converted/eccodes/accessor/Codeflag.cc
converted/eccodes/accessor/SecondOrderBitsPerValue.h
converted/eccodes/accessor/Int16.h
converted/eccodes/accessor/Uint64.cc
converted/eccodes/accessor/BufrdcExpandedDescriptors.cc
converted/eccodes/accessor/Nearest.h
converted/eccodes/accessor/GdsNotPresentBitmap.h
converted/eccodes/accessor/UnsignedBits.h
converted/eccodes/accessor/DataRawPacking.h
converted/eccodes/accessor/G2stepRange.h
converted/eccodes/accessor/Iterator.cc
converted/eccodes/accessor/BufrExtractSubsets.h
converted/eccodes/accessor/DataG1secondOrderConstantWidthPacking.h
converted/eccodes/accessor/GlobalGaussian.h
converted/eccodes/accessor/Constant.h
converted/eccodes/accessor/Round.h
converted/eccodes/accessor/ScaleValues.h
converted/eccodes/accessor/GaussianGridName.h
converted/eccodes/accessor/Variable.cc
converted/eccodes/accessor/Md5Sum.h
converted/eccodes/accessor/Signed.cc
converted/eccodes/accessor/PackBufrValues.cc
converted/eccodes/accessor/GaussianGridName.cc
converted/eccodes/accessor/DataApplyBitmap.cc
converted/eccodes/accessor/CountTotal.cc
converted/eccodes/accessor/Int16LittleEndian.cc
converted/eccodes/accessor/Pad.cc
converted/eccodes/accessor/SmartTable.h
converted/eccodes/accessor/DataG2simplePackingWithPreprocessing.cc
converted/eccodes/accessor/G1dayOfTheYearDate.h
converted/eccodes/accessor/IfsParam.h
converted/eccodes/accessor/SectionLength.cc
converted/eccodes/accessor/Pad.h
converted/eccodes/accessor/LatlonIncrement.cc
converted/eccodes/accessor/Data2orderPacking.h
converted/eccodes/accessor/Divdouble.cc
converted/eccodes/accessor/ToInteger.h
converted/eccodes/accessor/Bit.h
converted/eccodes/accessor/Codetable.cc
converted/eccodes/accessor/Group.cc
converted/eccodes/accessor/DataG1secondOrderGeneralExtendedPacking.cc
converted/eccodes/accessor/Int16.cc
converted/eccodes/accessor/SmartTableColumn.cc
converted/eccodes/accessor/DataRawPacking.cc
converted/eccodes/accessor/StepHumanReadable.h
converted/eccodes/accessor/DataSecondaryBitmap.cc
converted/eccodes/accessor/GtsHeader.cc
converted/eccodes/accessor/DataPngPacking.h
converted/eccodes/accessor/MarsParam.h
converted/eccodes/accessor/Message.h
converted/eccodes/accessor/AbstractLongVector.cc
converted/eccodes/accessor/MarsStep.h
converted/eccodes/accessor/CountMissing.cc
converted/eccodes/accessor/BufrDataElement.cc
converted/eccodes/accessor/ExpandedDescriptors.h
converted/eccodes/accessor/DataG2complexPacking.h
converted/eccodes/accessor/Trim.h
converted/eccodes/accessor/Transient.h
converted/eccodes/accessor/G2Chemical.h
converted/eccodes/accessor/Transient.cc
converted/eccodes/accessor/Longitudes.cc
converted/eccodes/accessor/Long.h
converted/eccodes/accessor/CodetableUnits.cc
converted/eccodes/accessor/Bit.cc
converted/eccodes/accessor/Int32.cc
converted/eccodes/accessor/Variable.h
converted/eccodes/accessor/DataG1secondOrderGeneralPacking.cc
converted/eccodes/accessor/G1fcperiod.cc
converted/eccodes/accessor/Uint16LittleEndian.h
converted/eccodes/accessor/Section.h
converted/eccodes/accessor/ReferenceValueError.cc
converted/eccodes/accessor/ValidityTime.h
converted/eccodes/accessor/TransientDarray.cc
converted/eccodes/accessor/DecimalPrecision.cc
converted/eccodes/accessor/GlobalGaussian.cc
converted/eccodes/accessor/Sprintf.cc
converted/eccodes/accessor/TransientDarray.h
converted/eccodes/accessor/Padtoeven.cc
converted/eccodes/accessor/Position.cc
converted/eccodes/accessor/G1numberOfCodedValuesShComplex.h
converted/eccodes/accessor/DataG2secondaryBitmap.cc
converted/eccodes/accessor/BufrGroup.h
converted/eccodes/accessor/DataShPacked.cc
converted/eccodes/accessor/Suppressed.h
converted/eccodes/accessor/LibraryVersion.cc
converted/eccodes/accessor/DataG1secondaryBitmap.h
converted/eccodes/accessor/DataG1simplePacking.h
converted/eccodes/accessor/G2MarsLabeling.cc
converted/eccodes/accessor/ProjString.cc
converted/eccodes/accessor/StepHumanReadable.cc
converted/eccodes/accessor/DataApplyGdsnotpresent.h
converted/eccodes/accessor/Ibmfloat.h
converted/eccodes/accessor/Label.cc
converted/eccodes/accessor/Concept.cc
converted/eccodes/accessor/ToDouble.h
converted/eccodes/accessor/G1verificationdate.h
converted/eccodes/accessor/ClosestDate.cc
converted/eccodes/accessor/Missing.h
converted/eccodes/accessor/Uint16LittleEndian.cc
converted/eccodes/accessor/DataShsimplePacking.h
converted/eccodes/accessor/LongVector.h
converted/eccodes/accessor/CountFile.h
converted/eccodes/accessor/Ascii.h
converted/eccodes/accessor/BufrStringValues.h
converted/eccodes/accessor/OffsetValues.cc
converted/eccodes/accessor/Int32.h
converted/eccodes/accessor/ChangeScanningDirection.h
converted/eccodes/accessor/Spd.cc
converted/eccodes/accessor/Sum.h
converted/eccodes/accessor/G2bitmap.h
converted/eccodes/accessor/G1numberOfCodedValuesShSimple.cc
converted/eccodes/accessor/NumberOfCodedValues.h
converted/eccodes/accessor/Values.h
converted/eccodes/accessor/Lookup.cc
converted/eccodes/accessor/Generic.cc
converted/eccodes/accessor/Padto.cc
converted/eccodes/accessor/G1fcperiod.h
converted/eccodes/accessor/Latitudes.cc
converted/eccodes/accessor/G2date.h
converted/eccodes/accessor/G1numberOfCodedValuesShSimple.h
converted/eccodes/accessor/Uint16.h
converted/eccodes/accessor/DataG2bifourierPacking.cc
converted/eccodes/accessor/BufrExtractDatetimeSubsets.cc
converted/eccodes/accessor/BufrSimpleThinning.cc
converted/eccodes/accessor/G1HalfByteCodeflag.h
converted/eccodes/accessor/StepInUnits.cc
converted/eccodes/accessor/Element.h
converted/eccodes/accessor/BitsPerValue.cc
converted/eccodes/accessor/G2level.h
converted/eccodes/accessor/DataG1secondOrderRowByRowPacking.h
converted/eccodes/accessor/DataSimplePacking.h
converted/eccodes/accessor/Dictionary.h
converted/eccodes/accessor/G2stepRange.cc
converted/eccodes/accessor/Group.h
converted/eccodes/accessor/DataComplexPacking.cc
converted/eccodes/accessor/G1numberOfCodedValuesShComplex.cc
converted/eccodes/accessor/G2latlon.h
converted/eccodes/accessor/G1bitmap.cc
converted/eccodes/accessor/OctahedralGaussian.cc
converted/eccodes/accessor/G1area.cc
converted/eccodes/accessor/Int64.cc
converted/eccodes/accessor/G2lon.cc
converted/eccodes/accessor/Ascii.cc
converted/eccodes/accessor/G1date.cc
converted/eccodes/accessor/Trim.cc
converted/eccodes/accessor/Laplacian.cc
converted/eccodes/accessor/Uint64LittleEndian.h
converted/eccodes/accessor/RdbtimeGuessDate.h
converted/eccodes/accessor/Section.cc
converted/eccodes/accessor/ToString.cc
converted/eccodes/accessor/Statistics.h
converted/eccodes/accessor/ToDouble.cc
converted/eccodes/accessor/G1stepRange.h
converted/eccodes/accessor/ExpandedDescriptors.cc
converted/eccodes/accessor/Assert.cc
converted/eccodes/accessor/G1MessageLength.cc
converted/eccodes/accessor/NumberOfPoints.h
converted/eccodes/accessor/DataG1secondOrderGeneralExtendedPacking.h
converted/eccodes/accessor/When.h
converted/eccodes/accessor/G2grid.h
converted/eccodes/accessor/JulianDay.cc
converted/eccodes/accessor/Times.cc
converted/eccodes/accessor/Ibmfloat.cc
converted/eccodes/accessor/Array.h
converted/eccodes/accessor/Size.cc
converted/eccodes/accessor/MarsStep.cc
converted/eccodes/accessor/Bytes.h
converted/eccodes/accessor/DataApplyBoustrophedonicBitmap.h
converted/eccodes/accessor/DataG2secondaryBitmap.h
converted/eccodes/accessor/Dirty.h
converted/eccodes/accessor/Padto.h
converted/eccodes/accessor/Raw.h
converted/eccodes/accessor/UnpackBufrValues.cc
converted/eccodes/accessor/Unsigned.cc
converted/eccodes/accessor/Suppressed.cc
converted/eccodes/accessor/Element.cc
converted/eccodes/accessor/G1Section4Length.h
converted/eccodes/accessor/ClosestDate.h
converted/eccodes/accessor/Lookup.h
converted/eccodes/accessor/BufrExtractDatetimeSubsets.h
converted/eccodes/accessor/AbstractLongVector.h
converted/eccodes/accessor/Codeflag.h
converted/eccodes/accessor/G1verificationdate.cc
converted/eccodes/accessor/Uint16.cc
converted/eccodes/accessor/G1Section4Length.cc
converted/eccodes/accessor/JulianDate.h
converted/eccodes/accessor/BufrdcExpandedDescriptors.h
converted/eccodes/accessor/DataComplexPacking.h
converted/eccodes/accessor/Double.h
converted/eccodes/accessor/DataJpeg2000Packing.cc
converted/eccodes/accessor/Message.cc
converted/eccodes/accessor/DataG1shsimplePacking.cc
converted/eccodes/accessor/G2endStep.cc
converted/eccodes/accessor/BufrElementsTable.h
converted/eccodes/accessor/DataRunLengthPacking.cc
converted/eccodes/accessor/Padtomultiple.cc
converted/eccodes/accessor/SelectStepTemplate.cc
converted/eccodes/accessor/G2Aerosol.h
converted/eccodes/accessor/PackBufrValues.h
converted/eccodes/accessor/G1monthlydate.cc
converted/eccodes/accessor/Uint32.cc
converted/eccodes/accessor/CodetableTitle.cc
converted/eccodes/accessor/DataRunLengthPacking.h
converted/eccodes/accessor/BufrDataArray.cc
converted/eccodes/accessor/SmartTable.cc
converted/eccodes/accessor/Longitudes.h
converted/eccodes/accessor/ProjString.h
converted/eccodes/accessor/Bits.cc
converted/eccodes/accessor/G1endOfIntervalMonthly.cc
converted/eccodes/accessor/BitsPerValue.h
converted/eccodes/accessor/DataApplyBoustrophedonic.h
converted/eccodes/accessor/G2grid.cc
converted/eccodes/accessor/G1date.h
converted/eccodes/accessor/DataG1complexPacking.h
converted/eccodes/accessor/DataG22orderPacking.cc
converted/eccodes/accessor/Signed.h
converted/eccodes/accessor/DataCcsdsPacking.cc
converted/eccodes/accessor/MessageCopy.h
converted/eccodes/accessor/Uint64LittleEndian.cc
converted/eccodes/accessor/Evaluate.h
converted/eccodes/accessor/CheckInternalVersion.h
converted/eccodes/accessor/Missing.cc
converted/eccodes/accessor/UnexpandedDescriptors.cc
converted/eccodes/accessor/CodetableUnits.h
converted/eccodes/accessor/G2Eps.cc
converted/eccodes/accessor/DataShsimplePacking.cc
converted/eccodes/accessor/DataG1complexPacking.cc
converted/eccodes/accessor/Int32LittleEndian.cc
converted/eccodes/accessor/Padtoeven.h
converted/eccodes/accessor/BufrExtractAreaSubsets.cc
converted/eccodes/accessor/LibraryVersion.h
converted/eccodes/accessor/DataShUnpacked.h
converted/eccodes/accessor/SignedBits.cc
converted/eccodes/accessor/OffsetFile.cc
converted/eccodes/accessor/G2latlon.cc
converted/eccodes/accessor/ReferenceValueError.h
converted/eccodes/accessor/DataG1shsimplePacking.h
converted/eccodes/accessor/RdbtimeGuessDate.cc
converted/eccodes/accessor/DataDummyField.cc
converted/eccodes/accessor/DataG1secondOrderRowByRowPacking.cc
converted/eccodes/accessor/AbstractVector.cc
converted/eccodes/accessor/DataG2shsimplePacking.cc
converted/eccodes/accessor/Time.cc
converted/eccodes/accessor/G2bitmapPresent.cc
converted/eccodes/accessor/HeadersOnly.cc
converted/eccodes/accessor/G1bitmap.h
converted/eccodes/accessor/SmartTableColumn.h
converted/eccodes/accessor/Vector.h
converted/eccodes/accessor/NumberOfPointsGaussian.cc
converted/eccodes/accessor/AbstractVector.h
converted/eccodes/accessor/Array.cc
converted/eccodes/accessor/Array.h
converted/eccodes/accessor/Ascii.cc
converted/eccodes/accessor/Ascii.h
converted/eccodes/accessor/Assertion.cc
converted/eccodes/accessor/Assertion.h
converted/eccodes/accessor/Bit.cc
converted/eccodes/accessor/Bit.h
converted/eccodes/accessor/Bitmap.cc
converted/eccodes/accessor/Bitmap.h
converted/eccodes/accessor/DataG2bifourierPacking.h
converted/eccodes/accessor/ToInteger.cc
converted/eccodes/accessor/JulianDay.h
converted/eccodes/accessor/Assert.h
converted/eccodes/accessor/CountFile.cc
converted/eccodes/accessor/StatisticsSpectral.h
converted/eccodes/accessor/G1stepRange.cc
converted/eccodes/accessor/Spd.h
converted/eccodes/accessor/NumberOfValues.h
converted/eccodes/accessor/SimplePackingError.h
converted/eccodes/accessor/G1MessageLength.h
converted/eccodes/accessor/LocalDefinition.cc
converted/eccodes/accessor/NumberOfValuesDataRawPacking.h
converted/eccodes/accessor/Dirty.cc
converted/eccodes/accessor/ValidityDate.cc
converted/eccodes/accessor/SpectralTruncation.h
converted/eccodes/accessor/Iterator.h
converted/eccodes/accessor/StatisticsSpectral.cc
converted/eccodes/accessor/SignedBits.h
converted/eccodes/accessor/DataCcsdsPacking.h
converted/eccodes/accessor/Sprintf.h
converted/eccodes/accessor/JulianDate.cc
converted/eccodes/accessor/Raw.cc
converted/eccodes/accessor/G1area.h
converted/eccodes/accessor/Position.h
converted/eccodes/accessor/DataG2simplePacking.cc
converted/eccodes/accessor/Getenv.h
converted/eccodes/accessor/Uint8.h
converted/eccodes/accessor/DataG22orderPacking.h
converted/eccodes/accessor/G2Eps.h
converted/eccodes/accessor/NumberOfPointsGaussian.h
converted/eccodes/accessor/Uint64.h
converted/eccodes/accessor/Ksec1expver.cc
converted/eccodes/accessor/Ieeefloat.h
converted/eccodes/accessor/Values.cc
converted/eccodes/accessor/Int64LittleEndian.h
converted/eccodes/accessor/DataJpeg2000Packing.h
converted/eccodes/accessor/BufrGroup.cc
converted/eccodes/accessor/NumberOfValues.cc
converted/eccodes/accessor/MessageCopy.cc
converted/eccodes/accessor/LatlonIncrement.h
converted/eccodes/accessor/G2Aerosol.cc
converted/eccodes/accessor/NumberOfPoints.cc
converted/eccodes/accessor/Bits.cc
converted/eccodes/accessor/Bits.h
converted/eccodes/accessor/BitsPerValue.cc
converted/eccodes/accessor/BitsPerValue.h
converted/eccodes/accessor/Blob.cc
converted/eccodes/accessor/Blob.h
converted/eccodes/accessor/Budgdate.cc
converted/eccodes/accessor/Budgdate.h
converted/eccodes/accessor/BufrDataArray.cc
converted/eccodes/accessor/BufrDataArray.h
converted/eccodes/accessor/BufrDataElement.cc
converted/eccodes/accessor/BufrDataElement.h
converted/eccodes/accessor/BufrElementsTable.cc
converted/eccodes/accessor/BufrElementsTable.h
converted/eccodes/accessor/BufrExtractAreaSubsets.cc
converted/eccodes/accessor/BufrExtractAreaSubsets.h
converted/eccodes/accessor/BufrExtractDatetimeSubsets.cc
converted/eccodes/accessor/BufrExtractDatetimeSubsets.h
converted/eccodes/accessor/BufrExtractSubsets.cc
converted/eccodes/accessor/BufrExtractSubsets.h
converted/eccodes/accessor/BufrGroup.cc
converted/eccodes/accessor/BufrGroup.h
converted/eccodes/accessor/BufrSimpleThinning.cc
converted/eccodes/accessor/BufrSimpleThinning.h
converted/eccodes/accessor/BufrStringValues.cc
converted/eccodes/accessor/BufrStringValues.h
converted/eccodes/accessor/BufrdcExpandedDescriptors.cc
converted/eccodes/accessor/BufrdcExpandedDescriptors.h
converted/eccodes/accessor/Bytes.cc
converted/eccodes/accessor/Bytes.h
converted/eccodes/accessor/ChangeAlternativeRowScanning.cc
converted/eccodes/accessor/ChangeAlternativeRowScanning.h
converted/eccodes/accessor/ChangeScanningDirection.cc
converted/eccodes/accessor/ChangeScanningDirection.h
converted/eccodes/accessor/CheckInternalVersion.cc
converted/eccodes/accessor/CheckInternalVersion.h
converted/eccodes/accessor/ClosestDate.cc
converted/eccodes/accessor/ClosestDate.h
converted/eccodes/accessor/Codeflag.cc
converted/eccodes/accessor/Codeflag.h
converted/eccodes/accessor/Codetable.cc
converted/eccodes/accessor/Codetable.h
converted/eccodes/accessor/CodetableTitle.cc
converted/eccodes/accessor/CodetableTitle.h
converted/eccodes/accessor/CodetableUnits.cc
converted/eccodes/accessor/CodetableUnits.h
converted/eccodes/accessor/Concept.cc
converted/eccodes/accessor/Concept.h
converted/eccodes/accessor/Constant.cc
converted/eccodes/accessor/Constant.h
converted/eccodes/accessor/CountFile.cc
converted/eccodes/accessor/CountFile.h
converted/eccodes/accessor/CountMissing.cc
converted/eccodes/accessor/CountMissing.h
converted/eccodes/accessor/Uint8.cc
converted/eccodes/accessor/Padding.h
converted/eccodes/accessor/HeadersOnly.h
converted/eccodes/accessor/Vector.cc
converted/eccodes/accessor/Ieeefloat.cc
converted/eccodes/accessor/G1dayOfTheYearDate.cc
converted/eccodes/accessor/SectionLength.h
converted/eccodes/accessor/Int8.h
converted/eccodes/accessor/SecondOrderBitsPerValue.cc
converted/eccodes/accessor/CountTotal.cc
converted/eccodes/accessor/CountTotal.h
converted/eccodes/accessor/Data2orderPacking.cc
converted/eccodes/accessor/Data2orderPacking.h
converted/eccodes/accessor/DataApplyBitmap.cc
converted/eccodes/accessor/DataApplyBitmap.h
converted/eccodes/accessor/DataApplyBoustrophedonic.cc
converted/eccodes/accessor/DataApplyBoustrophedonic.h
converted/eccodes/accessor/DataApplyBoustrophedonicBitmap.cc
converted/eccodes/accessor/DataApplyBoustrophedonicBitmap.h
converted/eccodes/accessor/DataApplyGdsnotpresent.cc
converted/eccodes/accessor/DataApplyGdsnotpresent.h
converted/eccodes/accessor/DataCcsdsPacking.cc
converted/eccodes/accessor/DataCcsdsPacking.h
converted/eccodes/accessor/DataComplexPacking.cc
converted/eccodes/accessor/DataComplexPacking.h
converted/eccodes/accessor/DataDummyField.cc
converted/eccodes/accessor/DataDummyField.h
converted/eccodes/accessor/DataG1complexPacking.cc
converted/eccodes/accessor/DataG1complexPacking.h
converted/eccodes/accessor/DataG1secondOrderConstantWidthPacking.cc
converted/eccodes/accessor/DataG1secondOrderConstantWidthPacking.h
converted/eccodes/accessor/DataG1secondOrderGeneralExtendedPacking.cc
converted/eccodes/accessor/DataG1secondOrderGeneralExtendedPacking.h
converted/eccodes/accessor/DataG1secondOrderGeneralPacking.cc
converted/eccodes/accessor/DataG1secondOrderGeneralPacking.h
converted/eccodes/accessor/DataG1secondOrderRowByRowPacking.cc
converted/eccodes/accessor/DataG1secondOrderRowByRowPacking.h
converted/eccodes/accessor/DataG1secondaryBitmap.cc
converted/eccodes/accessor/DataG1secondaryBitmap.h
converted/eccodes/accessor/DataG1shsimplePacking.cc
converted/eccodes/accessor/DataG1shsimplePacking.h
converted/eccodes/accessor/DataG1simplePacking.cc
converted/eccodes/accessor/DataG1simplePacking.h
converted/eccodes/accessor/DataG22orderPacking.cc
converted/eccodes/accessor/DataG22orderPacking.h
converted/eccodes/accessor/DataG2bifourierPacking.cc
converted/eccodes/accessor/DataG2bifourierPacking.h
converted/eccodes/accessor/DataG2complexPacking.cc
converted/eccodes/accessor/DataG2complexPacking.h
converted/eccodes/accessor/DataG2secondaryBitmap.cc
converted/eccodes/accessor/DataG2secondaryBitmap.h
converted/eccodes/accessor/DataG2shsimplePacking.cc
converted/eccodes/accessor/DataG2shsimplePacking.h
converted/eccodes/accessor/DataG2simplePacking.cc
converted/eccodes/accessor/DataG2simplePacking.h
converted/eccodes/accessor/DataG2simplePackingWithPreprocessing.cc
converted/eccodes/accessor/DataG2simplePackingWithPreprocessing.h
converted/eccodes/accessor/SelectStepTemplate.h
converted/eccodes/accessor/DataJpeg2000Packing.cc
converted/eccodes/accessor/DataJpeg2000Packing.h
converted/eccodes/accessor/DataPngPacking.cc
converted/eccodes/accessor/DataPngPacking.h
converted/eccodes/accessor/DataRawPacking.cc
converted/eccodes/accessor/DataRawPacking.h
converted/eccodes/accessor/DataRunLengthPacking.cc
converted/eccodes/accessor/DataRunLengthPacking.h
converted/eccodes/accessor/DataSecondaryBitmap.cc
converted/eccodes/accessor/DataSecondaryBitmap.h
converted/eccodes/accessor/DataShPacked.cc
converted/eccodes/accessor/DataShPacked.h
converted/eccodes/accessor/DataShUnpacked.cc
converted/eccodes/accessor/DataShUnpacked.h
converted/eccodes/accessor/DataShsimplePacking.cc
converted/eccodes/accessor/DataShsimplePacking.h
converted/eccodes/accessor/DataSimplePacking.cc
converted/eccodes/accessor/DataSimplePacking.h
converted/eccodes/accessor/DecimalPrecision.cc
converted/eccodes/accessor/DecimalPrecision.h
converted/eccodes/accessor/Dictionary.cc
converted/eccodes/accessor/Dictionary.h
converted/eccodes/accessor/Dirty.cc
converted/eccodes/accessor/Dirty.h
converted/eccodes/accessor/Divdouble.cc
converted/eccodes/accessor/Divdouble.h
converted/eccodes/accessor/Double.cc
converted/eccodes/accessor/Double.h
converted/eccodes/accessor/Element.cc
converted/eccodes/accessor/Element.h
converted/eccodes/accessor/Evaluate.cc
converted/eccodes/accessor/Evaluate.h
converted/eccodes/accessor/ExpandedDescriptors.cc
converted/eccodes/accessor/ExpandedDescriptors.h
converted/eccodes/accessor/FromScaleFactorScaledValue.cc
converted/eccodes/accessor/FromScaleFactorScaledValue.h
converted/eccodes/accessor/G1HalfByteCodeflag.cc
converted/eccodes/accessor/G1HalfByteCodeflag.h
converted/eccodes/accessor/G1MessageLength.cc
converted/eccodes/accessor/G1MessageLength.h
converted/eccodes/accessor/G1Section4Length.cc
converted/eccodes/accessor/G1Section4Length.h
converted/eccodes/accessor/G1area.cc
converted/eccodes/accessor/G1area.h
converted/eccodes/accessor/G1bitmap.cc
converted/eccodes/accessor/G1bitmap.h
converted/eccodes/accessor/G1date.cc
converted/eccodes/accessor/G1date.h
converted/eccodes/accessor/G1dayOfTheYearDate.cc
converted/eccodes/accessor/G1dayOfTheYearDate.h
converted/eccodes/accessor/G1endOfIntervalMonthly.cc
converted/eccodes/accessor/G1endOfIntervalMonthly.h
converted/eccodes/accessor/G1fcperiod.cc
converted/eccodes/accessor/G1fcperiod.h
converted/eccodes/accessor/G1forecastmonth.cc
converted/eccodes/accessor/G1forecastmonth.h
converted/eccodes/accessor/G1monthlydate.cc
converted/eccodes/accessor/G1monthlydate.h
converted/eccodes/accessor/G1numberOfCodedValuesShComplex.cc
converted/eccodes/accessor/G1numberOfCodedValuesShComplex.h
converted/eccodes/accessor/G1numberOfCodedValuesShSimple.cc
converted/eccodes/accessor/G1numberOfCodedValuesShSimple.h
converted/eccodes/accessor/G1stepRange.cc
converted/eccodes/accessor/G1stepRange.h
converted/eccodes/accessor/G1verificationdate.cc
converted/eccodes/accessor/G1verificationdate.h
converted/eccodes/accessor/G2Aerosol.cc
converted/eccodes/accessor/G2Aerosol.h
converted/eccodes/accessor/G2Chemical.cc
converted/eccodes/accessor/G2Chemical.h
converted/eccodes/accessor/G2Eps.cc
converted/eccodes/accessor/G2Eps.h
converted/eccodes/accessor/G2MarsLabeling.cc
converted/eccodes/accessor/G2MarsLabeling.h
converted/eccodes/accessor/G2bitmap.cc
converted/eccodes/accessor/G2bitmap.h
converted/eccodes/accessor/G2bitmapPresent.cc
converted/eccodes/accessor/G2bitmapPresent.h
converted/eccodes/accessor/G2date.cc
converted/eccodes/accessor/G2date.h
converted/eccodes/accessor/G2endStep.cc
converted/eccodes/accessor/G2endStep.h
converted/eccodes/accessor/G2grid.cc
converted/eccodes/accessor/G2grid.h
converted/eccodes/accessor/G2latlon.cc
converted/eccodes/accessor/G2latlon.h
converted/eccodes/accessor/G2level.cc
converted/eccodes/accessor/G2level.h
converted/eccodes/accessor/G2lon.cc
converted/eccodes/accessor/G2lon.h
converted/eccodes/accessor/G2stepRange.cc
converted/eccodes/accessor/G2stepRange.h
converted/eccodes/accessor/GaussianGridName.cc
converted/eccodes/accessor/GaussianGridName.h
converted/eccodes/accessor/GdsIsPresent.cc
converted/eccodes/accessor/GdsIsPresent.h
converted/eccodes/accessor/GdsNotPresentBitmap.cc
converted/eccodes/accessor/GdsNotPresentBitmap.h
converted/eccodes/accessor/Generic.cc
converted/eccodes/accessor/Generic.h
converted/eccodes/accessor/Getenv.cc
converted/eccodes/accessor/Getenv.h
converted/eccodes/accessor/GlobalGaussian.cc
converted/eccodes/accessor/GlobalGaussian.h
converted/eccodes/accessor/Group.cc
converted/eccodes/accessor/Group.h
converted/eccodes/accessor/GtsHeader.cc
converted/eccodes/accessor/GtsHeader.h
converted/eccodes/accessor/HashArray.cc
converted/eccodes/accessor/HashArray.h
converted/eccodes/accessor/HeadersOnly.cc
converted/eccodes/accessor/HeadersOnly.h
converted/eccodes/accessor/Ibmfloat.cc
converted/eccodes/accessor/Ibmfloat.h
converted/eccodes/accessor/Ieeefloat.cc
converted/eccodes/accessor/Ieeefloat.h
converted/eccodes/accessor/IfsParam.cc
converted/eccodes/accessor/IfsParam.h
converted/eccodes/accessor/Int16.cc
converted/eccodes/accessor/Int16.h
converted/eccodes/accessor/Int16LittleEndian.cc
converted/eccodes/accessor/Int16LittleEndian.h
converted/eccodes/accessor/Int32.cc
converted/eccodes/accessor/Int32.h
converted/eccodes/accessor/Int32LittleEndian.cc
converted/eccodes/accessor/Int32LittleEndian.h
converted/eccodes/accessor/Int64.cc
converted/eccodes/accessor/Int64.h
converted/eccodes/accessor/Int64LittleEndian.cc
converted/eccodes/accessor/Int64LittleEndian.h
converted/eccodes/accessor/Int8.cc
converted/eccodes/accessor/Int8.h
converted/eccodes/accessor/Iterator.cc
converted/eccodes/accessor/Iterator.h
converted/eccodes/accessor/JulianDate.cc
converted/eccodes/accessor/JulianDate.h
converted/eccodes/accessor/JulianDay.cc
converted/eccodes/accessor/JulianDay.h
converted/eccodes/accessor/Ksec1expver.cc
converted/eccodes/accessor/Ksec1expver.h
converted/eccodes/accessor/Label.cc
converted/eccodes/accessor/Label.h
converted/eccodes/accessor/Laplacian.cc
converted/eccodes/accessor/Laplacian.h
converted/eccodes/accessor/Latitudes.cc
converted/eccodes/accessor/Latitudes.h
converted/eccodes/accessor/LatlonIncrement.cc
converted/eccodes/accessor/LatlonIncrement.h
converted/eccodes/accessor/Latlonvalues.cc
converted/eccodes/accessor/Latlonvalues.h
converted/eccodes/accessor/LibraryVersion.cc
converted/eccodes/accessor/LibraryVersion.h
converted/eccodes/accessor/LocalDefinition.cc
converted/eccodes/accessor/LocalDefinition.h
converted/eccodes/accessor/Long.cc
converted/eccodes/accessor/Long.h
converted/eccodes/accessor/LongVector.cc
converted/eccodes/accessor/LongVector.h
converted/eccodes/accessor/Longitudes.cc
converted/eccodes/accessor/Longitudes.h
converted/eccodes/accessor/Lookup.cc
converted/eccodes/accessor/Lookup.h
converted/eccodes/accessor/MarsParam.cc
converted/eccodes/accessor/MarsParam.h
converted/eccodes/accessor/MarsStep.cc
converted/eccodes/accessor/MarsStep.h
converted/eccodes/accessor/Md5Sum.cc
converted/eccodes/accessor/Md5Sum.h
converted/eccodes/accessor/Message.cc
converted/eccodes/accessor/Message.h
converted/eccodes/accessor/MessageCopy.cc
converted/eccodes/accessor/MessageCopy.h
converted/eccodes/accessor/Missing.cc
converted/eccodes/accessor/Missing.h
converted/eccodes/accessor/Nearest.cc
converted/eccodes/accessor/Nearest.h
converted/eccodes/accessor/NonAlpha.cc
converted/eccodes/accessor/NonAlpha.h
converted/eccodes/accessor/NumberOfCodedValues.cc
converted/eccodes/accessor/NumberOfCodedValues.h
converted/eccodes/accessor/NumberOfPoints.cc
converted/eccodes/accessor/NumberOfPoints.h
converted/eccodes/accessor/NumberOfPointsGaussian.cc
converted/eccodes/accessor/NumberOfPointsGaussian.h
converted/eccodes/accessor/NumberOfValues.cc
converted/eccodes/accessor/NumberOfValues.h
converted/eccodes/accessor/NumberOfValuesDataRawPacking.cc
converted/eccodes/accessor/NumberOfValuesDataRawPacking.h
converted/eccodes/accessor/OctahedralGaussian.cc
converted/eccodes/accessor/OctahedralGaussian.h
converted/eccodes/accessor/OctetNumber.cc
converted/eccodes/accessor/OctetNumber.h
converted/eccodes/accessor/OffsetFile.cc
converted/eccodes/accessor/OffsetFile.h
converted/eccodes/accessor/OffsetValues.cc
converted/eccodes/accessor/OffsetValues.h
converted/eccodes/accessor/PackBufrValues.cc
converted/eccodes/accessor/PackBufrValues.h
converted/eccodes/accessor/Pad.cc
converted/eccodes/accessor/Pad.h
converted/eccodes/accessor/Padding.cc
converted/eccodes/accessor/Padding.h
converted/eccodes/accessor/Padto.cc
converted/eccodes/accessor/Padto.h
converted/eccodes/accessor/Padtoeven.cc
converted/eccodes/accessor/Padtoeven.h
converted/eccodes/accessor/Padtomultiple.cc
converted/eccodes/accessor/Padtomultiple.h
converted/eccodes/accessor/Position.cc
converted/eccodes/accessor/Position.h
converted/eccodes/accessor/ProjString.cc
converted/eccodes/accessor/ProjString.h
converted/eccodes/accessor/Raw.cc
converted/eccodes/accessor/Raw.h
converted/eccodes/accessor/RdbtimeGuessDate.cc
converted/eccodes/accessor/RdbtimeGuessDate.h
converted/eccodes/accessor/ReferenceValueError.cc
converted/eccodes/accessor/ReferenceValueError.h
converted/eccodes/accessor/Round.cc
converted/eccodes/accessor/Round.h
converted/eccodes/accessor/Scale.cc
converted/eccodes/accessor/Scale.h
converted/eccodes/accessor/ScaleValues.cc
converted/eccodes/accessor/ScaleValues.h
converted/eccodes/accessor/SecondOrderBitsPerValue.cc
converted/eccodes/accessor/SecondOrderBitsPerValue.h
converted/eccodes/accessor/Section.cc
converted/eccodes/accessor/Section.h
converted/eccodes/accessor/SectionLength.cc
converted/eccodes/accessor/SectionLength.h
converted/eccodes/accessor/SectionPadding.cc
converted/eccodes/accessor/SectionPadding.h
converted/eccodes/accessor/SectionPointer.cc
converted/eccodes/accessor/SectionPointer.h
converted/eccodes/accessor/SelectStepTemplate.cc
converted/eccodes/accessor/SelectStepTemplate.h
converted/eccodes/accessor/Sexagesimal2decimal.cc
converted/eccodes/accessor/Sexagesimal2decimal.h
converted/eccodes/accessor/Signed.cc
converted/eccodes/accessor/Signed.h
converted/eccodes/accessor/SignedBits.cc
converted/eccodes/accessor/SignedBits.h
converted/eccodes/accessor/SimplePackingError.cc
converted/eccodes/accessor/SimplePackingError.h
converted/eccodes/accessor/Size.cc
converted/eccodes/accessor/Size.h
converted/eccodes/accessor/SmartTable.cc
converted/eccodes/accessor/SmartTable.h
converted/eccodes/accessor/SmartTableColumn.cc
converted/eccodes/accessor/SmartTableColumn.h
converted/eccodes/accessor/Spd.cc
converted/eccodes/accessor/Spd.h
converted/eccodes/accessor/SpectralTruncation.cc
converted/eccodes/accessor/SpectralTruncation.h
converted/eccodes/accessor/Sprintf.cc
converted/eccodes/accessor/Sprintf.h
converted/eccodes/accessor/Statistics.cc
converted/eccodes/accessor/Statistics.h
converted/eccodes/accessor/StatisticsSpectral.cc
converted/eccodes/accessor/StatisticsSpectral.h
converted/eccodes/accessor/StepHumanReadable.cc
converted/eccodes/accessor/StepHumanReadable.h
converted/eccodes/accessor/StepInUnits.cc
converted/eccodes/accessor/StepInUnits.h
converted/eccodes/accessor/Sum.cc
converted/eccodes/accessor/Sum.h
converted/eccodes/accessor/Suppressed.cc
converted/eccodes/accessor/Suppressed.h
converted/eccodes/accessor/Time.cc
converted/eccodes/accessor/Time.h
converted/eccodes/accessor/Times.cc
converted/eccodes/accessor/Times.h
converted/eccodes/accessor/ToDouble.cc
converted/eccodes/accessor/ToDouble.h
converted/eccodes/accessor/ToInteger.cc
converted/eccodes/accessor/ToInteger.h
converted/eccodes/accessor/ToString.cc
converted/eccodes/accessor/ToString.h
converted/eccodes/accessor/Transient.cc
converted/eccodes/accessor/Transient.h
converted/eccodes/accessor/TransientDarray.cc
converted/eccodes/accessor/TransientDarray.h
converted/eccodes/accessor/Trim.cc
converted/eccodes/accessor/Trim.h
converted/eccodes/accessor/Uint16.cc
converted/eccodes/accessor/Uint16.h
converted/eccodes/accessor/Uint16LittleEndian.cc
converted/eccodes/accessor/Uint16LittleEndian.h
converted/eccodes/accessor/Uint32.cc
converted/eccodes/accessor/Uint32.h
converted/eccodes/accessor/Uint32LittleEndian.cc
converted/eccodes/accessor/Uint32LittleEndian.h
converted/eccodes/accessor/Uint64.cc
converted/eccodes/accessor/Uint64.h
converted/eccodes/accessor/Uint64LittleEndian.cc
converted/eccodes/accessor/Uint64LittleEndian.h
converted/eccodes/accessor/Uint8.cc
converted/eccodes/accessor/Uint8.h
converted/eccodes/accessor/UnexpandedDescriptors.cc
converted/eccodes/accessor/UnexpandedDescriptors.h
converted/eccodes/accessor/UnpackBufrValues.cc
converted/eccodes/accessor/UnpackBufrValues.h
converted/eccodes/accessor/Unsigned.cc
converted/eccodes/accessor/Unsigned.h
converted/eccodes/accessor/UnsignedBits.cc
converted/eccodes/accessor/UnsignedBits.h
converted/eccodes/accessor/ValidityDate.cc
converted/eccodes/accessor/ValidityDate.h
converted/eccodes/accessor/ValidityTime.cc
converted/eccodes/accessor/ValidityTime.h
converted/eccodes/accessor/Values.cc
converted/eccodes/accessor/Values.h
converted/eccodes/accessor/Variable.cc
converted/eccodes/accessor/Variable.h
converted/eccodes/accessor/Vector.cc
converted/eccodes/accessor/Vector.h
converted/eccodes/accessor/When.cc
converted/eccodes/accessor/When.h
)
if(UNIX)

View File

@ -142,6 +142,7 @@ class Function:
def cannot_convert(self):
self._lines.insert(1, "#ifdef CANNOT_CONVERT_CODE")
self._lines.insert(-1, "#endif")
if self._name != "destroy":
self._lines.insert(-1, "throw EccodesException(GRIB_NOT_IMPLEMENTED);")
@ -264,6 +265,7 @@ class Class:
substitute_re_top_level = {
r"^#define\s+(\w+)\s+(-?\d+)?!(\.|e|E)": r"const long \1 = \2;",
r"^#define\s+(\w+)\s+(-?\d+\.\d+([eE]-?\d+)?)": r"const double \1 = \2;",
r'\bgrib_inline_strcmp\b': 'strcmp',
}
def __init__(
@ -288,9 +290,9 @@ class Class:
self._factory_name = factory_name
self._members = members
self._functions = functions
self._body_includes = includes
self._implements = implements
self._body_includes = includes
self._forward_declarations = []
if super is None:
self._super, _ = self.tidy_class_name(class_)
@ -411,6 +413,9 @@ class Class:
raise Exception(f"Cannot convert method {name}")
def cannot_convert_top_level(self, name):
if name not in self._top_level_code:
print(list(self._top_level_code.keys()))
raise Exception(f"Cannot convert top level {name}")
self._top_level_code[name] = (
["#ifdef CANNOT_CONVERT_CODE"] + self._top_level_code[name] + ["#endif"]
)
@ -425,6 +430,9 @@ class Class:
if not ok:
raise Exception(f"Cannot convert member {name}")
def add_forward_declaration(self, name):
self._forward_declarations.append(name)
@property
def name(self):
return self._name
@ -503,6 +511,10 @@ class Class:
def static_functions(self):
return self._static_functions
@property
def forward_declarations(self):
return self._forward_declarations
def dump(self):
self.dump_header()
self.dump_body()
@ -518,14 +530,33 @@ class Class:
def save(self, ext, content):
target = os.path.join(ARGS.target, *self.namespaces, f"{self.name}.{ext}")
os.makedirs(os.path.dirname(target), exist_ok=True)
LOG.info("Writting %s", target)
with open(target, "w") as f:
tmp = os.path.join(ARGS.target, *self.namespaces, f"{self.name}-tmp.{ext}")
os.makedirs(os.path.dirname(target), exist_ok=True)
with open(tmp, "w") as f:
f.write(content)
ret = os.system(f"clang-format -i {target}")
ret = os.system(f"clang-format -i {tmp}")
assert ret == 0
# So we don't recomplie everything
if os.path.exists(target):
with open(target) as f:
old = f.read()
with open(tmp) as f:
new = f.read()
if old == new:
LOG.info("No change")
os.unlink(tmp)
return
LOG.info("Updating %s", target)
os.rename(tmp, target)
def dump_header(self):
template = env.get_template(f"{self._class}.h.j2")
self.save("h", template.render(c=self))
@ -622,9 +653,11 @@ class Accessor(Class):
rename = {
"Gen": "Generic",
"Md5": "Md5Sum", # We rename because of macos case insensitive file system
"Assert": "Assertion", # Name clash with assert.h
}
substitute_re = {
r'\bgrib_inline_strcmp\b': 'strcmp',
r"\bgrib_handle_of_accessor\(this\)": "this->handle()",
r"\bget_accessors\(this\)": "this->get_accessors()",
r"\bselect_area\(this\)": "this->select_area()",
@ -636,7 +669,12 @@ class Accessor(Class):
r"\bcompute_byte_count\(this\)": "this->compute_byte_count()",
r"\bselect_datetime\(this\)": "this->select_datetime()",
r"\bapply_thinning\(this\)": "this->apply_thinning()",
r"\bgrib_accessor_get_native_type\(this\)": "this->native_type()",
r"\bconcept_evaluate\(this\)": "this->concept_evaluate()",
r"\bnew_bif_trunc\(this\)": "this->new_bif_trunc()",
r"\bget_table_codes\(this\)": "this->get_table_codes()",
r"\bload_table\(this\)": "this->load_table()",
r"\bgrib_accessor_get_native_type\(this\)": "this->get_native_type()",
r"\bget_native_type\(this\)": "this->get_native_type()",
r"\bgrib_byte_offset\((\w+)\s*\)": r"\1->byte_offset()",
r"\bgrib_byte_count\((\w+)\s*\)": r"\1->byte_count()",
@ -652,6 +690,7 @@ class Accessor(Class):
r"\bgrib_unpack_bytes\((\w+)\s*,": r"\1->unpack_bytes(",
r"\bgrib_value_count\((\w+)\s*,": r"\1->value_count(",
r"\bgrib_update_size\((\w+)\s*,": r"\1->update_size(",
r"\bgrib_unpack_string_array\((\w+)\s*,": r"\1->unpack_string_array(",
r"\bgrib_is_missing_internal\((\w+)\)": r"\1->is_missing()",
r"\bpreferred_size\(this,": r"this->preferred_size(",
r"\bvalue_count\((\w+),": r"\1->value_count(",
@ -679,6 +718,7 @@ class Accessor(Class):
r"\bgrib_find_accessor\b": "Accessor::find",
r"\bgrib_pack_long\(this->(\w+),": r"this->\1->pack_long(",
r"\bgrib_value_count\(this->(\w+),": r"this->\1->value_count(",
r"\bgrib_pack_bytes\(this->(\w+),": r"this->\1->pack_bytes(",
r"\bAccessor::find\(this->handle\(\),": r"Accessor::find(",
# Temp stuff for making sure we still compile
r"\bgrib_optimize_decimal_factor\(this,": r"grib_optimize_decimal_factor(this->as_grib_accessor_while_converting(),",
@ -688,6 +728,16 @@ class Accessor(Class):
r"\badd_many_bitstream\(&ctx, this,": r"add_many_bitstream(&ctx, this->as_grib_accessor_while_converting(),",
r"\badd_bitstream\(&ctx, this,": r"add_bitstream(&ctx, this->as_grib_accessor_while_converting(),",
r"\baccessor_raw_get_offset\(this->(\w+)": r"accessor_raw_get_offset(this->\1->as_grib_accessor_while_converting()",
r"\bgrib_accessor_class_expanded_descriptors_set_do_expand\((\w+)": r"grib_accessor_class_expanded_descriptors_set_do_expand(\1->as_grib_accessor_while_converting()",
r"\bgrib_is_missing_string\((\w+)": r"grib_is_missing_string(\1->as_grib_accessor_while_converting()",
r"\bgrib_is_missing_long\((\w+)": r"grib_is_missing_long(\1->as_grib_accessor_while_converting()",
r"\bgrib_is_missing_double\((\w+)": r"grib_is_missing_double(\1->as_grib_accessor_while_converting()",
r"\baccessor_bufr_data_array_set_unpackMode\((\w+)": r"accessor_bufr_data_array_set_unpackMode(\1->as_grib_accessor_while_converting()",
r"\baction_concept_get_nofail\((\w+)": r"action_concept_get_nofail(\1->as_grib_accessor_while_converting()",
r"\baction_concept_get_concept\((\w+)": r"action_concept_get_concept(\1->as_grib_accessor_while_converting()",
}
def class_to_type(self):

View File

@ -19,6 +19,7 @@
const int TRUE = 1;
const int FALSE = 0;
inline int grib_inline_strcmp(const char* a, const char* b) { return strcmp(a, b); }
// See https://github.com/ecmwf/mir/blob/develop/src/mir/repres/Representation.cc
// for a similar approach

View File

@ -158,8 +158,7 @@ grib_accessor_class* grib_accessor_class_codetable = &_grib_accessor_class_codet
/* END_CLASS_IMP */
static int grib_load_codetable(grib_context* c, const char* filename,
const char* recomposed_name, size_t size, grib_codetable* t);
static int grib_load_codetable(grib_context* c, const char* filename, const char* recomposed_name, size_t size, grib_codetable* t);
static void init(grib_accessor* a, const long len, grib_arguments* params)
{
@ -276,14 +275,14 @@ static void dump_codetable(grib_codetable* atable)
}
}
#endif
static grib_codetable* load_table(grib_accessor_codetable* self)
static grib_codetable* load_table(grib_accessor* a)
{
grib_accessor_codetable* self = (grib_accessor_codetable*)a;
size_t size = 0;
grib_handle* h = ((grib_accessor*)self)->parent->h;
grib_context* c = h->context;
grib_codetable* t = NULL;
grib_codetable* next = NULL;
grib_accessor* a = (grib_accessor*)self;
char* filename = 0;
char recomposed[1024] = {0,};
char localRecomposed[1024] = {0,};
@ -541,7 +540,7 @@ static void dump(grib_accessor* a, grib_dumper* dumper)
long value;
if (!self->table_loaded) {
self->table = load_table(self); /* may return NULL */
self->table = load_table(a); /* may return NULL */
self->table_loaded = 1;
}
table = self->table;
@ -604,7 +603,7 @@ static int unpack_string(grib_accessor* a, char* buffer, size_t* len)
return err;
if (!self->table_loaded) {
self->table = load_table(self); /* may return NULL */
self->table = load_table(a); /* may return NULL */
self->table_loaded = 1;
}
table = self->table;
@ -655,7 +654,7 @@ static int pack_string(grib_accessor* a, const char* buffer, size_t* len)
#endif
if (!self->table_loaded) {
self->table = load_table(self); /* may return NULL */
self->table = load_table(a); /* may return NULL */
self->table_loaded = 1;
}
table = self->table;
@ -778,7 +777,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
rlen = 1; /* ECC-480 Performance: avoid func call overhead of grib_value_count */
if (!self->table_loaded) {
self->table = load_table(self); /* may return NULL */
self->table = load_table(a); /* may return NULL */
self->table_loaded = 1;
}

View File

@ -49,7 +49,8 @@
MEMBERS=double* dvalues
MEMBERS=float* fvalues
MEMBERS=size_t size
MEMBERS=int double_dirty
MEMBERS=int float_dirty
END_CLASS_DEF

View File

@ -500,9 +500,11 @@ static void free_bif_trunc(bif_trunc_t* bt, grib_accessor* a)
grib_context_free(gh->context, bt);
}
static bif_trunc_t* new_bif_trunc(grib_accessor* a, grib_accessor_data_g2bifourier_packing* self)
static bif_trunc_t* new_bif_trunc(grib_accessor* a)
{
int ret;
grib_accessor_data_g2bifourier_packing* self = (grib_accessor_data_g2bifourier_packing*)a;
grib_handle* gh = grib_handle_of_accessor(a);
bif_trunc_t* bt = (bif_trunc_t*)grib_context_malloc(gh->context, sizeof(bif_trunc_t));
@ -641,7 +643,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
if ((ret = grib_value_count(a, &count)) != GRIB_SUCCESS)
goto cleanup;
bt = new_bif_trunc(a, self);
bt = new_bif_trunc(a);
if (bt == NULL) {
ret = GRIB_INTERNAL_ERROR;
@ -742,7 +744,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len)
goto cleanup;
}
bt = new_bif_trunc(a, self);
bt = new_bif_trunc(a);
if (bt == NULL) {
long makeTemplate = 0;

View File

@ -216,8 +216,7 @@ static char* descriptor_type_name(int dtype)
}
#endif
static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded,
change_coding_params* ccp, int* err)
static void __expand(grib_accessor* a, bufr_descriptors_array* unexpanded, bufr_descriptors_array* expanded, change_coding_params* ccp, int* err)
{
int k, j, i;
grib_accessor_expanded_descriptors* self = (grib_accessor_expanded_descriptors*)a;

View File

@ -236,27 +236,27 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len)
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_variable* ac = (grib_accessor_variable*)a;
grib_accessor_variable* self = (grib_accessor_variable*)a;
if (*len < 1) {
grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1);
*len = 0;
return GRIB_ARRAY_TOO_SMALL;
}
*val = ac->dval;
*val = self->dval;
*len = 1;
return GRIB_SUCCESS;
}
static int unpack_long(grib_accessor* a, long* val, size_t* len)
{
grib_accessor_variable* ac = (grib_accessor_variable*)a;
grib_accessor_variable* self = (grib_accessor_variable*)a;
if (*len < 1) {
grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values ", a->name, 1);
*len = 0;
return GRIB_ARRAY_TOO_SMALL;
}
*val = (long)ac->dval;
*val = (long)self->dval;
*len = 1;
return GRIB_SUCCESS;
}

View File

@ -19,11 +19,12 @@
{% for n in c.namespaces %}namespace {{ n }} {
{% endfor %}
// top level code '-start-'
// start top level code '-start-'
{% for line in c.top_level_code['-start-'] %}{{ line }}
{% endfor %}
{% for m in c.static_functions %}
// start top level code '{{ m.name }}'
{% for line in c.top_level_code[m.name] %}{{ line }}
{% endfor %}
static {{ m.return_type }} {{ m.name }}({{ m.args_declaration }}) {
@ -78,7 +79,7 @@ const char* {{ c.name }}::className() const {
return "{{ c.name }}";
}
/* top level code -end- */
// top level code '-end-'
{% for line in c.top_level_code['-end-'] %}{{ line }}
{% endfor %}

View File

@ -16,10 +16,13 @@
#include {{ i }}
{% endfor %}
{% for n in c.namespaces %}namespace {{ n }} {
{% endfor %}
{% for f in c.forward_declarations %}
{{ f }};
{% endfor %}
class {{ c.name }} : public {{ c.super }} {
public:

View File

@ -0,0 +1,2 @@
def patch(klass):
klass.cannot_convert_method("notify_change")

View File

@ -0,0 +1,2 @@
def patch(klass):
klass.cannot_convert_top_level("restart_bitmap")

View File

@ -1,2 +1,4 @@
def patch(klass):
klass.cannot_convert_top_level("init")
klass.cannot_convert_method("destroy")
klass.cannot_convert_method("make_clone")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.mark_mutable("expandedDescriptorsAccessor_")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("load_table")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("unpack_string")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("unpack_string")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("unpack_string")

View File

@ -1,3 +1,8 @@
def patch(klass):
klass.cannot_convert_method("destroy")
klass.mark_mutable("size_")
klass.mark_mutable("fvalues_")
klass.mark_mutable("dvalues_")
klass.mark_mutable("double_dirty_")
klass.mark_mutable("float_dirty_")

View File

@ -0,0 +1,2 @@
def patch(klass):
klass.add_forward_declaration("typedef struct bif_trunc_t bif_trunc_t")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("unpack_double")

View File

@ -1,4 +1,4 @@
def patch(klass):
return
klass.cannot_convert_method("pack_double")
klass.cannot_convert_method("unpack_long")
klass.cannot_convert_method("pack_long")

View File

@ -1,3 +1,14 @@
def patch(klass):
klass.cannot_convert_method("init")
klass.cannot_convert_method("unpack_long")
klass.cannot_convert_method("pack_double")
klass.cannot_convert_method("pack_long")
klass.cannot_convert_method("pack_string")
klass.cannot_convert_method("next")
klass.cannot_convert_method("unpack")
klass.cannot_convert_method("pack_double_array_as_long")
klass.cannot_convert_method("unpack_string_array")
klass.cannot_convert_method("unpack_string")
klass.cannot_convert_method("notify_change")
klass.cannot_convert_method("destroy")
klass.cannot_convert_method("pack_string_array")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_top_level("-end-")

View File

@ -0,0 +1,4 @@
def patch(klass):
klass.cannot_convert_method("post_init")
klass.cannot_convert_method("notify_change")

View File

@ -0,0 +1,7 @@
def patch(klass):
klass.cannot_convert_method("init")
klass.cannot_convert_method("destroy")
klass.cannot_convert_method("update_size")
klass.cannot_convert_method("next")
klass.cannot_convert_method("byte_count")
klass.cannot_convert_method("sub_section")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("init")

View File

@ -1,6 +1,8 @@
def patch(klass):
# Redefined :-(
klass.mark_mutable("dirty_")
klass.mark_mutable("tableCodesSize_")
klass.mark_mutable("table_")
klass.mark_mutable("tableCodes_")
klass.cannot_convert_method("init")
klass.cannot_convert_method("destroy")

View File

@ -0,0 +1,4 @@
def patch(klass):
klass.cannot_convert_method("unpack_long")
klass.cannot_convert_method("destroy")
klass.cannot_convert_method("unpack_string_array")

View File

@ -0,0 +1,4 @@
def patch(klass):
klass.cannot_convert_method("string_length")

View File

@ -0,0 +1,3 @@
def patch(klass):
klass.cannot_convert_method("destroy")

View File

@ -0,0 +1,4 @@
def patch(klass):
klass.cannot_convert_method("destroy")
klass.cannot_convert_top_level("dump")
klass.cannot_convert_method("make_clone")

View File

@ -1,2 +1,3 @@
def patch(klass):
klass.cannot_convert_method("notify_change")
# klass.cannot_convert_method("concept_evaluate")