Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
bdc7b462
Commit
bdc7b462
authored
Nov 12, 2019
by
Uwe Schulzweida
Browse files
Replaced zaxisDefUUID()/zaxisInqUUID() by cdiDefKeyBytes()/cdiInqKeyBytes() with CDI_KEY_UUID.
parent
adf64576
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/zaxis.c
View file @
bdc7b462
...
...
@@ -131,7 +131,6 @@ void zaxis_init(zaxis_t *zaxisptr)
zaxisptr
->
vct
=
NULL
;
zaxisptr
->
number
=
0
;
zaxisptr
->
nhlev
=
0
;
memset
(
zaxisptr
->
uuid
,
0
,
CDI_UUID_SIZE
);
cdiInitKeys
(
&
zaxisptr
->
keys
);
zaxisptr
->
atts
.
nalloc
=
MAX_ATTRIBUTES
;
...
...
@@ -689,8 +688,8 @@ The function @func{zaxisDefUUID} defines the UUID for a generalized Z-axis.
*/
void
zaxisDefUUID
(
int
zaxisID
,
const
unsigned
char
uuid
[
CDI_UUID_SIZE
])
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
memcpy
(
zaxisptr
->
uuid
,
uuid
,
CDI_UUID_SIZE
);
cdiDefKeyBytes
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_UUID
,
uuid
,
CDI_UUID_SIZE
);
reshSetStatus
(
zaxisID
,
&
zaxisOps
,
RESH_DESYNC_IN_USE
);
}
...
...
@@ -712,8 +711,9 @@ The function @func{zaxisInqUUID} returns the UUID to a generalized Z-axis.
*/
void
zaxisInqUUID
(
int
zaxisID
,
unsigned
char
uuid
[
CDI_UUID_SIZE
])
{
zaxis_t
*
zaxisptr
=
zaxis_to_pointer
(
zaxisID
);
memcpy
(
uuid
,
zaxisptr
->
uuid
,
CDI_UUID_SIZE
);
memset
(
uuid
,
0
,
CDI_UUID_SIZE
);
int
length
=
CDI_UUID_SIZE
;
cdiInqKeyBytes
(
zaxisID
,
CDI_GLOBAL
,
CDI_KEY_UUID
,
uuid
,
&
length
);
}
/*
...
...
@@ -1379,8 +1379,8 @@ int zaxisCompareP(zaxis_t *z1, zaxis_t *z2)
diff
|=
strcmp
(
cdiInqVarKeyString
(
&
z1
->
keys
,
CDI_KEY_NAME
),
cdiInqVarKeyString
(
&
z2
->
keys
,
CDI_KEY_NAME
))
|
strcmp
(
cdiInqVarKeyString
(
&
z1
->
keys
,
CDI_KEY_LONGNAME
),
cdiInqVarKeyString
(
&
z2
->
keys
,
CDI_KEY_LONGNAME
))
|
strcmp
(
cdiInqVarKeyString
(
&
z1
->
keys
,
CDI_KEY_STDNAME
),
cdiInqVarKeyString
(
&
z2
->
keys
,
CDI_KEY_STDNAME
))
|
strcmp
(
cdiInqVarKeyString
(
&
z1
->
keys
,
CDI_KEY_UNITS
),
cdiInqVarKeyString
(
&
z2
->
keys
,
CDI_KEY_UNITS
))
|
memcmp
(
z1
->
uuid
,
z2
->
uuid
,
CDI_UUID_SIZE
);
|
strcmp
(
cdiInqVarKeyString
(
&
z1
->
keys
,
CDI_KEY_UNITS
),
cdiInqVarKeyString
(
&
z2
->
keys
,
CDI_KEY_UNITS
))
;
return
diff
!=
0
;
}
...
...
@@ -1397,7 +1397,6 @@ enum { zaxisNint = 7,
ubounds
=
1
<<
2
,
weights
=
1
<<
3
,
vct
=
1
<<
4
,
zaxisHasUUIDFlag
=
1
<<
5
,
};
static
...
...
@@ -1410,7 +1409,7 @@ int zaxisGetMemberMask( zaxis_t * zaxisP )
if
(
zaxisP
->
ubounds
)
memberMask
|=
ubounds
;
if
(
zaxisP
->
weights
)
memberMask
|=
weights
;
if
(
zaxisP
->
vct
)
memberMask
|=
vct
;
if
(
!
cdiUUIDIsNull
(
zaxisP
->
uuid
))
memberMask
|=
zaxisHasUUIDFlag
;
return
memberMask
;
}
...
...
@@ -1451,9 +1450,6 @@ zaxisGetPackSize(void * voidP, void *context)
packBufferSize
+=
serializeGetSize
(
1
,
CDI_DATATYPE_UCHAR
,
context
);
if
(
!
cdiUUIDIsNull
(
zaxisP
->
uuid
))
packBufferSize
+=
serializeGetSize
(
CDI_UUID_SIZE
,
CDI_DATATYPE_UCHAR
,
context
);
return
packBufferSize
;
}
...
...
@@ -1556,10 +1552,6 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack
(
unpackBuffer
,
unpackBufferSize
,
unpackBufferPos
,
&
zaxisP
->
positive
,
1
,
CDI_DATATYPE_UINT
,
context
);
if
(
memberMask
&
zaxisHasUUIDFlag
)
serializeUnpack
(
unpackBuffer
,
unpackBufferSize
,
unpackBufferPos
,
zaxisP
->
uuid
,
CDI_UUID_SIZE
,
CDI_DATATYPE_UCHAR
,
context
);
reshSetStatus
(
zaxisP
->
self
,
&
zaxisOps
,
reshGetStatus
(
zaxisP
->
self
,
&
zaxisOps
)
&
~
RESH_SYNC_BIT
);
}
...
...
@@ -1645,11 +1637,6 @@ zaxisPack(void * voidP, void * packBuffer, int packBufferSize,
serializePack
(
&
zaxisP
->
positive
,
1
,
CDI_DATATYPE_UINT
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
if
(
memberMask
&
zaxisHasUUIDFlag
)
serializePack
(
zaxisP
->
uuid
,
CDI_UUID_SIZE
,
CDI_DATATYPE_UCHAR
,
packBuffer
,
packBufferSize
,
packBufferPos
,
context
);
}
...
...
src/zaxis.h
View file @
bdc7b462
...
...
@@ -10,26 +10,25 @@
typedef
struct
{
double
*
vals
;
double
*
vals
;
#ifndef USE_MPI
char
**
cvals
;
int
clength
;
char
**
cvals
;
int
clength
;
#endif
double
*
lbounds
;
double
*
ubounds
;
double
*
weights
;
int
self
;
int
datatype
;
int
scalar
;
int
type
;
int
size
;
int
direction
;
int
vctsize
;
unsigned
positive
;
double
*
vct
;
int
number
;
/* Reference number to a generalized Z-axis */
int
nhlev
;
unsigned
char
uuid
[
CDI_UUID_SIZE
];
double
*
lbounds
;
double
*
ubounds
;
double
*
weights
;
int
self
;
int
datatype
;
int
scalar
;
int
type
;
int
size
;
int
direction
;
int
vctsize
;
unsigned
positive
;
double
*
vct
;
int
number
;
/* Reference number to a generalized Z-axis */
int
nhlev
;
cdi_keys_t
keys
;
cdi_atts_t
atts
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment