Commit 04e48b85 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add const declaration to serialization input parameters.

parent 8f4e7fd2
......@@ -16,22 +16,22 @@ serializeGetSize(int count, int datatype, void *context)
return serialize_get_size_p(count, datatype, context);
}
void serializePack(void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context)
void serializePack(const void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context)
{
void (*serialize_pack_p)(void *data, int count, int datatype,
void (*serialize_pack_p)(const void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context)
= (void (*)(void *, int, int, void *, int, int *, void *))
= (void (*)(const void *, int, int, void *, int, int *, void *))
namespaceSwitchGet(NSSWITCH_SERIALIZE_PACK).func;
serialize_pack_p(data, count, datatype, buf, buf_size, position, context);
}
void serializeUnpack(void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context)
void serializeUnpack(const void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context)
{
void (*serialize_unpack_p)(void *buf, int buf_size, int *position,
void (*serialize_unpack_p)(const void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context)
= (void (*)(void *, int, int *, void *, int, int, void *))
= (void (*)(const void *, int, int *, void *, int, int, void *))
namespaceSwitchGet(NSSWITCH_SERIALIZE_UNPACK).func;
serialize_unpack_p(buf, buf_size, position, data, count, datatype, context);
}
......@@ -71,8 +71,8 @@ serializeGetSizeInCore(int count, int datatype, void *context)
return count * elemSize;
}
void serializePackInCore(void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context)
void serializePackInCore(const void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context)
{
int size = serializeGetSize(count, datatype, context);
int pos = *position;
......@@ -82,8 +82,8 @@ void serializePackInCore(void *data, int count, int datatype,
*position = pos;
}
void serializeUnpackInCore(void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context)
void serializeUnpackInCore(const void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context)
{
int size = serializeGetSize(count, datatype, context);
int pos = *position;
......
......@@ -9,9 +9,9 @@
* Generic interfaces for (de-)marshalling
*/
int serializeGetSize(int count, int datatype, void *context);
void serializePack(void *data, int count, int datatype,
void serializePack(const void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context);
void serializeUnpack(void *buf, int buf_size, int *position,
void serializeUnpack(const void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context);
/*
......@@ -22,9 +22,18 @@ void serializeUnpack(void *buf, int buf_size, int *position,
* Interfaces for marshalling within a single memory domain
*/
int serializeGetSizeInCore(int count, int datatype, void *context);
void serializePackInCore(void *data, int count, int datatype,
void serializePackInCore(const void *data, int count, int datatype,
void *buf, int buf_size, int *position, void *context);
void serializeUnpackInCore(void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context);
void serializeUnpackInCore(const void *buf, int buf_size, int *position,
void *data, int count, int datatype, void *context);
#endif
/*
* Local Variables:
* c-file-style: "Java"
* c-basic-offset: 2
* indent-tabs-mode: nil
* show-trailing-whitespace: t
* require-trailing-newline: t
* End:
*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment