Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
4731959a
Commit
4731959a
authored
Mar 08, 2016
by
Thomas Jahns
🤸
Browse files
Prevent unnecessary string copy.
parent
a372c1d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
4731959a
...
...
@@ -4121,6 +4121,12 @@ int gridInqReference(int gridID, char *reference)
return
(
len
);
}
const
char
*
gridInqReferencePtr
(
int
gridID
)
{
grid_t
*
gridptr
=
gridID2Ptr
(
gridID
);
return
gridptr
->
reference
;
}
/*
@Function gridDefUUID
@Title Define the UUID for an unstructured grid
...
...
src/grid.h
View file @
4731959a
...
...
@@ -132,6 +132,8 @@ const double *gridInqAreaPtr(int gridID);
const
char
*
gridInqXnamePtr
(
int
gridID
);
const
char
*
gridInqYnamePtr
(
int
gridID
);
const
char
*
gridInqReferencePtr
(
int
gridID
);
int
gridCompare
(
int
gridID
,
const
grid_t
*
grid
);
int
gridGenerate
(
const
grid_t
*
grid
);
...
...
src/stream_cdf.c
View file @
4731959a
...
...
@@ -1740,14 +1740,9 @@ void cdfDefGridReference(stream_t *streamptr, int gridID)
cdf_put_att_int
(
fileID
,
NC_GLOBAL
,
"number_of_grid_used"
,
NC_INT
,
1
,
&
number
);
}
if
(
gridInqReference
(
gridID
,
NULL
)
)
{
char
gridfile
[
8912
];
gridInqReference
(
gridID
,
gridfile
);
if
(
gridfile
[
0
]
!=
0
)
cdf_put_att_text
(
fileID
,
NC_GLOBAL
,
"grid_file_uri"
,
strlen
(
gridfile
),
gridfile
);
}
const
char
*
gridfile
=
gridInqReferencePtr
(
gridID
);
if
(
gridfile
&&
gridfile
[
0
]
!=
0
)
cdf_put_att_text
(
fileID
,
NC_GLOBAL
,
"grid_file_uri"
,
strlen
(
gridfile
),
gridfile
);
}
static
...
...
Write
Preview
Supports
Markdown
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