mirror of https://github.com/ecmwf/eccodes.git
Minor updates to last commit
This commit is contained in:
parent
517b7f02ef
commit
9c6ffa0897
|
@ -6,15 +6,15 @@ from funcsig_mapping import FuncSigMapping
|
|||
|
||||
grib_bits_funcsig_conversions = [
|
||||
FuncSigMapping( FuncSig("void", "grib_set_bit_on", [Arg("unsigned char*", "p"), Arg("long*", "bitp")]),
|
||||
FuncSig("void", "gribSetBitOn", [Arg("std::vector<unsigned char>&", "p"), Arg("long&", "bitp")])),
|
||||
FuncSig("void", "gribSetBitOn", [Arg("DataPointer", "p"), Arg("long&", "bitp")])),
|
||||
|
||||
FuncSigMapping( FuncSig("void", "grib_set_bits_on", [Arg("unsigned char*", "p"), Arg("long*", "bitp"), Arg("long", "nbits")]),
|
||||
FuncSig("void", "gribSetBitsOn", [Arg("std::vector<unsigned char>&", "p"), Arg("long&", "bitp"), Arg("long", "nbits")])),
|
||||
FuncSig("void", "gribSetBitsOn", [Arg("DataPointer", "p"), Arg("long&", "bitp"), Arg("long", "nbits")])),
|
||||
|
||||
FuncSigMapping( FuncSig("void", "grib_set_bit_off", [Arg("unsigned char*", "p"), Arg("long*", "bitp")]),
|
||||
FuncSig("void", "gribSetBitOff", [Arg("std::vector<unsigned char>&", "p"), Arg("long&", "bitp")])),
|
||||
FuncSig("void", "gribSetBitOff", [Arg("DataPointer", "p"), Arg("long&", "bitp")])),
|
||||
|
||||
FuncSigMapping( FuncSig("void", "grib_set_bit", [Arg("unsigned char*", "p"), Arg("long", "bitp"), Arg("int", "val")]),
|
||||
FuncSig("void", "gribSetBit", [Arg("std::vector<unsigned char>&", "p"), Arg("long&", "bitp"), Arg("int", "val")])),
|
||||
FuncSig("void", "gribSetBit", [Arg("DataPointer", "p"), Arg("long&", "bitp"), Arg("int", "val")])),
|
||||
|
||||
]
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
namespace eccodes::accessor {
|
||||
|
||||
|
||||
void gribSetBitOn(std::vector<unsigned char>& p, long& bitp)
|
||||
void gribSetBitOn(DataPointer p, long& bitp)
|
||||
{
|
||||
long index = bitp / 8;
|
||||
p[index] |= (1u << (7 - ((bitp) % 8)));
|
||||
p += bitp / 8;
|
||||
*p |= (1u << (7 - (bitp % 8)));
|
||||
bitp++;
|
||||
}
|
||||
|
||||
void gribSetBitsOn(std::vector<unsigned char>& p, long& bitp, long nbits)
|
||||
void gribSetBitsOn(DataPointer p, long& bitp, long nbits)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < nbits; i++) {
|
||||
|
@ -20,14 +20,14 @@ void gribSetBitsOn(std::vector<unsigned char>& p, long& bitp, long nbits)
|
|||
}
|
||||
}
|
||||
|
||||
void gribSetBitOff(std::vector<unsigned char>& p, long& bitp)
|
||||
void gribSetBitOff(DataPointer p, long& bitp)
|
||||
{
|
||||
long index = bitp / 8;
|
||||
p[index] &= ~(1u << (7 - ((bitp) % 8)));
|
||||
p += bitp / 8;
|
||||
*p &= ~(1u << (7 - (bitp % 8)));
|
||||
bitp++;
|
||||
}
|
||||
|
||||
void gribSetBit(std::vector<unsigned char>& p, long bitp, int val)
|
||||
void gribSetBit(DataPointer p, long bitp, int val)
|
||||
{
|
||||
if (val == 0)
|
||||
gribSetBitOff(p, bitp);
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
|
||||
// C++ implementation of the functions in grib_accessor_class.cc that are not directly part of the C++ classes
|
||||
|
||||
#include "AccessorBuffer.h"
|
||||
#include <vector>
|
||||
|
||||
namespace eccodes::accessor {
|
||||
|
||||
void gribSetBitOn(std::vector<unsigned char>& p, long& bitp);
|
||||
void gribSetBitsOn(std::vector<unsigned char>& p, long& bitp, long nbits);
|
||||
void gribSetBitOff(std::vector<unsigned char>& p, long& bitp);
|
||||
void gribSetBit(std::vector<unsigned char>& p, long bitp, int val);
|
||||
void gribSetBitOn(DataPointer p, long& bitp);
|
||||
void gribSetBitsOn(DataPointer p, long& bitp, long nbits);
|
||||
void gribSetBitOff(DataPointer p, long& bitp);
|
||||
void gribSetBit(DataPointer p, long bitp, int val);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// All includes in one place, for convenience!
|
||||
#include "GribAccessorStub.h"
|
||||
#include "GribAccessorClassStub.h"
|
||||
#include "GribActionStub.h"
|
||||
#include "GribAccessorStub.h"
|
||||
#include "GribBitsAnyEndianStub.h"
|
||||
|
|
Loading…
Reference in New Issue