Commit fdf4bae1 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add const declarations for resource list element operation tables.

parent 13c037f2
......@@ -53,8 +53,8 @@ static int listInit = 0;
typedef struct listElem {
int next;
resOps * ops;
void * val;//ptr
const resOps *ops;
void *val;//ptr
int status;
} listElem_t;
......@@ -207,7 +207,7 @@ void listSizeExtend()
/**************************************************************/
int reshPut ( void *p, resOps *ops )
int reshPut ( void *p, const resOps *ops )
{
listElem_t * newListElem;
......@@ -236,7 +236,7 @@ int reshPut ( void *p, resOps *ops )
/**************************************************************/
void reshRemove ( cdiResH resH, resOps * ops )
void reshRemove ( cdiResH resH, const resOps * ops )
{
int nsp;
namespaceTuple_t nspT;
......@@ -267,7 +267,7 @@ void reshRemove ( cdiResH resH, resOps * ops )
/**************************************************************/
static listElem_t *
reshGetElem(const char *caller, cdiResH resH, resOps *ops)
reshGetElem(const char *caller, cdiResH resH, const resOps *ops)
{
listElem_t *listElem;
int nsp;
......@@ -303,14 +303,14 @@ reshGetElem(const char *caller, cdiResH resH, resOps *ops)
}
void *reshGetValue(const char * caller, cdiResH resH, resOps * ops)
void *reshGetValue(const char * caller, cdiResH resH, const resOps * ops)
{
return reshGetElem(caller, resH, ops)->val;
}
/**************************************************************/
void reshGetResHListOfType ( int c, int * resHs, resOps * ops )
void reshGetResHListOfType ( int c, int * resHs, const resOps * ops )
{
int i, j = 0, nsp;
......@@ -381,7 +381,7 @@ cdiResHFilterApply(const resOps *p,
/**************************************************************/
int reshCountType ( resOps * ops )
int reshCountType ( const resOps * ops )
{
int i, nsp, countType = 0;
......@@ -406,14 +406,14 @@ int reshCountType ( resOps * ops )
/**************************************************************/
int
reshResourceGetPackSize(int resH, resOps *ops, void *context)
reshResourceGetPackSize(int resH, const resOps *ops, void *context)
{
listElem_t *curr = reshGetElem(__func__, resH, ops);
return curr->ops->valGetPackSize(curr->val, context);
}
void
reshPackResource(int resH, resOps *ops,
reshPackResource(int resH, const resOps *ops,
void *buf, int buf_size, int *position, void *context)
{
listElem_t *curr = reshGetElem(__func__, resH, ops);
......@@ -510,7 +510,7 @@ void reshPackBufferCreate(char **packBuffer, int *packBufferSize, void *context)
/* for thread safety this feature would have to be integrated in reshPut */
void reshSetStatus ( cdiResH resH, resOps * ops, int status )
void reshSetStatus ( cdiResH resH, const resOps * ops, int status )
{
int nsp;
namespaceTuple_t nspT;
......@@ -542,7 +542,7 @@ void reshSetStatus ( cdiResH resH, resOps * ops, int status )
/**************************************************************/
int reshGetStatus ( cdiResH resH, resOps * ops )
int reshGetStatus ( cdiResH resH, const resOps * ops )
{
int nsp;
namespaceTuple_t nspT;
......
......@@ -42,15 +42,15 @@ enum {
void reshListCreate(int namespaceID);
void reshListDestruct(int namespaceID);
int reshPut ( void *, resOps * );
void reshRemove ( cdiResH, resOps * );
int reshPut ( void *, const resOps * );
void reshRemove ( cdiResH, const resOps * );
int reshCountType ( resOps * );
int reshCountType ( const resOps * );
void * reshGetValue(const char *, cdiResH, resOps * );
void * reshGetValue(const char *, cdiResH, const resOps * );
#define reshGetVal(resH, ops) reshGetValue(__func__, resH, ops)
void reshGetResHListOfType ( int, int *, resOps * );
void reshGetResHListOfType ( int, int *, const resOps * );
enum cdiApplyRet {
CDI_APPLY_ERROR = -1,
......@@ -68,11 +68,11 @@ cdiResHFilterApply(const resOps *p,
void reshPackBufferCreate ( char **, int *, void *context );
void reshPackBufferDestroy ( char ** );
int reshResourceGetPackSize(int resh, resOps *ops, void *context);
void reshPackResource(int resh, resOps *ops,
int reshResourceGetPackSize(int resh, const resOps *ops, void *context);
void reshPackResource(int resh, const resOps *ops,
void *buf, int buf_size, int *position, void *context);
void reshSetStatus ( cdiResH, resOps *, int );
int reshGetStatus ( cdiResH, resOps * );
void reshSetStatus ( cdiResH, const resOps *, int );
int reshGetStatus ( cdiResH, const resOps * );
void reshLock ( void );
void reshUnlock ( void );
......
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